/* ============================================================
   SITAKA tema-riski (tema tunggal)
   ------------------------------------------------------------
   - beranda & mode gelap dari tema 1 (sitaka_new)
   - pintasan layanan, halaman dalam terang, kartu datar dari tema 2 (sitaka_v2)
   - huruf lebih tebal: Plus Jakarta Sans untuk semua teks,
     isi 500 (bukan 400), judul 800
   Dimuat SETELAH sitaka-base.css, sitaka.css, sitaka-dark.css.
   ============================================================ */

:root {
  --cj-font-head: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cj-font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cj-r-lg: 16px;
  --cj-r-xl: 22px;
  --v3-accent: #003366;
  --v3-on-accent: #FFFFFF;
}
:root[data-theme="dark"] {
  --v3-accent: #FDB515;
  --v3-on-accent: #0B1220;
}

/* ---------- Tipografi lebih tebal ---------- */
body.cj { font-weight: 500; letter-spacing: -0.006em; }
body.cj h1, body.cj h2, body.cj h3 { font-weight: 800; letter-spacing: -0.025em; }
body.cj h4, body.cj h5 { font-weight: 700; }
body.cj strong, body.cj b { font-weight: 700; }
.cj-nav__link { font-weight: 600; }
.cj-submenu__label { font-weight: 700; }
.cj-submenu__desc, .cj-pagehead__lead, .cj-head__desc, .cj-hero__lead { font-weight: 500; }
.sk-hero .cj-hero__lead { font-weight: 500; color: rgba(255, 255, 255, 0.88); }
.sk-hero__kicker { font-weight: 700; }
body.cj .sk-search__box .input-transparent { font-weight: 500; }
.cj-footer, .cj-footer__list a, .cj-footer__contact li { font-weight: 500; }

/* ---------- Header: tombol pil seperti tema 2 ---------- */
.cj-btn.sk-cta { border-radius: 999px; }
.cj-theme { border-radius: 999px; }
.cj-nav__link.is-active { box-shadow: inset 0 -2px 0 var(--cj-gold); border-radius: 0; }

/* ---------- Beranda: pintasan layanan di bawah pencarian (di atas foto navy) ---------- */
.v3-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.v3-chips li { margin: 0; }
.v3-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 15px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(6px);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.v3-chip:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(253, 181, 21, 0.6); transform: translateY(-1px); }
.v3-chip i { color: var(--cj-gold); font-size: 13px; }
.v3-chip--gold { background: var(--cj-gold); border-color: var(--cj-gold); color: #0B1F3A !important; }
.v3-chip--gold i { color: #0B1F3A; }
.v3-chip--gold:hover { background: #FFD15C; border-color: #FFD15C; }

/* kartu statistik: datar, angka tebal */
.sk-stat { border-radius: var(--cj-r-lg); box-shadow: var(--cj-shadow); }
.sk-stat__num { font-weight: 800; letter-spacing: -0.03em; }

/* ---------- Halaman dalam: kepala halaman terang seperti tema 2 ---------- */
.cj-pagehead {
  background: var(--cj-surface);
  color: var(--cj-ink);
  border-bottom: 1px solid var(--cj-line);
}
.cj-pagehead h1 { color: var(--cj-ink-strong); }
.cj-pagehead__lead { color: var(--cj-muted); }
.cj-pagehead__lead a { color: var(--cj-blue); }
.cj-pagehead .cj-eyebrow { background: rgba(253, 181, 21, 0.16); color: #7A5600; border: 1px solid rgba(253, 181, 21, 0.45); }
.cj-pagehead .cj-eyebrow i { color: #7A5600; }
:root[data-theme="dark"] .cj-pagehead .cj-eyebrow { color: var(--cj-gold); }
:root[data-theme="dark"] .cj-pagehead .cj-eyebrow i { color: var(--cj-gold); }
.cj-crumbs, .cj-crumbs a { color: var(--cj-muted); }
.cj-crumbs a:hover, .cj-crumbs [aria-current] { color: var(--cj-ink-strong); }
.cj-pagehead .sk-search__box { background: var(--cj-surface-alt); box-shadow: none; }
.cj-pagehead .cj-btn--navy { background: var(--v3-accent); color: var(--v3-on-accent); }

.sk-page__card, .sk-tool { border-radius: var(--cj-r-xl); box-shadow: none; }
/* Jarak antarbagian beranda dirapatkan (sebelumnya 64-72px per sisi) */
.cj-section { padding-block: 28px; }
@media (min-width: 768px) { .cj-section { padding-block: 40px; } }
.cj-head { margin-bottom: 14px; }
.cj-head h2, .sk-collection-head h2 { margin-bottom: 4px; }
.sk-collection-head { margin-bottom: 12px; }
.sk-collection-head .cj-eyebrow { margin-bottom: 8px; }
body.cj .subtitle-section { margin-top: 4px; }
/* komponen koleksi bawaan SLiMS: mt-4 (24px) + pb-4 per buku */
.sk-coll .collection { margin-top: 12px !important; }
.sk-coll .collection > div { padding-bottom: 8px !important; }
.sk-eres .er-marquee { margin-top: 0; }
.sk-stats { padding-bottom: 0; }
.sk-found-home .sk-rail-head { margin-bottom: 12px; }
/* dua bagian berlatar sama yang berurutan: cukup satu jarak */
.cj-section--white + .cj-section--white,
.cj-section--alt + .cj-section--alt { padding-top: 0; }
.cj-section--white + #slims-home > .cj-section--white:first-child { padding-top: 0; }

/* kartu buku: tinggi mengikuti isi sendiri (bukan judul terpanjang), judul maks. 3 baris */
.sk-coll .collection { align-items: flex-start; }
.sk-coll .collection .card { height: auto !important; }
.sk-coll .collection .card-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
@media (max-width: 767.98px) {
  /* subjudul bagian cukup 2 baris di HP */
  body.cj .subtitle-section {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px;
  }
}
/* footer: jarak teks profil dengan ikon media sosial */
.cj-footer .sk-footer__about { margin-bottom: 0; }
.cj-footer .sk-footer__about > :last-child { margin-bottom: 0; }
.cj-footer .sk-footer__social { margin-top: 20px; }

/* ============================================================
   Beranda: Koleksi Terpopuler/Terbaru (slider) + Peringkat
   (parts/_koleksi_beranda.php, slider di sitaka.js initShelf)
   ============================================================ */
.sk-box {
  background: var(--cj-surface); border: 1px solid var(--cj-line); border-radius: var(--cj-r-xl);
  box-shadow: var(--cj-shadow-sm); padding: 20px; min-width: 0;
}
.sk-box__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.sk-box__title {
  display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--cj-font-head);
  font-size: 18px; font-weight: 800; color: var(--cj-ink-strong); line-height: 1.25;
}
.sk-box__ico {
  flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: rgba(var(--cj-gold-rgb), 0.16); color: #9A6B00; font-size: 15px;
}
.sk-box__desc { margin: 6px 0 0 44px; font-size: 13px; color: var(--cj-muted); }
.sk-box__nav { display: flex; gap: 8px; flex: none; }

.sk-koleksi__grid { display: grid; gap: 20px; }
/* layar lebar: Terpopuler & Terbaru berdampingan, masing-masing 4 judul per tampilan */
@media (min-width: 992px) {
  .sk-koleksi__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sk-koleksi__grid > :only-child { grid-column: 1 / -1; }
  .sk-koleksi .sk-shelf { gap: 12px; grid-auto-columns: calc((100% - 36px) / 4); }
  .sk-koleksi .sk-book { padding: 4px; }
  .sk-koleksi .sk-book__title { font-size: 13px; }
  .sk-koleksi .sk-book__cover.is-blank span { font-size: 11px; -webkit-line-clamp: 4; }
  .sk-koleksi__grid .sk-box__desc { margin-left: 0; }
  .sk-koleksi .sk-book__rank, .sk-koleksi .sk-book__new { top: 6px; left: 6px; font-size: 11px; padding: 2px 7px; }
}

/* rak buku: 2 per tampilan di HP, 3 di tablet, 4 di desktop; bergeser per "halaman" */
.sk-shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 16px) / 2); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
  padding: 2px 2px 6px; margin: -2px -2px 0;
}
.sk-shelf::-webkit-scrollbar { display: none; }
.sk-shelf:focus-visible { outline: 2px solid var(--cj-gold); outline-offset: 4px; border-radius: var(--cj-r-lg); }
@media (min-width: 640px) { .sk-shelf { grid-auto-columns: calc((100% - 32px) / 3); } }
@media (min-width: 992px) { .sk-shelf { grid-auto-columns: calc((100% - 48px) / 4); } }

.sk-book {
  scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  color: var(--cj-ink); text-decoration: none !important; border-radius: var(--cj-r-lg); padding: 8px;
  transition: background .2s ease;
}
.sk-book:hover { background: var(--cj-surface-alt); color: var(--cj-ink); }
.sk-book__media { position: relative; display: block; margin-bottom: 8px; }
.sk-book__cover {
  display: block; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--cj-line-soft);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16); transition: transform .25s ease, box-shadow .25s ease;
}
.sk-book__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sk-book:hover .sk-book__cover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22); }
/* sampul buatan untuk judul tanpa gambar */
.sk-book__cover.is-blank {
  background: linear-gradient(160deg, var(--sk-cover) 0%, color-mix(in srgb, var(--sk-cover) 70%, #000) 100%);
  color: #fff; position: relative;
}
.sk-book__cover.is-blank { display: flex; flex-direction: column; justify-content: space-between; padding: 14px 12px 14px 18px; }
.sk-book__cover.is-blank::before {
  content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 3px; background: rgba(255, 255, 255, 0.18);
}
.sk-book__cover.is-blank i { color: var(--cj-gold); font-size: 18px; }
.sk-book__cover.is-blank span {
  font-family: var(--cj-font-head); font-weight: 700; font-size: 13px; line-height: 1.35;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden;
}
.sk-book__rank, .sk-book__new {
  position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: var(--cj-r-pill);
  font-size: 12px; font-weight: 800; background: rgba(15, 23, 42, 0.78); color: #fff;
}
.sk-book__rank.is-top { background: var(--cj-gold); color: var(--cj-navy); }
.sk-book__new { background: #047857; }
.sk-book__title {
  font-family: var(--cj-font-head); font-weight: 700; font-size: 14px; line-height: 1.35; color: var(--cj-ink-strong);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.sk-book__author { font-size: 12.5px; color: var(--cj-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sk-shelf__dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; min-height: 8px; }
.sk-shelf__dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 9999px; background: var(--cj-line);
  transition: width .25s ease, background .25s ease; cursor: pointer;
}
.sk-shelf__dots button.is-active { width: 22px; background: var(--cj-gold); }

/* pemustaka teraktif: 4 kartu berjajar (2 x 2 di HP), tanpa slide */
.sk-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .sk-people { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
.sk-person {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 0;
  padding: 8px 4px; border-radius: var(--cj-r-lg); transition: background .2s ease;
}
.sk-person:hover { background: var(--cj-surface-alt); }
.sk-person__media { position: relative; display: block; width: 100%; max-width: 96px; margin-bottom: 10px; }
@media (min-width: 640px) { .sk-person__media { max-width: 132px; } }
.sk-person__avatar {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: linear-gradient(160deg, var(--cj-navy) 0%, var(--cj-blue) 100%); color: #fff;
  font-family: var(--cj-font-head); font-weight: 800; font-size: clamp(28px, 4vw, 40px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16); border: 3px solid var(--cj-surface); outline: 2px solid var(--cj-line);
}
.sk-person__avatar.is-1 { outline-color: var(--cj-gold); }
.sk-person__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sk-person__media .sk-book__rank { top: 0; left: 0; }
.sk-person__name {
  font-family: var(--cj-font-head); font-weight: 700; font-size: 13.5px; line-height: 1.35; color: var(--cj-ink-strong);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.sk-person__type { font-size: 12px; color: var(--cj-muted); }
.sk-people__empty { color: var(--cj-muted); font-size: 13px; margin: 0; }

@media (max-width: 575.98px) {
  .sk-box { padding: 16px; border-radius: var(--cj-r-lg); }
  .sk-box__desc { margin-left: 0; }
  .sk-box__title { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-shelf { scroll-behavior: auto; }
  .sk-book__cover, .sk-shelf__dots button { transition: none; }
}

/* mode gelap */
:root[data-theme="dark"] .sk-box__ico { background: rgba(253, 181, 21, 0.14); color: #F5D77A; }
:root[data-theme="dark"] .sk-book__cover, :root[data-theme="dark"] .sk-person__avatar { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); }
