/* ============================================
   UYANIŞ — Book Reader Stylesheet
   Drop-in: <link rel="stylesheet" href="book-nav.css">
   Theme: warm cream (paper) + antique gold accent
   ============================================ */

/* --- Fonts (Google Fonts) --- */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* --- Color tokens --- */
:root {
  --bg:           #F5F1E8;   /* warm cream / parchment */
  --bg-panel:     #FAF7F0;   /* lighter panel */
  --bg-elevated:  #FFFFFF;   /* drawer */
  --ink:          #2B2520;   /* warm near-black body text */
  --ink-soft:     #6B5F50;   /* secondary text */
  --ink-muted:    #9C8E7C;   /* tertiary / meta */
  --gold:         #A67C3A;   /* deep antique gold */
  --gold-soft:    #D4B886;   /* light gold for backgrounds */
  --gold-bg:      #F4E9D2;   /* gold tint for active states */
  --line:         #E5DDC8;   /* hairline borders */
  --line-soft:    #EFE9D9;
  --shadow:       0 2px 12px rgba(60, 45, 25, 0.08);
  --shadow-lg:    0 8px 32px rgba(60, 45, 25, 0.12);

  --serif: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 19px;
  padding-top: 56px;
  padding-bottom: 76px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================
   STICKY TOP BAR
   ============================================ */
.book-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 12px;
  z-index: 100;
  font-family: var(--sans);
}
.book-menu-btn {
  background: none;
  border: none;
  color: var(--ink);
  width: 40px;
  height: 40px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.book-menu-btn:hover { background: var(--line-soft); }
.book-menu-btn svg { width: 22px; height: 22px; }

.book-topbar-title {
  flex: 1;
  margin-left: 8px;
  overflow: hidden;
}
.book-topbar-title .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-topbar-title .sub {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 1px;
}

/* "akose.org" home link (right side of topbar) */
.book-topbar-home {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-left: 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.book-topbar-home:hover {
  color: var(--gold);
  background: var(--gold-bg);
  border-color: var(--gold-soft);
}
.book-topbar-home svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .book-topbar-home .home-text { display: none; }
  .book-topbar-home {
    padding: 8px 10px;
    gap: 0;
  }
  .book-topbar-home svg { width: 14px; height: 14px; }
}

/* progress bar */
.book-progress {
  position: fixed;
  top: 56px; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  z-index: 99;
  transition: width 0.1s ease-out;
}

/* ============================================
   DRAWER (chapter list)
   ============================================ */
.book-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 37, 32, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 200;
  backdrop-filter: blur(2px);
}
.book-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.book-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 86%;
  max-width: 340px;
  background: var(--bg-elevated);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 201;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  font-family: var(--sans);
}
.book-drawer.open { transform: translateX(0); }

.book-drawer-header {
  padding: 24px 20px 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
}
.book-drawer-header .book-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.book-drawer-header .book-subtitle {
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.book-drawer-list { padding: 12px 0 32px; }

.book-drawer-section {
  padding: 18px 20px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
}
.book-drawer-section:first-child {
  border-top: none;
  margin-top: 0;
}

.book-drawer-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 20px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}
.book-drawer-list a .num {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
}
.book-drawer-list a:hover {
  background: var(--line-soft);
  color: var(--ink);
}
.book-drawer-list a.active {
  background: var(--gold-bg);
  color: var(--ink);
  font-weight: 500;
  border-left: 3px solid var(--gold);
  padding-left: 17px;
}
.book-drawer-list a.active .num { color: var(--gold); }

/* ============================================
   CONTENT
   ============================================ */
.book-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 22px 48px;
}

.book-content .chapter-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 12px;
}

.book-content h1 {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 8px;
}

.book-content .chapter-author {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.book-content h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin: 36px 0 14px;
  letter-spacing: -0.3px;
}
.book-content h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  margin: 28px 0 12px;
}

.book-content p {
  margin-bottom: 18px;
  color: var(--ink);
}
.book-content p strong,
.book-content p b {
  font-weight: 600;
  color: var(--ink);
}

.book-content blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--gold);
  color: var(--ink-soft);
  font-style: italic;
}

/* Poem-style blockquote (gecentreerd, geen rand, gouden lijntjes) */
.book-content blockquote.poem {
  border-left: none;
  padding: 24px 0;
  margin: 40px auto;
  max-width: 480px;
  text-align: center;
  font-style: italic;
  font-size: 19px;
  line-height: 1.8;
  color: var(--ink);
}
.book-content blockquote.poem::before,
.book-content blockquote.poem::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto;
}
.book-content blockquote.poem::before { margin-bottom: 24px; }
.book-content blockquote.poem::after  { margin-top: 24px; }

/* Signoff (datum / naam, rechts uitgelijnd) */
.book-content .signoff {
  text-align: right;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  font-style: normal;
  margin-top: 32px;
}

.book-content a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: var(--gold-soft);
  text-underline-offset: 3px;
}
.book-content a:hover { text-decoration-color: var(--gold); }

.book-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 24px 0;
}

/* drop cap voor de eerste paragraaf - subtiele soefi-touch */
.book-content > p:first-of-type::first-letter {
  font-size: 56px;
  font-weight: 600;
  float: left;
  line-height: 0.9;
  margin: 6px 8px 0 0;
  color: var(--gold);
}

/* ============================================
   BOTTOM NAV — "leren boekomslag" stijl:
   donker warm bruin + cream tekst + gouden accent
   ============================================ */
.book-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 68px;
  background: var(--ink);              /* deep warm brown */
  border-top: 2px solid var(--gold);   /* gold ribbon on top edge */
  display: flex;
  z-index: 100;
  font-family: var(--sans);
  box-shadow: 0 -4px 16px rgba(43, 37, 32, 0.18);
}
.book-bottom-nav a,
.book-bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #F5F1E8;                      /* cream text on dark */
  font-family: inherit;
  font-size: 13px;
  padding: 8px 4px;
  transition: background 0.15s;
}
.book-bottom-nav a:active,
.book-bottom-nav button:active {
  background: rgba(212, 184, 134, 0.12);  /* subtle gold tint on tap */
}
.book-bottom-nav a:hover,
.book-bottom-nav button:hover {
  background: rgba(212, 184, 134, 0.08);
}
.book-bottom-nav a.disabled {
  opacity: 0.32;
  pointer-events: none;
}
.book-bottom-nav .label {
  font-size: 10px;
  color: var(--gold-soft);             /* gold uppercase label */
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 3px;
}
.book-bottom-nav .ch-title {
  font-size: 13px;
  color: #F5F1E8;                      /* cream chapter title */
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
}
.book-bottom-nav .toc-icon {
  width: 22px; height: 22px;
  color: var(--gold-soft);             /* gold table-of-contents icon */
}
.book-bottom-nav .divider {
  width: 1px;
  background: rgba(212, 184, 134, 0.25); /* faint gold divider */
  margin: 14px 0;
}

/* ============================================
   DESKTOP — drawer wordt zijbalk
   ============================================ */
@media (min-width: 980px) {
  body {
    padding-left: 300px;
    padding-bottom: 0;
  }
  .book-drawer {
    transform: translateX(0);
    width: 300px;
    max-width: 300px;
    box-shadow: none;
    border-right: 1px solid var(--line);
  }
  .book-drawer-overlay { display: none; }
  .book-menu-btn { display: none; }
  .book-topbar { left: 300px; }
  .book-progress { left: 300px; }

  /* Bottom-nav komt onder de inhoud te staan als chapter-footer */
  .book-bottom-nav {
    position: static;            /* in de flow, niet fixed */
    height: auto;
    /* geen left/right meer - body-padding regelt dat */
  }
  /* Op desktop is de drawer altijd zichtbaar, dus de İçindekiler-knop
     in het midden van de bottom-nav is overbodig. Verberg hem. */
  .book-bottom-nav .toc-btn-mid,
  .book-bottom-nav .toc-divider {
    display: none;
  }

  .book-content {
    padding: 56px 48px 64px;
    max-width: 760px;            /* breder voor desktop-leeskolom */
  }
  .book-content h1 { font-size: 44px; }
}

/* tablet tussenformaat */
@media (min-width: 700px) and (max-width: 979px) {
  .book-content {
    padding: 40px 32px 48px;
    max-width: 720px;
  }
  .book-content h1 { font-size: 42px; }
}
