/* Koruptorpedia. CSS polos, tanpa proses build. */

:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --surface-2: #f4f2ee;
  --ink: #16181d;
  --ink-2: #4b4d55;
  --muted: #6d6f77;
  --line: #e3e0d9;
  --accent: #a8201a;
  --accent-ink: #ffffff;
  --accent-soft: #fbeceb;
  --bar: #e34948;
  --sorot: #fff3d1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 24, 29, .05), 0 8px 24px rgba(22, 24, 29, .06);
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f6f5f2;
    --ink-2: #c9c8be;
    --muted: #a09f95;
    --line: #36352f;
    --accent: #ff8f85;
    --accent-ink: #1a1a19;
    --accent-soft: #3b201e;
    --bar: #e66767;
    --sorot: #3a3219;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
small { color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Navigasi */

.nav-shell {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav-links a { padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .93rem; font-weight: 500; white-space: nowrap; }
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav-search { margin-left: auto; }
.nav-search input { width: 150px; }
.btn.nav-toggle { display: none; margin-left: auto; }

@media (max-width: 1020px) {
  .nav-inner { flex-wrap: wrap; padding-block: 8px; }
  .btn.nav-toggle { display: inline-flex; }
  .nav-links { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 10px; }
  .nav-links.is-open { display: flex; }
  .nav-search { margin: 6px 0 0; }
  .nav-search input { width: 100%; }
}

/* Tombol dan isian */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-small { padding: 6px 12px; font-size: .88rem; }
.btn-danger { color: var(--accent); }

input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="url"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: .95rem;
}
textarea { min-height: 110px; resize: vertical; }

/* Hero */

.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 64px); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero h1 span { color: var(--accent); }
.lead { font-size: 1.1rem; color: var(--ink-2); margin-top: 18px; max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.summary-card h3 { margin-bottom: 4px; }

@media (max-width: 860px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

/* Bagian halaman */

section { padding: clamp(36px, 6vw, 72px) 0; }
.section-head { max-width: 62ch; margin-bottom: 28px; }
.section-head p { color: var(--ink-2); margin-top: 10px; }
.section-alt { background: var(--surface-2); }
.page-head { padding: clamp(32px, 5vw, 56px) 0 8px; }
.page-head p { color: var(--ink-2); margin-top: 14px; max-width: 70ch; font-size: 1.05rem; }
.page-body { padding: 24px 0 clamp(40px, 6vw, 72px); }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-card {
  display: block; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem;
}
.feature-card p { color: var(--ink-2); margin-top: 8px; font-size: .95rem; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

@media (max-width: 860px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) { .feature-grid { grid-template-columns: minmax(0, 1fr); } }

.cta { background: var(--ink); color: var(--surface); }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.cta p { opacity: .8; margin-top: 8px; max-width: 60ch; }

footer.site-footer { padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; }
.footer-inner p { max-width: 68ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* Dataset: kartu angka dan diagram batang */

.dataset { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); }
.dataset + .dataset { margin-top: 20px; }
.dataset-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.dataset-head h2, .dataset-head h3 { font-size: 1.25rem; }
.dataset-desc { color: var(--ink-2); margin-top: 8px; font-size: .95rem; max-width: 75ch; }
.dataset-source { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: .8rem; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0 0; }
.tile { padding: 16px; border-radius: 12px; background: var(--surface-2); }
.tile dt { font-size: .85rem; color: var(--ink-2); }
.tile dd { margin: 4px 0 0; font-family: var(--serif); font-size: 1.7rem; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.tile dd.tile-note { font-family: var(--sans); font-size: .8rem; font-weight: 400; color: var(--muted); line-height: 1.4; margin-top: 6px; }

.bars { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .95rem; }
.bars th, .bars td { padding: 7px 8px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.bars thead th { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bars tbody th { font-weight: 500; }
.bars tbody th small { display: block; font-weight: 400; }
.bars .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars .bar-cell { width: 42%; padding-right: 0; }
.bars tbody tr:hover { background: var(--surface-2); }
.bars tr.is-sorot { background: var(--sorot); }
.bars tr.is-sorot th { font-weight: 700; }
.bar { display: block; height: 12px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--bar); }
.bar-track { margin-top: 10px; }

@media (max-width: 560px) {
  .bars .bar-cell { width: 28%; }
  .bars th, .bars td { padding-inline: 5px; }
}

/* Rekor */

.rekor { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rekor-item { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rekor-no { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.rekor-item h2, .rekor-item h3 { font-size: 1.2rem; }
.rekor-item h2 a, .rekor-item h3 a { color: var(--ink); }
.rekor-meta { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.rekor-value { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.rekor-value strong { font-family: var(--serif); font-size: 1.5rem; }
.rekor-value span { color: var(--muted); font-size: .88rem; }
.rekor-foot { margin-top: 12px; }

@media (max-width: 560px) { .rekor-item { grid-template-columns: 34px minmax(0, 1fr); padding: 16px; } .rekor-no { font-size: 1.5rem; } }

/* Artikel */

.remah { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.artikel { max-width: 780px; }
.artikel h2 { margin: 36px 0 12px; }
.fakta { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 24px 0 0; }
.fakta div { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); }
.fakta dt { font-size: .8rem; color: var(--muted); }
.fakta dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.prosa { margin-top: 24px; color: var(--ink-2); max-width: 70ch; }
.daftar { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.daftar li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.daftar li p { color: var(--ink-2); font-size: .93rem; margin-top: 4px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.kosong { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-2); }
.catatan { margin-top: 20px; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; font-size: .93rem; }

/* Admin */

.admin-bar { background: var(--ink); color: var(--surface); }
.admin-bar .container { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; min-height: 54px; padding-block: 8px; }
.admin-bar a, .admin-bar button { color: inherit; opacity: .85; text-decoration: none; font: inherit; font-size: .93rem; background: none; border: 0; padding: 0; cursor: pointer; }
.admin-bar a:hover, .admin-bar button:hover, .admin-bar a[aria-current="page"] { opacity: 1; text-decoration: underline; }
.admin-bar .brand { color: inherit; opacity: 1; font-size: 1.1rem; margin-right: 8px; }
.admin-bar .spacer { flex: 1; }
.admin-main { padding: 28px 0 64px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.admin-head h1 { font-size: 1.7rem; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.flash-error { background: var(--accent-soft); border-color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table .aksi { white-space: nowrap; text-align: right; }
.table .aksi form { display: inline; }
.form { display: grid; gap: 16px; max-width: 860px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field label, .field legend { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field .error { font-size: .85rem; color: var(--accent); margin-top: 4px; font-weight: 600; }
fieldset.field { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; min-width: 0; }
.checks { display: grid; gap: 6px; max-height: 240px; overflow-y: auto; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: .93rem; font-weight: 400; }
.check input { margin-top: 5px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.rows th, .rows td { padding: 4px; }
.rows input[type="text"] { min-width: 90px; padding: 7px 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.login-box { width: min(400px, 100% - 32px); margin: clamp(40px, 12vh, 120px) auto; }

@media (max-width: 640px) { .form-row { grid-template-columns: minmax(0, 1fr); } }

.summary-card .dataset { border: 0; padding: 0; background: none; }
.summary-card .tiles { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.summary-card .tile dd:not(.tile-note) { font-size: 1.45rem; }

/* Foto dan ranking juara korupsi */

.foto { display: block; flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; object-position: top; background: var(--surface-2); }
.foto-besar { width: 160px; height: 200px; border-radius: var(--radius); }
.foto-kosong { display: grid; place-items: center; color: var(--muted); font-family: var(--serif); font-weight: 700; font-size: 1.1rem; letter-spacing: .04em; border: 1px solid var(--line); }
.foto-besar.foto-kosong { font-size: 2.6rem; }

.profil-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; }
.profil-foto { margin: 0; width: 160px; }
.profil-foto figcaption { margin-top: 8px; font-size: .78rem; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
@media (max-width: 560px) { .profil-head { grid-template-columns: minmax(0, 1fr); } }

.juara { list-style: none; margin: 16px 0 0; padding: 0; }
.juara-item { display: grid; grid-template-columns: 36px 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.juara-item:last-child { border-bottom: 0; }
.juara-no { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--accent); text-align: center; }
.juara-isi h3 { font-size: 1.05rem; }
.juara-isi h3 a { color: var(--ink); }
.juara-meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.juara-nilai { text-align: right; max-width: 260px; }
.juara-nilai strong { display: block; font-family: var(--serif); font-size: 1.2rem; white-space: nowrap; }
.juara-nilai span { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; margin-top: 2px; }
.page-body .dataset + .dataset { margin-top: 20px; }
@media (max-width: 640px) {
  .juara-item { grid-template-columns: 28px 48px minmax(0, 1fr); }
  .juara-item .foto { width: 48px; height: 48px; }
  .juara-nilai { grid-column: 3; text-align: left; max-width: none; }
}

.tokoh-kartu { display: flex; gap: 14px; align-items: flex-start; }
