/* ==========================================================================
   Hope for the Left Behind — Gallery Minimalist Video UI
   Inspired by Apple TV+, MUBI & The Criterion Channel
   Generous Whitespace · Borderless Floating Media · Whisper-Quiet Chrome
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0c0d11;
  --bg-elevated: #14161d;
  --bg-hover: #1c1f29;
  --ink: #f4f2ed;
  --ink-2: #a0a6b3;
  --ink-3: #6c7280;
  --line: rgba(244, 242, 237, 0.09);
  --accent: #e2b262;
  --accent-soft: rgba(226, 178, 98, 0.14);
  --header-bg: rgba(12, 13, 17, 0.84);

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --gutter: clamp(20px, 4.5vw, 64px);
  --header-h: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f5f0;
  --bg-elevated: #ffffff;
  --bg-hover: #ede9e0;
  --ink: #14151a;
  --ink-2: #585e6c;
  --ink-3: #838997;
  --line: rgba(20, 21, 26, 0.09);
  --accent: #a8711c;
  --accent-soft: rgba(168, 113, 28, 0.1);
  --header-bg: rgba(247, 245, 240, 0.88);
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ==========================================================================
   Whisper-Quiet Header
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: linear-gradient(to bottom, rgba(12, 13, 17, 0.72), transparent);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--line);
}

[data-theme="light"] .site-header:not(.is-solid) { color: #f4f2ed; }

.header-inner {
  height: 100%;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.wordmark {
  justify-self: start;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--serif);
  font-size: 1.38rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-item {
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0.68;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.nav-item:hover, .nav-item.is-active { opacity: 1; }
.nav-item.is-active { font-weight: 600; }

.nav-dot-count {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.header-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-trigger {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  opacity: 0.78;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}
.icon-trigger svg { width: 18px; height: 18px; }
.icon-trigger:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }
[data-theme="light"] .site-header.is-solid .icon-trigger:hover { background: rgba(20, 21, 26, 0.06); }

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ==========================================================================
   Serene Full-Bleed Cinema Hero (Single Focal Column — Zero Competing Boxes)
   ========================================================================== */
.hero {
  position: relative;
  min-height: min(68vh, 620px);
  padding: calc(var(--header-h) + 80px) var(--gutter) 68px;
  display: flex;
  align-items: flex-end;
  color: #f4f2ed;
  overflow: hidden;
  background: #0c0d11;
}

.hero-media {
  position: absolute;
  inset: 0;
  background: url("assets/banner.jpg") center 28% / cover no-repeat;
  filter: brightness(0.48) saturate(0.8);
  transform: scale(1.03);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 20%, rgba(226, 178, 98, 0.16) 0%, transparent 48%),
    linear-gradient(90deg, rgba(12, 13, 17, 0.92) 0%, rgba(12, 13, 17, 0.52) 55%, rgba(12, 13, 17, 0.25) 100%),
    linear-gradient(to top, var(--bg) 0%, rgba(12, 13, 17, 0.45) 32%, transparent 65%);
}
[data-theme="light"] .hero-scrim {
  background:
    radial-gradient(circle at 75% 20%, rgba(226, 178, 98, 0.16) 0%, transparent 48%),
    linear-gradient(90deg, rgba(12, 13, 17, 0.9) 0%, rgba(12, 13, 17, 0.55) 55%, rgba(12, 13, 17, 0.28) 100%),
    linear-gradient(to top, rgba(12, 13, 17, 0.88) 0%, rgba(12, 13, 17, 0.35) 32%, transparent 65%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.hero-kicker, .kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.hero-kicker { color: #e6be78; }

.hero-heading {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5.2vw, 4.6rem);
  font-weight: 600;
  line-height: 1.01;
  letter-spacing: -0.025em;
  color: #faf8f4;
}

.hero-copy {
  margin: 16px 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(244, 242, 237, 0.76);
  max-width: 48ch;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 26px;
  border-radius: 9999px;
  border: none;
  background: #f4f2ed;
  color: #0c0d11;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.2s var(--ease), background-color 0.2s ease;
}
.btn-primary svg { width: 15px; height: 15px; }
.btn-primary:hover { background: #e2b262; transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 24px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  color: #f4f2ed;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.42); }
[data-theme="light"] .page-shell .btn-secondary {
  border-color: var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
}

/* ==========================================================================
   Spacious Curated Shelves (56px-64px Breathing Room, Edge Peeking)
   ========================================================================== */
.shelves {
  padding: 44px 0 96px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.shelf-head {
  padding: 0 var(--gutter);
  margin-bottom: 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.shelf-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.shelf-more {
  border: none;
  background: transparent;
  padding: 4px 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s ease;
}
.shelf-more:hover { color: var(--accent); }

.shelf-viewport { position: relative; }

.shelf-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px var(--gutter) 16px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  touch-action: manipulation;
  scrollbar-width: none;
}
.shelf-track::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .shelf-track { scroll-behavior: smooth; }
}

.shelf-arrow {
  position: absolute;
  top: 8px;
  bottom: 48px;
  width: 54px;
  z-index: 10;
  border: none;
  display: grid;
  place-items: center;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.2s ease;
  touch-action: manipulation;
}
.shelf-viewport:hover .shelf-arrow,
.shelf-arrow:focus-visible { opacity: 1; }
.shelf-arrow[disabled] { opacity: 0 !important; pointer-events: none; }
.shelf-arrow-prev { left: 0; background: linear-gradient(to right, var(--bg) 15%, transparent); }
.shelf-arrow-next { right: 0; background: linear-gradient(to left, var(--bg) 15%, transparent); }
.shelf-arrow svg { width: 22px; height: 22px; }

/* ==========================================================================
   Minimalist Borderless Video Tiles (Apple TV+ / MUBI Craft)
   ========================================================================== */
.media-tile {
  flex: 0 0 300px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.media-frame {
  position: relative;
  border: none;
  padding: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevated);
  text-align: left;
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease);
}
.media-tile:hover .media-frame {
  transform: scale(1.035);
  box-shadow: 0 20px 44px -14px rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .media-tile:hover .media-frame {
  box-shadow: 0 18px 38px -14px rgba(20, 21, 26, 0.22);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Serene Gallery Artwork for Audio-Only / Self-Hosted Covers */
.art-cover {
  width: 100%;
  height: 100%;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f4f2ed;
  background:
    radial-gradient(circle at 85% 15%, rgba(226, 178, 98, 0.2) 0%, transparent 52%),
    linear-gradient(155deg, #171d2e 0%, #0f121b 100%);
}
.art-cover.tone-visions {
  background:
    radial-gradient(circle at 80% 20%, rgba(226, 178, 98, 0.22) 0%, transparent 50%),
    linear-gradient(155deg, #1b192d 0%, #10111a 100%);
}
.art-cover.tone-prophecy {
  background:
    radial-gradient(circle at 82% 18%, rgba(212, 138, 78, 0.22) 0%, transparent 50%),
    linear-gradient(155deg, #211921 0%, #111118 100%);
}

.art-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: rgba(230, 190, 120, 0.82);
}

.art-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.08;
  color: #faf8f4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.art-sub {
  font-size: 0.78rem;
  color: rgba(244, 242, 237, 0.62);
}

/* Hover-Only Subtle Controls */
.frame-hover-play {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 17, 0.28);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.media-tile:hover .frame-hover-play { opacity: 1; }

.play-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(244, 242, 237, 0.94);
  color: #0c0d11;
  display: grid;
  place-items: center;
}
.play-circle svg { width: 16px; height: 16px; margin-left: 2px; }

.frame-save-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(12, 13, 17, 0.72);
  color: #f4f2ed;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}
.media-tile:hover .frame-save-btn,
.frame-save-btn.is-saved { opacity: 1; }
.frame-save-btn svg { width: 14px; height: 14px; }
.frame-save-btn.is-saved { background: var(--accent); color: #0c0d11; }
.frame-save-btn.is-saved svg { fill: currentColor; }

/* Razor-thin bottom edge watched indicator (Apple TV+ pattern) */
.watched-edge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
}

.tile-caption {
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tile-title {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-title:hover { color: var(--accent); }
.tile-meta {
  font-size: 0.78rem;
  color: var(--ink-3);
}
.ready-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3bc27d;
  margin-right: 6px;
  vertical-align: middle;
}

/* ==========================================================================
   Minimal Gallery Bible Book Posters (Clean 3:4 Proportions, Zero Clutter)
   ========================================================================== */
.book-card {
  flex: 0 0 176px;
  scroll-snap-align: start;
  position: relative;
  border: none;
  border-radius: 12px;
  padding: 20px 18px 18px;
  aspect-ratio: 3 / 4;
  text-align: left;
  color: #f4f2ed;
  background:
    radial-gradient(circle at 82% 14%, rgba(226, 178, 98, 0.17) 0%, transparent 52%),
    linear-gradient(160deg, #161b29 0%, #10121a 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease);
}
.book-card:hover {
  transform: scale(1.04);
  box-shadow: 0 20px 44px -14px rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .book-card:hover {
  box-shadow: 0 18px 36px -14px rgba(20, 21, 26, 0.25);
}

.book-num {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(230, 190, 120, 0.78);
}

.book-name {
  margin: auto 0;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.05;
  color: #faf8f4;
}

.book-count {
  font-size: 0.76rem;
  color: rgba(244, 242, 237, 0.56);
}

.book-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
}

/* ==========================================================================
   Sub-Pages: Bible Library & Collections
   ========================================================================== */
.page-shell {
  padding: calc(var(--header-h) + 52px) var(--gutter) 96px;
  max-width: 1480px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.page-title {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 3.6vw, 3.2rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.tabs-inline {
  display: flex;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid var(--line);
}
.tabs-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 28px;
}
.tabs-scroll::-webkit-scrollbar { display: none; }

.tab-underline {
  border: none;
  background: transparent;
  padding: 10px 0 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  position: relative;
  transition: color 0.2s ease;
}
.tab-underline:hover, .tab-underline.is-active { color: var(--ink); }
.tab-underline.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.divisions-stack {
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.division-label {
  margin: 0 0 18px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-3);
}
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}
.books-grid .book-card { flex: none; width: 100%; }

/* Collections Progressive Filter Drawer */
.collections-head-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.muted-count { font-size: 0.84rem; color: var(--ink-3); }

.btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.btn-quiet svg { width: 15px; height: 15px; }
.btn-quiet:hover, .btn-quiet[aria-expanded="true"] { border-color: var(--accent); color: var(--ink); }

.filter-drawer {
  padding: 18px 20px;
  margin-bottom: 28px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.filter-drawer-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.drawer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.drawer-field select {
  height: 38px;
  padding: 0 28px 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.84rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.text-action {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 600;
  padding: 8px 4px;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.topic-pill {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.77rem;
  font-weight: 500;
}
.topic-pill:hover { color: var(--ink); border-color: var(--accent); }
.topic-pill.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px 20px;
}
.gallery-grid .media-tile { flex: none; width: 100%; }

.book-divider-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-top: 12px;
  border-bottom: 1px solid var(--line);
}
.book-divider-row h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
}

.empty-view { text-align: center; padding: 72px 20px; color: var(--ink-2); }
.more-wrap { margin-top: 44px; text-align: center; }

/* ==========================================================================
   Minimal Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px var(--gutter) 38px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--ink-3);
}
.footer-brand { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--ink-2); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.footer-links a, .footer-langs a {
  color: var(--ink-3);
  transition: color 0.18s ease;
}
.footer-links a:hover, .footer-langs a:hover { color: var(--accent); }
.footer-langs {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.78rem;
  color: var(--ink-3);
}

/* ==========================================================================
   Native <dialog> Modals (Search, Bible Chapters, Self-Hosted Player)
   ========================================================================== */
dialog.modal {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: #12141b;
  color: #f4f2ed;
  width: min(920px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.75);
  overscroll-behavior: contain;
}
dialog.modal::backdrop {
  background: rgba(6, 7, 10, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.close-x {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f2ed;
  font-size: 1.3rem;
  line-height: 1;
  display: grid;
  place-items: center;
}
.close-x:hover { background: rgba(255, 255, 255, 0.16); }

/* Search Dialog */
.search-modal { width: min(680px, calc(100vw - 32px)); margin-top: 10vh; }
.search-modal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.search-modal-bar svg { width: 18px; height: 18px; opacity: 0.6; flex-shrink: 0; }
.search-modal-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: #f4f2ed;
  outline: none;
}
.search-results {
  padding: 10px 12px 16px;
  max-height: 55vh;
  overflow-y: auto;
}
.search-hit {
  width: 100%;
  border: none;
  background: transparent;
  padding: 11px 12px;
  border-radius: 10px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.search-hit:hover { background: rgba(255, 255, 255, 0.06); }
.search-hit-title { font-size: 0.92rem; font-weight: 500; color: #f4f2ed; }
.search-hit-meta { font-size: 0.76rem; color: rgba(244, 242, 237, 0.55); white-space: nowrap; }

/* Book Chapters Dialog */
.book-modal-head {
  padding: 26px 28px 24px;
  background: radial-gradient(circle at 85% 15%, rgba(226, 178, 98, 0.18), transparent 50%), #151822;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.book-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.book-modal-controls { display: flex; align-items: center; gap: 10px; }
.book-modal-controls select {
  height: 34px;
  padding: 0 26px 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 13, 17, 0.7);
  color: #f4f2ed;
  font-size: 0.82rem;
}
.book-modal-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.book-modal-title { margin: 0; font-family: var(--serif); font-size: 2.5rem; font-weight: 600; line-height: 1.02; }
.book-modal-sub { margin: 6px 0 0; font-size: 0.86rem; color: rgba(244, 242, 237, 0.64); }

.book-modal-body { padding: 18px 28px 28px; }
.chapter-list { display: flex; flex-direction: column; }

.chapter-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 10px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  text-align: left;
  border-radius: 8px;
  transition: background-color 0.18s ease;
}
.chapter-row:hover { background: rgba(255, 255, 255, 0.05); }
.ch-num { font-size: 0.84rem; color: rgba(244, 242, 237, 0.45); font-variant-numeric: tabular-nums; }
.ch-title { font-size: 0.94rem; font-weight: 500; color: #f4f2ed; }
.ch-sub { font-size: 0.78rem; color: rgba(244, 242, 237, 0.56); margin-top: 2px; }
.ch-dur { font-size: 0.8rem; color: rgba(244, 242, 237, 0.56); font-variant-numeric: tabular-nums; white-space: nowrap; }

.related-block { margin-top: 28px; }
.related-heading { margin: 0 0 10px; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: rgba(244, 242, 237, 0.82); }

/* Self-Hosted Cinema Player Dialog */
.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.player-kicker { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #e2b262; }
.player-bar-right { display: flex; align-items: center; gap: 8px; }
.step-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #f4f2ed;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
}
.step-btn:hover:not(:disabled) { border-color: #e2b262; }
.step-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #06070a;
}
.player-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #06070a;
}
.queued-panel {
  position: absolute;
  inset: 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(226, 178, 98, 0.14), transparent 55%), #0c0d12;
}
.queued-panel h2 { margin: 0; font-family: var(--serif); font-size: 1.75rem; font-weight: 600; }
.queued-panel p { margin: 10px auto 0; max-width: 44ch; font-size: 0.9rem; color: rgba(244, 242, 237, 0.68); }

.player-info { padding: 20px 24px 26px; }
.player-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.player-title { margin: 0; font-family: var(--serif); font-size: 1.65rem; font-weight: 600; line-height: 1.18; }
.player-meta { margin: 4px 0 0; font-size: 0.82rem; color: rgba(244, 242, 237, 0.58); }

.player-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.speed-pills {
  display: inline-flex;
  padding: 2px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.speed-opt {
  border: none;
  background: transparent;
  color: rgba(244, 242, 237, 0.7);
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 0.74rem;
}
.speed-opt.is-active { background: #e2b262; color: #0c0d11; font-weight: 700; }

.ctrl-pill {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #f4f2ed;
  font-size: 0.78rem;
  font-weight: 600;
}
.ctrl-pill:hover { border-color: #e2b262; }
.ctrl-pill.is-active, .ctrl-pill-gold {
  background: #e2b262;
  border-color: #e2b262;
  color: #0c0d11;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 10px 18px;
  border-radius: 9999px;
  background: #181b24;
  color: #f4f2ed;
  border: 1px solid rgba(226, 178, 98, 0.45);
  font-size: 0.84rem;
  font-weight: 500;
}

/* ==========================================================================
   Multi-Library Hub & Full-Bleed Cinema Hero (Apple TV+ / A24 Craft)
   ========================================================================== */
.hub-hero {
  position: relative;
  min-height: min(78vh, 720px);
  padding: calc(var(--header-h) + 72px) 0 76px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #f4f2ed;
  background: #0c0d11;
}

.hub-hero-media {
  position: absolute;
  inset: 0;
  background: url("assets/hub-hero.jpg") center 42% / cover no-repeat;
  transform: scale(1.015);
  filter: saturate(1.05) contrast(1.04);
}

/* Preserve the vivid golden dawn rays on the right while giving crisp dark legibility on the left & seamless bottom melt */
.hub-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(12, 13, 17, 0.56) 0%, transparent 24%),
    linear-gradient(90deg, rgba(10, 12, 18, 0.88) 0%, rgba(10, 12, 18, 0.52) 44%, rgba(10, 12, 18, 0.12) 78%, rgba(10, 12, 18, 0.05) 100%),
    linear-gradient(to top, var(--bg) 0%, rgba(12, 13, 17, 0.62) 22%, transparent 56%);
}
[data-theme="light"] .hub-hero-scrim {
  background:
    linear-gradient(to bottom, rgba(10, 12, 18, 0.58) 0%, transparent 24%),
    linear-gradient(90deg, rgba(10, 12, 18, 0.86) 0%, rgba(10, 12, 18, 0.48) 46%, rgba(10, 12, 18, 0.08) 80%),
    linear-gradient(to top, rgba(10, 12, 18, 0.88) 0%, rgba(10, 12, 18, 0.32) 26%, transparent 58%);
}

.hub-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hub-hero-copy-block {
  max-width: 580px;
}

.hub-shell {
  padding: 0 var(--gutter);
  max-width: 1420px;
  margin: 0 auto;
}

.hub-title {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 5.8vw, 5.15rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.028em;
  color: #faf8f4;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}

.hub-title-italic {
  font-style: italic;
  font-weight: 500;
  color: #f0cb83;
}

.hub-copy {
  margin: 18px 0 0;
  max-width: 48ch;
  font-size: 1.03rem;
  line-height: 1.62;
  color: rgba(244, 242, 237, 0.82);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hub-whisper {
  margin: 26px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244, 242, 237, 0.58);
}

.hub-section {
  padding: 36px 0 28px;
}

.hub-section-title {
  margin-bottom: 22px;
}

.libraries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.library-card {
  position: relative;
  border: none;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease);
}
.library-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .library-card {
  border: 1px solid var(--line);
}
[data-theme="light"] .library-card:hover {
  box-shadow: 0 20px 40px -14px rgba(20, 21, 26, 0.16);
}

.library-card-banner {
  position: relative;
  height: 156px;
  background-size: cover;
  background-position: center;
  background-color: #161b28;
}
.library-card-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 13, 17, 0.92) 0%, rgba(12, 13, 17, 0.2) 60%, transparent 100%);
}

.library-card-body {
  padding: 0 24px 24px;
  margin-top: -42px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-card-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-elevated);
  background: #1a1f2e;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.library-card-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.95rem;
  font-weight: 600;
  line-height: 1.05;
  color: var(--ink);
}
.library-card-sub {
  margin: 3px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}
.library-card-bio {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.library-card-yt {
  margin: -4px 0 0;
  font-size: 0.78rem;
  color: var(--ink-3);
  font-weight: 500;
}
.speaker-bio-stats { color: rgba(244, 242, 237, 0.56); }
.speaker-yt-line {
  display: block;
  margin-top: 8px;
  font-size: 0.84rem;
  color: rgba(244, 242, 237, 0.64);
}
.speaker-yt-line a {
  color: #e6be78;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.library-card-foot {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--ink-3);
}
.library-card-enter {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.library-card:hover .library-card-enter { color: var(--accent); }

.hub-shelves { padding-top: 32px; }

/* Speaker Library View Header */
.speaker-hero { min-height: min(56vh, 510px); padding-bottom: 52px; }
.speaker-hero-content { max-width: 680px; }

.back-crumb {
  border: none;
  background: transparent;
  padding: 0 0 18px;
  font-size: 0.84rem;
  font-weight: 500;
  color: rgba(244, 242, 237, 0.72);
  display: inline-block;
  transition: color 0.2s ease;
}
.back-crumb:hover { color: #e2b262; }
.back-crumb-dark { color: var(--ink-2); }

.speaker-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}
.speaker-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(226, 178, 98, 0.55);
  flex-shrink: 0;
}
.speaker-heading { margin-top: 4px; font-size: clamp(2.4rem, 4.4vw, 3.8rem); }

.library-subnav {
  padding: 18px var(--gutter) 0;
}
.sub-shell {
  padding-top: 38px;
}

@media (max-width: 780px) {
  .libraries-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .header-inner { grid-template-columns: auto 1fr auto; }
  .nav-center { gap: 16px; justify-content: center; }
  .wordmark { font-size: 1.12rem; }
  .media-tile { flex: 0 0 250px; }
  .book-card { flex: 0 0 148px; }
  .book-modal-head, .book-modal-body { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 560px) {
  .wordmark { display: none; }
}
