/* ============================================================
   VoltBuilt — Footer
   Loads AFTER app.css and is the single source of truth for the
   footer layout. Keep all footer overrides here.
   ============================================================ */

/* ── Footer shell ──────────────────────────────────────────── */
.site-footer {
  position: relative;
  isolation: isolate;
  display: block;
  gap: normal;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding-block: clamp(7rem, 9vw, 9rem) clamp(4.75rem, 7vw, 6.25rem);
  color: #fff;
  background:
    radial-gradient(circle at 18% 14%, rgba(0, 132, 64, 0.18), transparent 36%),
    radial-gradient(circle at 84% 20%, rgba(2, 92, 151, 0.16), transparent 38%),
    linear-gradient(145deg, #061a29 0%, #082334 46%, #052a21 100%);
  border-radius: 0;
  clip-path: none;
}

.site-footer::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  height: clamp(8rem, 18vw, 18rem);
  content: "";
  background: linear-gradient(to bottom, rgba(5, 42, 33, 0), rgba(5, 42, 33, 0.68) 58%, #052a21 100%);
  pointer-events: none;
}

.site-footer > .container {
  position: relative;
  z-index: 1;
  max-width: min(1680px, calc(100% - clamp(2rem, 6vw, 5rem)));
  padding-inline: var(--container-padding);
}

.footer__deco {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.footer__deco--tl {
  top: auto;
  bottom: clamp(-360px, -18vw, -220px);
  left: clamp(-340px, -14vw, -210px);
  width: clamp(700px, 44vw, 980px);
  height: auto;
  opacity: 0.42;
  transform: rotate(-6deg);
  transform-origin: left bottom;
  filter: drop-shadow(0 20px 42px rgba(0, 0, 0, 0.4));
}

.footer-tagline-marquee {
  margin: 0;
  background: linear-gradient(100deg, #008440 0%, #08744a 34%, #062A3E 100%);
  border-radius: 0;
}

.footer__wordmark {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: -0.27em;
  z-index: 0;
  width: 100%;
  color: rgba(255, 255, 255, 0.05);
  font-size: clamp(9.5rem, 26vw, 34rem);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.08em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  background: linear-gradient(165deg, rgba(2, 92, 151, 0.34) 0%, rgba(255, 255, 255, 0.055) 45%, rgba(0, 132, 64, 0.32) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.026);
  transform: translateX(-50%) perspective(900px) rotateX(7deg);
  transform-origin: center bottom;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.035))
    drop-shadow(0 14px 18px rgba(0, 0, 0, 0.16))
    saturate(118%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.98) 56%, rgba(0, 0, 0, 0.42) 84%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.98) 56%, rgba(0, 0, 0, 0.42) 84%, transparent 100%);
}

/* ── Panel ─────────────────────────────────────────────────── */
.footer__panel {
  position: relative;
  z-index: 1;
  overflow: visible; /* let the brand card float above the top edge */
  padding: clamp(2rem, 3.4vw, 3rem);
  background:
    linear-gradient(145deg, rgba(226, 246, 255, 0.06), rgba(146, 194, 213, 0.018)),
    rgba(10, 38, 50, 0.28);
  border: 1px solid rgba(232, 247, 255, 0.14);
  border-radius: clamp(22px, 2.8vw, 32px);
  box-shadow:
    0 18px 76px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px) saturate(132%) contrast(100%);
  -webkit-backdrop-filter: blur(24px) saturate(132%) contrast(100%);
}

.footer__panel::before {
  position: absolute;
  inset: 1px;
  z-index: 0;
  content: "";
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.006) 48%, transparent 100%),
    radial-gradient(circle at 86% 92%, rgba(0, 132, 64, 0.018), transparent 42%);
  pointer-events: none;
}

.footer__panel::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  border-radius: inherit;
  background:
    radial-gradient(ellipse at center, transparent 62%, rgba(7, 30, 46, 0.04) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.01));
  pointer-events: none;
}

/* ── Grid: brand card (absolute) + nav (in flow) ───────────── */
.footer__grid {
  /* % of the grid's own box — NOT vw, so it can never drift from the
     scrollbar-affected viewport and always matches --card-w below */
  --card-w: clamp(296px, 28%, 344px);
  --card-gap: clamp(2rem, 3.6%, 3.75rem);
  /* override app.css which sets this to display:grid — must be block so the
     nav fills the whole width right of the card instead of a narrow cell */
  display: block;
  position: relative;
  z-index: 1;
  /* reserve room on the left for the absolutely-positioned card */
  padding-left: calc(var(--card-w) + var(--card-gap));
  box-sizing: border-box;
}

/* ── Brand card — anchored to the bottom of the columns, naturally
   taller than the nav so it floats above the panel's top edge ──── */
.footer__brand-card {
  position: absolute;
  left: 0;
  bottom: 0; /* bottom edge aligns with where the columns end */
  width: var(--card-w);
  z-index: 5;
  display: grid;
  align-content: start;
  gap: 0.85rem;
  padding: clamp(1.35rem, 1.8vw, 1.65rem);
  background: linear-gradient(162deg, #0c2a3c 0%, #08202e 55%, #06231c 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px; /* rounded corners */
  /* cut bottom-right corner — mask keeps the border-radius intact
     (clip-path would have forced sharp corners) */
  -webkit-mask-image: linear-gradient(-45deg, transparent 0, transparent 60px, #000 60px);
  mask-image: linear-gradient(-45deg, transparent 0, transparent 60px, #000 60px);
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.5));
}

/* green accent that traces the cut corner */
.footer__brand-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    -45deg,
    transparent 61px,
    rgba(72, 199, 142, 0.9) 61px,
    rgba(72, 199, 142, 0.9) 63px,
    transparent 63px
  );
}

.footer__brand-card > * {
  position: relative;
  z-index: 1;
}

.footer__brand-card .footer__logo,
.footer__brand-card .footer__logo .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.footer__brand-card .footer__logo img,
.footer__brand-card .footer__logo .custom-logo {
  height: 44px;
  width: auto;
}

.footer__brand-card .footer__logo--text {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ── Subscribe + search fields ─────────────────────────────── */
.footer-subscribe,
.footer-card-search {
  display: grid;
  gap: 0.4rem;
  max-width: none;
}

.footer-subscribe__label,
.footer-card-contact__label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.footer-subscribe__field,
.footer-card-search__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  min-height: 40px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
}

.footer-subscribe__field input,
.footer-card-search__field input {
  min-width: 0;
  padding-inline: 0.9rem;
  color: #fff;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 0.82rem;
}

.footer-subscribe__field input::placeholder,
.footer-card-search__field input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.footer-subscribe__field button,
.footer-card-search__field button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 1px;
  color: #fff;
  background: rgba(0, 132, 64, 0.85);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.footer-subscribe__field button:hover,
.footer-card-search__field button:hover {
  background: #008440;
}

/* ── Contact ───────────────────────────────────────────────── */
.footer-card-contact {
  display: grid;
  gap: 0.4rem;
}

.footer-card-contact__links {
  display: grid;
  gap: 0.34rem;
}

.footer-card-contact__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(232, 249, 241, 0.82);
  font-size: 0.79rem;
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-card-contact__links a:hover {
  color: #fff;
}

.footer-card-contact__links svg {
  flex: 0 0 auto;
  color: rgba(64, 196, 130, 0.95);
}

/* ── Socials inside the card ───────────────────────────────── */
.footer__brand-card .footer__social {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.1rem;
}

.footer__brand-card .social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.footer__brand-card .social-link:hover {
  color: #fff;
  background: rgba(0, 132, 64, 0.75);
}

/* ── Nav: fills the space right of the card ─ */
.footer__nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(1rem, 1.65vw, 1.85rem);
  width: auto;
  margin: 0;
}

.footer__col-title {
  margin-bottom: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links-item {
  position: relative;
}

.footer__links a {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.85rem;
  line-height: 1.3;
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer__links a:hover {
  color: #fff;
}

.footer__text {
  display: block;
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.85rem;
  line-height: 1.3;
}

.footer-contact-trigger {
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.56);
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.3;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 0.18s ease;
}

.footer-contact-trigger:hover,
.footer-contact-trigger[aria-expanded="true"] {
  color: #fff;
}

.footer-contact-popover {
  position: absolute;
  bottom: calc(100% + 0.7rem);
  left: 0;
  z-index: 20;
  display: grid;
  gap: 0.42rem;
  min-width: 235px;
  padding: 0.72rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(5, 30, 38, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transform-origin: left bottom;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  backdrop-filter: blur(22px) saturate(118%);
  -webkit-backdrop-filter: blur(22px) saturate(118%);
}

.footer-contact-popover.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.footer-contact-popover a {
  display: flex;
  align-items: center;
  gap: 0.52rem;
  min-height: 34px;
  padding: 0.35rem 0.45rem;
  color: rgba(232, 249, 241, 0.88);
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
}

.footer-contact-popover a:hover {
  color: #fff;
  background: rgba(0, 132, 64, 0.18);
}

.footer-contact-popover svg {
  flex: 0 0 auto;
  color: rgba(64, 196, 130, 0.95);
}

/* ── Bottom bar ────────────────────────────────────────────── */
.footer__bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.25rem;
  flex-wrap: wrap;
  width: auto;
  margin: clamp(2rem, 3.5vw, 3rem) 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer__bottom-main {
  display: flex;
  align-items: center;
  gap: 0.45rem 0.9rem;
  flex-wrap: wrap;
}

.footer__copyright,
.footer__credit,
.footer__registry {
  margin: 0;
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.78rem;
}

.footer__registry {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.footer__registry::before {
  width: 4px;
  height: 4px;
  content: "";
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.footer__legal {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.footer__legal::before {
  width: 4px;
  height: 4px;
  content: "";
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.footer__legal a {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.78rem;
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer__legal a:hover {
  color: rgba(255, 255, 255, 0.86);
}

.footer__credit a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.footer__credit a:hover {
  color: #fff;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 980px) {
  .site-footer {
    padding-block: clamp(4.75rem, 10vw, 6rem) clamp(4rem, 8vw, 6rem);
  }

  .footer__grid {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
    padding-left: 0; /* card no longer floats — stacks normally */
  }

  .footer__brand-card {
    position: static;
    width: 100%;
    max-width: 460px;
  }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .footer__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-footer {
    padding-block: 4.5rem 3rem;
  }

  .footer__deco--tl {
    top: auto;
    bottom: -130px;
    left: -150px;
    width: 430px;
    transform: rotate(-6deg);
    transform-origin: left bottom;
  }

  .footer__nav {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .footer__bottom-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .footer__legal::before {
    display: none;
  }

  .footer__registry::before {
    display: none;
  }

  .footer-contact-popover {
    right: 0;
    left: auto;
    min-width: min(255px, 78vw);
    transform-origin: right bottom;
  }
}

@media (max-width: 560px) {
  .footer__panel {
    padding: 1.35rem;
    border-radius: 18px;
  }

  .footer__wordmark {
    bottom: -0.22em;
    font-size: clamp(6.5rem, 34vw, 10rem);
  }
}

@media (max-width: 440px) {
  .footer__deco--tl {
    bottom: -112px;
    left: -132px;
    width: 376px;
  }

  .footer__nav {
    grid-template-columns: 1fr;
  }
}
