/* ============================================================================
   ragazzi-pic-1.css — CARRIED from
   ragazzi-site/community/css/sections/pic-1.css.

   A CUSTOM section, not a Dawn restyle. `image-banner` is the obvious candidate
   and it was rejected here for the same reason it was rejected for the shop
   banner (playbook §10.1/§10.3): its photo is an <img> with `object-fit` where
   this design needs a MEASURED CROP — the desktop layer's Figma imageTransform
   resolves to background-position-y 66.37% of a 600x600 master, and its second
   image slot is a half-width companion, not the mobile variant. Everything else
   image-banner offers (overlay opacity, height presets, the nine-position
   content grid, the button pair) would have to be neutralised to arrive at two
   settings.

   RENAMED, 1:1:  .pic-1  ->  .ragazzi-pic-1   (children unchanged)

   ONE DELIBERATE DEVIATION from the static, marked `PORT:` below: the photo's
   URL comes in as a custom property, because Liquid is not processed in a .css
   asset and the image is a section setting. Both background layers, their order
   (scrim FIRST so CSS paints it on top, which is the reverse of Figma's fills[]
   order) and the two crops are the static's, untouched.

   The heading TAG is a setting rather than the static's hardcoded <h1>: on this
   store the community page also carries `ragazzi-hero`, which already emits the
   page <h1>, and two of them is a document-outline defect. The visual token is
   h2's on both layers either way — the static's own comment says only the tag
   differs.
============================================================================ */

/* ---------------------------------------------------------------------------
   SECTION TOKENS — moved out of the page's tokens.css on 2026-08-13.

   These values are used by THIS block and nothing else, so they belong here,
   not in a site-wide :root. That is not tidiness: 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 the
   block's own class, it travels with it.

   All three bands are carried verbatim from the page's old tokens.css —
   desktop at the top, then the mobile and pseudo-tablet overrides — so the
   cascade is unchanged. Verified by computed-style diff at 375/768/1024/1440/1920.
--------------------------------------------------------------------------- */

.ragazzi-pic-1 {
  --text-h2: clamp(35px, calc(65px * (var(--max-vw) / var(--vw-base))), 65px);
  --lh-heading: 1.2;
  --section-pad-y: clamp(53px, calc(100px * (var(--max-vw) / var(--vw-base))), 100px);
  --color-scrim: rgba(0, 0, 0, 0.4);
  --color-text-inverse: #ffffff;
}

@media (max-width: 767px) {
  .ragazzi-pic-1 {
    --text-h2: clamp(27px, calc(32px + (var(--max-vw) - 375px) * 0.015), 65px);
    --lh-heading: 1.1;
    --section-pad-y: clamp(34px, calc(40px + (var(--max-vw) - 375px) * 0.015), 82px);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .ragazzi-pic-1 {
    --text-h2: clamp(32px, calc(32px + (var(--max-vw) - 768px) * 0.025), 65px);
    --lh-heading: 1.2;
    --section-pad-y: clamp(40px, calc(40px + (var(--max-vw) - 768px) * 0.025), 100px);
  }
}

/* ---- MOBILE BASE (0-767) ---------------------------------
   Figma 3100:21253: 375x601 fixed, vertical, justify CENTER /
   align CENTER, padding 40/20/40/20, gap 0, ONE child (the heading).  */

.ragazzi-pic-1 {
  /* D-pic1-1 (MUST-APPLY): BOTH Figma fills on ONE element, as two CSS
     background layers. CSS paints the FIRST-listed layer on TOP, which is
     the reverse of Figma's fills[] order (last = top) — so the scrim
     gradient is listed FIRST and the photo SECOND, reproducing
     fills[1] (#00000066) over fills[0] (image 9a2e1278…).
     Neither may be dropped: without the scrim the white heading falls
     from ~6.3:1 to ~3.5:1 contrast (D-pic1-12 tripwire); without the
     image the band is flat grey.
     D-pic1-5 (MUST-APPLY): the file is the RAW 600x600 `fill.url` master,
     never the composed `renderUrl` — the node has a live-HTML child, so
     its render bakes the heading text and the scrim into the pixels. */
  /* PORT: the photo URL is a custom property set inline by the section, because
     Liquid is not processed in a .css asset and the image is a merchant setting.
     The layer ORDER, the scrim and `cover` are the static's, untouched. */
  background-image:
    linear-gradient(var(--color-scrim), var(--color-scrim)),
    var(--pic-1-bg-image);
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  /* mobile fills[0].scaleMode = FILL, no imageTransform → plain centred
     cover. Do NOT give it a transform (D-pic1-5). */
  background-position: 50% 50%, 50% 50%;

  /* D-pic1-6: the band height is a FIXED frame height per layer (content
     is only 156 of 601 here, 278 of 858 on desktop), so it is a spacing
     value with its own clamps — never one `aspect-ratio` (2.238:1 vs
     0.624:1 cannot both be expressed, and on mobile 375/601 yields
     1229px at a 767 viewport where the token formula yields 607px).
     `min-height`, not `height`, so the box can never clip its content.
     M-min = round(601 x 320/375) = 513; M-max = round(601 x 767/375) = 1229. */
  min-height: clamp(513px, calc(601px + (var(--max-vw) - 375px) * 0.015), 1229px);

  display: flex;
  /* NOTE: no padding here on purpose — see the B-edge note above. */
}

.pic-1__content {
  /* The Pattern B-edge padding / alignment box. It has no Figma node of
     its own; its PADDING BOX is the thing that must measure 375x601 /
     1920x858 (D-pic1-8). */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* Figma justifyContent CENTER (block axis) */
  align-items: center;       /* Figma alignItems   CENTER (inline axis) */
  /* Section padding comes from the page tokens (brief-page.md §4.3);
     no per-section magic numbers. Block/inline longhand-pairs, never the
     `padding` shorthand. */
  padding-block: var(--section-pad-y);
  padding-inline: var(--container-pad);
}

.pic-1__title {
  /* D-pic1-2: this is the page <h1> (Figma has no h1 — all three headings
     share the one h2 token), styled with the UNCHANGED h2 visual token.
     Only the tag differs. */
  font-family: var(--font-body);
  font-size: var(--text-h2);          /* 32px mobile / 65px desktop */
  font-weight: 500;                   /* Figma fontWeight 500 both layers */
  /* NOT var(--lh-heading): that token is 1.1 in the mobile band because
     the OTHER two headings (`Our Leaders` 3100:21271, `Join the chat`
     3100:21278) are 110% there. THIS node is lineHeight 120% on BOTH
     layers (3100:21254 mobile, 3100:20978 desktop — brief-page.md §4.2a),
     so 1.2 is re-declared locally. */
  line-height: 1.2;
  letter-spacing: 0em;      /* Figma letterSpacing 0% */
  color: var(--color-text-inverse);   /* #ffffff */
  text-align: center;                 /* Figma textAlign CENTER (mobile) */
  /* D-pic1-2: explicit belt-and-braces reset. base.css already zeroes the
     UA h1 margin, and this page's section margins are provably 0 — a UA
     h1 margin is exactly how a prior run nearly shipped a doubled seam. */
  margin: 0;
  /* D-pic1-4 (MUST-APPLY): the cap is em, not px. 311/32 = 9.719em ties
     it to the element's own font-size, so the DESIGNED 2-line break
     survives every font-size in the mobile band. A pinned 311px cap turns
     the heading into 3 lines at a 767 viewport (font 37.9px) and grows
     the band. */
  max-width: 9.719em;
  overflow-wrap: break-word;
}

/* ---- PSEUDO-TABLET (768-1023) -----------------------------
   has-tablet-layer: false — interpolated, not designed. D-pic1-7: the
   MOBILE composition (centred both axes, wrapped, capped, white-space
   normal) holds through this whole band; the desktop composition appears
   only at 1024, matching the page-level 1024 rule for `community`.
   Padding and type are already interpolated by the tokens; only the band
   height needs its own formula here (M-base 601 → D-base 858). Bounded
   with max-width so it can never leak past the desktop block. */
@media (min-width: 768px) and (max-width: 1023px) {
  .ragazzi-pic-1 {
    min-height: clamp(601px, calc(601px + (var(--max-vw) - 768px) * 0.025), 858px);
  }
}

/* ---- DESKTOP (1024+) --------------------------------------
   Figma 3100:20975: 1920x858 fixed, vertical, justifyContent MAX /
   alignItems MIN, padding 100 all round → the heading is pinned
   BOTTOM-LEFT of the padding box (680 + 78 = 758 = 858 - 100). */
@media (min-width: 1024px) {
  .ragazzi-pic-1 {
    /* D-pic1-5 (MUST-APPLY): desktop fills[0].scaleMode = CROP with
       imageTransform [[1,0,0],[0,0.446875,0.3671125]] → the visible window
       is x 0-100%, y 36.71%-81.40% of the 600x600 source.
       background-position-y = offsetY / (1 - scaleY)
                             = 0.3671125 / 0.553125 = 66.37%
       cross-check: 82.15 / (223.78 - 100) = 66.37% ✓
       Do NOT round to 66% or "center bottom", and do NOT port Figma MCP's
       top:-82.15% / height:223.78% literally (that double-crops). */
    background-position: 50% 50%, 50% 66.37%;
    /* D-pic1-6: D-min = round(858 x 1024/1920) = 458; D-max = D-base = 858
       (the PINNED --vw-base == --max-vw == 1920 identity, brief-page.md
       §4.1 — not fluid-formulas "Common mistake #1"). The 1023→1024 step
       607→458 is the accepted page-wide 1024 step, not a bug. */
    min-height: clamp(458px, calc(858px * (var(--max-vw) / var(--vw-base))), 858px);
  }

  .pic-1__content {
    justify-content: flex-end;    /* Figma justifyContent MAX → bottom */
    align-items: flex-start;      /* Figma alignItems MIN     → left   */
  }

  .pic-1__container {
    /* D-pic1-3: `Container` 3100:20976 and `Heading 2` 3100:20977 occupy
       the identical box (391.75x78 @ 100,680) with padding 0 / gap 0 / no
       fill / a zero-width transparent stroke, and both are absent on
       mobile → ONE element; both node ids map to `.pic-1__container`.
       The px clamp is the alternative the slice sanctions over `6.027em`
       (which would need the h2 font-size copied onto this wrapper to
       resolve): D-min = round(391.75 x 1024/1920) = 209, D-max = D-base.
       The wrapper width is a pure geometry match — the heading inside is
       `nowrap` and overflows it by design, so no wrap ratio depends on it. */
    width: clamp(209px, calc(391.75px * (var(--max-vw) / var(--vw-base))), 391.75px);
  }

  .pic-1__title {
    max-width: none;
    /* Figma's text node 3100:20978 is 820 wide — it HUGS its one nowrap
       line — while its parent frames stay 391.75. A block-level <h1>
       would take the wrapper's 391.75 as its BOX (the glyphs would still
       paint to x=920, so it looks identical) and every box-vs-node check
       would read 391.75 where the node says 820. `max-content` reproduces
       the hug, so the DOM box matches the node: 820x78 at x=100. */
    width: max-content;
    /* D-pic1-3: NOT an invented `white-space` — Figma marks 3100:20978
       whitespace-nowrap, and the text node is 820 wide inside a 391.75
       wrapper, rendering UNCLIPPED to x=920 of 1920 (900px of content box
       deliberately left empty). Never widen the wrapper to 820, never add
       `overflow: hidden` (it would clip to "Welcome to y…"). */
    white-space: nowrap;
    text-align: left;             /* Figma textAlign LEFT (desktop) */
  }
}
