/* ═══════════════════════════════════════════════════════════════════════════
   EPYSO — HERO SLIDER  (hero-slider.css)
   
   Cinematic full-bleed slideshow. Replaces .rr-hero entirely.
   Uses existing --rr- tokens so light/dark theme works automatically.

   Paste this into style.css AFTER the existing :root / .rr-hero block
   (around line 3780), OR @import it, OR inject via wp_head.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Container ────────────────────────────────────────────────────────────── */
.ep-hero {
  position: relative;
  width: 100%;
  /* Tall enough to feel cinematic, short enough to show "more" below fold */
  height: clamp(480px, 72vh, 780px);
  overflow: hidden;
  background: #0d0e12; /* dark base while images load */
}

/* ── Background layers ────────────────────────────────────────────────────── */
.ep-hero__backgrounds {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.ep-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1);
  /* Subtle Ken-Burns: barely perceptible — adds life without screaming "effect" */
  transform: scale(1.04);
  animation: ep-kenburns 9s ease-out forwards paused;
}

.ep-hero__bg.is-active {
  opacity: 1;
  animation-play-state: running;
}

/* No-cover fallback: dark gradient */
.ep-hero__bg:not([style*="background-image"]) {
  background: linear-gradient(160deg, #1a1d26 0%, #0d0e12 100%);
}

@keyframes ep-kenburns {
  from { transform: scale(1.04); }
  to   { transform: scale(1.00); }
}

/* ── Gradient scrim ───────────────────────────────────────────────────────── */
/* Two-layer scrim: heavy at bottom for text, lighter vignette at sides       */
.ep-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    /* bottom-up gradient: text legibility */
    linear-gradient(
      to top,
      rgba(10, 10, 14, 0.92) 0%,
      rgba(10, 10, 14, 0.6)  35%,
      rgba(10, 10, 14, 0.2)  60%,
      transparent            100%
    ),
    /* left vignette: anchors text column */
    linear-gradient(
      to right,
      rgba(10, 10, 14, 0.55) 0%,
      transparent 55%
    );
  pointer-events: none;
}

/* ── Slide stage ──────────────────────────────────────────────────────────── */
.ep-hero__stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end; /* text anchors to the bottom */
}

/* ── Individual slides ────────────────────────────────────────────────────── */
.ep-hero__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  /* Content fades slightly after image — text trails in a beat later */
  transition: opacity 700ms cubic-bezier(0.4, 0, 0.2, 1) 200ms;
  pointer-events: none;
}

.ep-hero__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Content block ────────────────────────────────────────────────────────── */
.ep-hero__content {
  width: 100%;
  max-width: min(680px, 90vw);
  padding: 0 1.25rem 4.5rem 1.25rem;
  /* The signature element: a clay-coloured left border ribbon */
  border-left: 3px solid var(--rr-clay, #b1502f);
  margin-left: 1.25rem;
}

@media (min-width: 640px) {
  .ep-hero__content {
    padding-left: 2rem;
    padding-right: 2rem;
    margin-left: 2rem;
  }
}

@media (min-width: 1024px) {
  .ep-hero__content {
    padding-left: 3rem;
    padding-right: 3rem;
    padding-bottom: 5rem;
    margin-left: calc((100vw - 1280px) / 2 + 2rem);
    max-width: 620px;
  }
}

/* ── Genre tag ────────────────────────────────────────────────────────────── */
.ep-hero__genre {
  display: inline-block;
  font-family: var(--rr-font-ui, 'Inter', sans-serif);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rr-clay, #b1502f);
  text-decoration: none;
  margin-bottom: 0.875rem;
  /* Thin underline on hover only — no background pill */
  border-bottom: 1.5px solid transparent;
  transition: border-color 180ms;
}

.ep-hero__genre:hover {
  border-color: var(--rr-clay, #b1502f);
}

/* ── Story title ──────────────────────────────────────────────────────────── */
.ep-hero__title {
  font-family: var(--rr-font-display, 'Fraunces', Georgia, serif);
  font-size: clamp(1.875rem, 5.5vw, 3.5rem);
  font-weight: 400; /* Fraunces reads best at 400 — let the face do the work */
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #f5f0e8; /* warmer than pure white — paper-ish against dark bg */
  margin: 0 0 0.875rem;
  /* Tighten long titles on mobile */
  max-width: 22ch;
}

.ep-hero__title a {
  color: inherit;
  text-decoration: none;
  transition: color 180ms;
}

.ep-hero__title a:hover {
  color: #fff;
}

/* ── Excerpt ──────────────────────────────────────────────────────────────── */
.ep-hero__excerpt {
  font-family: var(--rr-font-ui, 'Inter', sans-serif);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  line-height: 1.65;
  color: rgba(245, 240, 232, 0.72);
  margin: 0 0 1.125rem;
  max-width: 52ch;
  /* Hidden on very small screens to keep CTA visible */
}

@media (max-width: 400px) {
  .ep-hero__excerpt { display: none; }
}

/* ── Meta row ─────────────────────────────────────────────────────────────── */
.ep-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1.375rem;
  font-family: var(--rr-font-ui, 'Inter', sans-serif);
  font-size: 0.75rem;
  color: rgba(245, 240, 232, 0.5);
}

.ep-hero__dot { color: rgba(245, 240, 232, 0.3); }

.ep-hero__author {
  font-weight: 600;
  color: rgba(245, 240, 232, 0.7);
}

/* Reuse existing status badge colours — they already have light text */
.ep-hero__status .rr-badge { font-size: 0.65rem; }

/* ── CTA button ───────────────────────────────────────────────────────────── */
.ep-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #f5f0e8; /* warm paper white — not blinding */
  color: #14161d;       /* dark ink */
  font-family: var(--rr-font-ui, 'Inter', sans-serif);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: var(--rr-radius, 3px);
  border: none;
  transition: background 180ms, transform 180ms, box-shadow 180ms;
}

.ep-hero__cta:hover,
.ep-hero__cta:focus-visible {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.ep-hero__cta:focus-visible {
  outline: 2px solid var(--rr-clay, #b1502f);
  outline-offset: 3px;
}

/* ── Slideshow controls ───────────────────────────────────────────────────── */
.ep-hero__controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1.25rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

@media (min-width: 640px) {
  .ep-hero__controls { right: 2rem; bottom: 2rem; }
}

@media (min-width: 1024px) {
  .ep-hero__controls { right: 3rem; bottom: 3rem; }
}

/* ── Progress ticks ───────────────────────────────────────────────────────── */
.ep-hero__progress {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ep-hero__tick {
  /* Bare button reset */
  all: unset;
  display: block;
  width: 28px;
  height: 2px;
  background: rgba(245, 240, 232, 0.25);
  border-radius: 1px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: width 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active tick is wider — draws attention without a pill or dot */
.ep-hero__tick.is-active {
  width: 52px;
  background: rgba(245, 240, 232, 0.3);
}

/* The fill bar that animates across during auto-advance */
.ep-hero__tick-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #f5f0e8;
  border-radius: 1px;
  transition: none; /* JS drives width directly */
}

.ep-hero__tick.is-active .ep-hero__tick-fill {
  /* JS adds .is-filling to kick off the CSS animation */
  animation: none;
}

.ep-hero__tick.is-filling .ep-hero__tick-fill {
  animation: ep-tick-fill var(--ep-slide-duration, 6000ms) linear forwards;
}

@keyframes ep-tick-fill {
  from { width: 0%; }
  to   { width: 100%; }
}

/* Focus ring for keyboard nav */
.ep-hero__tick:focus-visible {
  outline: 2px solid var(--rr-clay, #b1502f);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── Prev / Next arrows ───────────────────────────────────────────────────── */
.ep-hero__arrows {
  display: flex;
  gap: 4px;
}

.ep-hero__arrow {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 240, 232, 0.1);
  color: rgba(245, 240, 232, 0.7);
  cursor: pointer;
  transition: background 180ms, color 180ms;
}

.ep-hero__arrow:hover {
  background: rgba(245, 240, 232, 0.2);
  color: #f5f0e8;
}

.ep-hero__arrow:focus-visible {
  outline: 2px solid var(--rr-clay, #b1502f);
  outline-offset: 3px;
}

/* ── Search bar wrapper (sits directly below, not inside) ─────────────────── */
.ep-hero__search-wrap {
  position: relative;
  z-index: 10;
  margin-top: -1.5rem; /* slight overlap with hero bottom */
}

.ep-hero__search-wrap .container {
  display: flex;
}

/* Inherit the existing rr-hero__search styles — no changes needed */

/* ── Empty state ──────────────────────────────────────────────────────────── */
.ep-hero--empty {
  background: linear-gradient(160deg, #1a1d26 0%, #0d0e12 100%);
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ep-hero__bg {
    transition: opacity 200ms;
    animation: none;
  }
  .ep-hero__slide {
    transition: opacity 200ms;
  }
  .ep-hero__tick-fill,
  .ep-hero__tick.is-filling .ep-hero__tick-fill {
    animation: none;
    width: 100%; /* just show full fill, no animation */
  }
  .ep-hero__cta:hover {
    transform: none;
  }
}
