/* ============================================================================
   ragazzi-hero.css — CARRIED from ragazzi-site/css/sections/hero.css.

   WHAT WAS LEFT BEHIND, and why: the static's hero frame also contains the
   TICKER and the NAV — in Figma they sit inside the hero and share its photo,
   so the static merges them into one section. Shopify does not: the ticker is
   the announcement-bar section and the nav is the header section, both of which
   the merchant edits and reorders independently. Their rules therefore travel
   with those sections (ragazzi-announcement.css / ragazzi-header.css) and are
   not duplicated here. The token block below is carried WHOLE anyway — the nav
   and ticker tokens are the same design scale and the header step reads them.

   Everything above the ADAPTATION block is the static, verbatim, in its own
   order, so it stays diffable. The one edit inside the carried part is marked
   `PORT:` — the background image had to become a custom property, because
   Liquid is not processed in `.css` files and the photo is a section setting.
============================================================================ */

/* ---------------------------------------------------------------------------
   SECTION TOKENS — scoped to the block's own class, not a page-level :root.
   In Shopify a section can be dropped onto any template from the theme editor,
   so a section that reads a token from a page-level scope breaks the moment it
   is moved; scoped to its own class, it travels with it.
--------------------------------------------------------------------------- */

.hero--home {
  --font-display:        "Advercase", "Playfair Display", Georgia, serif;
  --size-h1-max:         clamp(332.8px, calc(624px * (var(--max-vw) / var(--vw-base))), 624px);
  --size-icon-nav:       clamp(16.26px, calc(30.48px * (var(--max-vw) / var(--vw-base))), 30.48px);
  --size-icon-ticker:    clamp(13.55px, calc(25.4px * (var(--max-vw) / var(--vw-base))), 25.4px);
  --sp-cta-pad-x:        clamp(32px, calc(60px * (var(--max-vw) / var(--vw-base))), 60px);
  --sp-cta-pad-y:        clamp(10.67px, calc(20px * (var(--max-vw) / var(--vw-base))), 20px);
  --sp-gutter:           var(--container-pad);
  --sp-hero-body-pb:     clamp(53.33px, calc(100px * (var(--max-vw) / var(--vw-base))), 100px);
  --sp-hero-content-gap: clamp(32px, calc(60px * (var(--max-vw) / var(--vw-base))), 60px);
  --sp-hero-heading-gap: clamp(13.33px, calc(25px * (var(--max-vw) / var(--vw-base))), 25px);
  --sp-nav-h:            clamp(59.2px, calc(111px * (var(--max-vw) / var(--vw-base))), 111px);
  --sp-nav-icons-gap:    clamp(16px, calc(30px * (var(--max-vw) / var(--vw-base))), 30px);
  --sp-nav-links-gap:    clamp(21.33px, calc(40px * (var(--max-vw) / var(--vw-base))), 40px);
  --sp-nav-pad-y:        clamp(16.26px, calc(30.48px * (var(--max-vw) / var(--vw-base))), 30.48px);
  --sp-ticker-h:         clamp(24.38px, calc(45.71px * (var(--max-vw) / var(--vw-base))), 45.71px);
  --text-btn-lg:         clamp(11px, calc(20px * (var(--max-vw) / var(--vw-base))), 20px);
  --text-h1-hero:        clamp(35px, calc(65px * (var(--max-vw) / var(--vw-base))), 65px);
  --text-logo:           clamp(24px, calc(45px * (var(--max-vw) / var(--vw-base))), 45px);
  --text-nav-link:       clamp(11px, calc(20px * (var(--max-vw) / var(--vw-base))), 20px);
  --text-ticker:         clamp(10px, calc(18px * (var(--max-vw) / var(--vw-base))), 18px);
}

@media (max-width: 767px) {
  .hero--home {
    --size-icon-nav:       clamp(17.07px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40.91px);
    --size-icon-ticker:    clamp(17.07px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40.91px);
    --sp-cta-pad-x:        clamp(34.13px, calc(40px + (var(--max-vw) - 375px) * 0.015), 81.81px);
    --sp-cta-pad-y:        clamp(12.8px, calc(15px + (var(--max-vw) - 375px) * 0.015), 30.68px);
    --sp-hero-body-pb:     clamp(51.2px, calc(60px + (var(--max-vw) - 375px) * 0.015), 122.72px);
    --sp-hero-content-gap: clamp(17.07px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40.91px);
    --sp-hero-heading-gap: clamp(8.53px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20.45px);
    --sp-nav-h:            clamp(51.2px, calc(60px + (var(--max-vw) - 375px) * 0.015), 122.72px);
    --sp-nav-icons-gap:    clamp(17.07px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40.91px);
    --sp-nav-pad-y:        clamp(17.07px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40.91px);
    --sp-ticker-h:         clamp(30.72px, calc(36px + (var(--max-vw) - 375px) * 0.015), 73.63px);
    --text-btn-lg:         clamp(12px, calc(14px + (var(--max-vw) - 375px) * 0.015), 29px);
    --text-h1-hero:        clamp(27px, calc(32px + (var(--max-vw) - 375px) * 0.015), 65px);
    --text-logo:           clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 41px);
    --text-nav-link:       clamp(14px, calc(16px + (var(--max-vw) - 375px) * 0.015), 33px);
    --text-ticker:         clamp(10px, calc(12px + (var(--max-vw) - 375px) * 0.015), 25px);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero--home {
    --size-h1-max:         clamp(335px, calc(335px + (var(--max-vw) - 768px) * 0.025), 624px);
    --size-icon-nav:       clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 30.48px);
    --size-icon-ticker:    clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 25.4px);
    --sp-cta-pad-x:        clamp(40px, calc(40px + (var(--max-vw) - 768px) * 0.025), 60px);
    --sp-cta-pad-y:        clamp(15px, calc(15px + (var(--max-vw) - 768px) * 0.025), 20px);
    --sp-hero-body-pb:     clamp(60px, calc(60px + (var(--max-vw) - 768px) * 0.025), 100px);
    --sp-hero-content-gap: clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 60px);
    --sp-hero-heading-gap: clamp(10px, calc(10px + (var(--max-vw) - 768px) * 0.025), 25px);
    --sp-nav-h:            clamp(60px, calc(60px + (var(--max-vw) - 768px) * 0.025), 111px);
    --sp-nav-icons-gap:    clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 30px);
    --sp-nav-links-gap:    clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 40px);
    --sp-nav-pad-y:        clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 30.48px);
    --sp-ticker-h:         clamp(36px, calc(36px + (var(--max-vw) - 768px) * 0.025), 45.71px);
    --text-btn-lg:         clamp(14px, calc(14px + (var(--max-vw) - 768px) * 0.025), 20px);
    --text-h1-hero:        clamp(32px, calc(32px + (var(--max-vw) - 768px) * 0.025), 65px);
    --text-logo:           clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 45px);
    --text-nav-link:       clamp(16px, calc(16px + (var(--max-vw) - 768px) * 0.025), 20px);
    --text-ticker:         clamp(12px, calc(12px + (var(--max-vw) - 768px) * 0.025), 18px);
  }
}

/* ============================================================
   hero.css — section 1 (`hero`), desktop 3080:13420 / mobile 3080:13969
   Pattern B-edge: the photo runs edge to edge, the inner bands carry the gutter.

   NAMESPACED in the static: every selector begins with `.hero--home`, because
   `.hero`, `.hero__heading` and `.hero__title` are also the mission page's —
   two different heroes, different rules. Keep the namespace; a Shopify theme
   has a FLAT `assets/` folder and one layout, so folder isolation is gone.
============================================================ */

/* ---------------------------------------------------------------------------
   `.btn` — the page's ONE button, in this section. `:where()` contributes ZERO
   specificity, so this ranks exactly like the bare selector it replaces.
--------------------------------------------------------------------------- */
:where(.hero--home) .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-cta-pad-y) var(--sp-cta-pad-x);
  background: var(--color-white);
  color: var(--color-black);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  /* part1's button ramp is 20px on desktop and is named `--text-btn-lg` because
     part2/part3 use `--text-btn` for an 18px one. Without this line part1's
     buttons would silently shrink to 18px. */
  font-size: var(--text-btn-lg);
  font-weight: 700;
  line-height: var(--lh-120);
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
}

.hero--home {
  position: relative;
  background: var(--color-black);
}

/* ---------------- Body (the photo box) ----------------
   Figma 3080:13444 (D) 1920 x 1034, padding [0,0,100,0] — NO horizontal
   padding; the nav row and the content row each carry the 100px gutter
   themselves. Figma 3080:13992 (M) 375 x 604, padding [0,20,60,20].
   Height is pinned by the design (brief §6 forbids 100vh); `min-height` keeps
   the 508px of `space-between` free space without risking a clip if a
   substituted font wraps a line further than Figma's.                        */
.hero--home .hero__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(515.4px, calc(604px + (var(--max-vw) - 375px) * 0.015), 1235.4px);
  padding: 0 var(--sp-gutter) var(--sp-hero-body-pb);
  /* PORT: the static hardcodes `url("../../assets/images/hero-bg.jpg")`. Liquid
     is NOT processed in `.css` files, and the photo is a section setting, so the
     section passes it in as a custom property on this element. The fallback is
     the shipped asset, so the rule still renders if the property is missing. */
  /* `--hero-overlay` is the optional flat wash set by the section; `none` is a
     valid layer, so the photo still paints when it is not set */
  background-image: var(--hero-overlay, none), var(--hero-bg-image);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: var(--hero-bg-position-mobile, 50% 50%);
}

/* 768–1023 has no Figma layer, but from 768 up it renders the DESKTOP inline nav,
   so it needs the desktop CROP ANCHOR too — not the mobile one. With `cover` and
   a centred vertical window this band crops the top off the photo and lifts the
   subject's white towel straight into the nav row: QA measured `COMMUNITY` at
   2.96–3.44:1 across 950–1023 against 4.62:1 at 1920. Anchoring the window at the
   TOP keeps the nav over the wall instead of over the towel. `cover` is kept
   because the desktop `100% 139.37%` pair only preserves the source's aspect at
   the DESKTOP box ratio — applying it here would stretch the photo. */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero--home .hero__body {
    background-position: var(--hero-bg-position-mobile, 50% 0%);
  }
}

/* ---------------- Content block ----------------
   Figma 3080:13470 (D) is the full 1920 with padding [0,100,0,100] and gap 60;
   3080:14012 (M) is 335 wide inside the body's own 20px padding, gap 20. */
.hero--home .hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: var(--sp-hero-content-gap);
}

/* Figma mobile: the heading group (3080:14013) and the h1 (3080:14014) are both
   `layoutSizingHorizontal: FILL` at 335 — they span the content column even
   though the text is shorter. On desktop the group HUGs and the h1 is a FIXED
   624, which its own max-width already produces, so the stretch is dropped
   there. Without this the mobile h1 box measures its text (265) instead of 335. */
.hero--home .hero__heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  row-gap: var(--sp-hero-heading-gap);
}

.hero--home .hero__title {
  align-self: stretch;
  font-family: var(--font-display);
  font-size: var(--text-h1-hero);
  font-weight: 400;
  line-height: var(--lh-tight);
  color: var(--color-white);
}

.hero--home .hero__sub {
  font-family: var(--font-body);
  font-size: var(--text-hero-sub);
  font-weight: 400;
  line-height: var(--lh-hero-sub);
  color: var(--color-white);
}

/* ============================================================
   PSEUDO-TABLET (768–1023) — has-tablet-layer: false
   Structure follows DESKTOP here (nav links inline, hamburger hidden, h1 wraps
   naturally against its cap). Scalars interpolate mobile -> desktop with the
   fixed 0.025 coefficient.
============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  /* The base rule above is the MOBILE formula (`M-base + (max-vw - 375) * .015`)
     and it has no upper guard, so it leaked into this band unchanged. The band
     owns its own interpolation: floor = M-base 604, ceiling = D-base 1034. */
  .hero--home .hero__body {
    min-height: clamp(604px, calc(604px + (var(--max-vw) - 768px) * 0.025), 1034px);
  }
}

@media (min-width: 768px) {
  /* MUST-APPLY (brief §5): without the cap the headline renders on ONE line and
     the whole hero composition is wrong. Figma FIXED 624 at 1920; the tablet band
     gets the same "natural wrap, max-width 624" cell as desktop, and the token
     interpolates --size-h1-max 335 -> 624 across 768–1023. */
  .hero--home .hero__title {
    max-width: var(--size-h1-max);
  }

  /* With the cap live, the heading group HUGs its content (Figma 3080:13471 =
     624 wide, which the h1's cap above already gives it) instead of stretching
     to the mobile content column. */
  .hero--home .hero__heading {
    align-self: flex-start;
  }
}

/* ============================================================
   DESKTOP (1024+)
============================================================ */
@media (min-width: 1024px) {
  .hero--home .hero__body {
    /* Figma 3080:13444: 1034 tall, padding-bottom 100, no horizontal padding. */
    min-height: clamp(551.47px, calc(1034px * (var(--max-vw) / var(--vw-base))), 1034px);
    padding-inline: 0;
    /* Re-creates the frame-level CROP (100% x 133.47%, anchored top) against the
       body box, which starts 45.71px below the frame top.
       PORT: the static's literal `100% 139.37%` / `50% 11.23%` are the values for
       the SHIPPED photo (630x473) in the desktop box (1920x1034) — 139.37% is
       exactly the height that keeps that source's aspect ratio, so a differently
       proportioned upload would be STRETCHED by it. The section recomputes both
       from the real image (and its focal point) and passes them in; the literals
       stay here as the fallback. */
    background-size: var(--hero-bg-size, 100% 139.37%);
    background-position: var(--hero-bg-position, 50% 11.23%);
  }

  /* The content row carries the gutter itself — its Figma parent has none. */
  .hero--home .hero__content {
    padding-inline: var(--sp-gutter);
  }
}

/* ============================================================================
   ADAPTATION — Shopify reconciliation. Nothing above this line is ours.
============================================================================ */

/* 1. In the static, `.hero__body` has TWO children — the nav row and the content
      row — and `justify-content: space-between` is what pushes the content to the
      bottom of the photo. Here the nav is Dawn's header section, so the body has
      ONE child and `space-between` would park it at the TOP. `margin-top: auto`
      restores the design's position without touching the carried rule. */
.hero--home .hero__content {
  margin-top: auto;
}

/* 2. Dawn's `.section + .section` seam margin does not reach this section (it has
      no `.section` class), and the hero must sit flush under the header. Stated
      because a stock section dropped above it would otherwise look like a bug. */
.shopify-section:has(> .hero--home) {
  margin-top: 0;
}

/* 3. VARIANT — vertical position of the content block.
      The home hero (Figma 3080:13444) is `justifyContent: SPACE_BETWEEN` with the
      nav as its first child, so the copy sits at the BOTTOM of the photo; rule 1
      above reproduces that. The community hero (Figma 3083:6162, 1920x1034) is
      the SAME frame with `justifyContent: CENTER` and the same padding-bottom
      100 — the nav is not inside it there, it is a white bar above the photo, so
      the copy is centred in the box that remains. `margin-block: auto` centres
      the one child inside `space-between` exactly as `justify-content: center`
      would, and it does it by overriding rule 1 rather than fighting the carried
      rule. Measured live at 1920: content 311.59 tall at y 311.2 of the 1034 box
      — i.e. (1034 - 100 - 311.59) / 2, which is Figma's composition.

      DESKTOP ONLY, on purpose. The node the variant was built from (3083:6162)
      is the desktop layer; there is no community mobile layer to read, and the
      mobile hero has no nav inside it on EITHER page, so its composition has no
      reason to differ. Below 1024 the variant is therefore inert and the section
      renders the home layout, which is a designed layer rather than a guess. If
      a mobile community frame turns up and it is centred too, drop the query. */
@media (min-width: 1024px) {
  .hero--home.hero--mid .hero__content {
    margin-block: auto;
  }
}

/* 4. VARIANT — the CTA type ramp.
      Figma gives the home CTA (3080:13476) 20px and the community CTA
      (3083:6168) 18px. Those are two DIFFERENT design tokens, not a rounding
      difference: 20px is part1's `--text-btn-lg`, declared in this file's token
      block, and 18px is the site-wide `--text-btn` that shop-banner, breathe and
      blog already use. The variant swaps the token, so both stay on the design's
      own ramps across all three bands (the mobile ramp is identical in both,
      the tablet ceiling differs 20 vs 18). Measured live at 1920:
      241.67 x 61.59 against the large button's 255.19 x 64. */
.hero--home.hero--cta-sm .btn {
  font-size: var(--text-btn);
}

/* ==========================================================================
   HOME, "Tudo Website (new)" 2975:3566 desktop / 2975:3741 mobile.
   Two opt-in looks, set from the section: the serif heading the redesigned
   pages use, and a button lettered in semibold title case. The about and
   community pages keep the original face and the bold capitals.
========================================================================== */
.hero--home.hero--serif .hero__title {
  font-family: "Bethany Elingston", "Playfair Display", Georgia, serif;
}

.hero--home.hero--cta-title .btn {
  font-weight: 600;
  text-transform: capitalize;
}

/* the design's mobile button is 16, where the capitals ramp gives 14 */
@media (max-width: 767px) {
  .hero--home.hero--cta-title .btn {
    font-size: clamp(14px, calc(16px + (var(--max-vw) - 375px) * 0.015), 33px);
  }
}

/* "Start Your / Beauty Journey" breaks after "Your" on BOTH layers in this
   design. The typed line break is normally a phone-only one, because the
   original face filled the 624 measure and wrapped there by itself; the serif
   is narrower and would pull "Beauty" up onto the first line. */
.hero--home.hero--serif .hero__title .u-br-mobile {
  display: inline;
}

/* Dark copy for light photos (setting `text_tone: dark`): black heading and
   sub, inverted button. The section's black backing is swapped for white so
   the photo's edges never show a dark seam while it loads. */
.hero--home.hero--dark {
  background: var(--color-white);
}

.hero--home.hero--dark .hero__title,
.hero--home.hero--dark .hero__sub {
  color: var(--color-black);
}

.hero--home.hero--dark .btn {
  background: var(--color-black);
  color: var(--color-white);
}

/* Phone layout `stack`: the photo runs full width at the top and the copy sits
   on white beneath it, for photos whose faces fill the lower half. The white
   layer starts where the visible photo ends, so the rest of a tall image is
   simply covered rather than squeezed. */
@media (max-width: 767px) {
  .hero--home.hero--stack .hero__body {
    --stack-h: 132vw;
    min-height: 0;
    padding-top: calc(var(--stack-h) + 32px);
    background-color: var(--color-white);
    background-image:
      linear-gradient(to bottom, transparent 0, transparent var(--stack-h), var(--color-white) var(--stack-h)),
      var(--hero-bg-image);
    background-size: 100% 100%, 100% auto;
    background-position: top, top;
  }

  .hero--home.hero--stack .hero__content {
    margin-top: 0;
  }
}

/* Phone layout `fade`: copy stays on the photo, in white over a soft dark fade
   at the foot of the frame. Overrides the dark copy of `hero--dark`, which is
   meant for the light desktop backdrop. */
@media (max-width: 767px) {
  .hero--home.hero--fade .hero__body {
    background-image:
      linear-gradient(to bottom, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.62) 100%),
      var(--hero-bg-image);
    background-position: var(--hero-bg-position-mobile, 50% 0%);
  }

  .hero--home.hero--fade .hero__title,
  .hero--home.hero--fade .hero__sub {
    color: var(--color-white);
  }

  .hero--home.hero--fade .btn {
    background: var(--color-white);
    color: var(--color-black);
  }
}
