/* ============================================================
   Modern Blog Platform — Design System
   Font utama: Times New Roman (seluruh website)
   ============================================================ */

:root {
  --font-main: "Times New Roman", Times, Georgia, serif;

  /* Garuda Nusantara — Light theme (merah-putih-emas) */
  --bg: #fdfcfa;
  --bg-alt: #f5f1e8;
  --surface: #ffffff;
  --surface-2: #f2ede2;
  --text: #1c1a17;
  --text-soft: #4b463e;
  --muted: #8d8578;
  --border: #e8e1d2;
  --border-strong: #cfc5ae;
  --accent: #c7001f;            /* merah Garuda */
  --accent-dark: #a3001a;
  --accent-soft: #fbe9eb;
  --accent-contrast: #ffffff;
  --gold: #d4a017;              /* emas Garuda */
  --gold-soft: #faf0d2;
  --navy: #0b2447;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --info: #1e3a8a;
  --info-soft: #e0e7ff;
  --shadow-sm: 0 1px 2px rgba(60, 40, 10, .07);
  --shadow-md: 0 4px 14px rgba(60, 40, 10, .1);
  --shadow-lg: 0 12px 32px rgba(60, 40, 10, .16);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --transition: .18s ease;
  --nav-height: 66px;
}

[data-theme="dark"] {
  --bg: #0c1120;
  --bg-alt: #101730;
  --surface: #151d36;
  --surface-2: #1d2745;
  --text: #eae6dc;
  --text-soft: #b8b2a2;
  --muted: #7f7a6c;
  --border: #2a3452;
  --border-strong: #3b4668;
  --accent: #f0434f;
  --accent-dark: #ff6b75;
  --accent-soft: #3a1b22;
  --accent-contrast: #ffffff;
  --gold: #e8b71a;
  --gold-soft: #3a3010;
  --navy: #060b18;
  --danger: #f87171;
  --danger-soft: #3b1d23;
  --success: #4ade80;
  --success-soft: #15331f;
  --warning: #fbbf24;
  --warning-soft: #3a2c12;
  --info: #60a5fa;
  --info-soft: #12263f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  line-height: 1.25;
  margin: 0 0 .5em;
  font-weight: 700;
  color: var(--text);
}
p { margin: 0 0 1em; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .12em .35em;
}
pre code { padding: 0; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-contrast); }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-main { min-height: calc(100vh - var(--nav-height) - 320px); }
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 26px; flex-wrap: wrap;
}
.section-title { font-size: 1.7rem; margin: 0; position: relative; padding-left: 14px; }
.section-title::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 4px; border-radius: 4px; background: var(--accent);
}
.link-more { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.muted { color: var(--muted); }
.center { text-align: center; }
.accent-text { color: var(--accent); }
.gold-text { color: var(--gold); }
.navy-text { color: var(--navy); }
.dot { color: var(--muted); margin: 0 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-main);
  font-size: 1rem; font-weight: 600;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; cursor: pointer;
  transition: all var(--transition); text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-dark); color: var(--accent-contrast); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-sm { padding: 7px 14px; font-size: .92rem; }
.btn-xs { padding: 4px 10px; font-size: .82rem; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn.disabled, .btn:disabled { opacity: .55; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); cursor: pointer; transition: all var(--transition);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.role-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em;
  border: 1px solid var(--border-strong);
}
.role-dev { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.role-admin { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.role-member { background: var(--info-soft); color: var(--info); border-color: transparent; }
.status-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-soft); cursor: default;
}
.status-published, .status-approved, .status-active { background: var(--success-soft); color: var(--success); border-color: transparent; }
.status-draft, .status-pending, .status-disabled { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.status-spam, .status-trashed { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---------- Avatar ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-xs { width: 28px; height: 28px; }
.avatar-sm { width: 38px; height: 38px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 88px; height: 88px; }

/* ---------- Card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner { display: flex; align-items: center; gap: 18px; height: var(--nav-height); justify-content: space-between; }
.brand { flex-shrink: 0; min-width: 0; }
.nav-actions { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { max-height: 40px; width: auto; border-radius: 6px; }
.brand-name {
  font-size: 1.45rem; font-weight: 800; color: var(--text);
  letter-spacing: -.01em; font-family: var(--font-main);
}
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 8px 14px; border-radius: var(--radius-sm); color: var(--text-soft);
  font-weight: 600; font-size: .98rem;
}
.nav-link:hover { color: var(--accent); background: var(--surface-2); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-search { display: flex; align-items: center; position: relative; }
.nav-search-input {
  width: 190px; padding: 8px 36px 8px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-family: var(--font-main); font-size: .92rem;
  transition: all var(--transition);
}
.nav-search-input:focus { outline: none; border-color: var(--accent); width: 230px; }
.nav-search .icon-btn {
  position: absolute; right: 2px; width: 32px; height: 32px;
  border: 0; background: transparent;
}

/* Dark mode toggle */
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* User menu */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; color: var(--text);
  font-family: var(--font-main); font-size: .92rem;
  max-width: 200px; min-width: 0;
}
.user-menu-btn:hover { border-color: var(--accent); }
.user-menu-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  display: none; /* default tersembunyi (CSS, bukan atribut) */
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 120; flex-direction: column;
}
/* dropdown hanya tampil jika diklik (class .open via JS) */
.user-dropdown.open { display: flex !important; }
.user-dropdown a, .dropdown-logout {
  padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text);
  text-decoration: none; font-size: .95rem; text-align: left;
  background: none; border: 0; cursor: pointer; font-family: var(--font-main);
  width: 100%;
}
.user-dropdown a:hover, .dropdown-logout:hover { background: var(--accent-soft); color: var(--accent); }

/* Burger */
.nav-burger { display: none; }

/* ---------- Hero (Garuda Nusantara) ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 55%),
    var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
/* motif halus: cincin emas ala piringan Garuda */
.hero::before {
  content: ""; position: absolute; right: -140px; top: -140px;
  width: 480px; height: 480px; border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--gold) 30%, transparent);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: -180px; bottom: -220px;
  width: 460px; height: 460px; border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--accent) 18%, transparent);
  pointer-events: none;
}
.hero-inner {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: 44px; align-items: center; padding-top: 64px; padding-bottom: 64px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  font-weight: 700; font-size: .85rem; margin-bottom: 16px; letter-spacing: .04em;
}
.hero-eyebrow::before {
  content: "★"; color: var(--gold); font-size: .8rem;
}
.hero-title { font-size: 2.9rem; line-height: 1.15; letter-spacing: -.015em; margin-bottom: 18px; }
.hero-desc { font-size: 1.15rem; color: var(--text-soft); max-width: 520px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-featured { display: block; text-decoration: none; overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); }
.hero-featured:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hero-featured-img img { width: 100%; height: 240px; object-fit: cover; }
.hero-featured-body { padding: 22px; }
.hero-featured-title { font-size: 1.45rem; margin: 12px 0 8px; color: var(--text); }
.hero-featured-excerpt { color: var(--text-soft); margin-bottom: 14px; }

/* ---------- Article cards ---------- */
.article-card { overflow: hidden; display: flex; flex-direction: column; transition: transform var(--transition), box-shadow var(--transition); }
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.article-card-img { position: relative; display: block; overflow: hidden; aspect-ratio: 16/9; }
.article-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.article-card:hover .article-card-img img { transform: scale(1.05); }
.article-card-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted); font-size: .9rem;
}
.article-card-cat { position: absolute; top: 10px; left: 10px; backdrop-filter: blur(4px); }
.article-card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.article-card-title { font-size: 1.18rem; margin: 0; line-height: 1.35; }
.article-card-title a { color: var(--text); }
.article-card-title a:hover { color: var(--accent); }
.article-card-excerpt { color: var(--text-soft); font-size: .95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-card-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .84rem; color: var(--muted); margin-top: auto;
}

/* ---------- Popular ---------- */
.popular-grid { display: grid; gap: 16px; }
.popular-item {
  display: grid; grid-template-columns: 44px 1fr 90px; gap: 16px; align-items: center;
  padding: 14px 18px; text-decoration: none; transition: all var(--transition);
}
.popular-item:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
.popular-rank {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: 1.1rem;
}
.popular-title { font-size: 1.02rem; margin: 0; color: var(--text); }
.popular-item:hover .popular-title { color: var(--accent); }
.popular-thumb { width: 90px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); }

/* ---------- Categories ---------- */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.category-card { overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: all var(--transition); }
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.category-img { aspect-ratio: 16/7; overflow: hidden; }
.category-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.category-card:hover .category-img img { transform: scale(1.06); }
.category-body { padding: 16px 18px 18px; }
.category-name { font-size: 1.15rem; margin: 0 0 4px; color: var(--text); }
.category-desc { color: var(--text-soft); font-size: .9rem; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.category-count { font-size: .82rem; color: var(--accent); font-weight: 700; }

/* ---------- Tag cloud ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 12px; }
.tag-cloud-lg .tag-pill { font-size: 1rem; padding: 9px 18px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-soft); font-weight: 600; font-size: .92rem;
  transition: all var(--transition); text-decoration: none;
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.tag-count { font-size: .75rem; background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }

/* ---------- Newsletter (merah garuda) ---------- */
.newsletter {
  background: linear-gradient(120deg, var(--accent-dark), var(--accent) 55%, color-mix(in srgb, var(--accent) 70%, var(--gold) 30%));
  color: var(--accent-contrast);
}
.newsletter-inner { text-align: center; padding: 20px 0; position: relative; }
.newsletter-title { color: var(--accent-contrast); font-size: 2rem; }
.newsletter-desc { color: color-mix(in srgb, var(--accent-contrast) 85%, transparent); max-width: 520px; margin: 0 auto 24px; }
.newsletter-form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }
.newsletter-input {
  flex: 1; padding: 12px 18px; border-radius: var(--radius-sm);
  border: 0; font-family: var(--font-main); font-size: 1rem;
  background: color-mix(in srgb, var(--accent-contrast) 94%, transparent);
  color: #111;
}
.newsletter-input:focus { outline: 3px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.newsletter .btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.newsletter .btn-primary:hover { background: #16305c; }
.newsletter-off { opacity: .8; }

/* ---------- Page head (listing) ---------- */
.page-head { padding: 44px 0 10px; }
.page-title { font-size: 2.2rem; margin-bottom: 4px; }
.page-sub { color: var(--text-soft); margin-bottom: 20px; }
.search-bar { display: flex; gap: 10px; max-width: 640px; }
.search-input {
  flex: 1; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong); background: var(--surface);
  font-family: var(--font-main); font-size: 1rem; color: var(--text);
}
.search-input:focus { outline: none; border-color: var(--accent); }

/* ---------- Layout with sidebar ---------- */
.layout-side { display: grid; grid-template-columns: 1fr 300px; gap: 28px; padding: 26px 0 60px; align-items: start; }
.layout-main { min-width: 0; }
.side-card { padding: 20px; margin-bottom: 20px; position: sticky; }
.side-card:first-child { position: static; }
.side-card-title { font-size: 1.05rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-link-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-soft); font-size: .95rem; text-decoration: none;
}
.side-link-row:hover { background: var(--accent-soft); color: var(--accent); }
.count-badge { background: var(--surface-2); border-radius: 999px; padding: 1px 9px; font-size: .78rem; font-weight: 700; }
.side-post { display: flex; gap: 12px; padding: 10px 0; text-decoration: none; align-items: center; border-bottom: 1px dashed var(--border); }
.side-post:last-child { border-bottom: 0; }
.side-post-rank { font-size: 1.2rem; font-weight: 800; color: var(--accent); opacity: .7; }
.side-post-thumb { width: 64px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; }
.side-post-title { font-size: .92rem; color: var(--text); margin: 0 0 2px; line-height: 1.35; }
.side-post:hover .side-post-title { color: var(--accent); }
.side-post-meta { font-size: .78rem; color: var(--muted); }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-soft);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty-state svg { color: var(--border-strong); }
.empty-state h3 { margin: 4px 0 0; }
.empty-state.small { padding: 30px 20px; }

/* ---------- Article detail ---------- */
.article-page { padding: 34px 0 70px; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-current { color: var(--text-soft); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-head { max-width: 820px; margin: 0 auto 24px; }
.article-title { font-size: 2.55rem; line-height: 1.18; letter-spacing: -.01em; margin-bottom: 18px; }
.article-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.article-meta-text { display: flex; flex-direction: column; }
.article-author { font-weight: 700; color: var(--text); }
.article-meta-sub { font-size: .85rem; color: var(--muted); }
.article-meta-sub a { color: var(--accent); }
.article-stats { margin-left: auto; display: flex; gap: 16px; color: var(--muted); font-size: .9rem; }
.stat-item { display: inline-flex; align-items: center; gap: 6px; }
.article-featured { margin: 0 0 30px; }
.article-featured img { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius-lg); }

.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.article-body { min-width: 0; }

/* Article typography */
.article-content { font-size: 1.12rem; line-height: 1.85; color: var(--text); }
.article-content > *:first-child { margin-top: 0; }
.article-content h2 { font-size: 1.75rem; margin: 1.8em 0 .6em; }
.article-content h3 { font-size: 1.4rem; margin: 1.6em 0 .5em; }
.article-content h4 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
.article-content p { margin: 0 0 1.25em; }
.article-content a { text-decoration: underline; text-underline-offset: 3px; }
.article-content ul, .article-content ol { margin: 0 0 1.25em; padding-left: 1.6em; }
.article-content li { margin-bottom: .35em; }
.article-content blockquote {
  margin: 1.6em 0; padding: 16px 22px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic; color: var(--text-soft);
}
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content pre {
  margin: 1.4em 0; padding: 18px 20px;
  background: #0d1321; color: #dbe2ef;
  border-radius: var(--radius-sm); overflow-x: auto;
  font-size: .9rem; line-height: 1.65;
  border: 1px solid #26324a;
}
[data-theme="dark"] .article-content pre { background: #0a0f1a; border-color: var(--border); }
.article-content pre code { background: none; border: 0; color: inherit; }
.article-content img { border-radius: var(--radius); margin: 1.4em auto; }
.article-content figure { margin: 1.8em 0; text-align: center; }
.article-content figure img { margin: 0 auto; }
.article-content figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; font-style: italic; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; }
.article-content th { background: var(--surface-2); }
.article-content hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.article-content .align-left { text-align: left; }
.article-content .align-center { text-align: center; }
.article-content .align-right { text-align: right; }
.article-content .align-justify { text-align: justify; }

.article-tags { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 30px 0; padding-top: 24px; border-top: 1px solid var(--border); }
.tags-label { font-weight: 700; color: var(--text-soft); }

/* Actions (like/bookmark) */
.article-actions { display: flex; gap: 12px; padding: 14px 18px; margin-bottom: 26px; }
.action-form { display: inline-flex; }
.action-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 18px; border-radius: 999px;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  color: var(--text-soft); font-family: var(--font-main);
  font-size: .98rem; font-weight: 700; cursor: pointer;
  transition: all var(--transition); text-decoration: none;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.action-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.action-count { font-weight: 800; }
.heart { font-size: 1.05rem; }
.action-hint {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 18px; border-radius: 999px;
  border: 1.5px dashed var(--border-strong); color: var(--muted);
  font-size: .95rem;
}

/* Badge internal (pengunjung) */
.internal-badge {
  font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 5px 12px;
}
.footer-note { color: #8fa0c0; font-size: .9rem; }

/* Author box */
.author-box { display: flex; gap: 18px; align-items: flex-start; padding: 22px; margin-bottom: 30px; }
.author-name { margin: 0 0 6px; }
.author-bio { color: var(--text-soft); margin-bottom: 8px; }

/* Article sidebar */
.article-side .side-card { position: sticky; top: calc(var(--nav-height) + 16px); }
.article-side .side-card:first-child { position: static; }

/* Comments */
.comments-section { max-width: 820px; margin: 50px auto 0; }
.comment-form { padding: 20px; margin-bottom: 24px; }
.comment-form-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: .95rem; }
.comment-input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong); background: var(--surface);
  font-family: var(--font-main); font-size: .98rem; color: var(--text);
  resize: vertical; min-height: 90px;
}
.comment-input:focus { outline: none; border-color: var(--accent); }
.comment-form-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.comment-login { padding: 16px 20px; margin-bottom: 24px; }
.comment-login p { margin: 0; }
.comment { display: flex; gap: 14px; padding: 18px 20px; margin-bottom: 14px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.comment-time { font-size: .78rem; color: var(--muted); }
.comment-text { margin: 0 0 8px; overflow-wrap: break-word; }
.comment-actions { display: flex; gap: 12px; align-items: center; }
.comment.reply { margin: 12px 0 4px 44px; padding: 14px 16px; background: var(--bg-alt); }
.link-btn {
  background: none; border: 0; color: var(--accent); cursor: pointer;
  font-family: var(--font-main); font-size: .85rem; font-weight: 700; padding: 2px 0;
}
.link-btn.danger { color: var(--danger); }
.link-btn:hover { text-decoration: underline; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: calc(100vh - var(--nav-height) - 320px);
  display: flex; align-items: center; justify-content: center;
  padding: 50px 20px;
  background:
    radial-gradient(700px 340px at 90% -5%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(600px 320px at 5% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%);
}
.auth-card { width: 100%; max-width: 440px; padding: 36px 34px; box-shadow: var(--shadow-md); }
.auth-brand { display: flex; justify-content: center; margin-bottom: 18px; text-decoration: none; }
.auth-brand img { max-height: 44px; }
.auth-brand span { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.auth-title { text-align: center; font-size: 1.7rem; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--text-soft); font-size: .95rem; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: .95rem; }
.auth-hint { margin-top: 18px; font-size: .88rem; }
.auth-hint summary { cursor: pointer; color: var(--muted); }
.auth-hint ul { margin: 8px 0 0; padding-left: 20px; }

/* ---------- Forms ---------- */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-weight: 700; font-size: .92rem; color: var(--text); }
.form-field input, .form-field textarea, .form-field select, .input {
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong); background: var(--surface);
  font-family: var(--font-main); font-size: .98rem; color: var(--text);
  transition: border-color var(--transition);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus, .input:focus {
  outline: none; border-color: var(--accent);
}
.input-lg { font-size: 1.15rem; padding: 13px 16px; }
.input-xs { padding: 4px 8px; font-size: .82rem; }
.input.grow { flex: 1; min-width: 140px; }
.field-hint { font-size: .8rem; color: var(--muted); margin: 2px 0 0; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-row { display: flex; gap: 18px; flex-wrap: wrap; }
.form-row-between { display: flex; justify-content: space-between; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: .92rem; font-weight: 600;
}
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }

/* ---------- Footer (navy garuda) ---------- */
.site-footer { background: var(--navy); border-top: 0; padding: 50px 0 0; margin-top: 60px; }
[data-theme="dark"] .site-footer { background: #070c18; border-top: 1px solid var(--border); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px;
}
.footer-col h4 { font-size: 1.05rem; margin-bottom: 14px; color: var(--gold); }
.footer-col a { display: block; color: #c3cde2; padding: 4px 0; font-size: .94rem; }
.footer-col a:hover { color: var(--gold); }
.footer-about p { color: #97a3bd; font-size: .92rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12); padding: 18px 20px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: .85rem; color: #8fa0c0;
}
.footer-bottom a { color: var(--gold); }
.footer-about h4 { color: #ffffff; }

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 999;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  padding: 13px 16px; border-radius: var(--radius-sm); color: #fff;
  box-shadow: var(--shadow-lg); font-size: .93rem; font-weight: 600;
  animation: toast-in .25s ease; display: flex; gap: 10px; align-items: center;
}
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }
.toast.warning { background: #d97706; }
.toast-close { margin-left: auto; background: none; border: 0; color: #fff; cursor: pointer; font-size: 1.1rem; opacity: .8; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast.hide { opacity: 0; transform: translateY(6px); transition: all .3s; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 34px 0 10px; }
.page-btn {
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong); color: var(--text-soft);
  font-weight: 700; font-size: .92rem; text-decoration: none;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.disabled { opacity: .4; pointer-events: none; }
.page-info { color: var(--muted); font-size: .9rem; }

/* ---------- Error pages ---------- */
.error-page { text-align: center; padding: 90px 20px; }
.error-code {
  font-size: 7rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-title { font-size: 1.6rem; margin: 14px 0 8px; }
.error-desc { color: var(--text-soft); max-width: 480px; margin: 0 auto 26px; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 14, 24, .55);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 20px; backdrop-filter: blur(3px);
}
.modal { width: 100%; max-width: 640px; max-height: 85vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; overflow-y: auto; }

/* ---------- Inline forms ---------- */
.inline-form { display: inline-flex; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 30px; padding-top: 44px; }
  .hero-featured { max-width: 640px; }
  .grid-3, .category-grid { grid-template-columns: repeat(2, 1fr); }
  .layout-side, .article-layout { grid-template-columns: 1fr; }
  .layout-sidebar, .article-side { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .article-side .side-card, .side-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  body { font-size: 16px; }
  .nav-actions { gap: 8px; min-width: 0; }
  .navbar-inner { gap: 10px; }
  .brand-logo { max-height: 34px; }
  .user-menu-name { display: none; }
  .user-menu-btn { max-width: 64px; padding: 4px 8px 4px 4px; }
  /* Anchor dua sisi (left:0; right:0), pola sama seperti .nav-links di bawah
     yang sudah terbukti tidak pernah kepotong — menghindari kasus .navbar
     (backdrop-filter) jadi containing block baru untuk elemen fixed di
     dalamnya, yang bikin perhitungan "right: Npx" jadi tidak bisa diandalkan. */
  .user-dropdown {
    position: fixed; top: var(--nav-height); left: 0; right: 0;
    min-width: 0; max-width: none; width: auto;
    border-radius: 0; border-left: 0; border-right: 0; border-top: 0;
    box-shadow: var(--shadow-md); align-items: stretch; padding: 6px 4px;
    max-height: calc(100vh - var(--nav-height)); overflow-y: auto;
  }
  .user-dropdown a, .user-dropdown .dropdown-logout { text-align: left; padding: 12px 16px; }
  .nav-links {
    position: fixed; top: var(--nav-height); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 10px 16px; gap: 2px;
    display: none; box-shadow: var(--shadow-md); z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-burger { display: inline-flex; }
  .nav-search { display: none; }
  .user-menu-name { display: none; }
  .grid-3, .category-grid { grid-template-columns: 1fr; }
  .layout-sidebar, .article-side { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.1rem; }
  .article-title { font-size: 1.9rem; }
  .article-stats { margin-left: 0; width: 100%; }
  .article-content { font-size: 1.06rem; }
  .newsletter-form { flex-direction: column; }
  .section { padding: 40px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .comment.reply { margin-left: 16px; }
  .toast-container { left: 16px; right: 16px; max-width: none; }
}

@media (max-width: 480px) {
  .nav-search-input { width: 0; }
  .container { padding: 0 14px; }
  .hero-actions .btn { width: 100%; }
  .popular-item { grid-template-columns: 36px 1fr; }
  .popular-thumb { display: none; }
  .auth-card { padding: 26px 20px; }
  .btn-block-mobile { width: 100%; }
}

/* ---------- Fix popup: elemen dengan atribut hidden harus selalu tersembunyi ---------- */
[hidden] { display: none !important; }

/* ---------- Auth: divider & Google ---------- */
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 14px;
  color: var(--muted); font-size: .85rem;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.google-btn-wrap { display: flex; justify-content: center; margin: 2px 0 12px; width: 100%; overflow: hidden; }
.google-btn-wrap > div { max-width: 100%; }
.auth-switch { margin-top: 16px; }
.google-btn-wrap iframe { border-radius: var(--radius-sm) !important; max-width: 100% !important; }

/* ---------- Preview gambar kategori ---------- */
.cat-img-preview {
  margin-top: 8px; width: 100%; height: 120px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .85rem; overflow: hidden;
  background: var(--bg-alt);
}
.cat-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.cat-img-preview-sm { height: 72px; max-width: 220px; }

/* ============================================================
   Responsive hardening — mobile (semua halaman)
   ============================================================ */
@media (max-width: 768px) {
  body { overflow-x: clip; }
  .search-bar { flex-direction: column; align-items: stretch; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form .btn { width: 100%; }
  .article-content table { display: block; overflow-x: auto; white-space: nowrap; }
  .article-content pre { max-width: 100%; }
  .auth-card { padding: 26px 18px; }
  .hero-actions .btn { width: 100%; }
  .article-meta { gap: 8px; }
  .side-card { padding: 16px; }
  .panel { padding: 16px; }
  .dash-head .btn { padding: 8px 12px; }
  .editor-actions .btn-block { width: 100%; }
  .comment { padding: 14px 14px; }
  .comment.reply { margin-left: 10px; }
  .grid-3 { gap: 16px; }
  .article-card-body { padding: 14px; }
  .toast-container { left: 12px; right: 12px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-num { font-size: 1.4rem; }
  .hero-title { font-size: 1.9rem; }
  .page-title { font-size: 1.7rem; }
  .article-title { font-size: 1.7rem; }
  .section-title { font-size: 1.4rem; }
  .footer-bottom { justify-content: center; text-align: center; }
  .popular-item { padding: 12px 14px; }
  .table td, .table th { padding: 10px 8px; }
}

/* ============================================================
   Audit responsif teliti — perbaikan titik-titik sempit
   ============================================================ */
@media (max-width: 600px) {
  .article-meta { gap: 8px; }
  .article-actions { flex-wrap: wrap; }
  .action-btn { padding: 8px 12px; font-size: .92rem; }
  .author-box { flex-wrap: wrap; }
  .profile-top { flex-wrap: wrap; }
  .comment-form-head { flex-wrap: wrap; }
  .comment-actions { flex-wrap: wrap; }
  .comment-login { padding: 12px 14px; }
  .newsletter-input { font-size: .95rem; }
  .search-bar .btn { width: 100%; }
  .page-head { padding: 30px 0 6px; }
  .breadcrumb { font-size: .8rem; gap: 5px; }
  .stat-item { font-size: .85rem; }
  .hero-eyebrow { font-size: .78rem; padding: 4px 10px; }
  .hero-featured-body { padding: 16px; }
  .hero-featured-title { font-size: 1.2rem; }
  .article-stats { gap: 10px; }
}
@media (max-width: 480px) {
  .brand-name { font-size: 1.15rem; }
  .nav-search { display: none; }
  .dash-topbar { padding: 0 10px; gap: 8px; }
  .topbar-right { gap: 8px; }
  .dash-content { padding: 16px 12px 24px; }
  .dash-head { gap: 10px; }
  .panel { padding: 14px; }
  .form-inline .input, .filter-bar .input { min-width: 0; flex: 1 1 100%; }
  .form-inline .btn, .filter-bar .btn { flex: 0 0 auto; }
  .slug-prefix { padding: 10px 8px; font-size: .78rem; }
  .editor-area { padding: 16px 14px; min-height: 320px; }
  .editor-toolbar button { min-width: 30px; height: 30px; }
  .article-content { font-size: 1.02rem; line-height: 1.75; }
  .article-content h2 { font-size: 1.5rem; }
  .comments-section .section-title { font-size: 1.3rem; }
  .auth-sub { font-size: .88rem; }
  .footer-grid { padding-bottom: 20px; }
  .container { padding: 0 12px; }
}
