/* ═══════════════════════════════════════════════════
   SHERLOCK HOLMES COMPLETE BOOK — book.css
   VIVA VOX Education
═══════════════════════════════════════════════════ */

/* ── Page setup ─────────────────────────────────── */
@page {
  size: A4;
  margin: 22mm 18mm 24mm 22mm;
  @bottom-center {
    content: counter(page);
    font-family: 'Inter', sans-serif;
    font-size: 8.5pt;
    color: #888;
  }
  @top-left {
    content: "Sherlock Holmes: Getting Young Again";
    font-family: 'Inter', sans-serif;
    font-size: 7.5pt;
    color: #aaa;
    letter-spacing: 0.04em;
  }
  @top-right {
    content: "VIVA VOX Education";
    font-family: 'Inter', sans-serif;
    font-size: 7.5pt;
    color: #aaa;
    letter-spacing: 0.04em;
  }
}

/* Cover — no margins, no header/footer */
@page cover {
  margin: 0;
  @top-left { content: none; }
  @top-right { content: none; }
  @bottom-center { content: none; }
}

/* Front matter — Roman numerals */
@page front {
  @bottom-center {
    content: counter(page, lower-roman);
    font-family: 'Inter', sans-serif;
    font-size: 8.5pt;
    color: #888;
  }
}

/* Part dividers — no number */
@page divider {
  @top-left { content: none; }
  @top-right { content: none; }
  @bottom-center { content: none; }
}

/* Mirror margins for proper book feel */
@page :left  { margin-left: 18mm; margin-right: 22mm; }
@page :right { margin-left: 22mm; margin-right: 18mm; }

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

/* ── Base ───────────────────────────────────────── */
body {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 11pt;
  line-height: 1.65;
  color: #1a1a1a;
  background: #fff;
  counter-reset: page 0;
}

@media screen {
  body {
    max-width: 210mm;
    margin: 0 auto;
    padding: 0;
    box-shadow: 0 2px 32px rgba(0,0,0,0.13);
    background: #f5f4f0;
  }
  .cover,
  .front-page,
  .toc-page,
  .part-divider,
  .ep-opener,
  .ep-body,
  .ws-page,
  .glossary-page,
  .ak-page,
  .colophon {
    background: #fff;
    margin: 20px auto;
    max-width: 170mm;
    padding: 22mm 18mm;
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
  }
  .cover {
    background: #1a2744;
    max-width: 210mm;
    margin: 0 auto;
  }
  .part-divider {
    background: #1a2744;
    max-width: 210mm;
    margin: 20px auto;
  }
}

/* ── Print button ───────────────────────────────── */
.print-bar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
}
.back-to-course {
  background: #fff;
  color: #1a2744;
  border: 1px solid #ddd;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 12pt;
  font-weight: 600;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  text-decoration: none;
}
.back-to-course:hover { background: #f5f5f5; }
.print-btn {
  background: #1a2744;
  color: #fff;
  border: none;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 12pt;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
}
.print-btn:hover { background: #243566; }
@media print { .print-bar { display: none; } }

/* ── Page break utilities ───────────────────────── */
.page-break { page-break-after: always; break-after: page; }
@media screen {
  .page-break { display: block; border-top: 1px dashed #ddd; margin: 40px 0; }
}

/* Orphans / widows */
p { orphans: 3; widows: 3; }

/* ════════════════════════════════════════════════
   COVER PAGE
════════════════════════════════════════════════ */
.cover {
  page: cover;
  page-break-after: always;
  break-after: page;
  background: #1a2744;
  color: #fff;
  width: 210mm;
  min-height: 297mm;
  display: flex;
  flex-direction: column;
  padding: 28mm 22mm 20mm;
  position: relative;
  overflow: hidden;
}
@media screen {
  .cover { min-height: 297mm; }
}

.cover-publisher {
  font-size: 8pt;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c9a227;
  font-weight: 700;
  margin-bottom: 4mm;
}
.cover-series {
  font-size: 9pt;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 20mm;
}
.cover-ornament {
  width: 48px;
  height: 3px;
  background: #c9a227;
  margin-bottom: 8mm;
}
.cover-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 34pt;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 6mm;
}
.cover-subtitle {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14pt;
  font-style: italic;
  color: rgba(255,255,255,0.75);
  margin-bottom: 16mm;
}
.cover-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: auto;
}
.cover-meta-item {
  font-size: 9pt;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.05em;
}
.cover-meta-item strong { color: rgba(255,255,255,0.9); }
.cover-footer {
  margin-top: auto;
  padding-top: 12mm;
  border-top: 1px solid rgba(201,162,39,0.35);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.cover-footer-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 13pt;
  font-weight: 700;
  color: #c9a227;
  letter-spacing: 0.04em;
}
.cover-footer-year {
  font-size: 9pt;
  color: rgba(255,255,255,0.4);
}
/* Decorative diagonal stripes bottom-right */
.cover::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border: 18px solid rgba(201,162,39,0.15);
  border-radius: 50%;
}
.cover::before {
  content: '';
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border: 10px solid rgba(201,162,39,0.1);
  border-radius: 50%;
}

/* ════════════════════════════════════════════════
   FRONT MATTER PAGES
════════════════════════════════════════════════ */
.front-page {
  page: front;
  page-break-after: always;
  break-after: page;
  padding: 14mm 0;
  min-height: 250mm;
}

.info-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18pt;
  color: #1a2744;
  font-weight: 700;
  margin-bottom: 10mm;
  padding-bottom: 4mm;
  border-bottom: 2px solid #1a2744;
}
.info-block { margin-bottom: 8mm; }
.info-label {
  font-size: 7.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c9a227;
  margin-bottom: 3px;
}
.info-value {
  font-size: 10.5pt;
  color: #333;
  line-height: 1.6;
}

/* How to use */
.how-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16pt;
  color: #1a2744;
  font-weight: 700;
  margin-bottom: 7mm;
  padding-bottom: 3mm;
  border-bottom: 2px solid #1a2744;
}
.how-step {
  display: flex;
  gap: 12px;
  margin-bottom: 6mm;
  align-items: flex-start;
}
.how-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20pt;
  font-weight: 700;
  color: #c9a227;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
}
.how-text { font-size: 10.5pt; line-height: 1.65; }
.how-text strong { color: #1a2744; }

/* TOC */
.toc-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16pt;
  color: #1a2744;
  font-weight: 700;
  margin-bottom: 8mm;
  padding-bottom: 3mm;
  border-bottom: 2px solid #1a2744;
}
.toc-part {
  font-size: 7.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #c9a227;
  margin: 7mm 0 4mm;
}
.toc-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 10.5pt;
  margin-bottom: 5px;
  line-height: 1.45;
}
.toc-ep-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: #1a2744;
  min-width: 28px;
  font-size: 9.5pt;
}
.toc-ep-title { flex: 1; }
.toc-dots {
  flex: 1;
  border-bottom: 1px dotted #bbb;
  margin: 0 4px 3px;
  min-width: 20px;
}
.toc-pg {
  color: #888;
  font-size: 9.5pt;
  min-width: 24px;
  text-align: right;
}
.toc-row-main { font-weight: 600; }
.toc-row-sub {
  font-size: 9pt;
  color: #666;
  padding-left: 28px;
}

/* ════════════════════════════════════════════════
   PART DIVIDER
════════════════════════════════════════════════ */
.part-divider {
  page: divider;
  page-break-after: always;
  break-after: page;
  background: #1a2744;
  color: #fff;
  width: 210mm;
  min-height: 297mm;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20mm;
}
.part-label {
  font-size: 8pt;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(201,162,39,0.8);
  margin-bottom: 8mm;
}
.part-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 64pt;
  font-weight: 700;
  color: rgba(255,255,255,0.08);
  line-height: 1;
  margin-bottom: 6mm;
}
.part-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28pt;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10mm;
}
.part-ornament {
  width: 40px;
  height: 2px;
  background: #c9a227;
  margin: 0 auto 8mm;
}
.part-desc {
  font-size: 10pt;
  color: rgba(255,255,255,0.55);
  max-width: 100mm;
  line-height: 1.7;
}

/* ════════════════════════════════════════════════
   EPISODE PAGES (Part 1 — Story)
════════════════════════════════════════════════ */
.episode {
  page-break-before: always;
  break-before: page;
  padding: 0;
}

/* Episode opener */
.ep-opener {
  padding: 12mm 0 10mm;
  border-bottom: 2.5px solid #1a2744;
  margin-bottom: 8mm;
}
.ep-meta {
  font-size: 7.5pt;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c9a227;
  font-weight: 700;
  margin-bottom: 4mm;
}
.ep-numeral {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 52pt;
  font-weight: 700;
  color: rgba(26,39,68,0.08);
  line-height: 0.9;
  margin-bottom: 2mm;
}
.ep-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22pt;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.15;
  margin-bottom: 3mm;
}
.ep-subtitle {
  font-size: 10pt;
  font-style: italic;
  color: #666;
}

/* Vocabulary box */
.ep-vocab {
  background: #f7f8fb;
  border: 1px solid #d0d4e4;
  border-radius: 4px;
  padding: 8mm 10mm;
  margin-bottom: 8mm;
}
.ep-vocab-label {
  font-size: 7pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #1a2744;
  border-left: 3px solid #c9a227;
  padding-left: 7px;
  margin-bottom: 5mm;
}
.ep-vocab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10pt;
}
.ep-vocab-table td {
  padding: 4px 8px;
  vertical-align: top;
  border-bottom: 1px solid #e4e7f0;
  line-height: 1.5;
}
.ep-vocab-table tr:last-child td { border-bottom: none; }
.ep-vocab-table .v-word { font-weight: 700; width: 22%; }
.ep-vocab-table .v-def { width: 50%; }
.ep-vocab-table .v-ua { color: #777; font-style: italic; font-size: 9.5pt; width: 28%; }

/* Watson intro box */
.watson-box {
  background: #1a2744;
  color: rgba(255,255,255,0.88);
  border-radius: 8px;
  padding: 8mm 10mm;
  margin-bottom: 8mm;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 11pt;
  line-height: 1.85;
}
.watson-box-label {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 7pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #c9a227;
  margin-bottom: 4mm;
}

/* Story text */
.story-text {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 11.5pt;
  line-height: 1.9;
  text-align: justify;
  hyphens: auto;
}
.story-text p {
  margin-bottom: 0;
  text-indent: 1.8em;
}
.story-text p:first-child { text-indent: 0; }

/* Drop cap */
.story-text p.drop-cap::first-letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3.6em;
  font-weight: 700;
  float: left;
  line-height: 0.78;
  margin: 0.06em 0.08em 0 0;
  color: #1a2744;
}

.story-sep {
  text-align: center;
  color: #bbb;
  margin: 6mm 0;
  letter-spacing: 0.5em;
  font-size: 10pt;
}

/* Pull quote */
.pull-quote {
  border-left: 3px solid #c9a227;
  padding: 4mm 8mm;
  margin: 7mm 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 12pt;
  color: #1a2744;
  line-height: 1.6;
}

/* Fact box */
.fact-box {
  background: #fdf9ee;
  border: 1px solid #e8d98a;
  border-radius: 4px;
  padding: 6mm 8mm;
  margin: 7mm 0;
  font-size: 9.5pt;
  line-height: 1.65;
  color: #444;
}
.fact-box strong { color: #1a2744; }

/* ════════════════════════════════════════════════
   PART 2 — WORKSHEETS
════════════════════════════════════════════════ */
.worksheet {
  page-break-before: always;
  break-before: page;
}

/* Section labels */
.sec-label {
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a2744;
  border-left: 3px solid #c9a227;
  padding-left: 8px;
  margin-bottom: 9px;
  line-height: 1.3;
}

/* Worksheet header */
.ws-header {
  border-bottom: 2.5px solid #1a2744;
  padding-bottom: 9px;
  margin-bottom: 14px;
}
.ws-series {
  font-size: 7.5pt;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 2px;
}
.ws-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17pt;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.15;
  margin-bottom: 2px;
}
.ws-subtitle {
  font-size: 9.5pt;
  color: #666;
  font-style: italic;
  margin-bottom: 7px;
}
.ws-meta {
  display: flex;
  gap: 22px;
  font-size: 9.5pt;
}
.meta-item { display: flex; align-items: center; gap: 5px; }
.meta-line { display: inline-block; width: 80px; border-bottom: 1px solid #444; }

/* Vocab table */
.vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 10pt;
}
.vocab-table thead th {
  background: #eef0f6;
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  text-align: left;
  border: 1px solid #c8ccda;
  color: #333;
}
.vocab-table td {
  padding: 5px 8px;
  border: 1px solid #d4d8e4;
  vertical-align: top;
  line-height: 1.5;
}
.vocab-table tr:nth-child(even) td { background: #f7f8fb; }
.vocab-table .v-word { font-weight: 700; }
.vocab-table .v-ua { color: #555; font-style: italic; font-size: 9.5pt; }

/* Matching exercise */
.match-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4px;
  font-size: 10pt;
}
.match-table td {
  padding: 4px 7px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
.match-table tr:last-child td { border-bottom: none; }
.match-word { font-weight: 600; white-space: nowrap; }
.match-blank {
  display: inline-block;
  width: 30px;
  height: 21px;
  border: 1.5px solid #555;
  border-radius: 3px;
  vertical-align: middle;
  margin: 0 4px;
}
.match-letter { font-weight: 700; color: #1a2744; padding-right: 4px; }
.match-col-words { width: 40%; }
.match-col-box   { width: 10%; text-align: center; }
.match-col-defs  { width: 50%; }

/* Think box */
.think-box {
  background: #fdf9ee;
  border-left: 3px solid #c9a227;
  padding: 8px 12px;
  font-size: 10pt;
  margin: 10px 0 0;
  border-radius: 0 4px 4px 0;
  line-height: 1.6;
}
.think-box strong { color: #1a2744; }

/* Word bank */
.word-bank {
  background: #f0f2f8;
  border: 1px solid #c4c9dc;
  padding: 7px 12px 8px;
  margin: 10px 0 12px;
  border-radius: 4px;
}
.wb-title {
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a2744;
  margin-bottom: 5px;
}
.wb-words {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 10pt;
  font-style: italic;
}

/* Reading text with gaps */
.reading-text p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11pt;
  line-height: 2.0;
  margin-bottom: 7px;
}
.blank {
  display: inline-block;
  border-bottom: 1.5px solid #333;
  min-width: 60px;
  margin: 0 2px;
}
.reading-sep {
  text-align: center;
  color: #aaa;
  margin: 8px 0;
  letter-spacing: 0.35em;
  font-size: 9.5pt;
}

/* Write lines */
.wline {
  border-bottom: 1px solid #b5b5b5;
  height: 25px;
  margin-bottom: 4px;
  width: 100%;
  display: block;
}
.wline-sm { border-bottom: 1px solid #b5b5b5; height: 22px; margin-bottom: 3px; width: 100%; display: block; }

/* Comprehension */
.comp-q { margin-bottom: 13px; }
.comp-q p { font-size: 10.5pt; font-weight: 500; margin-bottom: 4px; }

/* Grammar exercises */
.gex { margin-bottom: 15px; }
.gex-type {
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a2744;
  margin-bottom: 2px;
}
.gex-instr { font-size: 9pt; color: #555; margin-bottom: 6px; }
.gex-sent {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11pt;
  line-height: 2.1;
}
.order-list { display: flex; flex-direction: column; gap: 7px; }
.order-item { display: flex; align-items: center; gap: 9px; font-size: 10.5pt; line-height: 1.4; }
.order-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid #444;
  border-radius: 3px;
  flex-shrink: 0;
}
.qa-q { font-size: 10.5pt; font-weight: 500; margin-bottom: 4px; }

/* Speaking */
.speak-q { margin-bottom: 11px; }
.speak-q p { font-size: 10.5pt; margin-bottom: 3px; }

/* ════════════════════════════════════════════════
   GLOSSARY
════════════════════════════════════════════════ */
.glossary-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20pt;
  font-weight: 700;
  color: #1a2744;
  border-bottom: 2.5px solid #1a2744;
  padding-bottom: 5mm;
  margin-bottom: 8mm;
}
.gloss-letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14pt;
  font-weight: 700;
  color: #c9a227;
  margin: 6mm 0 3mm;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 2mm;
}
.gloss-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10pt;
}
.gloss-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  line-height: 1.5;
}
.gloss-table .g-word { font-weight: 700; width: 20%; }
.gloss-table .g-ep { color: #aaa; font-size: 8.5pt; width: 8%; text-align: center; }
.gloss-table .g-def { width: 46%; }
.gloss-table .g-ua { color: #666; font-style: italic; font-size: 9.5pt; width: 26%; }

/* ════════════════════════════════════════════════
   ANSWER KEY
════════════════════════════════════════════════ */
.ak-page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20pt;
  font-weight: 700;
  color: #1a2744;
  border-bottom: 2.5px solid #1a2744;
  padding-bottom: 5mm;
  margin-bottom: 8mm;
}
.ak-ep-label {
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a2744;
  border-left: 3px solid #c9a227;
  padding-left: 7px;
  margin: 6mm 0 4mm;
}
.ak-block { margin-bottom: 8mm; }
.ak-label {
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  margin-bottom: 3px;
}
.ak-text { font-size: 9.5pt; line-height: 1.65; }
.ak-text p { margin-bottom: 3px; }
.ak-cols { display: flex; gap: 20px; }
.ak-cols > div { flex: 1; }

/* ════════════════════════════════════════════════
   COLOPHON
════════════════════════════════════════════════ */
.colophon {
  margin-top: 20mm;
  padding-top: 6mm;
  border-top: 1px solid #ddd;
  font-size: 8.5pt;
  color: #999;
  line-height: 1.75;
  text-align: center;
}
.colophon strong { color: #666; }
