/* ═══════════════════════════════════════════════════════════════════════════
   NT Study Guide — Minimalist Academic Theme
   Palette: Parchment off-white · Charcoal text · Soft gold accents
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Fonts (loaded in HTML) ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Lato:wght@300;400;700&display=swap');

/* ── CSS Custom Properties ───────────────────────────────────────────────── */
:root {
  /* Palette */
  --color-parchment:    #F8F4EC;
  --color-parchment-dk: #F0EAD6;
  --color-parchment-md: #EDE5CE;
  --color-paper:        #FDFAF4;
  --color-charcoal:     #2C2C2C;
  --color-charcoal-md:  #4A4A4A;
  --color-charcoal-lt:  #6B6B6B;
  --color-gold:         #B8960C;
  --color-gold-dk:      #9a7200;
  --color-gold-lt:      #fdf6e0;
  --color-gold-md:      #D4AF37;
  --color-gold-bg:      #FFF8DC;
  --color-gold-hl:      #FFF176;
  --color-ink:          #1A1A2E;
  --color-muted:        #8A8070;
  --color-border:       #DDD5C0;
  --color-border-lt:    #EDE7D9;
  --color-white:        #FFFFFF;
  --color-error:        #C0392B;
  --color-success:      #27AE60;

  /* Highlight colors */
  --hl-yellow:  #FFF176;
  --hl-green:   #C8E6C9;
  --hl-blue:    #BBDEFB;
  --hl-pink:    #F8BBD9;
  --hl-orange:  #FFE0B2;

  /* Typography */
  --font-serif:  'EB Garamond', 'Garamond', 'Georgia', serif;
  --font-sans:   'Lato', 'Helvetica Neue', Arial, sans-serif;

  /* Sizing */
  --sidebar-w:   280px;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.12);
  --transition:  all 0.2s ease;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  background-color: var(--color-parchment);
  color: var(--color-charcoal);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--color-gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-gold-lt); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1.3;
}

p { margin-bottom: 0.75rem; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-parchment-dk); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--color-ink);
  color: var(--color-parchment);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--color-gold);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--color-ink);
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-logo h1 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-parchment);
  letter-spacing: 0.02em;
}

.sidebar-tagline {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--color-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Sidebar nav links */
.sidebar-nav {
  padding: 1rem 0;
  flex-shrink: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: rgba(248,244,236,0.7);
  letter-spacing: 0.02em;
  transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--color-parchment);
  background: rgba(255,255,255,0.06);
}

.sidebar-nav a.active {
  border-left: 3px solid var(--color-gold);
  padding-left: calc(1.25rem - 3px);
  color: var(--color-gold-lt);
}

.sidebar-nav .nav-icon { font-size: 0.95rem; width: 18px; text-align: center; }

/* Books list in sidebar */
.sidebar-section-title {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 0.75rem 1.25rem 0.4rem;
}

.sidebar-books {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 1rem;
