/* Berita: tema editorial untuk platform berita.
   Palet: tinta #16181d, kertas #ffffff/#f6f5f2, aksen merah editorial #a51c30.
   Aksen dipakai hemat (masthead, tautan aktif, fokus) sebagai satu aksen. */

:root {
  --ink: #16181d;
  --ink-soft: #3c3f47;
  --muted: #55565c;
  --paper: #ffffff;
  --paper-alt: #f6f5f2;
  --line: #e4e2dc;
  --accent: #a51c30;
  --accent-ink: #ffffff;
  --focus: #a51c30;
  --serif: Georgia, "Times New Roman", "Liberation Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

/* Fokus terlihat untuk semua elemen interaktif (WCAG 2.4.7). */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.2; }

/* Tautan lewati ke konten, tampil saat fokus. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  z-index: 2000;
  text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---- Masthead & navigasi publik ---- */
.site-masthead {
  border-bottom: 4px solid var(--ink);
  background: var(--paper);
}
.site-masthead .brand {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-decoration: none;
}
.site-masthead .brand:hover { color: var(--ink); }
.site-masthead .tagline {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.site-nav { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-nav .navbar-nav .nav-link { color: var(--ink); font-weight: 500; }
.site-nav .nav-link:hover,
.site-nav .nav-link:focus { color: var(--accent); }

.search-form { max-width: 260px; }

/* ---- Kartu post publik ---- */
.post-card { display: block; color: var(--ink); text-decoration: none; }
.post-card:hover { color: var(--ink); }
.post-card .card-title { font-family: var(--serif); }
.post-card:hover .card-title { color: var(--accent); }
.post-card .thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--paper-alt);
  border-radius: 4px 4px 0 0;
}
.post-card .meta { color: var(--muted); font-size: 0.85rem; }

.hero-card { background: var(--paper-alt); border: 1px solid var(--line); }
.hero-card .thumb { height: auto; max-height: 360px; width: 100%; object-fit: cover; }

.kicker {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.kicker:hover { color: var(--accent); text-decoration: underline; }

/* ---- Sidebar publik ---- */
.sidebar-widget { border-top: 3px solid var(--ink); }
.sidebar-widget h2 { font-size: 1.1rem; }
.sidebar-widget ul { list-style: none; padding-left: 0; }
.sidebar-widget li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sidebar-widget li:last-child { border-bottom: 0; }
.sidebar-widget a { text-decoration: none; }
.sidebar-widget a:hover { color: var(--accent); }

/* ---- Breadcrumb ---- */
.breadcrumb { --bs-breadcrumb-divider: "/"; font-size: 0.9rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---- Isi artikel ---- */
.article-body {
  max-width: 44rem;
  font-size: 1.08rem;
}
.article-body h2, .article-body h3 { margin-top: 1.6em; }
.article-body img { max-width: 100%; height: auto; border-radius: 4px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 8px 10px; }
.article-body th { background: var(--paper-alt); text-align: left; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  margin: 1em 0;
  padding: 0.5em 1em;
  color: var(--ink-soft);
  background: var(--paper-alt);
}
.article-body pre {
  background: var(--paper-alt);
  padding: 1em;
  overflow-x: auto;
  border-radius: 4px;
}
.cover-image { width: 100%; height: auto; border-radius: 6px; }

/* ---- Komentar ---- */
.comment { border-left: 3px solid var(--line); padding: 0.5rem 0 0.5rem 1rem; }

/* ---- Footer publik ---- */
.site-footer {
  border-top: 4px solid var(--ink);
  background: var(--paper-alt);
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---- Halaman statis / 404 ---- */
.static-page { max-width: 44rem; }

/* ---- Pagination ---- */
.pagination .page-link { color: var(--ink); }
.pagination .page-link:hover { color: var(--accent); }
.pagination .active .page-link { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---- Admin ---- */
.admin-body { background: var(--paper-alt); }
.admin-shell { min-height: 100vh; }
.admin-sidebar {
  width: 250px;
  background: var(--ink);
  color: #e7e7ea;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  padding: 1rem 0;
  z-index: 1040;
  overflow-y: auto;
}
.admin-sidebar .admin-brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: #fff;
  padding: 0 1rem 1rem;
  border-bottom: 1px solid #2a2d33;
  text-decoration: none;
  display: block;
}
.admin-sidebar .admin-brand:hover { color: #fff; }
.admin-nav-link {
  display: block;
  color: #d5d6da;
  padding: 0.6rem 1rem;
  text-decoration: none;
  font-weight: 500;
}
.admin-nav-link:hover, .admin-nav-link:focus { color: #fff; background: #26282e; }
.admin-nav-link.active { color: #fff; border-left: 4px solid var(--accent); }
.admin-sidebar .admin-logout { margin: 0 1rem; }
.admin-main { margin-left: 250px; min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.admin-content { padding: 1.25rem 1.5rem 3rem; flex: 1; max-width: 1100px; }
.admin-content h1 { font-size: 1.6rem; border-bottom: 2px solid var(--ink); padding-bottom: 0.5rem; margin-bottom: 1.25rem; }

.admin-toggle { display: none; }

.stat-card { border: 1px solid var(--line); background: var(--paper); }
.stat-card .stat-value { font-family: var(--serif); font-size: 2rem; font-weight: 700; }
.stat-card .stat-label { color: var(--muted); font-size: 0.85rem; }

/* Badge status admin */
.badge-draft { background: var(--paper-alt); color: var(--ink-soft); border: 1px solid var(--line); }
.badge-published { background: #1c7c46; color: #fff; }
.badge-pending { background: #b5741a; color: #fff; }
.badge-approved { background: #1c7c46; color: #fff; }
.badge-spam { background: var(--accent); color: #fff; }

/* Tabel admin bisa discroll horizontal di layar sempit. */
.table-responsive { border: 1px solid var(--line); background: var(--paper); border-radius: 4px; }
.table-responsive table { margin-bottom: 0; }
.table thead th { background: var(--paper-alt); border-bottom: 2px solid var(--line); }
.table td, .table th { vertical-align: middle; }
.table .thumb-admin { width: 60px; height: 40px; object-fit: cover; border-radius: 3px; }

/* Form admin */
.admin-form .form-label { font-weight: 600; }
.field-hint { color: var(--muted); font-size: 0.85rem; }

/* ---- Modul SEO (form post) ---- */
.seo-panel { border: 1px solid var(--line); background: var(--paper); }
.serp-preview { font-family: Arial, sans-serif; }
.serp-title { color: #1a0dab; font-size: 1.15rem; line-height: 1.3; margin: 0; }
.serp-url { color: #006621; font-size: 0.85rem; margin: 0; }
.serp-desc { color: #4d5156; font-size: 0.9rem; margin: 0; }
.meter { font-size: 0.85rem; font-weight: 600; }
.meter.ok { color: #1c7c46; }
.meter.over { color: var(--accent); }

.editor-preview {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1rem;
  background: var(--paper);
  min-height: 120px;
}

/* Responsif admin: sidebar menjadi panel geser di bawah 992px. */
@media (max-width: 991.98px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-toggle { display: inline-flex; }
  .admin-content { padding: 1rem; }
}

/* Responsif umum */
@media (max-width: 575.98px) {
  .site-masthead .brand { font-size: 1.5rem; }
  .admin-content h1 { font-size: 1.4rem; }
}
