/* Bridge: minimal overrides. Keep this file tiny. */

/* Anchor the root rem base so every rem-based height (nav bars + spacer)
   computes identically and the fixed header never drifts from its spacer. */
html {
  font-size: 16px !important;
}

@media screen and (min-width: 992px) {
  .nav_logo.show-tablet,
  .nav_logo.show-mobile-portrait,
  .nav_logo.show-mobile-landscape {
    display: none !important;
  }
}

/* Fix the white seam under the header: the fixed nav is semi-transparent
   (#f4e9dde6 = 90% cream) with backdrop blur, so the white page body shows
   through at its bottom edge and reads as a white strip. Make it fully
   opaque and drop the blur so nothing bleeds through. */
.nav_component {
  background-color: #f4e9dd !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Remove any body top margin that could push the hero down and expose a gap. */
body {
  margin-top: 0 !important;
}

/* The spacer must track the fixed nav's height at every breakpoint. The
   reference site already provides a responsive 5.375rem (86px) at <=767px;
   a flat desktop value here would fight it, so we only correct the desktop
   value and let the reference's own responsive rule win on smaller screens. */
@media screen and (min-width: 768px) {
  .nav_spacer {
    height: 7.75rem;
  }
}

/* The nav's drop shadow creates a faint gray seam right under the bar.
   Drop it so the nav bottom meets the hero cleanly. */
.nav_component {
  box-shadow: none;
}

/* The hero photo's own light-gray sky shows at its top edge (cropped by
   object-position: 50% 30%) and reads as a white strip under the nav.
   Nudge the image's vertical focus up so the light band is cropped away
   and the photo sits flush under the header. */
.home-header_background-image {
  object-position: 50% 12%;
}

/* Defensive: the self-hosted Typekit fonts (museo-slab/transat) can fail to
   load in some engines, which collapses headings to zero height and leaves
   blank white space. Guarantee headings always lay out with real height via
   a reliable fallback stack, so text never disappears even if fonts fail. */
h1, h2, h3, h4, h5, h6 {
  font-family: transat, museo-slab, sans-serif !important;
  height: auto !important;
  min-height: 1em !important;
}

/* NOTE: Do NOT paint body/html cream here — the hero photo wrapper uses
   z-index:-1, and a body background paints OVER it, hiding the photo.
   The white strip under the nav is the hero photo's own light-gray top
   edge, fixed via object-position on .home-header_background-image below. */

/* ------------------------------------------------------------------
   Hero / CTA photo fix.
   Webflow gives the background-image wrappers `z-index: -1`. With our
   Astro markup those wrappers escape the section and paint BEHIND the
   <body> (which is #fff), so photos vanish and a white band shows under
   the nav. `isolation: isolate` creates a local stacking context on the
   section, keeping the -1 wrapper inside it (above the body canvas).
   ------------------------------------------------------------------ */
.section-header.is-home,
.section_home-header,
.home-header_empty,
.section-header.is-service,
.section-cta,
.section-header.is-shop,
.section-header.is-account,
.section-header.is-shop-category,
.section-header.is-privacy {
  isolation: isolate;
}

/* ------------------------------------------------------------------
   Homepage CTA "Learn your options..." band.
   .section-cta's gradient is transparent on the left third, so with a
   white page canvas the left half reads as an empty white block and the
   photo only shows on the far right. Give the section the ink backdrop
   its gradient expects, and let the isolated -1 photo paint over it.
   ------------------------------------------------------------------ */
.section-cta {
  background-color: #22212e;
}

/* The support/hero overlay layer sits above the photo (z-index 1). On a
   white canvas its transparent top shows white. Tint the service hero
   back to cream so the fade resolves onto the site's own colour. */
.section-header.is-service {
  background-color: #f4e9dd;
}

/* ------------------------------------------------------------------
   FIX (final): the Webflow photo wrappers use z-index:-1, which paints
   them behind the page canvas and every ancestor background — that is
   what made photos vanish and left white/blank bands. Instead of fighting
   ancestors, lift the wrappers to z-index:0 and raise the text/content
   layers above them. Nothing can cover the photo now, and no white gap
   can appear because the photo itself fills the section top-to-bottom.
   ------------------------------------------------------------------ */
.header_background-wrapper-2,
.header_background-wrapper,
.header_background-wrapper.is-services,
.cta-background-image-wrapper,
.home-header_background-image-wrapper-2,
.home-header_background-image {
  z-index: 0;
}

/* ------------------------------------------------------------------
   HOME HERO HEIGHT (the "cut in half" hero).
   `.section-header.is-home` in the reference is a flex column stretched by
   `.padding-section-large` (8rem) — so the hero is exactly as tall as the
   copy needs (~660px at 1506x900), not a full-viewport block. The reference
   paints the same 660px box, but its `<main>` wrapper supplies the flex
   chain that lets `.section-header.is-home` resolve `min-height: calc(100vh
   - 7.32rem)`; our `<main class="main-wrapper">` does, so the hero must be
   forced to fill from the nav down to the viewport bottom, capped at 64rem.
   ------------------------------------------------------------------ */
.home-header_empty {
  display: block;
}
.home-header_empty > .section-header.is-home {
  min-height: calc(100vh - 7.75rem);
}
@media screen and (max-width: 767px) {
  .home-header_empty > .section-header.is-home {
    min-height: calc(100vh - 5.375rem);
  }
}

/* Keep the photo pinned behind the copy inside the same stacking context. */
.header_background-wrapper-2 > *,
.header_background-wrapper > *,
.cta-background-image-wrapper > * {
  position: relative;
  z-index: 0;
}

/* Text/content layers must sit above the photo. */
.section-header.is-home > *,
.section_home-header .padding-global,
.section-header.is-service > *,
.section-cta > .padding-global {
  position: relative;
  z-index: 2;
}

/* Drop the backdrops added earlier — they painted over the photos. */
.section-cta {
  background-color: transparent;
}

/* ------------------------------------------------------------------
   CTA banner photo collapse.
   .cta-background-image is a direct flex child of a column flex wrapper
   with align-items:flex-end; width:120%/height:100% don't resolve as a
   flex item, so the <img> shrinks to its intrinsic tiny box (e.g. 58x24)
   and the banner reads as an empty white/gradient block. Pin it to the
   wrapper box instead.
   ------------------------------------------------------------------ */
.cta-background-image-wrapper {
  align-items: stretch;
}

.cta_background-image {
  flex: 0 0 auto;
  position: absolute;
  inset: 0;
  width: 120%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
}

/* The same flex-shrink issue can hit the service/hero wrappers. */
.header_background-wrapper.is-services,
.header_background-wrapper-2 {
  align-items: stretch;
}
.header_background-image,
.home-header_background-image {
  flex: 0 0 auto;
}

/* ------------------------------------------------------------------
   NAV / HERO TOP ALIGNMENT (the residual white strip).
   `.nav_tertiary` (30px) and `.nav_secondary` (30px) are `position:
   fixed`, so they take no space in flow. That leaves `.nav` beginning
   at y=22 rather than y=0, and `.nav_spacer` therefore reserves
   22 -> 146 (desktop) / 22 -> 108 (mobile) instead of from the top.

   Measured: nav_component paints 0 -> 124 (desktop) but only 0 -> 86
   on mobile, where `.nav_secondary` is hidden. The hero photo starts at
   the spacer's bottom edge (108). So 86 -> 108 on mobile is bare white
   body with nothing painting over it — a ~22px strip directly under
   the nav. Desktop hides the same defect only because the fixed nav
   happens to paint past that band.

   Pull the nav block back to the top of the flow so the spacer reserves
   from y=0 and the hero always begins exactly where the nav ends.
   ------------------------------------------------------------------ */
.nav {
  margin-top: -1.375rem; /* 22px: cancel the fixed tertiary bar's offset */
}

/* ------------------------------------------------------------------
   HOME HERO: restore the reference's own box model.
   Our bridge overrides above made every photo wrapper `position:relative;
   z-index:0`, which turned `.header_background-wrapper-2` into a 100%
   *in-flow* (full width, zero height) block: it stacked ABOVE the copy and
   squeezed the photo into a ~360px band at the top — the "cut in half" hero.
   The reference keeps that wrapper `position:absolute; z-index:-1` so the
   photo fills the whole hero behind the copy. Re-assert that, and give the
   isolated section a painted backdrop so the photo never falls behind the
   white page canvas.
   ------------------------------------------------------------------ */
.section_home-header,
.home-header_empty,
.home-header_empty > .section-header.is-home,
.section-header.is-home {
  background-color: #f4e9dd;
}

.home-header_empty .header_background-wrapper-2 {
  position: absolute;
  z-index: 0;
  inset: 0;
  height: 100%;
}

.home-header_empty .home-header_background-image-wrapper-2 {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: auto;
}

.home-header_empty .home-header_background-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 33%;
  z-index: 0;
}

.home-header_empty .home-header_background-layer {
  z-index: 1;
}

/* ------------------------------------------------------------------
   SUBSCRIBE CARD — the form was collapsing.
   `subscribe.astro` uses the older page-component vocabulary
   (`.field`, `.btn`, `.sub-card`), but this layout only loads the
   reference Webflow sheets; `src/styles/*.css` was never imported. So the
   inputs fell back to browser defaults (180px wide, flush-left) instead
   of filling the card, and the card had no padding. Restore the intended
   form layout with the site's own tokens.
   ------------------------------------------------------------------ */
.sub-card {
  padding: 3rem;
  max-width: 40rem;
}

.sub-card h2 {
  margin-bottom: 1rem;
}

.sub-card form {
  margin-top: 2rem;
}

.sub-card .field {
  margin-bottom: 1.5rem;
}

.sub-card .field label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .5rem;
}

.sub-card .field input,
.sub-card .field textarea,
.sub-card .field select {
  display: block;
  width: 100%;
  padding: .75rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: inherit;
  background-color: #fff;
  border: 1px solid #d4d7df;
  border-radius: .5rem;
}

.sub-card .field input:focus,
.sub-card .field textarea:focus,
.sub-card .field select:focus {
  outline: none;
  border-color: #451b2d;
  box-shadow: 0 0 0 3px rgba(69, 27, 45, .18);
}

.sub-card .text-muted {
  margin-top: .5rem;
}

@media screen and (max-width: 767px) {
  .sub-card {
    padding: 1.5rem;
  }
}

/* ------------------------------------------------------------------
   SUPPORT SERVICE PAGES (`/support/*`) header + intro.
   1) `.header_background-image.is-service` is `min-width:84rem` with
      `object-position:100% 30%`. On our markup the wrapper is a normal
      flow box, so the 84rem-wide image is laid out at its intrinsic
      height, pushing the header to ~1474px and dropping the copy far
      below the fold. Pin the photo to the wrapper instead.
   2) Keep the copy/photo layering of the reference: photo behind,
      text at z-index 2.
   ------------------------------------------------------------------ */
/* The hero must NOT paint a solid cream fill: the reference relies on the
   photo itself being the backdrop, with its own `linear-gradient(to right,
   transparent 33%, #f4e9ddcc 54%)` layer fading it out to cream on the right.
   A solid background-color here covers that photo and kills the fade. */
.section-header.is-service {
  background-color: transparent;
  overflow: hidden;
}

.section-header.is-service .header_background-wrapper.is-services {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: flex;
  align-items: stretch;
}

.section-header.is-service .header_background-image.is-service {
  position: absolute;
  inset: 0;
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  object-fit: cover;
  /* Reference: subject sits left-of-centre, right side fades to cream. */
  object-position: 0% 30%;
}

.section-header.is-service .padding-global {
  position: relative;
  z-index: 2;
}

/* Service intro: image column + rich text, as the reference lays it out. */
.service-intro_image-wrapper {
  border-radius: 1rem;
  overflow: hidden;
}

.service-intro_image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Footer polish: language links and the Tiny Giants credit were still
   rendering as browser-default blue/underlined anchors against the dark
   footer. Give them the site's champagne treatment to match the reference. */
.section-footer .locales-list a,
.section-footer .footer-color,
.section-footer .text-color-amethyst {
  color: #f4e9dd;
  text-decoration: none;
}

.section-footer .locales-list a:hover {
  color: #ecba99;
  text-decoration: underline;
}

.section-footer .w-inline-block,
.section-footer .footer_credit,
.section-footer .footer_credit-link,
.section-footer a .footer_credit {
  color: #ecba99;
  text-decoration: none;
}

/* ------------------------------------------------------------------
   SERVICE INTRO PHOTO.
   `.service-intro_image-wrapper` is a 240px-wide flex column while the
   photo is 1728x1154, so `object-fit: cover` on a 399px-tall box scales
   the image to ~600px wide and crops it to a narrow strip of bedding.
   The reference shows the whole subject: let the wrapper take the photo's
   own aspect ratio instead of stretching it to the text column's height.
   ------------------------------------------------------------------ */
.section-service-intro .service-intro_component {
  align-items: flex-start;
}

.section-service-intro .service-intro_image-wrapper {
  align-self: flex-start;
  min-height: 0;
  height: auto;
  aspect-ratio: 1728 / 1154;
  border-radius: 0.75rem;
  overflow: hidden;
}

.section-service-intro .service-intro_image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: 55% 50%;
  border-radius: 0;
}

@media screen and (max-width: 991px) {
  .section-service-intro .service-intro_image-wrapper {
    max-width: 20rem;
  }
}
