/* ─────────────────────────────────────────────────────────────────────────────
 * Hero Slideshow — standalone stylesheet
 *
 * Dependencies: var(--p-font-display) from portal.css (used in .hero-cta-btn).
 * For use outside this project, replace var(--p-font-display) with a literal
 * font stack: 'Space Grotesk', sans-serif
 * ───────────────────────────────────────────────────────────────────────────── */

/* ── 1. Background Layers ─────────────────────────────────────────────────── */

.hero-bg-layers {
  position: absolute; inset: 0; z-index: 0;
}
.hero-bg-layer {
  position: absolute; inset: 0;
  background: #111;
  opacity: 0;
  transition: opacity 0.85s ease;
}
.hero-bg-layer.is-active { opacity: 1; }

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Video backgrounds */
.hero-bg-layer video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* ── 2. Layout Zones ──────────────────────────────────────────────────────── */

.hero-top {
  position: relative; z-index: 1;
  padding: 48px 56px 0;
  flex-shrink: 0;
}
.hero-content-area {
  position: relative; z-index: 1;
  flex: 1; min-height: 0;
}
.hero-footer {
  position: relative; z-index: 1;
  padding: 0 56px 45px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  gap: 25px;
}

/* ── 3. Slide Content Items ───────────────────────────────────────────────── */

.hero-slide-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 56px 5px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  pointer-events: none;
}
.hero-slide-content.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Outgoing slide drifts slightly upward as it fades */
.hero-slide-content.is-leaving {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

/* ── 4. Slide Typography ──────────────────────────────────────────────────── */

/* .login-hero-headline supplies: font-family, font-size, font-weight, line-height, max-width */
.hero-slide-title    { margin: 0; color: #fff; }
/* .login-hero-sub supplies: font-size, color, max-width, margin-top, line-height */
.hero-slide-subtitle { margin-bottom: 0; }

/* ── 5. CTA Buttons ───────────────────────────────────────────────────────── */

.hero-slide-ctas {
  display: flex; align-items: center; gap: 10px;
  margin-top: 22px; flex-wrap: wrap;
}
.hero-cta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600; line-height: 1;
  font-family: var(--p-font-display, 'Space Grotesk', sans-serif);
  text-decoration: none; white-space: nowrap;
  cursor: pointer; border: none;
  transition: opacity 0.18s ease, transform 0.15s ease;
}
.hero-cta-btn:hover { opacity: 0.82; transform: translateY(-1px); }

.hero-cta-btn-primary   { background: #fff; color: #111; }
.hero-cta-btn-secondary {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1.5px solid currentColor;
}
.hero-cta-btn-secondary:hover {
  color: #fff; opacity: 1;
}

/* ── 6. Slide Counter ─────────────────────────────────────────────────────── */

.hero-slide-counter {
  display: flex; align-items: center; gap: 3px;
  font-size: 12px;
  font-family: var(--p-font-display, 'Space Grotesk', sans-serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.3);
  user-select: none;
}
.hero-counter-current { color: rgba(255,255,255,0.7); font-weight: 600; }
.hero-counter-sep     { margin: 0 1px; }

/* ── 7. Multi-Bar Progress Track ──────────────────────────────────────────── */

.hero-progress-track {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 4px;
  flex-shrink: 0;
  width: 85%;
}

.hero-progress-segment {
  flex: 1;
  background: rgba(255,255,255,0.13);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}

/* Extended hit target — 8px above and below the visible bar */
.hero-progress-segment::before {
  content: '';
  position: absolute;
  inset: -8px 0;
}

.hero-progress-segment:not(.is-active):hover {
  background: rgba(255,255,255,0.28);
}

.hero-progress-fill {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.65);
  border-radius: 100px;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.hero-progress-fill.is-animating {
  animation-name: heroProgressAnim;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  /* animation-duration is set per-fill by JS */
}

.hero-progress-fill.is-complete {
  transform: scaleX(1) !important;
  animation: none !important;
}

@keyframes heroProgressAnim {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Pause fill animation while cursor is over the progress track */
.hero-progress-track:hover .hero-progress-fill.is-animating {
  animation-play-state: paused;
}

/* ── 8. Reduced Motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .hero-bg-layer                   { transition: none; }
  .hero-slide-content              { transition: none; }
  .hero-slide-content.is-leaving   { transition: none; }
  .hero-progress-fill.is-animating { animation-duration: 0.01ms !important; }
}

/* ── 9. Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .hero-top           { padding: 32px 24px 0; }
  .hero-slide-content { padding: 0 24px 0px; }
  .hero-footer        { padding: 0 24px 18px; }
  .hero-progress-track{ gap: 3px; }
}

@media (max-width: 768px) {
      .hero-footer {
        position: relative;
        z-index: 1;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: space-between;
        flex-shrink: 0;
        gap: 15px;
        padding: 10px 24px;
    }
}