/* ============================================================
   TEMPLATE-HERO-SLIDER.CSS — Almare Lanka Travels
   "Pearl Glass" v9.0 (homepage hero over main-slider.mp4)
   Class prefix: fh- (AlmareHero)

   All values reference css/main.css design tokens. Contrast for text
   over the video comes from --hero-text-* tokens on the letters only:
   there is no overlay or scrim across the hero. Load AFTER main.css.
============================================================ */

.fh-hero {
  position: relative;
  width: 100%;
  min-height: clamp(620px, 94vh, 960px);
  overflow: hidden;
  background: var(--color-navy-mid);
  isolation: isolate;
}

/* ---------- Media: photo fallback underneath, video on top ---------- */
.fh-hero__media {
  position: absolute;
  inset: 0;
  z-index: var(--z-index-0);
}

.fh-hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1100ms ease, transform 8s linear;
}
.fh-hero__photo.is-active { opacity: 1; transform: scale(1); }

.fh-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1200ms ease;
}
.fh-hero[data-video="ready"] .fh-hero__video { opacity: 1; }

/* ---------- Stage: bottom-left copy, no background ---------- */
.fh-hero__stage {
  position: relative;
  z-index: var(--z-index-20);
  min-height: clamp(620px, 94vh, 960px);
  display: flex;
  align-items: flex-end;
}

.fh-hero__stage-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--spacing-24) var(--spacing-6) 7.5rem;
}

.fh-hero__copy-viewport {
  position: relative;
  display: grid;
  width: min(720px, 100%);
}

/* feathered shade behind the text block only, no visible edge */
.fh-hero__copy-viewport::before {
  content: "";
  position: absolute;
  inset: -90px -160px -70px -140px;
  background: var(--hero-text-halo);
  filter: blur(18px);
  pointer-events: none;
  z-index: -1;
}

.fh-hero__copy {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  visibility: hidden;
  pointer-events: none;
}
.fh-hero__copy.is-active { visibility: visible; pointer-events: auto; }
.fh-hero__copy.is-leaving { visibility: visible; }

.fh-hero__eyebrow {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  font-family: var(--font-wordmark);
  font-weight: var(--font-weight-semibold);
  font-size: 0.78rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--color-champagne-light);
  text-shadow: var(--hero-text-shadow);
}
.fh-hero__eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--color-champagne-light);
  box-shadow: var(--hero-mark-shadow);
  transform-origin: left;
}

.fh-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--font-weight-medium);
  font-size: clamp(2.75rem, 6.2vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
  color: var(--color-white);
  -webkit-text-stroke: 2.4px var(--hero-text-stroke);
  paint-order: stroke fill;
  text-shadow: var(--hero-text-shadow);
}
.fh-hero__title em { font-style: italic; font-weight: var(--font-weight-normal); color: var(--color-white); }

.fh-hero__desc {
  margin: 0;
  max-width: 52ch;
  font-family: var(--font-primary);
  font-size: 1.125rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.65;
  color: var(--color-white);
  -webkit-text-stroke: 0.5px var(--hero-text-stroke);
  paint-order: stroke fill;
  text-shadow: var(--hero-text-shadow);
}

.fh-hero__stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2) var(--spacing-6);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.02em;
  color: var(--color-white);
  -webkit-text-stroke: 0.4px var(--hero-text-stroke);
  paint-order: stroke fill;
  text-shadow: var(--hero-text-shadow);
}
.fh-hero__stats li { display: flex; align-items: center; gap: var(--spacing-2); }
.fh-hero__stats li::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--color-champagne);
  transform: rotate(45deg);
  box-shadow: var(--hero-mark-shadow);
}

.fh-hero__actions { display: flex; flex-wrap: wrap; gap: var(--spacing-3); margin-top: var(--spacing-2); }
.fh-hero__cta { box-shadow: var(--hero-btn-shadow); }
.fh-hero__cta-ghost {
  color: var(--color-white);
  background: transparent;
  border: 1px solid var(--color-white-85);
  text-shadow: var(--hero-text-shadow);
}
.fh-hero__cta-ghost:hover,
.fh-hero__cta-ghost:focus-visible { color: var(--color-white); background: var(--color-white-12); border-color: var(--color-white); }

/* ---------- Premium motion: words rise out of a mask ---------- */
.fh-hero__word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.06em 0.02em 0.12em;
  margin: -0.06em -0.02em -0.12em;
}
.fh-hero__word > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 900ms var(--ease-premium), opacity 900ms var(--ease-premium);
  transition-delay: calc(var(--i, 0) * 70ms + 180ms);
}
.fh-hero__copy.is-active .fh-hero__word > span { transform: none; opacity: 1; }
.fh-hero__copy.is-leaving .fh-hero__word > span {
  transform: translateY(-105%);
  opacity: 0;
  transition-duration: 550ms;
  transition-delay: calc(var(--i, 0) * 30ms);
}

.fh-hero__rise {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 800ms var(--ease-premium), transform 800ms var(--ease-premium);
}
.fh-hero__copy.is-active .fh-hero__rise { opacity: 1; transform: none; }
.fh-hero__copy.is-leaving .fh-hero__rise { opacity: 0; transform: translateY(-10px); transition-duration: 400ms; transition-delay: 0ms; }
.fh-hero__rise--1 { transition-delay: 100ms; }
.fh-hero__rise--2 { transition-delay: 650ms; }
.fh-hero__rise--3 { transition-delay: 800ms; }
.fh-hero__rise--4 { transition-delay: 950ms; }
.fh-hero__eyebrow.fh-hero__rise::before { transform: scaleX(0); transition: transform 900ms var(--ease-premium) 300ms; }
.fh-hero__copy.is-active .fh-hero__eyebrow::before { transform: scaleX(1); }

/* ---------- Right rail ---------- */
.fh-hero__rail {
  position: absolute;
  z-index: var(--z-index-30);
  right: var(--spacing-6);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-4);
}
.fh-hero__rail-logo { width: 52px; height: 52px; filter: var(--hero-logo-shadow); }
.fh-hero__rail-text {
  font-family: var(--font-wordmark);
  font-weight: var(--font-weight-semibold);
  font-size: 0.625rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-white);
  text-shadow: var(--hero-text-shadow);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.fh-hero__dots { display: flex; flex-direction: column; gap: 2px; }
.fh-hero__dot {
  appearance: none;
  border: 0;
  background: none;
  width: 44px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fh-hero__dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--color-white);
  box-shadow: var(--hero-mark-shadow);
  transition: var(--transition-premium);
}
.fh-hero__dot.is-active::before { height: 24px; border-radius: 6px; background: var(--color-white); }

/* ---------- Bottom controls ---------- */
.fh-hero__controls {
  position: absolute;
  z-index: var(--z-index-30);
  left: 0;
  right: 0;
  bottom: var(--spacing-6);
}
.fh-hero__controls-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--spacing-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-3);
}
.fh-hero__pill {
  display: flex;
  align-items: center;
  padding: 2px;
  background: var(--gradient-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-white-70);
  border-radius: var(--radius-full);
}
.fh-hero__btn {
  appearance: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--color-gold-dark);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.875rem;
}
.fh-hero__btn:hover { color: var(--color-gold); }
.fh-hero__sep { width: 1px; height: 20px; background: var(--color-navy-border); }
.fh-hero__progress {
  flex: 0 1 200px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-white-45);
  box-shadow: var(--hero-mark-shadow);
}
.fh-hero__progress-fill { width: 0; height: 100%; border-radius: inherit; background: var(--color-white); }
.fh-hero__counter {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-white);
  text-shadow: var(--hero-text-shadow);
}
.fh-hero__counter b { font-weight: var(--font-weight-semibold); }

.fh-hero__btn:focus-visible,
.fh-hero__dot:focus-visible,
.fh-hero__cta:focus-visible,
.fh-hero__cta-ghost:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 3px;
  box-shadow: var(--hero-focus-ring);
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
  .fh-hero__rail { display: none; }
  .fh-hero__stage-inner { padding: var(--spacing-24) var(--spacing-4) 7.5rem; }
  .fh-hero__controls-inner { padding: 0 var(--spacing-4); }
  .fh-hero__desc { font-size: 1rem; }
  .fh-hero__copy-viewport::before { inset: -60px -40px -50px -40px; }
}

@media (prefers-reduced-motion: reduce) {
  .fh-hero__photo,
  .fh-hero__word > span,
  .fh-hero__rise,
  .fh-hero__eyebrow::before { transition: none !important; transform: none !important; }
}
