/**
 * Hormone Optimisation — page-specific sections beyond Phero/Bio Blocks.
 *
 * Benefit cards only use the .bcard__icon--photo variant.
 *
 * @package SmudgeChild
 */

/* ═══════════════════ SECTION 2 — YOUR JOURNEY ═══════════════════ */

.journey {
  background: var(--bg);
  padding: clamp(64px, 10vh, 128px) 0 0;
  overflow: hidden;
}

/* heading block — .bcards__head/__title/__sub is a shared header pattern
   reused (with different class names) by Benefits' own .benefits__head. */
.bcards__head { width: min(900px, 92vw); margin: 0 auto; text-align: center; }
.bcards__title {
  font-family: var(--sans); font-weight: 500; letter-spacing: -0.02em;
  font-size: clamp(30px, 3.8vw, 54px); line-height: 1.06; color: var(--ink); margin: 0;
  text-wrap: balance;
}
.bcards__sub {
  margin: 16px auto 0;
  font-size: clamp(15px, 1.4vw, 19px); line-height: 1.55; color: var(--ink-soft); text-wrap: pretty;
}

/* animated zigzag step timeline */
.hsteps {
  position: relative; width: min(1060px, 92vw);
  margin: clamp(46px, 7vh, 88px) auto 0;
  padding-bottom: clamp(80px, 14vh, 160px);   /* tail: spine continues toward the next section */
}
.hsteps__spine {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px;
  background: linear-gradient(180deg, rgba(74,35,14,0) 0, rgba(74,35,14,0.92) clamp(80px, 12vh, 130px));
  transform: translateX(-50%);
}
.hstep {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 84px); align-items: start;
  padding: clamp(18px, 3vh, 38px) 0;
}
.hstep__media {
  grid-column: 1; grid-row: 1;
  border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3.1;
  background: #efece7; box-shadow: 0 30px 70px -50px rgba(12, 12, 13, 0.45);
}
.hstep__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hstep__copy { grid-column: 2; grid-row: 1; padding-top: clamp(26px, 6vh, 84px); max-width: 30rem; }
.hstep:nth-of-type(even) .hstep__media { grid-column: 2; }
.hstep:nth-of-type(even) .hstep__copy { grid-column: 1; }
.hstep__label {
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
}
.hstep__title {
  font-family: var(--sans); font-weight: 500; letter-spacing: -0.02em;
  font-size: clamp(22px, 2.4vw, 32px); line-height: 1.1; color: var(--ink);
  margin: 12px 0 16px;
}
.hstep__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hstep__list li {
  position: relative; padding-left: 22px;
  font-size: clamp(15px, 1.05vw, 17px); line-height: 1.5; color: var(--ink-soft); text-wrap: pretty;
}
.hstep__list li::before {
  content: ""; position: absolute; left: 1px; top: 0.5em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
@media (max-width: 820px) {
  .hsteps__spine { display: none; }
  .hstep { grid-template-columns: 1fr; gap: 16px; padding: 24px 0; }
  .hstep__media, .hstep:nth-of-type(even) .hstep__media { grid-column: 1; grid-row: auto; }
  .hstep__copy, .hstep:nth-of-type(even) .hstep__copy { grid-column: 1; grid-row: auto; padding-top: 0; }
}

/* ═══════════════════ SECTION 2B — BENEFITS ═══════════════════ */

.benefits {
  position: relative; overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(18,9,4,0.52), rgba(18,9,4,0.60)),
    url("../images/benefits-bg.jpg");
  background-size: cover; background-position: center;
  padding: clamp(150px, 22vh, 240px) 0 clamp(64px, 9vh, 120px);
}
.benefits__head { width: min(900px, 92vw); margin: 0 auto; text-align: center; position: relative; z-index: 2; }
.benefits__title {
  font-family: var(--sans); font-weight: 500; letter-spacing: -0.02em;
  font-size: clamp(30px, 3.8vw, 54px); line-height: 1.06; color: #fff; margin: 0; text-wrap: balance;
}
.benefits__sub {
  margin: 16px auto 0; max-width: 54ch;
  font-size: clamp(15px, 1.4vw, 19px); line-height: 1.55; color: rgba(255,255,255,0.82); text-wrap: pretty;
}
.benefits .bcards__viewport, .benefits .bcards__cta { position: relative; z-index: 2; }

/* the Journey spine visually continues into this section as a connector,
   ending in a dot node */
.benefits__connector {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 22px; height: clamp(100px, 16vh, 172px); z-index: 3; pointer-events: none;
}
.benefits__connector-line {
  position: absolute; left: 50%; top: 0; bottom: 24px; width: 1.5px; transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.6) 60%, rgba(255,255,255,0.42) 100%);
}
.benefits__connector-node {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 20px; height: 20px; border: 1.5px solid rgba(255,255,255,0.8); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.benefits__connector-node span { width: 6px; height: 6px; border-radius: 50%; background: #fff; }

/* full-bleed marquee viewport with soft edge fades */
.bcards__viewport {
  margin-top: clamp(40px, 6vh, 78px);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.bcards__track {
  display: flex; gap: 18px; width: max-content; align-items: stretch;
  padding: 6px 9px;                        /* room for card shadow + half a gap each side */
  animation: bcards-scroll 58s linear infinite;
}
@keyframes bcards-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.bcard {
  flex: 0 0 auto; width: clamp(228px, 19vw, 288px);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.055));
  border: none;
  -webkit-backdrop-filter: blur(36px) saturate(150%) brightness(1.08);
  backdrop-filter: blur(36px) saturate(150%) brightness(1.08);
  border-radius: 18px;
  padding: clamp(18px, 1.5vw, 24px);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.05);
  display: flex; flex-direction: column; gap: 12px;
}
.bcard__icon {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; box-shadow: 0 9px 18px -11px rgba(12, 12, 13, 0.5);
}
.bcard__icon--photo {
  width: 84px; height: 84px; border-radius: 15px; overflow: hidden; padding: 0;
}
.bcard__icon--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Full-width photo (image ≥ 400px wide; see hormones.php). Bleeds to the card's
   edges, 3:2, rounded with the card. */
.bcard--wide { padding-top: 0; overflow: hidden; }
.bcard--wide .bcard__icon--photo {
  width: auto; height: auto; aspect-ratio: 3 / 2; border-radius: 0; box-shadow: none;
  margin: 0 calc(-1 * clamp(18px, 1.5vw, 24px)) 4px;
}
.bcard__title {
  font-weight: 600; font-size: clamp(16px, 1.2vw, 19px); letter-spacing: -0.01em;
  color: #fff; margin: 0;
}
.bcard__desc {
  font-size: clamp(13px, 0.9vw, 15px); line-height: 1.5; color: rgba(255, 255, 255, 0.78);
  margin: 0; text-wrap: pretty;
}

.bcards__cta { margin-top: clamp(40px, 6vh, 76px); display: flex; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .bcards__track { animation: none; }
  .bcards__viewport { overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
  .bcards__viewport::-webkit-scrollbar { display: none; }
}

/* No fade-in animation for either section. */
.journey .reveal, .benefits .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
/* ═══════════════════ BIO BLOCKS — men → women gap (phones) ═══════════════════
   Each block keeps bio.css's desktop padding (72–140px), so the join
   between the Men and Women blocks would add up to ~190px on phones; it's
   18px each side here. Bio Blocks have no ids, so the join is targeted by
   structure: a plain block followed by a mirrored one. This file only
   loads on the Hormones template, so GLP-1's bio blocks are unaffected.
   Two-class selectors so these win over bio.css's .bio / .bio--mirror
   rules regardless of load order. */
@media (max-width: 860px) {
  .bio:has(+ .bio.bio--mirror) { padding-bottom: 18px; }
  .bio + .bio.bio--mirror { padding-top: 18px; }
}

/* ═══════════════════ YOUR JOURNEY — phone pinned step card ═══════════════════
   On phones the section pins for a scroll run; a square picture sits under
   the heading and each step's photo slides up into it, Step 1–N tabs sit
   under it, and each step's title rises word by word with its bullets
   following. Markup: hormones.php wraps the steps in .hsteps__pin and adds
   the tabs; behaviour in hormones-sections.js.
   The scroll run is 110svh per step (--steps, set by hormones.php), so
   2–6 steps all pace the same. The tab buttons reset the theme's global
   button styles.
   Phones stay pinned at every size. To stop the longest step being cut
   off on shorter phones, hormones-sections.js sets --sq (picture height)
   and --fit (type scale, 1 = design size) on .hsteps__pin; the sizes below
   multiply by --fit. */

/* desktop: the wrapper and tabs don't exist visually — zigzag unchanged */
.hsteps__pin { display: contents; }
.hsteps__tabs { display: none; }

@media (max-width: 860px) {
  .journey { padding-top: 0; overflow: visible; } /* overflow: hidden would stop the pin sticking */

  /* heading — hormones-sections.js moves it inside the pin on phones */
  .hsteps__pin > .bcards__head { position: relative; z-index: 21; width: calc(100% - 44px); margin: 0 auto; padding-top: clamp(78px, 10svh, 92px); }
  .hsteps__pin > .bcards__head .bcards__title { font-size: calc(clamp(28px, 7.8vw, 34px) * var(--fit, 1)); }
  .hsteps__pin > .bcards__head .bcards__sub { font-size: calc(16px * var(--fit, 1)); margin-top: calc(10px * var(--fit, 1)); }

  .hsteps { width: 100%; height: calc(var(--steps, 4) * 110svh); margin: 0; padding: 0; }
  .hsteps__spine { display: none; }
  .hsteps__pin { --sq: calc((100vw - 44px) * 0.8); display: block; position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--bg); }

  .hstep { position: absolute; inset: var(--hh, 220px) 0 0 0; display: grid; grid-template-columns: 1fr; grid-template-rows: calc(var(--sq) + 12px) auto 1fr; align-items: stretch; gap: 0; padding: 0; pointer-events: none; }
  .hstep.is-active { pointer-events: auto; }
  .hstep__media, .hstep:nth-of-type(even) .hstep__media { grid-column: 1; grid-row: 1; aspect-ratio: auto; width: auto; height: var(--sq); justify-self: stretch; margin: 12px 22px 0; border-radius: 18px; overflow: hidden; background: transparent; box-shadow: none; }
  .hstep__media img { transform: translateY(var(--mty, 118%)); will-change: transform; }
  .hstep:first-of-type .hstep__media img { transform: none; }
  .hstep__copy, .hstep:nth-of-type(even) .hstep__copy { grid-column: 1; grid-row: 2; padding: calc(50px + 18px * var(--fit, 1)) 22px 0; max-width: none; } /* 50px = room for the tabs row, which sits in this gap */
  .hstep__label { display: none; }
  .hstep__title { font-size: calc(clamp(24px, 6.8vw, 29px) * var(--fit, 1)); line-height: 1.12; margin: 0 0 calc(10px * var(--fit, 1)); }
  .hstep__title .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
  .hstep__title .w > span { display: inline-block; transform: translateY(112%); transition: transform 0.9s cubic-bezier(0.22,1,0.36,1); }
  .hstep.is-active .hstep__title .w > span { transform: none; transition-delay: var(--d, 0s); }
  .hstep__list { gap: 5px; opacity: 0; transform: translateY(24px); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22,1,0.36,1); }
  .hstep.is-active .hstep__list { opacity: 1; transform: none; transition-delay: var(--rd, 0.5s); }
  .hstep.no-anim .w > span, .hstep.no-anim .hstep__list { transition: none !important; } /* scrolling back up snaps instead of re-animating */
  .hstep__list li { font-size: calc(16px * var(--fit, 1)); line-height: 1.42; }

  .hsteps__tabs { display: flex; position: absolute; z-index: 20; left: 22px; right: 22px; top: calc(var(--hh, 220px) + 12px + var(--sq) + 14px); justify-content: space-between; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid rgba(12,12,13,0.14); }
  .hsteps__tabs .hsteps__tab,
  .hsteps__tabs .hsteps__tab:hover,
  .hsteps__tabs .hsteps__tab:focus { background: none; border: 0; border-radius: 0; box-shadow: none; width: auto; min-height: 0; padding: 4px 0; cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; line-height: 1.3; text-transform: uppercase; white-space: nowrap; color: rgba(12,12,13,0.34); transition: color 0.25s ease; }
  .hsteps__tabs .hsteps__tab.is-on { color: var(--accent); font-weight: 700; }
  /* scroll-progress line (--prog from hormones-sections.js) */
  .hsteps__tabs { background: linear-gradient(var(--ink), var(--ink)) 0 100% / calc(var(--prog, 0) * 100%) 2px no-repeat, linear-gradient(rgba(12,12,13,0.14), rgba(12,12,13,0.14)) 0 100% / 100% 1px no-repeat; border-bottom: 0; }
}
/* shorter phones */
@media (max-width: 860px) and (max-height: 700px) {
  .hstep__media, .hstep:nth-of-type(even) .hstep__media { margin-top: 12px; }
  .hstep__copy, .hstep:nth-of-type(even) .hstep__copy { padding-top: calc(50px + 10px * var(--fit, 1)); }
  .hstep__list li { font-size: calc(15.5px * var(--fit, 1)); }
  .hsteps__pin > .bcards__head { padding-top: 78px; }
}
/* Phones (Lumart, 12 Nov): TRT / HRT / Thyroid blocks. Smaller photo card,
   centred; smaller type set closer to the card; one button, after the last block. */
@media (max-width: 860px) {
  .bio .bio__inner { gap: 20px; }
  .bio .bio__media { width: min(78%, 300px); max-height: none; margin: 0 auto; }
  .bio .bio__copy, .bio.bio--mirror .bio__copy { text-align: center; }
  .bio.bio .section-title.bio__title { font-size: 26px; line-height: 1.12; }
  .bio .bio__body { font-size: 15px; line-height: 1.5; margin-top: 10px; }
  .bio:has(+ .bio) .bio__actions { display: none; }
  .bio .bio__actions { justify-content: center; }
}

/* Benefits cards are swipeable (Dylan, 12 Nov): with JS the viewport scrolls
   natively and hormones-sections.js moves it; the CSS marquee is off. */
.bcards__viewport.is-live { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -ms-overflow-style: none; }
.bcards__viewport.is-live::-webkit-scrollbar { display: none; }
.bcards__viewport.is-live .bcards__track { animation: none; }

/* Lumart, 12 Nov (phones): the TRT / HRT / Thyroid blocks follow Superpower's
   step cards: a wide landscape picture inside the page gutter, softly rounded
   with no border or shadow, then a short centred title and grey text. */
@media (max-width: 860px) {
  .bio.bio { padding-top: 28px; padding-bottom: 28px; }
  .bio .bio__inner { gap: 22px; }
  .bio .bio__media { width: 100%; aspect-ratio: 3 / 2; max-height: none; margin: 0; border-radius: 16px; box-shadow: none; }
  .bio.bio .section-title.bio__title { font-size: 22px; line-height: 1.2; font-weight: 500; letter-spacing: -0.01em; }
  .bio .bio__body { font-size: 17px; line-height: 1.45; color: var(--ink-soft); margin: 10px auto 0; max-width: 34ch; }
}

/* Lumart, 12 Nov: full-bleed pin (see --barpad in style.css); the steps keep
   clear of a showing toolbar. */
@media (max-width: 860px) {
  .hsteps__pin { height: 100vh; height: 100lvh; }
  .hstep { bottom: var(--barpad, 0px); }
}
/* Lumart, 12 Nov: round bullets on the Hormones steps (were diamonds). */
.hstep__list li::before { border-radius: 50%; transform: none; }
/* Lumart, 13 Nov: the step picture switches at one point and slides in on its
   own (hormones-sections.js sets --mty to 0 or 118%), like the Scans cards. */
@media (max-width: 860px) {
  .hstep__media img { transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1); }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .hstep__media img { transition: none; }
}
/* Lumart, 13 Nov: on phones the zigzag spine is hidden, so the Benefits
   connector started from nothing at the section edge. A short spine tail now
   leaves the bottom of the steps and meets it, and the connector is shorter
   (as on Employers). */
@media (max-width: 860px) {
  .hsteps::after {
    content: ""; position: absolute; left: 50%; top: 100%; z-index: 22;
    width: 1.5px; height: clamp(36px, 5vh, 48px); transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(74,35,14,0) 0, rgba(74,35,14,0.92) 100%);
    pointer-events: none;
  }
  .journey { padding-bottom: clamp(36px, 5vh, 48px); } /* room for the tail below the pinned steps, clear of the text */
  .benefits__connector { height: clamp(64px, 9vh, 100px); }
}

/* Lumart, 13 Nov (desktop): the benefit cards can be dragged with the mouse
   (hormones-sections.js); they no longer pause on hover. */
.bcards__viewport.is-live { cursor: grab; user-select: none; -webkit-user-select: none; }
.bcards__viewport.is-live.is-dragging { cursor: grabbing; }
.bcards__viewport.is-live img { -webkit-user-drag: none; pointer-events: none; }

/* Lumart, 13 Nov (desktop): less white space in the TRT / HRT / Thyroid rows.
   Landscape-ish pictures (5:4, were 4:5) sit closer to the copy's height,
   and the rows are closer together. */
@media (min-width: 881px) {
  .bio.bio { padding-top: clamp(40px, 6vh, 64px); padding-bottom: clamp(40px, 6vh, 64px); }
  .bio .bio__media { aspect-ratio: 5 / 4; }
}

/* Lumart, 13 Nov 10:23: step labels match the home page's pill (black, orange pip, mono caps). */
.hstep__label {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 6px 13px; border-radius: 999px; background: var(--ink); color: #fff;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 18px;
}
.hstep__label .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
/* Mobile has the step tabs, so the per-step pill stays hidden there (Lumart, 13 Nov 10:26). */
@media (max-width: 860px) { .hstep__label { display: none; } }

/* Lumart, 13 Nov 10:27: TRT / HRT / Thyroid headings were too big on desktop (60px, above the section titles). */
@media (min-width: 861px) {
  .bio.bio .section-title.bio__title { font-size: clamp(36px, 3vw, 44px); line-height: 1.1; }
}
