/* ============================================================
   DESIGN TOKENS
============================================================ */
:root {
  --ff-display: 'Syne', sans-serif;
  --ff-body: 'DM Sans', sans-serif;
  --ff-serif: 'Instrument Serif', serif;
  --ff-arabic: 'Noto Naskh Arabic', serif;

  --bg-base: #F5F2ED;
  --bg-surface: #FFFFFF;
  --bg-muted: #EDE9E2;
  --bg-accent: #004D42;
  --bg-accent-soft: #E0F0EC;

  --tx-primary: #1A1814;
  --tx-secondary: #5A5650;
  --tx-muted: #9A9590;
  --tx-on-accent: #FFFFFF;
  --tx-accent: #004D42;

  --bd-light: rgba(26, 24, 20, 0.10);
  --bd-medium: rgba(26, 24, 20, 0.18);

  --accent: #006B5C;
  --danger: #C0392B;
  --warn: #D4780A;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);

  --sidebar-w: 220px;
  --right-w: 248px;
  --header-h: 56px;
  --quickbar-h: 38px;
  --topbar-total: 94px;
}

/* ── Dark mode ──────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-base: #0E0F12;
  --bg-surface: #181A1F;
  --bg-muted: #1F2127;
  --bg-accent: #00B89A;
  --bg-accent-soft: #0A2E2A;

  --tx-primary: #EDE9E2;
  --tx-secondary: #9A9590;
  --tx-muted: #5A5650;
  --tx-on-accent: #0E0F12;
  --tx-accent: #00C9A7;

  --bd-light: rgba(255, 255, 255, 0.07);
  --bd-medium: rgba(255, 255, 255, 0.13);

  --accent: #00C9A7;
  --danger: #E74C3C;
  --warn: #F39C12;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.40);
}

/* ── Arabic RTL ─────────────────────────────────────────── */
[lang="ar"] { direction: rtl; font-family: var(--ff-arabic); }
[lang="ar"] .cat-item  { border-left: none; border-right: 2px solid transparent; }
[lang="ar"] .cat-item.active { border-right-color: var(--accent); }
[lang="ar"] .widget-item { border-left: none; border-right: 2px solid transparent; }
[lang="ar"] .widget-item:hover { border-right-color: var(--accent); }
[lang="ar"] .article-cat-badge { left: auto; right: 14px; }
[lang="ar"] .sidebar-drawer { left: auto; right: -100%; }
[lang="ar"] .sidebar-drawer.open { right: 0; left: auto; }
[lang="ar"] .article-content blockquote {
  border-left: none;
  border-right: 3px solid var(--accent);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: var(--ff-body);
  background: var(--bg-base);
  color: var(--tx-primary);
  line-height: 1.6;
  transition: background .25s, color .25s;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============================================================
   QUICKBAR
============================================================ */
.quickbar {
  height: var(--quickbar-h);
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.quickbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.quickbar-links::-webkit-scrollbar { display: none; }
.quickbar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: color .15s, background .15s;
  font-family: var(--ff-display);
}
.quickbar-link:hover { color: #fff; background: rgba(255,255,255,.12); }
.quickbar-link i { font-size: 11px; opacity: .7; }

.quickbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Language switcher ──────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.10);
  border-radius: 20px;
  padding: 2px;
  gap: 1px;
}
.lang-btn {
  padding: 3px 10px;
  border-radius: 18px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.68);
  letter-spacing: .04em;
  transition: all .15s;
  font-family: var(--ff-display);
}
.lang-btn.active,
.lang-btn:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ── Theme toggle ───────────────────────────────────────── */
.theme-toggle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.80);
  font-size: 14px;
  transition: all .15s;
  background: rgba(255,255,255,.10);
}
.theme-toggle:hover { color: #fff; background: rgba(255,255,255,.20); }

/* ── Quickbar icon buttons (admin / kontributor) ────────── */
.qb-separator {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,.18);
  flex-shrink: 0;
}
.qb-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.80);
  font-size: 13px;
  transition: all .15s;
  background: rgba(255,255,255,.10);
  text-decoration: none;
  position: relative;
  flex-shrink: 0;
}
.qb-icon-btn:hover { color: #fff; background: rgba(255,255,255,.22); }
.qb-icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  background: rgba(0,0,0,.80);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .15s, transform .15s;
  font-family: var(--ff-display);
  letter-spacing: .02em;
  z-index: 999;
}
.qb-icon-btn:hover::after { opacity: 1; transform: translateY(0); }

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bd-light);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: var(--quickbar-h);
  z-index: 190;
  box-shadow: var(--shadow-sm);
}
.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--tx-secondary);
  font-size: 18px;
  transition: all .15s;
  flex-shrink: 0;
}
.hamburger:hover { background: var(--bg-muted); color: var(--tx-primary); }

/* ── Logo ───────────────────────────────────────────────── */
.nav-logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-title { font-family: var(--ff-display); font-size: 15px; font-weight: 700; color: var(--tx-primary); letter-spacing: -.01em; }
.logo-sub { font-size: 10px; color: var(--tx-muted); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }

/* ── Search ─────────────────────────────────────────────── */
.nav-search { flex: 0; margin-left: auto; position: relative; display: flex; align-items: center; gap: 8px; }
.search-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-secondary);
  font-size: 14px;
  background: transparent;
  border: 1px solid transparent;
  transition: all .15s;
}
.search-toggle:hover { background: var(--bg-muted); color: var(--tx-primary); border-color: var(--bd-light); }
.search-wrap {
  width: 0;
  overflow: hidden;
  transition: width .22s ease, opacity .18s;
  opacity: 0;
  display: flex;
  align-items: center;
}
.search-wrap.open { width: 260px; opacity: 1; }
.search-wrap .search-input {
  width: 100%;
  height: 34px;
  background: var(--bg-muted);
  border: 1px solid var(--bd-light);
  border-radius: 20px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--tx-primary);
  font-family: var(--ff-body);
  outline: none;
  transition: all .15s;
}
.search-wrap .search-input::placeholder { color: var(--tx-muted); }
.search-wrap .search-input:focus {
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(0,107,92,.12);
}

/* ============================================================
   LAYOUT WRAPPER & GRID
============================================================ */
.layout-wrapper { max-width: 1220px; margin: 0 auto; padding: 0 16px; }
.main-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-w);
  gap: 22px;
  padding: 24px 0 48px;
  align-items: start;
}

/* ============================================================
   SIDEBAR KIRI
============================================================ */
.sidebar {
  position: sticky;
  top: calc(var(--topbar-total) + 20px);
  max-height: calc(100vh - var(--topbar-total) - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bd-medium) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--bd-medium); border-radius: 4px; }

.sidebar-section {
  background: var(--bg-surface);
  border: 1px solid var(--bd-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.sidebar-header {
  padding: 11px 16px 9px;
  border-bottom: 1px solid var(--bd-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-header-title {
  font-family: var(--ff-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--tx-muted);
}
.sidebar-header i { color: var(--accent); font-size: 12px; }

/* ── Category list ──────────────────────────────────────── */
.cat-list { padding: 6px 0; }
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  transition: all .12s;
  gap: 8px;
  border-left: 2px solid transparent;
}
.cat-item:hover { background: var(--bg-muted); }
.cat-item.active { background: var(--bg-accent-soft); border-left-color: var(--accent); }
.cat-item-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cat-name { font-size: 13px; font-weight: 500; color: var(--tx-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-item.active .cat-name { color: var(--tx-accent); font-weight: 600; }
.cat-count {
  font-size: 11px;
  color: var(--tx-muted);
  background: var(--bg-muted);
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
  font-weight: 500;
}
.cat-item.active .cat-count { background: var(--bg-accent-soft); color: var(--tx-accent); }

/* ── Sidebar drawer (mobile) ────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  backdrop-filter: blur(2px);
}
.sidebar-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  bottom: 0;
  width: 280px;
  background: var(--bg-surface);
  z-index: 310;
  overflow-y: auto;
  padding: 16px;
  transition: left .25s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-md);
}
.sidebar-drawer.open { left: 0; }
.drawer-close {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bd-light);
}
.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-secondary);
  font-size: 16px;
  transition: all .15s;
}
.drawer-close-btn:hover { background: var(--bg-muted); }

/* ============================================================
   CONTENT COLUMN
============================================================ */
.content-col { min-width: 0; }
.section-label { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-label-text {
  font-family: var(--ff-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--tx-muted);
}
.section-label-line { flex: 1; height: 1px; background: var(--bd-light); }

/* ── Article card ───────────────────────────────────────── */
.article-full {
  background: var(--bg-surface);
  border: 1px solid var(--bd-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .35s ease both;
}
.article-cover {
  width: 100%;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  position: relative;
  overflow: hidden;
}
.ph-bg-1 { background: linear-gradient(135deg,#d4ede6,#a8d8cc); }
.ph-bg-2 { background: linear-gradient(135deg,#e0d4ed,#c4a8d8); }
.ph-bg-3 { background: linear-gradient(135deg,#ede8d4,#d8cba8); }
.ph-bg-4 { background: linear-gradient(135deg,#d4e0ed,#a8c4d8); }
.ph-bg-5 { background: linear-gradient(135deg,#edd4d4,#d8a8a8); }

.article-cat-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 11px;
  border-radius: 20px;
  font-family: var(--ff-display);
  z-index: 1;
}
.cover-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.12));
}
.article-body { padding: 24px 28px 20px; }
.article-title {
  font-family: var(--ff-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--tx-primary);
  line-height: 1.22;
  margin-bottom: 12px;
  letter-spacing: -.03em;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bd-light);
}
.meta-author { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tx-secondary); }
.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--bd-medium); flex-shrink: 0; }
.meta-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--tx-muted); }
.meta-item i { font-size: 11px; }

.article-content { font-size: 15px; color: var(--tx-secondary); line-height: 1.80; margin-bottom: 22px; }
.article-content p { margin-bottom: 1em; }
.article-content p:last-child { margin-bottom: 0; }
.article-content strong { color: var(--tx-primary); font-weight: 600; }
.article-content em { font-family: var(--ff-serif); font-style: italic; font-size: 16px; }
.article-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.2em 0;
  padding: .7em 1em;
  background: var(--bg-accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--tx-secondary);
  font-style: italic;
}

/* ── Article footer: reaksi + navigasi ─────────────────── */
.article-footer {
  border-top: 1px solid var(--bd-light);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.reaction-group { display: flex; align-items: center; gap: 8px; }
.reaction-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--bd-light);
  color: var(--tx-secondary);
  transition: all .15s;
  background: var(--bg-base);
}
.reaction-btn:hover { border-color: var(--bd-medium); color: var(--tx-primary); }
.reaction-btn.liked { border-color: var(--accent); background: var(--bg-accent-soft); color: var(--tx-accent); }
.reaction-btn.disliked { border-color: var(--danger); background: rgba(192,57,43,.07); color: var(--danger); }
.reaction-btn i { font-size: 14px; }
.reaction-btn:disabled { opacity: .5; cursor: not-allowed; }

.article-nav { display: flex; align-items: center; gap: 8px; }
.art-nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--bd-light);
  color: var(--tx-secondary);
  background: var(--bg-surface);
  transition: all .15s;
  white-space: nowrap;
}
.art-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--tx-accent); }
.art-nav-btn:disabled { opacity: .35; cursor: default; }
.page-indicator { font-size: 12px; color: var(--tx-muted); padding: 0 4px; white-space: nowrap; }

/* ============================================================
   RIGHT COLUMN — WIDGETS
============================================================ */
.right-col {
  position: sticky;
  top: calc(var(--topbar-total) + 20px);
  max-height: calc(100vh - var(--topbar-total) - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bd-medium) transparent;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.right-col::-webkit-scrollbar { width: 4px; }
.right-col::-webkit-scrollbar-thumb { background: var(--bd-medium); border-radius: 4px; }

.widget-box {
  background: var(--bg-surface);
  border: 1px solid var(--bd-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.widget-header {
  padding: 11px 16px 9px;
  border-bottom: 1px solid var(--bd-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget-title {
  font-family: var(--ff-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--tx-muted);
}
.widget-header i { font-size: 12px; }
.wi-ann { color: #175AC8; }
.wi-new { color: var(--accent); }
.wi-hot { color: #C0392B; }

.widget-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all .12s;
}
.widget-item:hover { background: var(--bg-muted); border-left-color: var(--accent); }
.widget-num {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--bd-medium);
  line-height: 1;
  min-width: 20px;
  flex-shrink: 0;
  letter-spacing: -.04em;
  margin-top: 1px;
}
.widget-info { flex: 1; min-width: 0; }
.widget-item-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--tx-primary);
  line-height: 1.35;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.widget-item:hover .widget-item-title { color: var(--tx-accent); }
.widget-item-meta { font-size: 10.5px; color: var(--tx-muted); }

.ann-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}
.ann-icon-wrap.info { background: rgba(23,90,200,.10); color: #175AC8; }
.ann-icon-wrap.warn { background: rgba(212,120,10,.10); color: var(--warn); }
.ann-icon-wrap.ok   { background: var(--bg-accent-soft); color: var(--tx-accent); }

/* ============================================================
   FOOTER
============================================================ */
.footer {
  border-top: 1px solid var(--bd-light);
  background: var(--bg-surface);
  padding: 18px 24px;
  text-align: center;
}
.footer-text { font-size: 12px; color: var(--tx-muted); line-height: 1.6; }
.footer-text a { color: var(--tx-accent); }

/* ============================================================
   SKELETON LOADING
============================================================ */
.skeleton {
  border-radius: 6px;
  background: var(--bg-muted);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
  animation: shimmer 1.4s ease-in-out infinite;
}
[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.06) 50%, transparent 100%);
}

/* ============================================================
   ANIMASI
============================================================ */
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 960px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hamburger { display: flex; }
  .right-col { position: static; max-height: none; }
}

@media (max-width: 680px) {
  :root { --quickbar-h: 42px; --topbar-total: 98px; }
  .main-layout { grid-template-columns: 1fr; padding: 14px 0 32px; gap: 14px; }
  .right-col { position: static; max-height: none; }
  .article-body { padding: 16px 16px 14px; }
  .article-footer { padding: 12px 16px; }
  .article-cover { height: 200px; }
  .article-title { font-size: 20px; }
  .quickbar { padding: 0 14px; }
  .quickbar-link span { display: none; }
  .navbar { padding: 0 14px; }
  .nav-search { max-width: none; }
  .logo-sub { display: none; }
  .layout-wrapper { padding: 0 12px; }
}
