/**
 * FAEL — editorial hero (full viewport, rail at bottom)
 */

body.theme-fael .fael-hero-viewport {
  --fael-hero-rail-h: 3.5rem;
  --hero-viewport-h: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: var(--hero-viewport-h);
  height: var(--hero-viewport-h);
  max-height: var(--hero-viewport-h);
  overflow: hidden;
  background: #ffffff;
}

@supports (height: 100dvh) {
  body.theme-fael .fael-hero-viewport {
    --hero-viewport-h: 100dvh;
  }
}

@supports (height: 100svh) {
  body.theme-fael .fael-hero-viewport {
    --hero-viewport-h: 100svh;
  }
}

body.theme-fael .fael-hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

body.theme-fael .fael-hero__media {
  position: absolute;
  /* Keep photo on the right so portrait lifestyle shots don’t dominate / over-crop */
  top: 0;
  right: 0;
  bottom: 0;
  left: 42%;
  z-index: 0;
  overflow: hidden;
  background: var(--surface-2);
}

@media (max-width: 899px) {
  body.theme-fael .fael-hero__media {
    left: 0;
    inset: 0;
  }
}

body.theme-fael .fael-hero__media-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 1s;
}

body.theme-fael .fael-hero__media-layer.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

body.theme-fael .fael-hero__media-layer.is-leaving {
  opacity: 1;
  filter: brightness(0.94);
  transition: filter 0.9s ease;
  z-index: 1;
}

body.theme-fael .fael-hero__media-layer.is-entering {
  opacity: 1;
  visibility: visible;
  z-index: 3;
  clip-path: inset(0 100% 0 0);
  animation: faelHeroWipeIn 0.9s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes faelHeroWipeIn {
  to { clip-path: inset(0 0 0 0); }
}

body.theme-fael .fael-hero__media-layer img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  /* Slight pull-back so subjects don’t feel oversized */
  transform: scale(1.02);
  transform-origin: center center;
}

@media (max-width: 899px) {
  body.theme-fael .fael-hero__media-layer img {
    object-position: center 35%;
    transform: scale(1);
  }
}

body.theme-fael .fael-hero__media-shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(
      102deg,
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 255, 255, 0.92) 18%,
      rgba(255, 255, 255, 0.35) 42%,
      rgba(10, 10, 10, 0.08) 100%
    );
}

@media (min-width: 900px) {
  body.theme-fael .fael-hero__media-shade {
    background:
      linear-gradient(
        90deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.55) 8%,
        rgba(255, 255, 255, 0) 22%,
        rgba(10, 10, 10, 0.12) 100%
      );
  }
}

@media (max-width: 899px) {
  body.theme-fael .fael-hero__media-shade {
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.88) 0%,
        rgba(255, 255, 255, 0.72) 42%,
        rgba(255, 255, 255, 0.55) 100%
      );
  }
}

body.theme-fael .fael-hero__frame {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  flex: 1;
  padding-bottom: var(--fael-hero-rail-h);
  overflow: hidden;
}

body.theme-fael .fael-hero__panel-accent {
  position: absolute;
  top: calc(var(--header-sticky-h, 56px) + 0.75rem);
  left: clamp(1rem, 3vw, 2rem);
  bottom: calc(var(--fael-hero-rail-h) + clamp(1.5rem, 4vw, 2.5rem));
  width: 3px;
  background: var(--fael-red);
  pointer-events: none;
  z-index: 0;
}

body.theme-fael .fael-hero__container {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  min-height: 0;
  /* Clear fixed header so copy isn’t hidden underneath */
  padding-top: calc(var(--header-sticky-h, 56px) + 0.75rem);
  padding-right: clamp(1.25rem, 3vw, 2rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
  padding-left: clamp(1.5rem, 3.5vw, 2.25rem);
}

body.theme-fael .fael-hero__slides {
  position: relative;
  width: min(100%, 38rem);
}

body.theme-fael .fael-hero__panel { display: none; }
body.theme-fael .fael-hero__panel.is-active { display: block; }

body.theme-fael .fael-hero__panel.is-leaving [data-hero-line] {
  animation: faelHeroLineOut 0.4s ease forwards;
}

body.theme-fael .fael-hero__panel.is-active [data-hero-line] {
  opacity: 0;
  animation: faelHeroLineIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--line-delay, 0s);
}

@keyframes faelHeroLineIn {
  to { opacity: 1; }
}

@keyframes faelHeroLineOut {
  to { opacity: 0; }
}

body.theme-fael .fael-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding-left: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

body.theme-fael .fael-hero__eyebrow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  background: var(--fael-red);
  color: #ffffff;
  font-size: 0.72rem;
  border-radius: var(--fael-radius);
}

body.theme-fael .fael-hero__title {
  margin: 0 0 1rem;
  padding-left: 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--fael-black);
  max-width: 12ch;
}

body.theme-fael .fael-hero__title-word {
  display: inline-block;
  margin-right: 0.14em;
}

body.theme-fael .fael-hero__lead {
  margin: 0 0 1.5rem;
  padding-left: 0.5rem;
  max-width: 32rem;
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.6;
  color: var(--muted);
}

body.theme-fael .fael-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  padding-left: 0.5rem;
}

body.theme-fael .fael-hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: var(--fael-radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.8rem 1.25rem;
}

/* Slider rail — pinned to bottom of hero */
body.theme-fael .fael-hero__rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: var(--fael-hero-rail-h);
  border-top: 1px solid var(--line);
  background: #ffffff;
}

body.theme-fael .fael-hero__rail-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

body.theme-fael .fael-hero__rail-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 auto;
  min-width: 0;
}

body.theme-fael .fael-hero__counter {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--fael-black);
}

body.theme-fael .fael-hero__progress {
  flex: 1 1 auto;
  height: 2px;
  max-width: min(18rem, 40vw);
  background: var(--line);
  overflow: hidden;
}

body.theme-fael .fael-hero__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--fael-red);
}

body.theme-fael .fael-hero__progress-fill.is-running {
  animation: faelHeroProgress var(--fael-hero-duration, 9s) linear forwards;
}

@keyframes faelHeroProgress {
  to { width: 100%; }
}

body.theme-fael .fael-hero__rail-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

body.theme-fael .fael-hero__dot {
  width: 1.5rem;
  height: 2px;
  padding: 0;
  border: none;
  background: var(--line);
  cursor: pointer;
  transition: background 0.2s ease;
}

body.theme-fael .fael-hero__dot[aria-current="true"] {
  background: var(--fael-red);
  width: 2rem;
}

body.theme-fael .fael-hero__dot:hover {
  background: var(--fael-black);
}

body.theme-fael .fael-hero__arrow {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--fael-radius);
  background: #ffffff;
  color: var(--fael-black);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body.theme-fael .fael-hero__arrow:hover {
  border-color: var(--fael-red);
  background: var(--fael-red);
  color: #ffffff;
}

body.theme-fael .fael-hero__scroll {
  position: absolute;
  right: clamp(1rem, 3vw, 2rem);
  bottom: calc(var(--fael-hero-rail-h) + 1rem);
  z-index: 6;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--fael-black);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

@media (min-width: 900px) {
  body.theme-fael .fael-hero__scroll { display: flex; }
}

body.theme-fael .fael-hero__scroll:hover {
  opacity: 1;
  color: var(--fael-black);
}

body.theme-fael .fael-hero__scroll-line {
  width: 1px;
  height: 2rem;
  background: linear-gradient(180deg, var(--fael-red), transparent);
}

body.theme-fael .fael-hero-viewport .hero-controls {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  body.theme-fael .fael-hero__media-layer,
  body.theme-fael .fael-hero__panel [data-hero-line],
  body.theme-fael .fael-hero__progress-fill {
    animation: none !important;
    transition: none !important;
  }

  body.theme-fael .fael-hero__media-layer img {
    transform: none;
  }

  body.theme-fael .fael-hero__panel.is-active [data-hero-line] {
    opacity: 1;
  }
}

/* Mobile / small tablet hero */
@media (max-width: 899px) {
  body.theme-fael .fael-hero-viewport {
    --fael-hero-rail-h: 3.75rem;
  }

  body.theme-fael .fael-hero__container {
    align-items: flex-end;
    padding-right: 1.1rem;
    padding-left: 1.15rem;
    padding-bottom: 1.15rem;
  }

  body.theme-fael .fael-hero__panel-accent {
    left: 1rem;
    top: calc(var(--header-sticky-h, 56px) + 0.55rem);
    bottom: calc(var(--fael-hero-rail-h) + 1.15rem);
  }

  body.theme-fael .fael-hero__slides {
    width: 100%;
    max-width: 100%;
  }

  body.theme-fael .fael-hero__eyebrow {
    margin-bottom: 0.7rem;
    font-size: 0.68rem;
  }

  body.theme-fael .fael-hero__title {
    font-size: clamp(1.75rem, 8.2vw, 2.65rem);
    margin-bottom: 0.75rem;
    line-height: 1.05;
  }

  body.theme-fael .fael-hero__lead {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    max-width: 28rem;
  }

  body.theme-fael .fael-hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    width: 100%;
  }

  body.theme-fael .fael-hero__btn {
    justify-content: center;
    width: 100%;
    padding: 0.85rem 1.1rem;
  }

  body.theme-fael .fael-hero__rail-inner {
    gap: 0.65rem;
    padding: 0 0.85rem;
  }

  body.theme-fael .fael-hero__progress {
    max-width: none;
    flex: 1 1 auto;
  }

  body.theme-fael .fael-hero__dot {
    width: 1.1rem;
  }

  body.theme-fael .fael-hero__dot[aria-current="true"] {
    width: 1.5rem;
  }

  body.theme-fael .fael-hero__arrow {
    width: 2.5rem;
    height: 2.5rem;
  }

  body.theme-fael .fael-hero__media-shade {
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0.2) 28%,
        rgba(255, 255, 255, 0) 48%
      ),
      linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(255, 255, 255, 0.72) 22%,
        rgba(255, 255, 255, 0.15) 48%,
        transparent 68%
      );
  }
}

@media (max-width: 479px) {
  body.theme-fael .fael-hero__counter {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }

  body.theme-fael .fael-hero__rail-nav {
    gap: 0.25rem;
  }

  body.theme-fael .fael-hero__dot {
    display: none;
  }
}
