/* ============================================================
   AydrA web book - DARK theme, metal aesthetic
   ============================================================ */
:root {
  --bg: #0e0e10;
  --bg-soft: #16161a;
  --bg-card: #1a1a1d;
  --panel: #08080a;
  --ink: #e8e3d8;
  --ink-soft: #b8b5ad;
  --gold: #d4a868;
  --gold-bright: #e8c082;
  --red: #c84040;
  --dark-red: #b03030;
  --muted: #888;
  --line: #2a2a2e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== SIDEBAR (darker than content) ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 300px;
  background: var(--panel);
  color: var(--ink-soft);
  overflow-y: auto;
  padding: 20px 14px 30px;
  border-right: 2px solid var(--gold);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  z-index: 1000;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #2a2a30; border-radius: 4px; }
.logo a { color: #fff; text-decoration: none; display: block; padding: 8px 10px 16px; border-bottom: 1px solid #1f1f23; margin-bottom: 16px; }
.logo span { display: block; font-size: 30px; font-weight: bold; letter-spacing: 3px; font-family: Georgia, serif; color: var(--gold); }
.logo small { display: block; font-size: 11px; color: #777; margin-top: 4px; letter-spacing: 1px; }
.nav-search { padding: 0 6px 14px; }
.nav-search input {
  width: 100%; padding: 8px 12px;
  background: #050507; border: 1px solid #2a2a2e; color: #ccc;
  border-radius: 4px; font-size: 13px; font-family: inherit;
}
.nav-search input:focus { outline: 1px solid var(--gold); border-color: var(--gold); }
.sidebar-nav details { margin-bottom: 4px; }
.sidebar-nav summary {
  list-style: none; padding: 8px 10px; border-radius: 4px;
  cursor: pointer; color: var(--gold); font-size: 13px;
  font-weight: 500;
}
.sidebar-nav summary::-webkit-details-marker { display: none; }
.sidebar-nav summary::before { content: '▸'; display: inline-block; margin-right: 8px; transition: transform 0.15s; color: #666; font-size: 11px; }
.sidebar-nav details[open] > summary::before { transform: rotate(90deg); }
.sidebar-nav summary:hover { background: #181820; }
.sidebar-nav summary a { color: inherit; text-decoration: none; }
.sidebar-nav summary strong { color: var(--gold); }
.sidebar-nav ul { list-style: none; padding: 0 0 6px 26px; }
.sidebar-nav li a {
  display: block; padding: 5px 10px; color: #aaa; text-decoration: none;
  font-size: 12.5px; border-radius: 3px; margin: 1px 0;
  line-height: 1.4;
}
.sidebar-nav li a:hover { background: #181820; color: #fff; }
.sidebar-nav li a.active { background: var(--dark-red); color: #fff; }
.sidebar-nav li a[data-pg]::after {
  content: attr(data-pg); float: right; font-size: 10px;
  color: #555; font-family: monospace; padding-top: 2px;
}

.menu-toggle {
  position: fixed; top: 12px; left: 12px; z-index: 1100;
  background: var(--panel); border: 1px solid var(--gold);
  color: var(--gold); font-size: 22px; padding: 6px 12px;
  cursor: pointer; border-radius: 4px; display: none;
  line-height: 1;
}

/* ===== CONTENT AREA (dark) ===== */
.content-wrap {
  margin-left: 300px;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.book-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 50px 100px;
}

/* ===== SECTION (uniforme, semplice) ===== */
.section {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
.section:last-child { border-bottom: 0; }
.section > * { margin-bottom: 18px; }
.section > *:last-child { margin-bottom: 0; }

/* ===== OPENER PART (hero scuro con gold) ===== */
.section.opener {
  text-align: center;
  padding: 80px 30px;
  margin: 60px 0;
  background: linear-gradient(135deg, #18181c 0%, #0a0a0c 100%);
  border: 0;
  border-top: 4px solid var(--gold);
  border-bottom: 4px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.section.opener .part-header { margin: 0; }
.section.opener .part-tag {
  display: block;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 18px;
  letter-spacing: 8px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section.opener h1 {
  color: var(--gold-bright);
  font-size: 44px;
  margin: 16px 0;
  font-weight: bold;
  line-height: 1.1;
  letter-spacing: 1px;
  border: 0;
  padding: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.section.opener .lead {
  font-size: 17px;
  color: var(--ink-soft);
  font-style: italic;
  max-width: 500px;
  margin: 20px auto 0;
  border: 0;
  padding: 0;
}

/* ===== TYPOGRAPHY (centered) ===== */
.section {
  text-align: center;
}
.section h2 {
  font-size: 28px;
  color: var(--gold);
  font-weight: bold;
  line-height: 1.25;
  margin: 28px auto 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--dark-red);
  letter-spacing: 0.5px;
  display: inline-block;
  text-align: center;
  max-width: 90%;
}
.section h2-wrap { text-align: center; }
.section:first-of-type h2 { margin-top: 0; }
.section h3 { font-size: 22px; color: var(--gold); margin: 24px 0 12px; font-weight: bold; text-align: center; }
.section h4 { font-size: 17px; color: var(--gold); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: 1px; text-align: center; }

.section p {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink);
  margin: 0 0 16px;
  text-align: center;
}
.section p.lead {
  font-size: 18px;
  font-style: italic;
  color: var(--ink-soft);
  margin: 16px auto 24px;
  text-align: center;
  border-left: 0;
  padding-left: 0;
  max-width: 600px;
}
.section em { font-style: italic; color: var(--gold-bright); }
.section strong, .section b { color: var(--red); font-weight: bold; }

/* ===== BLOCKQUOTE (highlight quotes - centered) ===== */
.section blockquote {
  border-top: 2px solid var(--dark-red);
  border-bottom: 2px solid var(--dark-red);
  background: var(--bg-card);
  padding: 20px 32px;
  margin: 24px auto;
  font-style: italic;
  color: var(--ink);
  font-size: 17px;
  text-align: center;
  max-width: 600px;
  border-radius: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.section blockquote strong { font-style: normal; color: var(--gold-bright); }

/* ===== FIGURE (immagini) ===== */
.section figure {
  margin: 24px 0;
  text-align: center;
}
.section figure img {
  display: block;
  max-width: 100%;
  max-height: 500px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.section figure figcaption {
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 10px;
  padding: 0 20px;
}

.section > img {
  display: block;
  max-width: 100%;
  max-height: 500px;
  margin: 24px auto;
  border: 1px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* ===== LINK ===== */
.section a {
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold);
}
.section a:hover { color: var(--gold); border-bottom-style: solid; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.8); }
  .content-wrap { margin-left: 0; }
  .book-content { padding: 60px 20px 60px; max-width: 100%; }
  .section { padding: 28px 0; }
  .section.opener { padding: 50px 20px; margin: 40px 0; }
  .section.opener h1 { font-size: 30px; }
  .section h2 { font-size: 24px; }
  .section h3 { font-size: 20px; }
  .section p { font-size: 16px; }
  .section figure img { max-height: 400px; }
}

@media (max-width: 480px) {
  .section h2 { font-size: 22px; }
  .section.opener h1 { font-size: 26px; }
  .section.opener .part-tag { font-size: 14px; letter-spacing: 5px; }
  .section figure img { max-height: 320px; }
  .book-content { padding: 60px 14px 60px; }
}

/* ===== PRINT ===== */
@media print {
  html, body { background: #fff; color: #000; }
  .sidebar, .menu-toggle { display: none; }
  .content-wrap { margin-left: 0; }
  .section { page-break-inside: avoid; color: #000; }
  .section h2, .section h3, .section h4 { color: var(--dark-red); }
  .section.opener { background: #fff; }
}
