/* ==========================================================================
   Hero 1A + 1B + 1C — sticky "curtain" hero
   Load AFTER main.css.

   .hero-curtain / .hero-curtain__*  shared by Hero 1A, 1B and 1C
   .hero-curtain--center             centered text modifier (Hero 1C)
   .hero-1b__*                       Hero 1B only (headline + keyword rotator)

   Every rule is scoped to .hero-curtain, so other hero variants that share
   the legacy .hero class are not affected.
   ========================================================================== */

/* ---------- Tokens: scoped to the hero only ---------- */
.hero-curtain {
  --hero-accent: #eb8a81;
  --hero-ease: cubic-bezier(.2, .7, .2, 1);
  --hero-logo-gap: 80px;          /* space between marquee logos */
}

/* ---------- 1. Neutralise the legacy fixed-hero setup ----------
   Old: .hero{position:fixed} + .main{padding-top:90vh} (or 60vh via .main--pt-sm) at >=992px.
   New: sticky hero, no spacer padding. */
.main:has(.hero-curtain) {
  padding-top: 0;
}

/* ---------- 2. Sticky hero (the "curtain") ---------- */
.hero.hero-curtain {
  position: sticky;
  /* If the hero is taller than the viewport, pin its BOTTOM edge instead of its top.
     --hero-h is written by hero.js */
  top: min(0px, calc(100vh - var(--hero-h, 0px)));
  top: min(0px, calc(100svh - var(--hero-h, 0px)));
  z-index: 1;
  min-height: max(720px, 92vh);
  padding: 0;                     /* vertical padding lives on .hero-curtain__container */
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}

/* Short heroes: Hero 1A without logos and Hero 1C (adjust to taste) */
.hero.hero-curtain.hero--sm {
  min-height: max(460px, 60vh);
}
.hero.hero-curtain.resources-hero {
  min-height: max(320px, 40vh);
}

/* Everything after the hero slides OVER it (needs its own background) */
.hero-curtain ~ * {
  position: relative;
  z-index: 2;
}
/* First section after the hero: rounded top edge overlapping the hero */
.hero-curtain + * {
  margin-top: -32px;
  border-radius: 32px 32px 0 0;
  overflow: clip;
}

/* Pricing block next to a single CTA (Hero 1A) */
.hero-curtain .hero-curtain__pricing {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-curtain .hero-curtain__pricing-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #ffffff8c;
}
.hero-curtain .hero-curtain__pricing-value {
  font-size: clamp(17px, 16px + .4vw, 21px);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: #fff;
}

/* Content sits above the legacy .hero:before gradient overlay.
   Fallbacks after the commas are used if the theme does not define the variable. */
.hero-curtain__container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-max, 1320px);
  margin-inline: auto;
  padding-inline: var(--container-pad, 12px);
  padding-block: clamp(6rem, 5rem + 3vw, 9rem) clamp(2.5rem, 2rem + 1.5vw, 4rem);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-7, 48px);
}
.hero-curtain__content {
  flex-direction: column;
  gap: 24px;
  max-width: 100%;
  flex: 1;
  justify-content: center;
}

/* ---------- 3a. WYSIWYG body (Hero 1A + 1C) and Hero 1B headline ---------- */
.hero-curtain__body h1,
.hero-1b .hero-1b__headline {
  margin: 0 0 1.5rem;
  font-size: clamp(36px, 24px + 3vw, 64px);
  line-height: 1.2;
  letter-spacing: -1px;
  color: #fff;
}
.hero-curtain__body > :is(p, ul, ol) {
  max-width: 55ch;
  color: #ffffffe0;
}

/* Everything after the h1 (p, h2, h3, h4, ul, ol, ...) gets one shared style */
.hero-curtain .hero-curtain__body h1 ~ * {
  margin: 0;
  max-width: 55ch;
  font-family: var(--font-body, inherit);
  font-size: clamp(16px, 15.2px + .35vw, 19px);
  line-height: 1.6;
  color: #ffffffe0;
  animation: heroCurtainEntry .7s var(--hero-ease) .64s both;
}
.hero-curtain .hero-curtain__body h1 ~ *:last-child {
  margin-bottom: 0;
}

/* ---------- 3b. Hero 1B only: rotating keyword ---------- */
/* The window: exactly one line tall */
.hero-1b__rotator {
  display: inline-block;
  height: 1.2em;
  overflow: hidden;
  vertical-align: top;
  line-height: 1.2;
}
/* The stack: moved up in 1.2em steps by @keyframes hero1bKeywords (generated in PHP) */
.hero-1b__keywords {
  display: block;
  animation: hero1bKeywords var(--hero-kw-dur, 12s) infinite cubic-bezier(.7, 0, .3, 1);
  will-change: transform;
}
.hero-1b__keyword {
  display: block;
  height: 1.2em;
  line-height: 1.2;
  color: var(--hero-accent);
  white-space: nowrap;
}

.hero-1b__description {
  max-width: 54ch;
  color: #ffffffe0;
}

/* ---------- Trustpilot widget (shared) ---------- */
.hero-curtain .trustpilot-widget {
  -webkit-transform: translateX(-21%);
  -ms-transform: translateX(-21%);
  transform: translateX(-17%);
  margin: 0 0 25px 0;
  max-width: 860px;
}

/* ---------- 4. Entry animation (page load) ---------- */
@-webkit-keyframes heroCurtainEntry {
  from { opacity: 0; -webkit-transform: translateY(20px); transform: translateY(20px); }
  to   { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); }
}
@keyframes heroCurtainEntry {
  from { opacity: 0; -webkit-transform: translateY(20px); transform: translateY(20px); }
  to   { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); }
}
.hero-curtain__logo         { animation: heroCurtainEntry .7s var(--hero-ease) .12s both; }
.hero-1b__headline,
.hero-curtain__body         { animation: heroCurtainEntry .8s var(--hero-ease) .25s both; }
.hero-1b__description       { animation: heroCurtainEntry .7s var(--hero-ease) .5s both; }
.hero-curtain__ctas         { animation: heroCurtainEntry .7s var(--hero-ease) .65s both; }
.hero-curtain__trust-marquee { animation: heroCurtainEntry .7s var(--hero-ease) .85s both; }

.hero-curtain__ctas > .btn {
  gap: .5em;
  padding: .95rem 1.75rem !important;
  font-weight: 600;
  font-size: 15px !important;
}

/* ---------- 5. Logo marquee (replaces owl-carousel) ---------- */
.hero-curtain__trust-marquee {
  margin-top: auto;
  padding-block: 24px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  -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%);
}
.hero-curtain__trust-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: heroCurtainMarquee 35s linear infinite;
  will-change: transform;
}
.hero-curtain__trust-marquee:hover .hero-curtain__trust-track { animation-play-state: paused; }

/* Spacing is PADDING on each cell (not flex gap) so two sets are exactly 2x one set,
   which makes translateX(-50%) loop without a jump. */
.hero-curtain__trust-cell {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 48px;
  padding-inline: calc(var(--hero-logo-gap) / 2);
}
.hero-curtain__trust-cell img {
  width: auto !important;           /* beats legacy .logos-carousel img rules */
  max-width: 160px;
  max-height: 48px;
  object-fit: contain;
  opacity: .88;
  transition: opacity .2s var(--hero-ease);
}
.hero-curtain__trust-cell:hover img { opacity: 1; }

@keyframes heroCurtainMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- 6. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-curtain__logo,
  .hero-1b__headline,
  .hero-curtain__body,
  .hero-curtain__body h1 ~ *,
  .hero-1b__description,
  .hero-curtain__ctas,
  .hero-curtain__trust-marquee,
  .hero-1b__keywords,
  .hero-curtain__trust-track { animation: none !important; }
}

/* ---------- 7. Responsive ---------- */
@media (max-width: 991px) {
  .hero-curtain .trustpilot-widget {
    -webkit-transform: translateX(-27%);
    -ms-transform: translateX(-27%);
    transform: translateX(-27%);
    margin: 0 0 25px 0;
    max-width: 700px;
  }
}
@media (max-width: 767px) {
  .hero-curtain .trustpilot-widget {
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
    max-width: 255px;
    margin-left: -15px;
  }
}
@media (max-width: 575px) {
  .hero-curtain { --hero-logo-gap: 48px; }
  .hero-curtain__container { padding-block: 7rem calc(32px + 2.5rem); }
  /* .hero-curtain__container { padding-block: clamp(5rem, 4rem + 4vw, 6rem) 1.5rem; } */
  .hero-curtain__trust-cell { min-width: 120px; }
}

/* ---------- 8. Centered variant (Hero 1C) ----------
   Keep this block LAST. Selectors are extra-specific on purpose so they beat the
   left-aligned rules above and the responsive Trustpilot rules, whatever their order. */
.hero-curtain.hero-curtain--center .hero-curtain__body {
  text-align: center;
}
/* The 54ch text boxes are centered, not pinned to the left */
.hero-curtain.hero-curtain--center .hero-curtain__body > * {
  margin-inline: auto;
}
/* The Trustpilot offsets were made for left-aligned heroes; reset them here */
.hero-curtain.hero-curtain--center .trustpilot-widget {
  -webkit-transform: none;
  -ms-transform: none;
  transform: none;
  margin-inline: auto;
}