/* ==================================================================
   Audience Hero — kwizzbit/audience-hero (whole-file segment)
   Faithful slice of /HTML/audience-hero.html. Globals (reset/body/font-face/:root)
   dropped; tokens canonical (theme.json). Full-bleed via the .kwb-segment wrapper.
   ================================================================== */

.ah-hero {
      background: var(--wp--preset--color--cream);
      /* Image top at 207px from window: 207 - 88px header = 119px */
      padding-top: 119px;
      padding-bottom: 0;
    }
.ah-hero__inner {
      display: grid;
      grid-template-columns: 1fr;
      gap: 2rem;
      align-items: center;
    }
@media (min-width: 1024px) {
.ah-hero__inner {
        grid-template-columns: 524px 1fr;
        gap: 70px;
        /* Top-align columns so each can be offset independently */
        align-items: start;
        max-width: 1100px;
        margin-inline: auto;
      }
}
.ah-hero__media {
      position: relative;
      width: 100%;
      max-width: 32rem;
      margin-inline: auto;
      /* Extra bottom space for the card's downward overhang */
      padding-bottom: 60px;
    }
/* ── Layered coral backdrop behind the photo (decorative) ──
   The artwork (two stacked, slightly-rotated #FDC8BD rects @ 0.5 opacity) lives
   in hero-backdrop.svg. Lives on .ah-hero__media (not __image-wrap, which clips
   via overflow:hidden) so it can peek out behind. Size + offset scale down per
   breakpoint (tablet ×0.8, mobile ×0.63) to track the scaled photo. */
.ah-hero__media::before {
      content: "";
      position: absolute;
      z-index: 0;          /* behind photo (z:1), card (z:10), avatar (z:20) */
      /* Desktop: 530×511 artwork on the 524×492 photo, nudged up-left to peek */
      top: -35px;
      left: -38px;
      width: 530px;
      height: 511px;
      background: url('/wp-content/uploads/hero-backdrop.svg') no-repeat center / contain;
      pointer-events: none;
    }
@media (min-width: 1024px) {
.ah-hero__media {
        width: 524px;
        max-width: none;
        margin-inline: 0;
        padding-bottom: 60px;
      }
}
.ah-hero__image-wrap {
      position: relative;
      z-index: 1;               /* sits above the solid coral shadow */
      width: 524px;
      height: 492px;
      max-width: 100%;
      overflow: hidden;
      background: var(--wp--preset--color--cream-soft);
      display: block;
      /* Block 1 offset — block 2 should use animation-delay: 3.5s */
      animation: ah-image-float 5s ease-in-out infinite;
      animation-delay: 1s;
    }
@keyframes ah-image-float {
      0%, 100% { transform: translateY(0); }
      50%      { transform: translateY(-8px); }
    }
.ah-hero__image {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
@keyframes ah-card-float {
      0%   {
        transform: rotate(-1.5deg) translate(0px, 0px);
        box-shadow: 10px 13px 3px rgba(0,0,0,0.15);
      }
      30%  {
        transform: rotate(-1.1deg) translate(2px, -5px);
        box-shadow: 11px 17px 6px rgba(0,0,0,0.11);
      }
      60%  {
        transform: rotate(-1.8deg) translate(-1px, -7px);
        box-shadow: 9px 19px 7px rgba(0,0,0,0.09);
      }
      100% {
        transform: rotate(-1.5deg) translate(0px, 0px);
        box-shadow: 10px 13px 3px rgba(0,0,0,0.15);
      }
    }
.ah-hero__card {
      position: absolute;
      left: -16px;
      bottom: 58px;
      transform-origin: center center;
      z-index: 10;
      border: 2px solid #FCF0E6;
      animation: ah-card-float 7s ease-in-out infinite;
    }
.ah-quiz {
      position: relative;
      display: block;
      /* Spec: 333 × 105px — gradient height controlled separately */
      width: 333px;
      height: 105px;
      border-radius: 0;
      overflow: hidden;
      background: #F4A623;
      isolation: isolate;
    }
.ah-quiz__image {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      z-index: 0;
    }
.ah-quiz__gradient {
      position: absolute;
      /* 74px tall, pinned to the bottom — only covers the text area */
      bottom: 0;
      left: 0;
      right: 0;
      height: 74px;
      background: linear-gradient(
        to top,
        rgba(24, 19, 17, 1) 0%,
        rgba(24, 19, 17, 0) 100%
      );
      z-index: 1;
    }
.ah-quiz__body {
      position: absolute;
      left: 0; right: 0; bottom: 0;
      padding: 0.75rem 1rem 0.875rem;
      color: var(--wp--preset--color--white);
      z-index: 2;
    }
.ah-quiz__title {
      font-family: var(--wp--preset--font-family--body);
      font-weight: 700;
      font-size: var(--wp--preset--font-size--sm);
      line-height: 1.25;
      letter-spacing: -0.015em;   /* match gateway / homepage card title treatment */
      margin: 0 0 0.375rem 0;
      max-width: 66%;             /* leaves room for the host avatar */
    }
.ah-quiz__meta {
      display: flex;
      align-items: center;
      gap: 0.875rem;
      font-family: var(--wp--preset--font-family--body);
      font-weight: 500;
      font-size: 0.75rem;
      line-height: 1;
      color: rgba(255,255,255,0.92);
    }
.ah-quiz__meta-item {
      display: inline-flex;
      align-items: center;
      gap: 0.3125rem;
    }
.ah-quiz__meta-icon {
      width: 12px; height: 12px;
      flex: none;
    }
@keyframes ah-avatar-float {
      0%   { transform: translateY(0px) rotate(0deg); }
      40%  { transform: translateY(-5px) rotate(0.4deg); }
      70%  { transform: translateY(-3px) rotate(-0.3deg); }
      100% { transform: translateY(0px) rotate(0deg); }
    }
@keyframes ah-avatar-pop {
      0%   { transform: scale(0); }
      80%  { transform: scale(1.12); }
      100% { transform: scale(1); }
    }
.ah-quiz__avatar {
      position: absolute;
      /* Right side of card — card left(-16) + card width(333) - 80px inset = 237px */
      left: 237px;
      /* Sit over the card — card bottom(58) + card height(105) - avatar half(27) = 136px */
      bottom: 100px;
      width: 55px;
      height: 55px;
      border-radius: 50%;
      overflow: hidden;
      /* Match card border exactly */
      border: 2px solid #FCF0E6;
      /* Card shadow: 10px 13px 3px rgba(0,0,0,0.15) — inverted upwards: y flips */
      box-shadow: 10px -13px 3px rgba(0, 0, 0, 0.15);
      z-index: 20;
      animation: ah-avatar-float 5s ease-in-out infinite;
      animation-delay: -2s;
    }
.ah-quiz__avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center top;
      display: block;
      /* transform scale zooms from centre without layout gaps */
      transform: scale(1.35);
    }
.ah-quiz__avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
.ah-hero__content {
      text-align: center;
    }
@media (min-width: 1024px) {
.ah-hero__content {
        text-align: left;
        max-width: 32rem;
        padding-top: 0;
      }
}
/* Brands & Marketers (page 125) has a longer hero headline
   ("Big-impact quizzes, for brands & marketers.") that wraps awkwardly inside
   the default 32rem column — widen the column on this page only. */
@media (min-width: 1024px) {
      body.page-id-125 .ah-hero__content { max-width: 44rem; }
    }
.ah-hero__title {
      font-family: var(--wp--preset--font-family--display);
      font-weight: 400;
      /* 80px (nudged up from 72px) */
      font-size: 5rem;
      /* keep the same tight ratio (0.889) */
      line-height: 0.889;
      /* Sketch tracking -7.75 = -7.75px at 72px size = -0.10764em */
      letter-spacing: -0.10764em;
      color: var(--wp--preset--color--ink);
      margin: 0 0 var(--wp--preset--spacing--50) 0;
      text-wrap: balance;
    }
/* "for" is a connector word — reduce its visual weight across all audience heroes */
.ah-hero__title-for {
      font-size: 0.8em;
    }
@keyframes ah-cursor-blink {
      0%, 100% { opacity: 1; }
      50%       { opacity: 0; }
    }
.ah-hero__title-accent {
      color: var(--wp--preset--color--coral);
      animation: ah-cursor-blink 1.1s step-end infinite;
    }
.ah-hero__lead {
      font-family: var(--wp--preset--font-family--body);
      font-weight: 500;
      font-size: var(--wp--preset--font-size--md);   /* 17px */
      line-height: 1.412;                            /* 24/17 */
      letter-spacing: 0;
      color: var(--wp--preset--color--ink-soft);
      margin: 0 0 var(--wp--preset--spacing--60) 0;
      /* Bound width of 327px — forces 3-line wrap at 17px */
      width: 327px;
      max-width: 100%;
      margin-inline: auto;
    }
@media (min-width: 1024px) {
.ah-hero__lead { margin-inline: 0; }
}
.ah-hero__cta {
      display: flex;
      justify-content: center;
    }
@media (min-width: 1024px) {
.ah-hero__cta { justify-content: flex-start; }
}
/* Widen the Get started button in the audience hero only — scoped so
   other btn--primary instances elsewhere on the site are unaffected */
.ah-hero__cta .btn--primary {
  padding-inline: 2.75rem;
}

/* Leading audience icon inside the Get started button — pulled from the nav
   dropdown for this audience, whitened and sized to sit beside the label.
   The two-class selector outranks the global `.btn > svg` 10px rule. */
.ah-hero__cta .btn .ah-hero__cta-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.ah-hero__cta-icon path,
.ah-hero__cta-icon rect {
  fill: #fff;
}

/* ── Scroll-reveal entry — media + content lift + fade as the loader lifts.
   Gated behind .has-scroll-reveal (added by audience-hero.js) so no-JS and
   reduced-motion users always see the hero. ── */
/* ── Avatar: hidden during scroll-reveal priming, pops in independently ── */
/* Suppress float + scale to zero while the loader covers the screen */
.ah-hero.has-scroll-reveal .ah-quiz__avatar {
  transform: scale(0);
  animation: none;
}
/* Pop-in + float triggered by JS (.is-avatar-visible added ~700ms after reveal).
   Higher specificity (4 classes) beats the suppressor above (3 classes). */
.ah-hero.has-scroll-reveal .ah-quiz__avatar.is-avatar-visible {
  animation:
    ah-avatar-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    ah-avatar-float 5s ease-in-out 0.35s infinite;
}

.ah-hero.has-scroll-reveal .ah-hero__media,
.ah-hero.has-scroll-reveal .ah-hero__content {
  opacity: 0;
  transform: translateY(var(--wp--custom--motion--scroll-reveal-distance));
  transition:
    opacity var(--wp--custom--motion--scroll-reveal-duration) var(--wp--custom--motion--scroll-reveal-easing),
    transform var(--wp--custom--motion--scroll-reveal-duration) var(--wp--custom--motion--scroll-reveal-easing);
}
.ah-hero.has-scroll-reveal.is-visible .ah-hero__media   { opacity: 1; transform: none; transition-delay: 0s;   }
.ah-hero.has-scroll-reveal.is-visible .ah-hero__content { opacity: 1; transform: none; transition-delay: 0.1s; }
.ah-trust {
      padding-top: 0;
      /* Desktop: lift the trust strip up tight under the hero blocks
         (the <=1023px block resets this to 0 for stacked mobile). */
      margin-top: -56px;
      padding-bottom: calc(clamp(2.5rem, 5vw, 4.5rem) + 20px);
    }
.ah-trust__inner {
      text-align: center;
      /* Match the hero content package width so the strip sits under it */
      max-width: 1100px;
      margin-inline: auto;
    }
.ah-trust__label {
      display: block;
      font-family: 'Pixelar', monospace;
      font-weight: 400;
      font-size: 19px;
      line-height: 1;
      letter-spacing: 0;
      text-transform: none;
      color: #FF3623;
      margin-bottom: var(--wp--preset--spacing--60);
    }
.ah-trust__grid {
      display: flex;
      flex-wrap: nowrap;
      justify-content: space-between;
      align-items: center;
      width: 897px;
      max-width: 100%;
      margin-inline: auto;
    }
.ah-trust__row {
      display: contents;
    }
.ah-trust__ticker {
      display: contents;
    }
.ah-trust__ticker [aria-hidden="true"] {
      display: none;
    }
.ah-trust__logo-img {
      display: block;
      height: 40px;
      width: auto;
      opacity: 0.9;   /* match the homepage trust strip's softened logos */
    }
/* Inline SVG logos (used on EO / corporate audience pages) are wider at the
   same height — scale them down so they fit the 897px grid with visible gaps.
   :is(svg) leaves CC's <img> logos completely unaffected. */
.ah-trust__logo-img:is(svg) {
      height: 26px;
      flex-shrink: 0;
    }
/* Pubs, Bars & Venues (page 127): two of the seven logos (Admiral Taverns,
   Global Brands) ship as raster-in-SVG, so they're served as ink-tinted <img>
   instead — match them to the 26px inline-SVG logo height on this page. */
body.page-id-127 .ah-trust__logo-img:is(img) {
      height: 26px;
      flex-shrink: 0;
    }
/* Charity Fundraisers (page 124): three of the five logos (Simon on the Streets,
   Sands, Different Strokes) ship as raster, served as ink-tinted <img> — match
   them to the 26px inline-SVG logo height on this page. */
body.page-id-124 .ah-trust__logo-img:is(img) {
      height: 26px;
      flex-shrink: 0;
    }
/* Sands + Different Strokes read a touch small against the others — nudge up. */
body.page-id-124 .ah-trust__logo-img[src*="ch-trust-sands"],
body.page-id-124 .ah-trust__logo-img[src*="ch-trust-strokes"] {
      height: 32px;
    }
/* Teams & Workplaces (page 126): only six logos on this strip, so there's room
   to size them all up a little for presence. */
body.page-id-126 .ah-trust__logo-img:is(svg) {
      height: 32px;
    }
/* Admiral Taverns + Greene King read a touch small against the others —
   nudge each up slightly for optical balance. */
body.page-id-127 .ah-trust__logo-img[src*="pb-trust-admiral"],
body.page-id-127 .ah-trust__logo-img[aria-label="Greene King"] {
      height: 32px;
    }
@media (max-width: 1023px) {
.ah-hero {
        padding-top: 72px;
        /* Extra bottom padding so Get started button clears the ah-trust strip */
        padding-bottom: 5rem;
      }
.ah-hero__image-wrap {
        width: 419px;  /* 524 × 0.8 */
        height: 394px; /* 492 × 0.8 */
        margin-inline: auto;
      }
.ah-hero__media {
        margin-inline: auto;
      }
/* Backdrop scaled to the 419×394 photo (×0.8). Photo is centred in the media
   box here, so centre the artwork on it then apply the same left-lean. */
.ah-hero__media::before {
        width: 424px;   /* 530 × 0.8 */
        height: 409px;  /* 511 × 0.8 */
        top: -28px;     /* 35 × 0.8 */
        left: 50%;
        transform: translateX(calc(-50% - 28px));
      }
.ah-hero__content {
        margin-top: -80px;
        text-align: center;
        margin-inline: auto;
      }
.ah-hero__title {
        max-width: 470px;
        margin-inline: auto;
      }
.ah-hero__lead {
        margin-inline: auto;
      }
.ah-hero__cta {
        justify-content: center;
      }
.ah-trust {
        padding-top: 0;
        margin-top: 0;
      }
.ah-trust__grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;
        width: 100%;
      }
.ah-trust__row {
        display: flex;
        justify-content: center;
        gap: 32px;
        align-items: center;
        flex-wrap: nowrap;
      }
}
@keyframes ah-logo-ticker {
      0%   { transform: translateX(0); }
      100% { transform: translateX(-50%); }
    }
@media (max-width: 640px) {
.ah-hero {
        padding-top: 24px;
        padding-bottom: 1rem;
        /* contain the backdrop's left poke so it can't cause sideways scroll */
        overflow-x: clip;
      }
.ah-hero__inner {
        width: 100%;
        padding-inline: 4vw;
        box-sizing: border-box;
      }
.ah-hero__media {
        width: min(330px, 92vw);
        margin-inline: auto;
        padding-bottom: 80px; /* +30px gap before headline */
      }
/* Backdrop scaled to the ≈330×310 photo (×0.63). Photo fills the media box and
   is centred, so centre the artwork on it then apply the same left-lean. */
.ah-hero__media::before {
        width: 334px;   /* 530 × 0.63 */
        height: 322px;  /* 511 × 0.63 */
        top: -22px;     /* 35 × 0.63 */
        left: 50%;
        transform: translateX(calc(-50% - 22px));
      }
.ah-hero__image-wrap {
        width: 100%;
        height: auto;
        aspect-ratio: 524 / 492;
        margin-inline: auto;
        display: block;
      }
.ah-hero__card {
        left: -4%;
        bottom: 52px; /* above the padding-bottom (50px) + a touch */
      }
.ah-quiz {
        width: 80%;
        height: auto;
        aspect-ratio: 266 / 84;
      }
.ah-quiz__avatar {
        width: min(44px, 13.5vw);
        height: min(44px, 13.5vw);
        left: 65%;
        bottom: 110px;
      }
.ah-quiz__title {
        font-size: 0.6875rem; /* 11px */
        margin-bottom: 0.25rem;
      }
.ah-quiz__meta {
        font-size: 0.6875rem; /* 11px */
        gap: 0.5rem;
      }
.ah-quiz__meta-icon {
        width: 9px;
        height: 9px;
      }
.ah-hero__content {
        margin-top: -110px;
        text-align: center;
        margin-inline: auto;
        width: 100%;
        padding-inline: 0;
      }
.ah-hero__title {
        margin-bottom: 16px;
      }
.ah-hero__lead {
        margin-bottom: 22px;
      }
.ah-hero__title {
        font-size: clamp(1.875rem, 10.13vw, 2.375rem); /* 30–38px */
        line-height: 0.8421;        /* 32÷38 */
        letter-spacing: -0.10763em; /* -4.09px ÷ 38px */
        width: min(332px, 88vw);    /* fluid cap — never overflows */
        margin-inline: auto;
      }
.ah-hero__lead {
        font-size: 1rem;
        font-weight: 500;
        width: min(300px, 88vw);
        max-width: 100%;
        margin-inline: auto;
      }
.ah-hero__cta {
        justify-content: center;
        margin-bottom: calc(2rem + 20px); /* +20px gap before trust strip */
      }
.ah-trust {
        margin-top: -16px;
        overflow: hidden;
        margin-inline: calc(-1 * clamp(1rem, 4vw, 3rem));
      }
.ah-trust__inner {
        padding-inline: 0;
      }
.ah-trust__label {
        font-size: 18px;
        margin-bottom: var(--wp--preset--spacing--40);
        padding-inline: clamp(1rem, 4vw, 3rem);
      }
.ah-trust__grid {
        display: block;
        width: 100%;
        overflow: hidden;
        /* Fade the looping logos into the cream backdrop at both edges so they
           dissolve as they near the window edges (mobile only). Matches the
           homepage trust strip. */
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 13%, #000 87%, transparent 100%);
                mask-image: linear-gradient(to right, transparent 0, #000 13%, #000 87%, transparent 100%);
      }
.ah-trust__ticker {
        display: flex;
        align-items: center;
        gap: 28px;
        width: max-content;
        padding-left: clamp(1rem, 4vw, 3rem);
        animation: ah-logo-ticker 40s linear infinite;
      }
.ah-trust__row {
        display: contents;
      }
.ah-trust__ticker [aria-hidden="true"] {
        display: contents;
      }
.ah-trust__logo-img {
        height: 30px;
        flex-shrink: 0;
      }
}
@media (prefers-reduced-motion: reduce) {
.ah-hero__title-accent {
        animation: none !important;
        opacity: 1 !important;
      }
.ah-hero__card {
        animation: none !important;
        transform: rotate(-1.5deg) !important;
        box-shadow: 10px 13px 3px rgba(0,0,0,0.15) !important;
        margin-left: 0 !important;
      }
.ah-trust__ticker {
        animation: none !important;
      }
.ah-quiz__avatar {
        animation: none !important;
        transform: none !important;
      }
}
