/* ============================================================
   Alrafaa Group — hero video slider
   Layers on top of the base .hero styles in styles.css
   ============================================================ */

.hero-slider { position: relative; }

.hero-slides { position: absolute; inset: 0; }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s var(--ease), visibility 1s var(--ease);
  will-change: opacity;
}
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }

/* Background layer: poster image (always) + video/iframe on top when ready */
.hero-slide-bg {
  position: absolute;
  inset: 0;
  background-color: #15171a;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero-slide-bg video,
.hero-slide-bg iframe {
  position: absolute;
  border: 0;
  pointer-events: none;
}
/* Video file — simple object-fit cover */
.hero-slide-bg video {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s var(--ease);
}
.hero-slide-bg video.is-ready { opacity: 1; }

/* YouTube iframe — scale a 16:9 frame to fully cover the viewport */
.hero-slide-bg iframe {
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;          /* 16:9 based on width */
  min-height: 100vh;
  min-width: 177.78vh;      /* 16:9 based on height */
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .8s var(--ease);
}
.hero-slide-bg iframe.is-ready { opacity: 1; }

/* Legibility overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,.04) 38%, rgba(0,0,0,.10) 60%, rgba(0,0,0,.62) 100%);
}

.hero-slide .hero-inner { z-index: 2; }

/* Subtle entrance for the active slide's text */
.hero-slide .eyebrow,
.hero-slide h1,
.hero-slide .hero-meta {
  opacity: 0;
  transform: translateY(18px);
}
.hero-slide.is-active .eyebrow { animation: heroIn .9s var(--ease) .15s forwards; }
.hero-slide.is-active h1       { animation: heroIn .9s var(--ease) .28s forwards; }
.hero-slide.is-active .hero-meta { animation: heroIn .9s var(--ease) .42s forwards; }
@keyframes heroIn { to { opacity: 1; transform: none; } }

.hero-cta {
  margin-top: .4em;
  background: #fff;
  color: var(--ink);
  border: 0;
}
.hero-cta:hover { background: rgba(255,255,255,.88); }

/* ---- Controls ---- */
.hero-controls {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(20px, 3vw, 40px);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  pointer-events: none;
}
.hero-controls > * { pointer-events: auto; }

.hero-dots { display: flex; align-items: center; gap: 14px; }
.hero-dot {
  position: relative;
  width: 46px;
  height: 3px;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,.32);
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
}
.hero-dot-progress {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: #fff;
}
.hero-dot.is-active .hero-dot-progress { width: 100%; }

.hero-nav { display: flex; gap: 10px; }
.hero-nav button {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.06);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.hero-nav button:hover { background: rgba(255,255,255,.18); border-color: #fff; }
.hero-nav svg { width: 18px; height: 18px; }
[dir="rtl"] .hero-nav svg { transform: scaleX(-1); }

@media (max-width: 720px) {
  .hero-dot { width: 30px; }
  .hero-nav button { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
  .hero-slide .eyebrow,
  .hero-slide h1,
  .hero-slide .hero-meta { opacity: 1; transform: none; animation: none; }
  .hero-dot-progress { transition: none !important; }
}
