/* =====================================================
   GIÁO XỨ THANH HẢI — SÁCH KÝ SỬ GIÁO XỨ & XUẤT PDF
   assets/css/book.css
   ===================================================== */

.book-reader-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ── Book Navigation / Toolbar ── */
.book-toolbar {
  position: sticky;
  top: 70px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

/* ── Sách Ký Sử Main Document ── */
.history-book {
  background: #FFFDF8;
  color: #2C2825;
  border-radius: var(--r-xl);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.45);
  border: 1px solid #E8E0D2;
  overflow: hidden;
  font-family: 'Playfair Display', Georgia, serif;
}

/* ── Book Cover Page ── */
.book-cover {
  background: linear-gradient(135deg, #1C182A 0%, #2D2545 50%, #151122 100%);
  color: #F8F5EE;
  padding: 5rem 3rem;
  text-align: center;
  position: relative;
  border-bottom: 6px double #C8A452;
}
.book-cover-ornament {
  font-size: 2.5rem;
  color: #C8A452;
  margin-bottom: 1.5rem;
}
.book-diocese-lbl {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #D4AF37;
  margin-bottom: 0.5rem;
}
.book-main-title {
  font-size: 3rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}
.book-sub-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  color: #C4BAA9;
  font-weight: 400;
  margin-bottom: 3rem;
}
.book-cover-footer {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #A09482;
  border-top: 1px solid rgba(200, 164, 82, 0.3);
  padding-top: 1.5rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ── Table of Contents ── */
.book-toc {
  padding: 3.5rem 3.5rem 2rem;
  border-bottom: 1px dashed #D8CFC0;
  background: #FAF6ED;
}
.toc-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #5C1D24;
  text-align: center;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toc-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 1.05rem;
  color: #4A423B;
  border-bottom: 1px dotted #D0C4B0;
  padding-bottom: 4px;
}
.toc-item a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.toc-item a:hover {
  color: #7C1D24;
}

/* ── Book Chapter & Content ── */
.book-body {
  padding: 3.5rem;
}
.book-chapter {
  margin-bottom: 4.5rem;
}
.chapter-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #C8A452;
}
.chapter-number {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #C8A452;
  margin-bottom: 0.4rem;
}
.chapter-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #4A151C;
  line-height: 1.25;
}

.book-article {
  margin-bottom: 3rem;
}
.article-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 1rem;
}
.article-year {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #7C1D24;
  background: #EFE6D5;
  padding: 2px 8px;
  border-radius: 4px;
}
.article-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #1F1B18;
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.85;
  color: #38322D;
  text-align: justify;
}
.article-content p {
  margin-bottom: 1.25rem;
}
.article-content p:first-of-type::first-letter {
  font-size: 3.2rem;
  float: left;
  line-height: 0.8;
  padding-right: 8px;
  padding-top: 4px;
  color: #7C1D24;
  font-weight: 700;
}

.article-img-box {
  margin: 1.5rem 0;
  text-align: center;
  background: #F0E8D8;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #D8CFC0;
}
.article-img-box img {
  max-height: 380px;
  margin: 0 auto;
  border-radius: 4px;
}
.article-img-caption {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: #6E645A;
  margin-top: 6px;
  font-style: italic;
}

/* ── Print & PDF Formatting Rules ── */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .portal-header, .app-header, .sidebar, .book-toolbar, .btn, .toast-wrap, .modal-mask {
    display: none !important;
  }
  .book-reader-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .history-book {
    box-shadow: none !important;
    border: none !important;
    background: #fff !important;
  }
  .book-cover {
    background: #111 !important;
    color: #fff !important;
    page-break-after: always;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .book-chapter {
    page-break-before: always;
  }
  .book-body {
    padding: 0 !important;
  }
}
