/* ═══════════════════════════════════════════════════════════
   NAV SYSTEM — Jailbirds In Flight
   Option 5: Book title centered, chapter trigger → dropdown,
   prev / next arrows flanking.
   ═══════════════════════════════════════════════════════════ */

/* Push all page content below the fixed nav */
body {
  padding-top: 72px;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Prev / Next ─────────────────────────────────────────── */
.nav-prev,
.nav-next {
  flex: 1;
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: clamp(0.75rem, 1.1vw, 0.9rem);
  letter-spacing: 0.1em;
}

.nav-next {
  text-align: right;
}

/* All nav links — override browser defaults */
nav a,
nav a:link,
nav a:visited {
  color: rgba(255, 255, 255, 0.45) !important;
  text-decoration: none !important;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #fff !important;
  text-decoration: none !important;
}

/* ── Center block ────────────────────────────────────────── */
.nav-center {
  flex: 1;
  text-align: center;
  position: relative;
}

.nav-book-title {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  letter-spacing: 0.14em;
  color: #fff;
  line-height: 1;
}

.nav-chapter-trigger {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(0.65rem, 0.95vw, 0.8rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.3s ease;
  user-select: none;
}

.nav-chapter-trigger:hover {
  color: rgba(255, 255, 255, 0.75);
}

.nav-chapter-trigger .arrow {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 0.7em;
}

.nav-chapter-trigger.open .arrow {
  transform: rotate(180deg);
}

/* ── Dropdown ────────────────────────────────────────────── */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0;
  min-width: 340px;
  z-index: 2000;
  max-height: 70vh;
  overflow-y: auto;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.nav-dropdown::-webkit-scrollbar {
  width: 4px;
}

.nav-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.nav-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.nav-dropdown.open {
  display: block;
}

.nav-dropdown a,
.nav-dropdown a:link,
.nav-dropdown a:visited {
  display: block !important;
  padding: 8px 24px !important;
  font-family: "Cormorant Garamond", serif !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.1em !important;
  color: rgba(255, 255, 255, 0.4) !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-dropdown a:hover {
  color: rgba(255, 255, 255, 0.9) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

.nav-dropdown a.active,
.nav-dropdown a.active:visited {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Smooth scroll anchor links don't jump behind nav */
html {
  scroll-padding-top: 80px;
}

/* ── Section sizing — fit sections to visible area below nav ── */
/* Each section is exactly viewport minus nav height, so nothing hides behind the nav */

.chapter-header {
  height: calc(100vh - 72px) !important;
  min-height: calc(100vh - 72px) !important;
}

.image-section,
.video-bg-section {
  min-height: calc(100vh - 72px) !important;
}

.image-section img,
.image-section video,
.video-bg-section img,
.video-bg-section video,
.image-section .image-overlay,
.video-bg-section .image-overlay {
  min-height: calc(100vh - 72px) !important;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav {
    padding: 14px 20px;
    gap: 12px;
  }

  .nav-dropdown {
    min-width: 280px;
  }

  .nav-dropdown a,
  .nav-dropdown a:link,
  .nav-dropdown a:visited {
    white-space: normal !important;
  }
}
