/* ===================================================================
   Hero (banner slideshow) - split hero with headline lines, lead,
   three pill buttons and a collage illustration (Figma "Hero", 4:55).
   Scoped with the cx-herop prefix. Colours via design tokens.
   =================================================================== */

.cx-herop {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.cx-herop__track {
  position: relative;
  width: 100%;
  touch-action: pan-y;
}

.cx-herop__slide {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: var(--herop-height, auto);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Fade mode: slides stacked in one grid cell so the track keeps the tallest height. */
.cx-herop--fade .cx-herop__track { display: grid; }
.cx-herop--fade .cx-herop__slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.cx-herop--fade .cx-herop__slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

/* Slide mode: flex row translated sideways by the script. */
.cx-herop--slide .cx-herop__track { display: flex; transition: transform 0.5s ease; }
.cx-herop--slide .cx-herop__slide { flex: 0 0 100%; }

/* Overlay layout: photo background with a scrim, light text. */
.cx-herop__slide--overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-ink) 40%, transparent), color-mix(in srgb, var(--c-ink) 55%, transparent));
  pointer-events: none;
}

.cx-herop__inner {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 48px;
  width: 100%;
  max-width: var(--container, 1440px);
  margin-inline: auto;
  padding-inline: var(--gutter, 64px);
}

.cx-herop__inner--solo { grid-template-columns: minmax(0, 1fr); }
.cx-herop--rev .cx-herop__inner:not(.cx-herop__inner--solo) { grid-template-columns: auto minmax(0, 1fr); }
.cx-herop--rev .cx-herop__collage { order: -1; }

.cx-herop__text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }

/* Headline: Playfair 92/96 lines + 64/84 italic accent line. */
.cx-herop__title {
  margin: 0;
  font-size: var(--fs-hero, 92px);
  line-height: 1.043;
  letter-spacing: -0.01em;
  color: inherit;
}
.cx-herop__line { display: block; }
.cx-herop__accent {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-hero-accent, 64px);
  font-style: italic;
  line-height: 1.3125;
  letter-spacing: 0;
  color: var(--slide-accent, var(--c-blue));
}
[dir="rtl"] .cx-herop__accent { font-style: normal; }
[dir="rtl"] .cx-herop__title { letter-spacing: 0; line-height: 1.25; }

.cx-herop__lead {
  margin: 0;
  max-width: 560px;
  font: 400 var(--fs-lead, 19px)/1.58 var(--f-body);
  color: inherit;
}

.cx-herop__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cx-herop .btn--yellow { border-color: var(--c-ink); }
.cx-herop__slide--overlay .btn--yellow { border-color: transparent; }
.cx-herop .btn { transition: transform 0.15s ease, opacity 0.15s ease; }
.cx-herop .btn:hover { transform: translateY(-1px); opacity: 0.92; }

/* Collage */
.cx-herop__collage { margin: 0; display: flex; justify-content: center; align-items: center; min-width: 0; }
.cx-herop__collage img {
  display: block;
  width: var(--collage-w, 660px);
  max-width: 100%;
  height: auto;
  max-height: var(--collage-h, 600px);
  object-fit: contain;
}
.cx-herop__collage--photo img { border-radius: var(--r-card, 28px); object-fit: cover; height: var(--collage-h, 600px); }

/* Overlay text colour */
.cx-herop__slide--overlay { color: var(--c-white); }
.cx-herop__slide--overlay .cx-herop__accent { color: var(--slide-accent, var(--c-yellow)); }

/* Arrows */
.cx-herop__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--c-line);
  border-radius: 999px;
  background: var(--c-white);
  color: var(--c-ink);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.cx-herop__arrow:hover { border-color: var(--c-ink); }
.cx-herop__arrow--prev { inset-inline-start: 16px; }
.cx-herop__arrow--next { inset-inline-end: 16px; }

/* Dots */
.cx-herop__dots {
  position: absolute;
  inset-inline-start: 50%;
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  transform: translateX(-50%);
}
[dir="rtl"] .cx-herop__dots { transform: translateX(50%); }
.cx-herop__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--c-line);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cx-herop__dot.is-active { background: var(--c-ink); transform: scale(1.25); }
.cx-herop__arrow:focus-visible,
.cx-herop__dot:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }

@media (max-width: 1199px) {
  .cx-herop__title { font-size: calc(var(--fs-hero, 92px) * 0.8); }
  .cx-herop__accent { font-size: calc(var(--fs-hero-accent, 64px) * 0.8); }
  .cx-herop__inner { gap: 32px; }
}

@media (max-width: 991px) {
  .cx-herop__inner,
  .cx-herop--rev .cx-herop__inner:not(.cx-herop__inner--solo) { grid-template-columns: minmax(0, 1fr); }
  .cx-herop--rev .cx-herop__collage { order: 0; }
  .cx-herop__collage img { width: min(var(--collage-w, 660px), 100%); }
  .cx-herop__arrow { display: none; }
  .cx-herop__dots { bottom: 10px; }
}

@media (max-width: 640px) {
  .cx-herop__text { gap: 20px; }
  .cx-herop__title { font-size: var(--fs-hero, 56px); }
  .cx-herop__accent { font-size: var(--fs-hero-accent, 40px); }
  .cx-herop .btn { padding-block: calc(var(--btn-py, 16px) - 2px); padding-inline: calc(var(--btn-px, 28px) - 6px); font-size: 15px; }
}

/* Mobile: smaller type, centred text, full-width stacked buttons. */
@media (max-width: 767px) {
  /* padding is set inline from section settings, so override it here */
  .cx-herop__slide { padding-top: 24px !important; padding-bottom: 40px !important; }
  .cx-herop__text { align-items: center; text-align: center; gap: 16px; }
  .cx-herop__title { font-size: calc(var(--fs-hero, 56px) * 1.05); }
  .cx-herop__accent { font-size: calc(var(--fs-hero-accent, 40px) * 0.75); }
  .cx-herop__lead { font-size: 15px; line-height: 1.55; max-width: 100%; }
  .cx-herop__actions { flex-direction: column; align-items: stretch; width: 100%; gap: 10px; }
  .cx-herop .btn { display: flex; width: 100%; box-sizing: border-box; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-herop--fade .cx-herop__slide,
  .cx-herop--slide .cx-herop__track,
  .cx-herop .btn,
  .cx-herop__dot { transition: none; }
  .cx-herop .btn:hover { transform: none; }
}

/* Entrance motion: title lines rise in one after another, the collage pops in. */
@keyframes hz-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes hz-pop { from { opacity: 0; transform: scale(.94) translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes hz-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.cx-herop__slide.is-active .cx-herop__line { animation: hz-rise .7s cubic-bezier(.2,.7,.2,1) both; }
.cx-herop__slide.is-active .cx-herop__line:nth-child(2) { animation-delay: .1s; }
.cx-herop__slide.is-active .cx-herop__accent { animation: hz-rise .7s cubic-bezier(.2,.7,.2,1) .2s both; }
.cx-herop__slide.is-active .cx-herop__lead { animation: hz-rise .7s cubic-bezier(.2,.7,.2,1) .3s both; }
.cx-herop__slide.is-active .cx-herop__actions { animation: hz-rise .7s cubic-bezier(.2,.7,.2,1) .4s both; }
.cx-herop__slide.is-active .cx-herop__collage img { animation: hz-pop .9s cubic-bezier(.2,.7,.2,1) .15s both, hz-float 7s ease-in-out 1.2s infinite; }
@media (prefers-reduced-motion: reduce) {
  .cx-herop__slide .cx-herop__line, .cx-herop__slide .cx-herop__accent, .cx-herop__slide .cx-herop__lead,
  .cx-herop__slide .cx-herop__actions, .cx-herop__slide .cx-herop__collage img { animation: none !important; }
}

/* Hover: the collage leans in and grows a little (uses scale/rotate, independent of the entrance + float animation). */
.cx-herop__collage img { transition: scale .5s cubic-bezier(.2,.7,.2,1), rotate .5s cubic-bezier(.2,.7,.2,1), filter .4s ease; }
.cx-herop__collage:hover img { scale: 1.05; rotate: -2.5deg; filter: drop-shadow(0 18px 28px rgba(14, 14, 14, .16)); }
@media (hover: none), (prefers-reduced-motion: reduce) { .cx-herop__collage:hover img { scale: 1; rotate: 0deg; filter: none; } }

/* the scroll tilt arrives as --sm-rot (assets/scroll-motion.js) */
.cx-herop__collage { rotate: var(--sm-rot, 0deg); }
