/**
 * MésioFits hero — a stage: satin curtains on both sides and a drape between the text and the
 * photo stay fixed, while each slide's photo and text crossfade in. Full width, edge to edge.
 * On desktop the hero is exactly one screen tall below the header (and the 40px promo bar when
 * it's showing), less 20px.
 */

.hero-carousel {
  --hero-cream: #f2ede6;
  --hero-split: 50%;                 /* where the photo starts; the drape hangs over its left edge */
  --hero-media-h: 380px;             /* mobile photo height */
  --hero-offset: calc(var(--header-height) + 20px);
  position: relative;
  width: 100%;
  background: var(--hero-cream);
}
body:has(.fh-promo-marquee) .hero-carousel { --hero-offset: calc(var(--header-height) + 40px + 20px); }

.hero-carousel__viewport {
  position: relative;
  overflow: hidden;
}

/* Slides are stacked and crossfade; the tallest sets the height */
.hero-carousel__track { display: grid; }
.hero-slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  transition: visibility 0s linear 1s;
}
.hero-slide.is-active { z-index: 1; visibility: visible; transition: none; }

/* The incoming photo fades in over the outgoing one (which only disappears once covered);
   the old text fades out quickly, then the new text rises in — never two texts at once. */
.hero-slide__media { opacity: 0; transition: opacity 0s linear 1s; }
.hero-slide.is-active .hero-slide__media { opacity: 1; transition: opacity 1s var(--ease-out); }
.hero-slide__text { opacity: 0; transform: translateY(12px); transition: opacity 0.3s ease, transform 0.3s ease; }
.hero-slide.is-active .hero-slide__text {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-out) 0.3s, transform 0.7s var(--ease-out) 0.3s;
}
.hero-carousel--single .hero-slide,
.hero-carousel--single .hero-slide__media,
.hero-carousel--single .hero-slide__text { visibility: visible; opacity: 1; transform: none; }

/* Photo (on phones it sits on top, framed by the curtains; text below) */
.hero-slide__media {
  order: -1;
  position: relative;
  height: var(--hero-media-h);
  overflow: hidden;
}
.hero-slide__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}
.hero-slide.is-active .hero-slide__media img { animation: hero-settle 6s var(--ease-out) both; }
@keyframes hero-settle { from { transform: scale(1.05); } to { transform: scale(1); } }

/* Text on the cream stage */
.hero-slide__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 30px 24px 64px;
  background: radial-gradient(ellipse 70% 60% at 45% 50%, #faf7f2 0%, var(--hero-cream) 70%);
}
.hero-slide__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6f625a;
}
.hero-slide__brand {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--mesio-espresso);
}
.hero-slide__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 9vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--mesio-espresso);
}
.hero-slide__desc {
  margin: 0 0 10px;
  max-width: 34em;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #6f625a;
}
.hero-slide__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  background: var(--mesio-espresso);
  color: var(--mesio-ivory);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}
.hero-slide__cta:hover { background: var(--mesio-olive); color: var(--mesio-ivory); transform: translateY(-2px); }

/* Fixed curtain frame (never moves or changes between slides) */
.hero-carousel__frame {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--hero-media-h);
  pointer-events: none;
  z-index: 2;
}
.hero-curtain {
  position: absolute;
  top: 0;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 10px rgba(43, 33, 28, 0.28));
}
.hero-curtain--left { left: 0; width: 17%; }
.hero-curtain--right { right: 0; width: 17%; transform: scaleX(-1); }
.hero-curtain--drape { display: none; }

/* Controls */
.hero-carousel__arrow {
  position: absolute;
  top: calc(var(--hero-media-h) / 2);
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--mesio-espresso);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(43, 33, 28, 0.22);
  transition: transform var(--duration) var(--ease-out), background var(--duration) var(--ease-out);
}
.hero-carousel__arrow:hover { background: var(--mesio-ivory); }
.hero-carousel__arrow--prev { left: 10px; }
.hero-carousel__arrow--next { right: 10px; }

.hero-carousel__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 3;
  display: flex;
  justify-content: center;
}
.hero-carousel__dots {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(43, 33, 28, 0.28);
  backdrop-filter: blur(2px);
}
.hero-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width var(--duration) var(--ease-out), background var(--duration) var(--ease-out);
}
.hero-carousel__dot.is-active { width: 22px; background: #fff; }

/* Mobile: no eyebrow ("Tailored to Fit · Made in Nigeria") or brand line — photo, title and button only */
@media (max-width: 767.98px) {
  .hero-slide__eyebrow,
  .hero-slide__brand { display: none; }

  /* The button sits on the photo, centred near its bottom edge */
  .hero-slide { position: relative; }
  .hero-slide__text,
  .hero-slide.is-active .hero-slide__text { transform: none; }   /* keep the button from shifting while it fades */
  .hero-slide__text { position: static; }
  .hero-slide__cta { z-index: 2; }
  .hero-slide__cta {
    position: absolute;
    top: calc(var(--hero-media-h) - 76px);
    left: 0;
    right: 0;
    width: max-content;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(43, 33, 28, 0.35);
  }
}

/* Desktop: the full stage — text on the left, photo on the right, curtains framing both */
@media (min-width: 768px) {
  .hero-carousel__track {
    height: calc(100vh - var(--hero-offset));
    height: calc(100svh - var(--hero-offset));
    min-height: 480px;
    max-height: 900px;
  }
  .hero-slide { position: relative; display: block; }
  .hero-slide__media {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--hero-split);
    right: 0;
    height: auto;
  }
  .hero-slide__text {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--hero-split) + 1px);
    justify-content: center;
    padding: 40px 6% 40px 12.4%;
    gap: 16px;
  }
  .hero-slide__title { font-size: clamp(2.5rem, 4.1vw, 5rem); }
  .hero-slide__desc { font-size: clamp(0.95rem, 1.05vw, 1.1rem); }

  .hero-carousel__frame { inset: 0; height: auto; }
  .hero-curtain--left { width: 13.5%; }
  .hero-curtain--right { width: 13.5%; }
  .hero-curtain--drape {
    display: block;
    left: calc(var(--hero-split) - 7%);
    width: 7.5%;
    filter: drop-shadow(8px 0 14px rgba(43, 33, 28, 0.3));
  }

  .hero-carousel__arrow { top: 50%; width: 52px; height: 52px; font-size: 1rem; }
  .hero-carousel__arrow--prev { left: 2.8%; }
  .hero-carousel__arrow--next { right: 2.8%; }
  .hero-carousel__controls { bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-slide.is-active,
  .hero-slide__media, .hero-slide.is-active .hero-slide__media,
  .hero-slide__text, .hero-slide.is-active .hero-slide__text { transition: none; }
  .hero-slide.is-active .hero-slide__media img { animation: none; }
}
