/* Era carousel / timeline experience */

:root{
  --timeline-bg: #050608;
  --timeline-surface: rgba(15, 18, 26, 0.65);
  --timeline-glass: rgba(255,255,255,0.08);
  --timeline-glass-strong: rgba(255,255,255,0.14);
  --timeline-border: rgba(255,255,255,0.18);
  --timeline-text: #f6f7fb;
  --timeline-muted: #c6c9d4;
  --timeline-accent: #f4b41a;
}

html[data-site-theme='parchment']{
  --timeline-bg: var(--bg);
  --timeline-surface: rgba(239,234,221,0.92);
  --timeline-glass: rgba(253,246,227,0.72);
  --timeline-glass-strong: rgba(253,246,227,0.88);
  --timeline-border: rgba(215,207,184,0.95);
  --timeline-text: var(--text);
  --timeline-muted: var(--muted);
  --timeline-accent: var(--trih-gold, #B7950B);
}

/* Accessible contrast mode: ensure timeline vars use high-contrast colors. */
html[data-theme='contrast']{
  --timeline-bg: #000000;
  --timeline-surface: #000000;
  --timeline-glass: rgba(255,255,255,0.10);
  --timeline-glass-strong: rgba(255,255,255,0.16);
  --timeline-border: #ffffff;
  --timeline-text: #ffffff;
  --timeline-muted: #e0e0e0;
  --timeline-accent: #ffd700;
}

main.full-bleed{ padding:0; background:var(--timeline-bg); }

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border:0;
}

.timeline-shell{
  background:var(--timeline-bg);
  color:var(--timeline-text);
  min-height:100vh;
  /* keep local text vars aligned with the timeline palette (theme-aware) */
  --text: var(--timeline-text);
  --muted: var(--timeline-muted);
}
.timeline-shell a{ color:inherit; }
.timeline-shell h1,
.timeline-shell h2,
.timeline-shell h3{ color: var(--timeline-text); }
.timeline-shell .meta{ color: var(--timeline-muted); }

.timeline-hero{
  padding: 88px 6vw 56px;
  padding-left: clamp(80px, 10vw, 180px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 10% 20%, rgba(244,180,26,0.18), transparent 50%),
    radial-gradient(120% 120% at 80% -10%, rgba(255,255,255,0.08), transparent 42%),
    /* Match Search Explorer dark hero overlay */
    linear-gradient(rgba(5,6,8,0.84), rgba(5,6,8,0.84)),
    var(--hero-image, url('../images/web/eras/banner.jpg'));
  background-size: cover;
  background-position: center;
  /* Keep overlays consistent with other pages (no special blend mode). */
  background-blend-mode: normal;
}
.timeline-hero::after{
  content:'';
  position:absolute; inset:0;
  /* Keep minimal extra vignette so the hero transparency matches other pages */
  background: none;
  pointer-events:none;
}
.timeline-hero .hero-inner{ position:relative; z-index:1; max-width: 960px; }
.timeline-hero h1{ font-family:'Playfair Display', serif; font-size: clamp(2.4rem, 4vw, 3.4rem); margin: 0 0 14px; line-height:1.05; color: var(--timeline-text); }
.timeline-hero p.lead{ color: rgba(246,247,251,0.92); max-width: 740px; margin:0 0 20px; font-size: 1.05rem; font-weight: 400; }
.timeline-hero .eyebrow{ color: var(--timeline-muted); }
.timeline-hero .hero-actions{ display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-top: 8px; }
.timeline-hero .primary-cta{ background: var(--timeline-accent); color:#111; border:none; border-radius: 14px; padding:12px 18px; font-weight: 700; text-decoration:none; box-shadow:0 10px 30px rgba(244,180,26,0.25); }
.timeline-hero .primary-cta:hover{ filter:brightness(1.05); }

.timeline-nav{
  position:fixed;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display:flex;
  flex-direction:column;
  gap:18px;
  align-items:flex-start;
}
.timeline-nav .timeline-label{
  display:none;
  color: rgba(255,255,255,0.7);
  font-weight:700;
  letter-spacing:0.12em;
  text-transform:uppercase;
  font-size:0.72rem;
  padding:6px 10px;
  background: rgba(0,0,0,0.35);
  border:1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.timeline-nav .timeline-line{
  position:absolute; left:8px; top:-40vh; bottom:-40vh; width:2px;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.25) 20%, rgba(255,255,255,0.3) 80%, transparent 100%);
  z-index:-1;
}
.timeline-nav .nav-dot{
  width:16px; height:16px; border-radius:50%; border:2px solid var(--timeline-border);
  background: rgba(255,255,255,0.12);
  cursor:pointer;
  position:relative;
  transition:transform .2s ease, background .2s ease, border-color .2s ease;
}
.timeline-nav .nav-dot::after{
  content: attr(data-label);
  position:absolute; left:26px; top:50%; transform:translateY(-50%);
  background: rgba(5,6,8,0.9);
  border:1px solid var(--timeline-border);
  color: var(--timeline-text);
  padding:4px 8px; border-radius:6px;
  opacity:0; pointer-events:none; transition:opacity .2s ease;
  white-space: nowrap; font-size:0.8rem; font-weight:600;
}
.timeline-nav .nav-dot:hover::after, .timeline-nav .nav-dot.active::after{ opacity:1; }
.timeline-nav .nav-dot:hover, .timeline-nav .nav-dot.active{ background: var(--timeline-accent); border-color: var(--timeline-accent); transform:scale(1.12); }
.timeline-nav .nav-dot:focus-visible{
  outline: 3px solid var(--timeline-accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(244,180,26,0.2);
}
.timeline-nav .nav-dot:focus-visible::after{ opacity:1; }

@media (max-width: 992px){
  .timeline-nav{ position:sticky; top:0; transform:none; flex-direction:row; padding:14px 10px 10px; background: rgba(5,6,8,0.92); justify-content:center; gap:10px; }
  .timeline-nav .timeline-line{ display:none; }
  .timeline-nav .timeline-label{ order:-1; margin-right:6px; }
  .timeline-hero{ padding-left: 6vw; }
}

/* Mobile-friendly nav: docked pill bar at the bottom */
@media (max-width: 720px){
  .timeline-nav{
    position: fixed;
    bottom: 12px;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(5,6,8,0.92);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 8px 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    flex-direction: row;
    gap: 8px;
    z-index: 1030;
  }
  .timeline-nav .timeline-label{
    display:block;
    position:absolute;
    top:-32px;
    left:50%;
    transform:translateX(-50%);
    background: rgba(5,6,8,0.86);
    border:1px solid rgba(255,255,255,0.14);
    box-shadow:0 8px 18px rgba(0,0,0,0.35);
  }
  .timeline-nav .nav-dot{
    width: 12px; height: 12px;
  }
  .timeline-nav .nav-dot::after{
    display:none; /* hide tooltips on mobile */
  }
}

.era-sections{ scroll-snap-type: y mandatory; }
.era-panel{
  position:relative;
  min-height: 94vh;
  display:flex;
  align-items:center;
  overflow:hidden;
  scroll-snap-align: start;
  scroll-margin-top: 72px; /* navbar offset */
  color: var(--timeline-text);
  background-image:
    linear-gradient(rgba(5,6,8,0.65), rgba(5,6,8,0.40)),
    var(--era-image, none);
  background-size: cover;
  background-position: center;
}
.era-panel::before{
  content:'';
  position:absolute; inset:0;
  background: linear-gradient(120deg, rgba(5,6,8,0.84) 0%, rgba(5,6,8,0.25) 55%, rgba(5,6,8,0.86) 100%);
}
.era-panel .content-container{
  position:relative;
  z-index:1;
  width: min(1200px, 90vw);
  margin: 0 auto;
  padding: 40px 0 64px;
}
.era-header{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom: 26px; border-bottom:1px solid rgba(255,255,255,0.18); padding-bottom:14px; flex-wrap:wrap; }
.era-header h2{ font-family:'Playfair Display', serif; font-size: clamp(2rem, 3vw, 3rem); margin:0; line-height:1.05; color: var(--timeline-text); }
.era-header .eyebrow{ letter-spacing:0.2em; text-transform:uppercase; font-weight:700; font-size:0.78rem; color:var(--timeline-muted); margin:0 0 6px; }
.era-header .meta{ color: var(--timeline-muted); margin:4px 0 0; }
.era-actions{ display:flex; gap:10px; align-items:center; }
.enter-era-btn{ background:transparent; color:var(--timeline-accent); border:1px solid var(--timeline-accent); border-radius: 12px; padding:10px 14px; text-decoration:none; font-weight:700; transition: all .2s ease; }
.enter-era-btn:hover{ background:var(--timeline-accent); color:#111; }

.sampler-section{ margin-bottom: 18px; }
.section-heading{
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--timeline-muted);
  margin: 0 0 10px;
  font-weight: 700;
}
.sampler-grid{ display:grid; gap:16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); grid-auto-rows: minmax(160px, auto); }
@media (min-width: 960px){
  .sampler-grid{ grid-template-columns: repeat(4, 1fr); }
  .tile-span-2-col{ grid-column: span 2; }
  .tile-span-2-row{ grid-row: span 2; }
}

.timeline-card, .placeholder-card{
  position:relative;
  background: var(--timeline-surface);
  border:1px solid var(--timeline-border);
  border-radius: 14px;
  padding: 16px;
  text-decoration:none;
  color: inherit;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.28);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  display:flex; flex-direction:column; gap:8px;
}
.timeline-card:hover{ transform: translateY(-4px); border-color: var(--timeline-accent); box-shadow: 0 18px 40px rgba(0,0,0,0.32); }
.timeline-card:focus-visible,
.enter-era-btn:focus-visible,
.primary-cta:focus-visible{
  outline: 3px solid var(--timeline-accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(244,180,26,0.15);
}

.badge-pill{
  align-self:flex-start;
  background: rgba(255,255,255,0.14);
  color: var(--timeline-text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  border:1px solid var(--timeline-border);
  text-transform: uppercase;
  font-weight: 700;
}
.badge-episode{ background: var(--timeline-accent); color:#111; border:none; }
.pill-date{ background: rgba(37,99,235,0.18); border-color: rgba(37,99,235,0.35); color:#e7f0ff; }
.chip-series{ background: rgba(244,180,26,0.16); border-color: rgba(244,180,26,0.35); color:#fdf3cc; }

.timeline-card h3{ font-family:'Playfair Display', serif; margin:0; font-size:1.2rem; line-height:1.2; }
.timeline-card .card-meta{ color: var(--timeline-muted); font-size:0.9rem; }
.timeline-card .card-desc{ color: var(--timeline-text); opacity:0.88; margin:0; line-height:1.5; font-size:0.95rem; }

.placeholder-card{ border-style: dashed; border-color: rgba(255,255,255,0.35); color: var(--timeline-muted); background: rgba(255,255,255,0.05); }
.placeholder-card strong{ color: var(--timeline-text); }
.placeholder-card ul{ margin: 6px 0 0 18px; padding:0; }
.placeholder-card li{ margin:4px 0; }

.list-chips{ display:flex; gap:6px; flex-wrap:wrap; }
.list-chips .chip{ background: rgba(255,255,255,0.14); border-radius:10px; padding:6px 10px; font-size:0.8rem; }

/* Ensure footer doesn't overlap content on long panels */
@media (max-width: 720px){
  .timeline-hero{ padding-top: 72px; }
  .era-panel{ min-height: 86vh; }
}

/* High contrast overrides */

/* ------------------------------------------------------------------
   Parchment theme overrides (match site parchment pages)
-------------------------------------------------------------------*/
html[data-site-theme='parchment'] main.full-bleed{ background: var(--bg); }
html[data-site-theme='parchment'] .timeline-shell{ background: var(--bg); color: var(--text); }
html[data-site-theme='parchment'] .timeline-shell .meta{ color: var(--muted); }

html[data-site-theme='parchment'] .timeline-hero{
  background:
    radial-gradient(120% 120% at 10% 20%, rgba(183,149,11,0.18), transparent 52%),
    radial-gradient(120% 120% at 80% -10%, rgba(192,57,43,0.08), transparent 45%),
    linear-gradient(rgba(253,246,227,0.56), rgba(253,246,227,0.72)),
    var(--hero-image, url('../images/web/eras/banner.jpg'));
  background-size: cover;
  background-position: center;
  background-blend-mode: normal;
}
html[data-site-theme='parchment'] .timeline-hero::after{
  background: none;
}
html[data-site-theme='parchment'] .timeline-hero h1{ color: var(--text); }
html[data-site-theme='parchment'] .timeline-hero p.lead{ color: var(--text); opacity: 0.90; font-weight: 400; }

html[data-site-theme='parchment'] .timeline-nav .timeline-line{
  background: linear-gradient(180deg, transparent 0%, rgba(107,94,85,0.35) 20%, rgba(107,94,85,0.40) 80%, transparent 100%);
}
html[data-site-theme='parchment'] .timeline-nav .nav-dot{
  background: rgba(253,246,227,0.72);
  border-color: rgba(215,207,184,0.95);
}
html[data-site-theme='parchment'] .timeline-nav .nav-dot:hover,
html[data-site-theme='parchment'] .timeline-nav .nav-dot.active{
  background: rgba(183,149,11,0.18);
  border-color: rgba(183,149,11,0.85);
}
html[data-site-theme='parchment'] .timeline-nav .nav-dot::after{
  background: rgba(239,234,221,0.96);
  border-color: rgba(215,207,184,0.95);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(67,50,31,0.14);
}
html[data-site-theme='parchment'] .timeline-label{
  background: rgba(239,234,221,0.96);
  border-color: rgba(215,207,184,0.95);
  color: var(--text);
}

html[data-site-theme='parchment'] .era-panel{
  color: var(--text);
  background-image:
    linear-gradient(rgba(253,246,227,0.55), rgba(253,246,227,0.68)),
    var(--era-image, none);
}
html[data-site-theme='parchment'] .era-panel::before{
  background: linear-gradient(120deg, rgba(253,246,227,0.86) 0%, rgba(253,246,227,0.26) 55%, rgba(253,246,227,0.86) 100%);
}
html[data-site-theme='parchment'] .era-header{
  border-bottom-color: rgba(215,207,184,0.95);
}
html[data-site-theme='parchment'] .era-header h2{ color: var(--text); }
html[data-site-theme='parchment'] .section-heading{ color: var(--muted); }
html[data-site-theme='parchment'] .enter-era-btn{
  color: var(--timeline-accent);
  border-color: rgba(183,149,11,0.85);
}
html[data-site-theme='parchment'] .enter-era-btn:hover{
  background: rgba(183,149,11,0.14);
  color: var(--text);
}

html[data-site-theme='parchment'] .timeline-card,
html[data-site-theme='parchment'] .placeholder-card{
  background: rgba(239,234,221,0.95);
  border-color: rgba(215,207,184,0.95);
  box-shadow: 0 10px 26px rgba(67,50,31,0.12);
}
html[data-site-theme='parchment'] .timeline-card:hover{
  border-color: rgba(183,149,11,0.85);
  box-shadow: 0 14px 34px rgba(67,50,31,0.16);
}
html[data-site-theme='parchment'] .timeline-card .card-meta{ color: var(--muted); }
html[data-site-theme='parchment'] .timeline-card .card-desc{ color: var(--text); opacity: 0.90; }

@media (max-width: 992px){
  html[data-site-theme='parchment'] .timeline-nav{
    background: rgba(239,234,221,0.98);
    border-bottom: 1px solid rgba(215,207,184,0.95);
  }
}
@media (max-width: 720px){
  html[data-site-theme='parchment'] .timeline-nav{
    background: rgba(239,234,221,0.98);
    border-color: rgba(215,207,184,0.95);
    box-shadow: 0 10px 24px rgba(67,50,31,0.16);
  }
  html[data-site-theme='parchment'] .timeline-nav .timeline-label{
    background: rgba(239,234,221,0.98);
    border-color: rgba(215,207,184,0.95);
    box-shadow: 0 10px 24px rgba(67,50,31,0.18);
  }
}

html[data-theme='contrast'] .timeline-shell{
  background:#000;
  color:#fff;
}
html[data-theme='contrast'] .timeline-nav .nav-dot{
  background:#000;
  border-color:#fff;
}
html[data-theme='contrast'] .timeline-nav .nav-dot:hover,
html[data-theme='contrast'] .timeline-nav .nav-dot.active{
  background:#ffd700;
  border-color:#ffd700;
}
html[data-theme='contrast'] .timeline-nav .nav-dot::after,
html[data-theme='contrast'] .timeline-label{
  background:#000;
  border-color:#fff;
  color:#fff;
}
html[data-theme='contrast'] .timeline-hero{
  background: linear-gradient(#000,#000), var(--hero-image);
}
html[data-theme='contrast'] .timeline-card,
html[data-theme='contrast'] .placeholder-card{
  background:#000;
  border:2px solid #fff;
  color:#fff;
}
html[data-theme='contrast'] .badge-episode{
  background:#ffd700;
  color:#000;
}
html[data-theme='contrast'] .enter-era-btn,
html[data-theme='contrast'] .primary-cta{
  border:2px solid #ffd700;
  color:#ffd700;
  background:#000;
}
html[data-theme='contrast'] .primary-cta:hover,
html[data-theme='contrast'] .enter-era-btn:hover{
  color:#000;
  background:#ffd700;
}
