/*
  File: /app-collection/serialhukes/assets/style.css
  Desain: "Perpustakaan Digital ABBA" — rak lima jilid NALAR KEADILAN.

  Token sistem:
    Warna dasar : --paper #FAF7F0 (kertas hangat, bukan putih steril)
                  --ink    #1B3A57 (biru tua institusional, dari sampul buku)
                  --gold   #C8860D (emas redup, aksen "percaya diri")
                  --line   #DDD3BE (garis pemisah hangat)
    Warna jilid : ditentukan per-buku di config.php (properti 'warna'),
                  dipakai sebagai aksen "punggung buku" di rak.
    Tipografi   : display = Lora (serif, berwibawa, kesan kitab)
                  body    = "Source Sans 3" / system sans (mudah dibaca lama)
    Layout      : dashboard = rak buku horizontal/grid, bukan kartu generik.
*/

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --paper: #FAF7F0;
  --paper-raised: #FFFFFF;
  --ink: #1B3A57;
  --ink-soft: #3A5572;
  --gold: #C8860D;
  --line: #DDD3BE;
  --text: #2B2A27;
  --text-soft: #5C5950;
  --shadow: 0 2px 10px rgba(27, 58, 87, 0.08), 0 1px 2px rgba(27, 58, 87, 0.06);
  --shadow-lift: 0 12px 28px rgba(27, 58, 87, 0.16), 0 2px 6px rgba(27, 58, 87, 0.08);
  --radius: 10px;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--gold); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

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

/* ===================== TOP BAR (semua halaman) ===================== */
.topbar {
  background: var(--ink);
  color: #EFE7D6;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar .brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
}
.topbar .brand .mark {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: #fff;
}
.topbar .brand .mark .accent { color: var(--gold); }
.topbar .brand .sub {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: #C9D4DF;
  font-style: italic;
}
.topbar nav a {
  color: #EFE7D6;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
}
.topbar nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ===================== HERO (dashboard) ===================== */
.hero {
  padding: 64px 24px 40px;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}
.hero .eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--ink);
  font-weight: 700;
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-soft);
  margin: 0 auto 8px;
  max-width: 640px;
}
.hero .tagline {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  margin-top: 6px;
}

/* ===================== RAK BUKU (signature element) ===================== */
.shelf-wrap {
  max-width: 1100px;
  margin: 10px auto 60px;
  padding: 0 24px;
}
.shelf-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0 18px;
}
.shelf-label .line { flex: 1; height: 1px; background: var(--line); }
.shelf-label span {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.shelf {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 980px) {
  .shelf { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .shelf { grid-template-columns: 1fr; }
}

.book-spine {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 6px solid var(--book-color, var(--ink));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px 20px;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.book-spine:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.book-spine .kode {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--book-color, var(--ink));
  text-transform: uppercase;
  margin-bottom: 10px;
}
.book-spine h2 {
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--ink);
}
.book-spine .sub {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-soft);
  margin-bottom: 14px;
}
.book-spine .intro {
  font-size: 0.92rem;
  color: var(--text);
  flex: 1;
  margin-bottom: 18px;
}
.book-spine .open-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--book-color, var(--ink));
  align-self: flex-start;
  padding: 8px 14px;
  border: 1.5px solid var(--book-color, var(--ink));
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.book-spine .open-link:hover {
  background: var(--book-color, var(--ink));
  color: #fff;
}
.book-spine .open-link svg { width: 14px; height: 14px; }

/* ===================== HALAMAN ISI BUKU ===================== */
.book-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.book-header {
  border-bottom: 3px solid var(--book-color, var(--ink));
  padding: 40px 0 28px;
  margin-bottom: 36px;
}
.book-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 22px;
}
.book-header .back-link:hover { color: var(--ink); }
.book-header .kode {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--book-color, var(--gold));
  margin-bottom: 10px;
}
.book-header h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.15;
}
.book-header .sub {
  font-style: italic;
  color: var(--text-soft);
  font-size: 1.05rem;
}

/* Tipografi isi naskah */
.book-content .sec-h1 {
  font-family: var(--serif);
  font-size: 1.55rem;
  color: var(--ink);
  margin: 48px 0 18px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.book-content .sec-h1:first-child { border-top: none; margin-top: 0; }
.book-content .sec-h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 30px 0 12px;
}
.book-content .sec-h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin: 22px 0 10px;
}
.book-content p { margin: 0 0 16px; color: var(--text); }
.book-content ul.doc-list {
  margin: 0 0 18px;
  padding-left: 22px;
}
.book-content ul.doc-list li { margin-bottom: 9px; }

/* Tabel data biasa */
.table-wrap { overflow-x: auto; margin: 22px 0 28px; }
table.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--paper-raised);
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}
table.doc-table th {
  background: var(--ink);
  color: #fff;
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
}
table.doc-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.doc-table tr:nth-child(even) td { background: #F5F1E8; }

/* ===================== BOX KHUSUS (motivator, catatan, dll) ===================== */
.doc-box {
  border-radius: 8px;
  padding: 18px 20px;
  margin: 26px 0;
  border: 1px solid var(--line);
}
.doc-box p, .doc-box ul { margin: 0 0 10px; }
.doc-box p:last-child, .doc-box ul:last-child { margin-bottom: 0; }
.doc-box strong:first-child { display: block; margin-bottom: 8px; font-size: 0.95rem; }

.box-motivator {
  background: #FFF3D6;
  border-color: #E8C873;
  border-left: 4px solid var(--gold);
}
.box-motivator strong:first-child { color: #8A5E08; }

.box-catatan {
  background: #FCE8E6;
  border-color: #E8B6B0;
  border-left: 4px solid #B3261E;
}
.box-catatan strong:first-child { color: #8C231C; }

.box-renungkan {
  background: #EDF3F8;
  border-color: #C7D9E8;
  border-left: 4px solid var(--ink);
}
.box-renungkan strong:first-child { color: var(--ink); }

.box-ilustrasi {
  background: #F4F1EC;
  border-color: #DCD3C2;
  border-left: 4px solid #8A7B66;
  font-style: italic;
  color: #4A4438;
}

.box-rujukan {
  background: #E8F0E8;
  border-color: #BFD8BF;
  border-left: 4px solid #2E7D32;
}
.box-rujukan strong:first-child { color: #2E7D32; }

.box-colophon {
  background: #F5F5F5;
  border-color: #DDDDDD;
  border-left: 4px solid #888888;
  font-size: 0.9rem;
}

/* ===================== FOOTER ===================== */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-raised);
  padding: 32px 24px;
  margin-top: 40px;
}
.site-footer .inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.site-footer .meta p { margin: 0 0 4px; }
.site-footer .meta .name { font-weight: 700; color: var(--ink); }
.site-footer .place {
  text-align: right;
  font-style: italic;
}

/* ===================== UTILITAS ===================== */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
