/* ═══════════════════ SHARED "PHERO" HERO (contained banner + ticker) ═══════════════════
   Used on Peptides, GLP-1, Hormone Optimisation, Supplements and What We
   Test; only the background image and ticker words differ per page (ACF,
   group_phero_hero.json). The ticker animates continuously via phero.js
   (rAF), so transform/opacity are set every frame rather than eased. */

.phero { background: var(--bg); }
.phero__frame {
  position: relative; margin: 0; overflow: hidden;
  height: clamp(400px, 60vh, 600px); background: #2a2622;
}
.phero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 24%; }
.phero__scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(14, 12, 9, 0.74) 0%, rgba(14, 12, 9, 0.5) 30%, rgba(14, 12, 9, 0.08) 56%, rgba(14, 12, 9, 0) 72%),
    linear-gradient(180deg, rgba(14, 12, 9, 0.42) 0%, rgba(14, 12, 9, 0) 24%, rgba(14, 12, 9, 0) 70%, rgba(14, 12, 9, 0.28) 100%);
}
.phero__ticker {
  position: absolute; z-index: 3; left: clamp(26px, 5vw, 78px); top: 50%; transform: translateY(-50%);
}
.tick-window {
  position: relative; height: clamp(140px, 24vh, 190px); width: clamp(185px, 21vw, 272px); overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
}
.tick-list {
  list-style: none; margin: 0; padding: 0; position: absolute; left: 0; right: 0; top: 0;
  will-change: transform;
  /* No transition here — phero.js drives transform every animation frame for a
     continuous crawl. A CSS transition would fight the per-frame updates. */
}
.tick-item {
  display: flex; align-items: center; justify-content: flex-end;
  height: clamp(28px, 4.2vh, 38px);
  font-family: var(--mono); font-weight: 500; letter-spacing: 0.01em;
  font-size: clamp(16px, 1.75vw, 22px); line-height: 1; color: #fff; white-space: nowrap;
  /* No opacity transition — same reasoning as .tick-list above. */
}
.tick-line {
  position: absolute; top: 50%; transform: translateY(-50%);
  left: calc(clamp(185px, 21vw, 272px) + 16px);
  height: 2px; width: clamp(90px, 15vw, 280px); z-index: 4;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0));
}

/* ───────────── RESPONSIVE ───────────── */
@media (max-width: 880px) {
  .phero__frame { height: clamp(340px, 48vh, 460px); }
}
@media (max-width: 720px) {
  .tick-item { font-size: clamp(15px, 4.4vw, 19px); }
}

/*
 * Phone ticker (≤860px): bigger words, left-aligned on the 22px gutter, a
 * wider window so the longer words fit, no rule line. Comes after the 720px
 * rule above so its font size wins on every phone.
 * .phero__frame and .phero__scrim aren't changed here because Pricing's
 * hero uses them too. phero.js measures the row height itself, so the
 * taller 40px rows need no JS change.
 */
@media (max-width: 860px) {
  .phero__ticker { left: 22px; top: 56%; }
  .tick-window {
    width: min(78vw, 320px); height: 160px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
  }
  .tick-item { justify-content: flex-start; height: 40px; font-size: clamp(20px, 5.8vw, 25px); }
  .tick-line { display: none; }
}
/* ───────────── HEADLINE + BUTTON (phero_headline set) ─────────────
   GLP-1, Hormone and Peptides carry their H1 and the membership button in
   the hero so both are on the first screen. The ticker moves up to make room. */
.phero--has-copy .phero__frame { height: clamp(520px, 74vh, 680px); }
.phero--has-copy .phero__ticker { top: 36%; }
.phero__copy {
  position: absolute; z-index: 3;
  left: clamp(26px, 5vw, 78px); right: clamp(26px, 5vw, 78px); bottom: clamp(32px, 7vh, 64px);
  display: flex; flex-direction: column; align-items: flex-start; gap: clamp(18px, 2.4vh, 26px);
}
.phero__title {
  margin: 0; max-width: 16ch; color: #fff;
  font-family: var(--sans); font-weight: 600; letter-spacing: -0.024em; line-height: 1.04;
  font-size: clamp(34px, 4.2vw, 60px); text-wrap: balance;
}
.phero__cta { margin: 0; }
@media (max-width: 860px) {
  .phero--has-copy .phero__frame { height: clamp(500px, 78vh, 620px); }
  .phero--has-copy .phero__ticker { top: 30%; }
  .phero--has-copy .phero__scrim {
    background: linear-gradient(180deg, rgba(14, 12, 9, 0.5) 0%, rgba(14, 12, 9, 0.12) 40%, rgba(14, 12, 9, 0.66) 100%);
  }
  .phero__copy { left: 22px; right: 22px; bottom: 28px; }
  .phero__title { font-size: clamp(32px, 9vw, 42px); }
}

/* Lumart, 12 Nov: on phones the What we test runner sat behind the word wheel.
   Show the left of the photo so he lands on the right, clear of the words. */
@media (max-width: 860px) {
  .page-template-templateswhatwetest-php .phero__img { object-position: 10% 18%; }
}

/* Lumart, 12 Nov: the dark overlay on the What we test hero was too heavy on
   phones. Lighter overall; a soft shade stays behind the word wheel only. */
@media (max-width: 860px) {
  .page-template-templateswhatwetest-php .phero__scrim {
    background:
      linear-gradient(90deg, rgba(14, 12, 9, 0.42) 0%, rgba(14, 12, 9, 0.22) 40%, rgba(14, 12, 9, 0) 62%),
      linear-gradient(180deg, rgba(14, 12, 9, 0.22) 0%, rgba(14, 12, 9, 0) 24%);
  }
}

/* Lumart, 12 Nov:
   1. Therapeutics heroes (GLP-1, Hormones, Peptides) match the Supplements
      hero's size and shape: no taller frame for the headline, no button.
   2. The turning word wheel is much smaller everywhere (What we test too). */
.phero--has-copy .phero__frame { height: clamp(400px, 60vh, 600px); }
.phero--has-copy .phero__ticker { top: 34%; }
.tick-window { height: clamp(104px, 16vh, 132px); width: clamp(150px, 15vw, 210px); }
.tick-item { height: clamp(22px, 3vh, 26px); font-size: clamp(12.5px, 1.1vw, 15px); }
.tick-line { left: calc(clamp(150px, 15vw, 210px) + 14px); width: clamp(70px, 10vw, 200px); }
@media (max-width: 880px) {
  .phero--has-copy .phero__frame { height: clamp(340px, 48vh, 460px); }
}
@media (max-width: 860px) {
  .tick-window { width: min(60vw, 240px); height: 112px; }
  .tick-item { height: 28px; font-size: 15px; }
  .phero--has-copy .phero__ticker { top: 26%; }
  .phero__title { font-size: clamp(28px, 7.8vw, 36px); }
}
@media (max-width: 860px) { .phero--has-copy .phero__ticker { top: 42%; } } /* between the nav pill and the headline */

/* Lumart, 12 Nov (later): the word wheel a bit bigger again, on the
   therapeutics heroes, Supplements and What we test. */
.tick-window { height: clamp(124px, 19vh, 160px); width: clamp(180px, 18vw, 260px); }
.tick-item { height: clamp(26px, 3.6vh, 32px); font-size: clamp(14.5px, 1.35vw, 18px); }
.tick-line { left: calc(clamp(180px, 18vw, 260px) + 14px); }
@media (max-width: 860px) {
  .tick-window { width: min(66vw, 270px); height: 132px; }
  .tick-item { height: 33px; font-size: 17.5px; }
}

/* Lumart, 13 Nov: on desktop the word wheel is bigger, and the dark overlay
   is a bit lighter on every hero that carries the wheel (phones too). */
@media (min-width: 861px) {
  .tick-window { height: clamp(150px, 23vh, 196px); width: clamp(220px, 22vw, 320px); }
  .tick-item { height: clamp(32px, 4.4vh, 39px); font-size: clamp(18px, 1.7vw, 23px); }
  .tick-line { left: calc(clamp(220px, 22vw, 320px) + 16px); width: clamp(90px, 12vw, 240px); }
}
.phero__scrim {
  background:
    linear-gradient(90deg, rgba(14, 12, 9, 0.56) 0%, rgba(14, 12, 9, 0.36) 30%, rgba(14, 12, 9, 0.05) 56%, rgba(14, 12, 9, 0) 72%),
    linear-gradient(180deg, rgba(14, 12, 9, 0.3) 0%, rgba(14, 12, 9, 0) 24%, rgba(14, 12, 9, 0) 70%, rgba(14, 12, 9, 0.2) 100%);
}
@media (max-width: 860px) {
  .phero--has-copy .phero__scrim {
    background: linear-gradient(180deg, rgba(14, 12, 9, 0.38) 0%, rgba(14, 12, 9, 0.08) 40%, rgba(14, 12, 9, 0.5) 100%);
  }
  .page-template-templateswhatwetest-php .phero__scrim {
    background:
      linear-gradient(90deg, rgba(14, 12, 9, 0.32) 0%, rgba(14, 12, 9, 0.16) 40%, rgba(14, 12, 9, 0) 62%),
      linear-gradient(180deg, rgba(14, 12, 9, 0.16) 0%, rgba(14, 12, 9, 0) 24%);
  }
}

/* Dylan, 25 Nov: Peptides banner (sit-ups photo) framed on the man, who sits on the right. */
.phero__img[src*="peptides-hero-situp"] { object-position: 88% 30%; }

/* Lumart, 26 Nov: the Therapeutics heroes (Peptides, GLP-1, Hormones, Supplements) get the
   same white frame as the Gut, Genetics, Home and Scans heroes. Desktop: 10px of page colour
   with 24px corners. Phones: below the dark header bar, 8px margin, 22px corners.
   What We Test and Pricing share this hero and are left as they are. */
@media (min-width: 761px) {
  :is(.page-template-peptides, .page-template-glp1, .page-template-hormones, .page-template-supplements) .phero__frame::after {
    content: ""; position: absolute; inset: 10px; z-index: 50; pointer-events: none;
    border-radius: 24px; box-shadow: 0 0 0 60px var(--bg);
  }
}
@media (max-width: 760px) {
  :is(.page-template-peptides, .page-template-glp1, .page-template-hormones, .page-template-supplements) .phero__frame {
    margin: calc((65px + env(safe-area-inset-top, 0px)) + 8px) 8px 0; border-radius: 22px;
  }
}
