/* Halaman publik SSR: /karakter, /karakter/:id-:slug, /blog, /blog/:slug.
   Muat SETELAH /tokens.css. Semua warna, tipe, spasi, radius dari token; tidak ada warna baru.
   Nav, tombol, plate, kotak dialog, footer, dan kredit Netra = pola landing.css (disalin, bukan diimpor).
   Spesifikasi lengkap: design/DESIGN.md, bagian "Public site pages". Base = HP; layar lebar lewat 761px dan 1024px. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 800; text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: var(--fs-h1); line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.375rem, 1.15rem + 1vw, 1.875rem); line-height: var(--lh-snug); letter-spacing: -0.02em; }
::selection { background: var(--selection); }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-xs); }

.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--space-4); top: -60px; z-index: 30; background: var(--surface); color: var(--text);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-xs); font-weight: 700; }
.skip:focus { top: var(--space-2); }
.icon {
  width: 20px; height: 20px; flex: none; display: inline-block; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.fine { font-size: var(--fs-small); color: var(--text-muted); }

/* Tombol: .btn = tenang (sekunder), .btn.primary = satu aksi utama sakura per layar. Sama dengan landing. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px;
  font: inherit; font-weight: 700; text-decoration: none; border-radius: var(--radius-pill); padding: 12px 24px; cursor: pointer;
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--line);
  transition: transform var(--dur-fast) ease, filter var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn.primary:hover { background: var(--primary-hover); }
.btn:active { transform: scale(var(--press-scale)); }
.btn:focus-visible { border-radius: var(--radius-pill); }
.btn .icon { width: 18px; height: 18px; }
.link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--violet-text); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .icon { width: 18px; height: 18px; }

/* ---------- Header publik (pola nav landing) ---------- */
.site-nav {
  position: sticky; top: 0; z-index: var(--z-nav); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.site-nav .bar { display: flex; align-items: center; gap: var(--space-4); height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font-weight: 800; font-size: 22px; letter-spacing: -0.03em; text-decoration: none; }
.brand svg { width: 36px; height: auto; }
.site-nav .links { display: flex; gap: var(--space-4); }
.site-nav .links a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  font-size: 15px; font-weight: 700; color: var(--text-muted); text-decoration: none;
}
.site-nav .links a:hover { color: var(--text); }
.site-nav .links a[aria-current] { color: var(--text); }
.site-nav .links a[aria-current]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 3px; border-radius: 2px; background: var(--primary);
}
.site-nav .links .wide { display: none; }
.site-nav .btn { min-height: 40px; padding: 8px 16px; font-size: 15px; }

/* ---------- Breadcrumbs ---------- */
.crumbs { padding-top: var(--space-2); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; min-width: 0; font-size: var(--fs-small); color: var(--text-muted); }
.crumbs li { display: flex; align-items: center; min-width: 0; flex: none; }
.crumbs li:last-child { flex: 1 1 auto; }
.crumbs li + li::before {
  content: ""; flex: none; width: 16px; height: 16px; margin: 0 4px; background: currentColor; opacity: 0.7;
  -webkit-mask: url(/icons/chevron-right.svg) center / contain no-repeat; mask: url(/icons/chevron-right.svg) center / contain no-repeat;
}
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { min-width: 0; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Kepala halaman (h1 + paragraf isi biasa, tanpa subjudul) ---------- */
.page-head { display: grid; gap: var(--space-4); padding: var(--space-4) 0 var(--space-6); max-width: 760px; }
.page-head p { font-size: 17px; }

/* ---------- Katalog: toolbar filter + jumlah ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-5); }
.filters {
  display: flex; gap: var(--space-2); list-style: none; padding: 0 var(--space-4) 2px; margin: 0 calc(-1 * var(--space-4));
  overflow-x: auto; scrollbar-width: none; max-width: calc(100% + 2 * var(--space-4));
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: var(--radius-pill); white-space: nowrap;
  font-size: 15px; font-weight: 700; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  transition: border-color var(--dur-fast) ease;
}
.chip:hover { border-color: var(--secondary); }
.chip[aria-current] { background: var(--secondary); color: var(--on-secondary); border-color: transparent; }
.chip:focus-visible { border-radius: var(--radius-pill); }
.count { font-size: var(--fs-small); font-weight: 700; color: var(--text-muted); }

/* ---------- Kartu karakter ---------- */
.cgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); list-style: none; margin: 0; padding: 0; }
.ccard {
  position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.ccard:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.ccard:has(:is(h2, h3) a:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.ccard :is(h2, h3) a:focus-visible { outline: none; }
.ccard .body { flex: 1; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-3) var(--space-3); }
.ccard :is(h2, h3) { font-size: 17px; line-height: var(--lh-snug); letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccard :is(h2, h3) a { text-decoration: none; }
.ccard :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.ccard .desc { font-size: var(--fs-small); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ccard .art { aspect-ratio: 4 / 5; }
.ccard .tags { margin-top: auto; }
.ccard .tags li:nth-child(n+3) { display: none; }
.ccard .by {
  display: flex; align-items: center; gap: 6px; min-width: 0; padding-top: var(--space-2); border-top: 1px solid var(--line);
  font-size: var(--fs-micro); font-weight: 700; color: var(--text-muted);
}
.ccard .by span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard .by .icon { width: 14px; height: 14px; }

/* Area art: gambar artist (3:4, dipotong dari atas) atau blok hue + inisial kalau belum ada gambar. */
.art {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden; display: grid; place-items: center;
  background: hsl(var(--h, 260) 70% 92%); color: hsl(var(--h, 260) 55% 42%);
}
:root[data-theme="dark"] .art { background: hsl(var(--h, 260) 30% 18%); color: hsl(var(--h, 260) 70% 72%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .art { background: hsl(var(--h, 260) 30% 18%); color: hsl(var(--h, 260) 70% 72%); } }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.art b { font-size: clamp(64px, 20vw, 112px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; opacity: 0.9; user-select: none; }
.art .icon { position: absolute; right: 12px; top: 12px; width: 22px; height: 22px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tag {
  display: inline-block; max-width: 100%; padding: 4px 10px; border-radius: var(--radius-pill); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-micro); font-weight: 700; line-height: 1.4; background: var(--chip-bg); color: var(--violet-text);
}

/* Katalog kosong / filter tanpa hasil */
.empty {
  display: grid; gap: var(--space-3); justify-items: start; padding: var(--space-8) var(--space-5);
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.empty h2 { font-size: var(--fs-h3); }
.pager { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-8); }
.pager .next-page { margin-left: auto; }

/* ---------- Detail karakter ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); padding: var(--space-3) 0 var(--space-12); }
.portrait { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.portrait .art { border-radius: 0; }
.portrait .art img { object-fit: contain; object-position: 50% 50%; }
.portrait.is-empty .art { aspect-ratio: 16 / 10; }
.portrait figcaption { display: flex; align-items: center; gap: var(--space-2); min-height: 52px; padding: var(--space-2) var(--space-4); font-size: var(--fs-small); color: var(--text-muted); }
.portrait figcaption .icon { width: 18px; height: 18px; color: var(--primary); }
.portrait figcaption a, .portrait figcaption strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; color: var(--text);
}
.portrait figcaption a { display: inline-flex; align-items: center; min-height: 44px; color: var(--violet-text); text-decoration: underline; text-underline-offset: 3px; }
.info { display: grid; gap: var(--space-5); align-content: start; min-width: 0; }
.info > .desc { font-size: 17px; max-width: 62ch; }
.start { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.start .btn { flex: 1 1 100%; }
.block { display: grid; gap: var(--space-4); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.block h2 { font-size: var(--fs-h3); }
.block p { max-width: 62ch; }

/* Kotak dialog VN + papan nama miring: perangkat visual brand (landing .dlg / .plate). */
.plate {
  display: inline-block; max-width: calc(100% - 32px); transform: skewX(var(--papan-skew)); background: var(--secondary); color: var(--on-secondary);
  border-radius: 10px; padding: 6px 18px; font-weight: 800; font-size: 16px; line-height: 1.3;
}
.plate > span { display: block; transform: skewX(14deg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg { position: relative; margin-top: 18px; padding: 28px 20px 22px; border-radius: 22px; background: var(--surface-raised); border: 1px solid var(--line); box-shadow: var(--shadow); }
.dlg .plate { position: absolute; top: -18px; left: 18px; }
.dlg p + p { margin-top: var(--space-2); }
.dlg .act { font-style: italic; color: var(--text-muted); }
.dlg .say { font-size: 17px; font-weight: 500; }
.dlg .more { margin-top: var(--space-3); }

/* ---------- Blog: daftar tulisan ---------- */
.posts { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); list-style: none; margin: 0 0 var(--space-12); padding: 0; }
.post {
  position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur) var(--ease-out);
}
.post:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.post:has(h2 a:focus-visible, h3 a:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.post h2 a:focus-visible, .post h3 a:focus-visible { outline: none; }
.post .cover { aspect-ratio: 16 / 9; background: var(--chip-bg); }
.post .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post .body { flex: 1; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); }
.post h2, .post h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.post h2 a, .post h3 a { text-decoration: none; }
.post h2 a::after, .post h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.post .excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post .meta { margin-top: auto; }

/* Baris meta: tanggal, waktu baca, penulis. Di kartu: di bawah. Di artikel: byline (satu-satunya baris di bawah h1). */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); font-size: var(--fs-meta); font-weight: 600; color: var(--text-muted); }
.meta > * { display: inline-flex; align-items: center; gap: 6px; }
.meta .icon { width: 16px; height: 16px; }

/* ---------- Artikel ---------- */
.article { max-width: var(--container-narrow); margin: 0 auto; padding: var(--space-3) 0 var(--space-12); }
.article > header { display: grid; gap: var(--space-4); margin-bottom: var(--space-8); }
.avatar {
  width: 32px; height: 32px; border-radius: var(--radius-pill); display: grid; place-items: center; flex: none;
  background: var(--secondary); color: var(--on-secondary); font-size: var(--fs-meta); font-weight: 800;
}
.byline { gap: var(--space-2) var(--space-4); }
.byline .who { color: var(--text); font-weight: 700; }
.article .cover-fig { margin: 0 0 var(--space-8); }
.article .cover-fig img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--chip-bg); }
.article .cover-fig figcaption, .prose figcaption { margin-top: var(--space-2); font-size: var(--fs-small); color: var(--text-muted); }
.article .cover-fig figcaption a, .prose figcaption a { color: var(--violet-text); font-weight: 700; }

/* Tipografi panjang: 17px HP / 18px desktop, line-height 1.75, lebar baca maks 68ch. */
.prose { font-size: 17px; line-height: 1.75; max-width: 68ch; overflow-wrap: break-word; hyphens: manual; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem); line-height: 1.25; margin-top: 2.2em; scroll-margin-top: 84px; }
.prose h3 { font-size: 1.2em; line-height: 1.3; letter-spacing: -0.01em; margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose a { color: var(--violet-text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2.5px; }
.prose strong { font-weight: 800; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--primary); font-weight: 800; }
.prose blockquote { padding: 2px 0 2px 20px; border-left: 4px solid var(--secondary); font-weight: 500; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; padding: 2px 6px; border-radius: 6px; background: var(--chip-bg); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.prose hr { border: 0; width: 64px; height: 2px; margin: 2.5em auto; background: var(--line-strong); }
.prose figure { margin: 1.8em 0; }
.prose figure .dlg { margin-top: 18px; font-size: 16px; line-height: 1.6; }
.prose img { display: block; border-radius: var(--radius-sm); }

/* CTA di akhir artikel + tulisan terkait */
.cta-box { display: grid; gap: var(--space-4); justify-items: start; margin-top: var(--space-12); padding: var(--space-6) var(--space-5);
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cta-box h2 { font-size: var(--fs-h3); }
.related { display: grid; gap: var(--space-5); padding: var(--space-10) 0 var(--space-12); border-top: 1px solid var(--line); }
.related .cgrid, .related .posts { margin: 0; }

/* ---------- Footer (sama dengan landing) + kredit Netra ---------- */
.site-footer { padding: 40px 0 56px; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--text-muted); }
.site-footer p { max-width: 720px; }
.site-footer .row { display: flex; flex-wrap: wrap; gap: 0 22px; margin-top: var(--space-2); }
.site-footer .row a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-muted); font-weight: 700; text-decoration: none; }
.site-footer .row a:hover { color: var(--text); }
.site-footer .row span { display: inline-flex; align-items: center; min-height: 44px; }
.netra-credit {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-2);
  margin: 12px 0 0 calc(-1 * var(--space-2)); border-radius: var(--radius-xs);
  color: var(--text-muted); font-size: var(--fs-meta); font-weight: 600; line-height: 1; text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.netra-credit img { display: block; height: 20px; width: auto; flex: none; }
.netra-credit .on-dark { display: none; }
.netra-credit:hover { color: var(--text); }
.netra-credit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
:root[data-theme="dark"] .netra-credit .on-light { display: none; }
:root[data-theme="dark"] .netra-credit .on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .netra-credit .on-light { display: none; }
  :root:not([data-theme="light"]) .netra-credit .on-dark { display: block; }
}

/* ---------- 761px: tablet / laptop kecil ---------- */
@media (min-width: 761px) {
  .wrap { padding: 0 var(--space-6); }
  .site-nav .links { gap: 22px; }
  .site-nav .links .wide { display: inline-flex; }
  .page-head { padding: var(--space-6) 0 var(--space-8); }
  .filters { margin: 0; padding: 0 0 2px; max-width: 100%; flex-wrap: wrap; }
  .cgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
  .ccard { border-radius: var(--radius); }
  .ccard .body { padding: var(--space-4) var(--space-5) var(--space-5); gap: var(--space-3); }
  .ccard :is(h2, h3) { font-size: var(--fs-h3); }
  .ccard .desc { font-size: 15px; }
  .ccard .tags li:nth-child(3) { display: list-item; }
  .ccard .by { font-size: var(--fs-meta); }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
  .posts > .is-first { grid-column: 1 / -1; }
  .post { border-radius: var(--radius); }
  .post .body { padding: var(--space-6); }
  .is-first h2 { font-size: clamp(1.375rem, 1.15rem + 1vw, 1.875rem); }
  .prose { font-size: var(--fs-lead); }
  .cta-box { padding: var(--space-8); }
  .start .btn { flex: 0 0 auto; min-width: 220px; }
}

/* ---------- 1024px: desktop ---------- */
@media (min-width: 1024px) {
  .cgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); }
  .detail { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-12); align-items: start; padding-top: var(--space-6); }
  .detail .portrait { position: sticky; top: 88px; }
  .portrait.is-empty .art { aspect-ratio: 3 / 4; }
  .posts > .is-first.has-cover { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .posts > .is-first.has-cover .cover { aspect-ratio: auto; min-height: 300px; }
  .posts > .is-first.has-cover .body { justify-content: center; padding: var(--space-8); }
  .posts > .is-first.has-cover .meta { margin-top: var(--space-2); }
  .related .posts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .chip, .ccard, .post { transition: none; }
  .ccard:hover { transform: none; }
}
