/* ============================================================
   footer — brief/footer.md (D 3446:1052 / M 3446:2052)
   Pattern B-edge: .footer (= .container, gutter as padding-inline) paints the
   section gradient; two bands own their block padding. The newsletter band
   breaks out of the gutter to paint brand-80 edge to edge (brief-page §1).
   Mobile-first: base = 0-767 (anchor 375) · 768-1023 pseudo-tablet (D-footer-5)
   · 1024+ desktop (--vw-base 1440).
   ============================================================ */

.footer {
  /* --- section-scoped fluid values (brief §2 "Fluid values") — MOBILE --- */
  --fo-signup-pad: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 60px);
  --fo-main-pad: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40px);
  --fo-title-gap: clamp(9px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20px);
  --fo-signup-gap: clamp(13px, calc(15px + (var(--max-vw) - 375px) * 0.015), 40px);
  --fo-form-gap: clamp(9px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20px);
  --fo-field-pad: clamp(9px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20px);
  --fo-btn-pad-b: clamp(9px, calc(11px + (var(--max-vw) - 375px) * 0.015), 18px);
  --fo-btn-pad-i: clamp(20px, calc(24px + (var(--max-vw) - 375px) * 0.015), 24px);
  --fo-wordmark-gap: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 60px);
  --fo-row-gap: clamp(34px, calc(40px + (var(--max-vw) - 375px) * 0.015), 82px);
  --fo-cols-gap: clamp(48px, calc(56px + (var(--max-vw) - 375px) * 0.015), 107px);
  --fo-follow-gap: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 20px);
  --fo-legal-gap: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 20px);
  --fo-title-list-gap: clamp(13px, calc(15px + (var(--max-vw) - 375px) * 0.015), 15px);
  --fo-link-gap: clamp(9px, calc(10px + (var(--max-vw) - 375px) * 0.015), 10px);
  --fo-legal-link-gap: clamp(9px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20px);
  --fo-icon: clamp(31px, calc(36px + (var(--max-vw) - 375px) * 0.015), 36px);
  --fo-icon-gap: clamp(4px, calc(5px + (var(--max-vw) - 375px) * 0.015), 5px);
  --fo-social-w: clamp(131px, calc(154px + (var(--max-vw) - 375px) * 0.015), 154px);
  --footer-wordmark-size: clamp(41px, calc(48px + (var(--max-vw) - 375px) * 0.015), 53.88px);

  /* D-footer-3: 5-stop forest→sage ramp; mobile + pseudo-tablet angle 82.21deg */
  --fo-gradient-stops: #26352B 0%, #515546 35.576%, #717564 58.172%, #9FA491 85.095%, #D9DCC6 100%;

  display: flex;
  flex-direction: column;
  margin-top: var(--section-gap); /* faq → footer (brief §2: D 120 / M 60) */
  background: linear-gradient(82.21deg, var(--fo-gradient-stops));
  color: var(--color-white-80);
  font-family: var(--font-body);
}

/* ---------- Newsletter band ---------- */
.footer__signup {
  display: flex;
  flex-direction: column;
  gap: var(--fo-signup-gap);
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  padding-block: var(--fo-signup-pad);
  background: var(--color-brand-80);
}

.footer__signup-copy {
  display: flex;
  flex-direction: column;
  gap: var(--fo-title-gap);
}

.footer__title {
  font-family: var(--font-display);
  font-variation-settings: var(--fv-display);
  font-size: var(--text-h2);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-heading);
  color: var(--color-white);
}

.footer__lead {
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--lh-ui);
  color: var(--color-white);
}

.footer__form {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  column-gap: var(--fo-form-gap);
  row-gap: 10px;
}

.footer__input {
  flex: 1 1 0;
  min-width: 0;
  padding-block: 0;           /* height = the SIGN UP row (stretch), text centred natively */
  padding-inline: var(--fo-field-pad);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: var(--radius-card);
  font-family: var(--font-body);
  font-size: var(--text-body);  /* 14 below 768 as drawn — iOS zoom: BA-footer-6 */
  font-weight: 400;
  line-height: var(--lh-ui);
  color: var(--color-white);
}
.footer__input::placeholder {
  color: var(--color-white-80);
  opacity: 1;
}

.footer__submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-block: var(--fo-btn-pad-b);
  padding-inline: var(--fo-btn-pad-i);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-family: var(--font-body);
  font-size: var(--text-cta);
  font-weight: 500;
  line-height: var(--lh-ui);
  color: var(--color-brand);
  white-space: nowrap;
  transition: opacity .2s ease;
}
.footer__submit:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Live status (BA-footer-3). Empty → visually hidden but kept in the a11y tree,
   so it takes no space in the form row; filled → its own line under the row. */
.footer__status {
  flex: 1 0 100%;
  font-size: var(--text-body);
  line-height: var(--lh-ui);
  color: var(--color-white);
}
.footer__status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Main band ---------- */
.footer__main {
  display: flex;
  flex-direction: column;
  gap: var(--fo-wordmark-gap);
  padding-block: var(--fo-main-pad);
}

.footer__row {
  display: flex;
  flex-direction: column;
  gap: var(--fo-row-gap);
}

/* Mobile: Discover | Help on row 1 (each hugs its content), Follow on its own row 2
   (Figma row frame 3446:2071 → flex-wrap; a spanning grid item would widen the
   auto tracks with the 318px social grid and push Help right) */
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: var(--fo-cols-gap);
  row-gap: var(--fo-follow-gap);
}
.footer__col--follow { flex: 0 0 100%; }

.footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fo-title-list-gap);
}

.footer__col-title {
  font-size: var(--text-body);
  font-weight: 500;
  line-height: var(--lh-ui);
  color: var(--color-white);
}

.footer__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fo-link-gap);
}

.footer__link,
.footer__social-link,
.footer__legal-link {
  color: var(--color-white-80);
  transition: color .2s ease;
}

.footer__link {
  display: block;
  font-size: var(--text-body-fixed);
  font-weight: 400;
  line-height: var(--lh-ui);
  white-space: nowrap;
}

/* Social: mobile 2 × 2, column-major (Instagram, TikTok | YouTube, Havn Journal) */
.footer__social {
  display: grid;
  /* RESPONSIVE (P2-PA-1): tracks cap at the drawn 154 but may shrink below 375 (320: 2 x 153 ran
     14.7px past the viewport). At >= 375 the column is 335 wide, so both tracks still resolve to 154. */
  grid-template-columns: repeat(2, minmax(0, var(--fo-social-w)));
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: var(--fo-link-gap);
}

.footer__social-link {
  display: flex;
  align-items: center;
  gap: var(--fo-icon-gap);
  width: var(--fo-social-w);
  max-width: 100%;                 /* follows its (shrinkable) track below 375 */
}

.footer__social-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: var(--fo-icon);
  height: var(--fo-icon);
}
/* TikTok / Havn Journal: ring is baked into the SVG (D-footer-8) — fill the box */
.footer__social-icon img {
  width: 100%;
  height: 100%;
}
/* Instagram / YouTube: ring = CSS border (Figma frame stroke), 24px glyph centred */
.footer__social-icon--ring {
  border: 1px solid var(--color-white-80);
  border-radius: var(--radius-round);
}
.footer__social-icon--ring img {
  width: calc(var(--fo-icon) * 24 / 36);
  height: calc(var(--fo-icon) * 24 / 36);
}

.footer__social-label {
  font-size: var(--text-body-fixed);
  font-weight: 400;
  line-height: var(--lh-ui);
  white-space: nowrap;
}

/* Legal */
.footer__legal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fo-legal-gap);
}

.footer__copyright {
  max-width: 100%;
  font-size: var(--text-body-sm);
  font-weight: 400;
  line-height: var(--lh-ui);
  color: var(--color-white-80);
}

.footer__legal-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fo-legal-link-gap);
}

.footer__legal-link {
  display: block;
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--lh-ui);
  text-decoration: underline;
  white-space: nowrap;
}

/* Wordmark (D-footer-7): live text, 4 letters spread by space-between, frame cropped to
   the cap height. Mobile: 186 / 335 = 55.52% box at x 82.9 (24.75%), as drawn. */
.footer__wordmark {
  height: 0.707em;
  font-family: var(--font-body);
  font-size: var(--footer-wordmark-size);
  font-weight: 500;
  line-height: var(--lh-logo);
  color: var(--color-white);
}
.footer__wordmark-text {
  display: flex;
  justify-content: space-between;
  width: 55.52%;
  height: 1em;
  margin-top: -0.147em;
  margin-left: 24.75%;
}

/* ---------- States (BA-footer-1) ---------- */
.footer__input:focus-visible,
.footer__submit:focus-visible,
.footer__link:focus-visible,
.footer__social-link:focus-visible,
.footer__legal-link:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}
.footer__link:focus-visible,
.footer__social-link:focus-visible,
.footer__legal-link:focus-visible { color: var(--color-white); }
.footer__input[aria-invalid="true"] { border-color: var(--color-white); }

@media (hover: hover) {
  .footer__link:hover,
  .footer__social-link:hover,
  .footer__legal-link:hover { color: var(--color-white); }
  .footer__submit:not(:disabled):hover { opacity: 0.9; }
}

/* ============================================================
   PSEUDO-TABLET 768-1023 (no Figma layer — D-footer-5, FD-BL)
   newsletter: desktop-compressed row · nav: grid-3 (social 1 × 4)
   · legal: stack + inline links · wordmark: desktop spread
   ============================================================ */
@media (min-width: 768px) {
  .footer {
    --fo-signup-pad: clamp(25.88px, calc(25.88px + (var(--max-vw) - 768px) * 0.025), 60px);
    --fo-main-pad: clamp(25.88px, calc(25.88px + (var(--max-vw) - 768px) * 0.025), 40px);
    --fo-title-gap: clamp(15.88px, calc(15.88px + (var(--max-vw) - 768px) * 0.025), 20px);
    --fo-signup-gap: clamp(20.88px, calc(20.88px + (var(--max-vw) - 768px) * 0.025), 40px);
    --fo-form-gap: clamp(15.88px, calc(15.88px + (var(--max-vw) - 768px) * 0.025), 20px);
    --fo-field-pad: clamp(15.88px, calc(15.88px + (var(--max-vw) - 768px) * 0.025), 20px);
    --fo-btn-pad-b: clamp(16.88px, calc(16.88px + (var(--max-vw) - 768px) * 0.025), 18px);
    --fo-btn-pad-i: 24px;
    --fo-wordmark-gap: clamp(25.88px, calc(25.88px + (var(--max-vw) - 768px) * 0.025), 60px);
    --fo-row-gap: clamp(45.88px, calc(45.88px + (var(--max-vw) - 768px) * 0.025), 82px);
    --fo-cols-gap: clamp(61.88px, calc(61.88px + (var(--max-vw) - 768px) * 0.025), 107px);
    --fo-follow-gap: 20px;
    --fo-legal-gap: 20px;
    --fo-title-list-gap: 15px;
    --fo-link-gap: 10px;
    --fo-legal-link-gap: clamp(15.88px, calc(15.88px + (var(--max-vw) - 768px) * 0.025), 20px);
    --fo-icon: 36px;
    --fo-icon-gap: 5px;
    --fo-social-w: 154px;
    --footer-wordmark-size: clamp(105px, calc(var(--max-vw) * 197 / 1440), 263px);
  }

  .footer__signup {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
  .footer__signup-copy { flex: 1 1 0; min-width: 0; }
  .footer__form { flex: 0 1 50%; }

  /* Kept left-packed (desktop 3446:1068 packs the nav into the left 556 of 1360). RESPONSIVE tried
     repeat(3, minmax(0,1fr)) for tablet_review M1 and reverted it: spreading moved Follow onto the
     light end of the 82deg gradient — white-on-gradient p5 3.47 → 2.20 @768, 4.36 → 2.36 @1023. */
  .footer__nav {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    align-items: start;
  }
  .footer__col--follow { flex: none; }

  .footer__social {
    display: flex;
    flex-direction: column;
  }

  .footer__copyright { max-width: 70ch; }   /* ch measure kept: tablet_review M2 @1023 is FD-CR; a wider % measure runs the text onto the light gradient end */

  .footer__legal-links { flex-direction: row; flex-wrap: wrap; }

  .footer__wordmark { height: 0.70em; }
  .footer__wordmark-text {
    width: 100%;
    margin-top: -0.15em;
    margin-left: 0;
  }
}

/* ============================================================
   DESKTOP 1024+ (frame 1440)
   ============================================================ */
@media (min-width: 1024px) {
  .footer {
    --fo-signup-pad: clamp(43px, calc(60px * (var(--max-vw) / var(--vw-base))), 80px);
    --fo-main-pad: clamp(28px, calc(40px * (var(--max-vw) / var(--vw-base))), 53px);
    --fo-title-gap: clamp(14px, calc(20px * (var(--max-vw) / var(--vw-base))), 27px);
    --fo-signup-gap: clamp(28px, calc(40px * (var(--max-vw) / var(--vw-base))), 53px);
    --fo-form-gap: clamp(14px, calc(20px * (var(--max-vw) / var(--vw-base))), 27px);
    --fo-field-pad: clamp(14px, calc(20px * (var(--max-vw) / var(--vw-base))), 27px);
    --fo-btn-pad-b: clamp(13px, calc(18px * (var(--max-vw) / var(--vw-base))), 24px);
    --fo-btn-pad-i: clamp(17px, calc(24px * (var(--max-vw) / var(--vw-base))), 32px);
    --fo-wordmark-gap: clamp(43px, calc(60px * (var(--max-vw) / var(--vw-base))), 80px);
    --fo-copy-w: clamp(403px, calc(567px * (var(--max-vw) / var(--vw-base))), 756px);
    --fo-form-w: clamp(393px, calc(553px * (var(--max-vw) / var(--vw-base))), 737px);
    --fo-nav-w: clamp(395px, calc(556px * (var(--max-vw) / var(--vw-base))), 741px);
    --fo-legal-w: clamp(394px, calc(554px * (var(--max-vw) / var(--vw-base))), 739px);
    --fo-copyright-w: clamp(310px, calc(436px * (var(--max-vw) / var(--vw-base))), 581px);
    --fo-title-list-gap: clamp(11px, calc(15px * (var(--max-vw) / var(--vw-base))), 20px);
    --fo-link-gap: clamp(7px, calc(10px * (var(--max-vw) / var(--vw-base))), 13px);
    --fo-legal-link-gap: clamp(14px, calc(20px * (var(--max-vw) / var(--vw-base))), 27px);
    --fo-icon: clamp(26px, calc(36px * (var(--max-vw) / var(--vw-base))), 48px);
    --fo-icon-gap: clamp(4px, calc(5px * (var(--max-vw) / var(--vw-base))), 7px);
    --fo-social-w: clamp(105px, calc(147px * (var(--max-vw) / var(--vw-base))), 196px);
    --footer-wordmark-size: clamp(140px, calc(197px * (var(--max-vw) / var(--vw-base))), 263px);

    background: linear-gradient(60.85deg, var(--fo-gradient-stops));
  }

  .footer__signup-copy { flex: 0 1 var(--fo-copy-w); }
  .footer__form { flex: 0 1 var(--fo-form-w); }

  /* links + legal: one row, nav left 556 / legal right 554, legal links pinned to the bottom */
  .footer__row {
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    gap: 0;
  }

  .footer__nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex: 0 1 var(--fo-nav-w);
    column-gap: 0;
  }

  .footer__legal {
    flex: 0 1 var(--fo-legal-w);
    justify-content: space-between;
    gap: 0;
  }
  .footer__copyright { max-width: var(--fo-copyright-w); }
  .footer__legal-links { flex-wrap: nowrap; }
}

/* Demo credit inside the legal line (added on the move into gridoxweb.com) */
.footer__credit {
  color: inherit;
  text-decoration: underline;
}
