:root {
  --ungu-tua: #4c1d95;
  --ungu: #7c3aed;
  --ungu-terang: #a855f7;
  --ungu-pucat: #f3e8ff;
  --ungu-pucat-2: #faf5ff;
  --putih: #ffffff;
  --teks: #1f1533;
  --teks-abu: #6b6478;
  --border: #e9d8fd;
  --merah: #dc2626;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(76, 29, 149, 0.08);
  --shadow-lg: 0 8px 30px rgba(76, 29, 149, 0.15);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--ungu-pucat-2);
  color: var(--teks);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== TOP BAR ===== */
.topbar {
  background: var(--ungu-tua);
  color: #e9d8fd;
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 34px;
}
.topbar-tanggal { opacity: .85; }
.topbar-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f3e8ff;
  opacity: .9;
  transition: opacity .15s;
}
.topbar-admin:hover { opacity: 1; }
.topbar-admin svg { width: 15px; height: 15px; }

/* ===== HEADER ===== */
.site-header {
  background: var(--putih);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  color: var(--ungu-tua);
  white-space: nowrap;
}
.logo .badge-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ungu-terang), var(--ungu-tua));
  display: inline-block;
}
.logo span.sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--teks-abu);
  display: block;
  letter-spacing: .5px;
}

.search-form {
  flex: 1;
  max-width: 420px;
  display: flex;
}
.search-form input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-right: none;
  padding: 9px 14px;
  border-radius: 20px 0 0 20px;
  outline: none;
  font-size: 14px;
  background: var(--ungu-pucat-2);
}
.search-form input:focus { border-color: var(--ungu); }
.search-form button {
  border: 1.5px solid var(--ungu);
  background: var(--ungu);
  color: #fff;
  padding: 0 18px;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.search-form button:hover { background: var(--ungu-tua); }

/* ===== NAV KATEGORI ===== */
.nav-kategori {
  background: linear-gradient(90deg, var(--ungu-tua), var(--ungu));
}
.nav-kategori ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
}
.nav-kategori a {
  display: block;
  padding: 11px 16px;
  color: #f3e8ff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: .15s;
}
.nav-kategori a:hover,
.nav-kategori a.aktif {
  background: rgba(255,255,255,0.12);
  border-bottom-color: #fff;
  color: #fff;
}

/* ===== LAYOUT ===== */
.layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 26px;
  margin: 28px auto;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

.section-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--ungu-tua);
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 5px solid var(--ungu);
}

/* ===== HERO (berita utama) ===== */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 30px;
}
@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; }
}
.hero-utama {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 340px;
  background: #ddd;
}
.hero-utama img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.hero-caption {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(0deg, rgba(30,10,60,.92), rgba(30,10,60,0));
  padding: 60px 22px 18px;
}
.hero-caption .kategori-tag { background: var(--ungu-terang); }
.hero-caption h2 {
  color: #fff;
  font-size: 24px;
  margin: 8px 0 6px;
  line-height: 1.3;
}
.hero-caption p { color: #e9d8fd; font-size: 13px; margin: 0; }

.hero-list { display: flex; flex-direction: column; gap: 12px; }
.hero-list-item {
  display: flex;
  gap: 12px;
  background: var(--putih);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
}
.hero-list-item img {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.hero-list-item h3 {
  font-size: 13.5px;
  margin: 0 0 4px;
  line-height: 1.35;
  color: var(--teks);
}
.hero-list-item .meta { font-size: 11px; color: var(--teks-abu); }

/* ===== KARTU BERITA (grid) ===== */
.grid-berita {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 560px) {
  .grid-berita { grid-template-columns: 1fr; }
}
.card-berita {
  background: var(--putih);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}
.card-berita:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card-berita .thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--ungu-pucat);
}
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kategori-tag {
  display: inline-block;
  background: var(--ungu-pucat);
  color: var(--ungu-tua);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.card-body h3 {
  font-size: 15.5px;
  margin: 0;
  line-height: 1.4;
  color: var(--teks);
}
.card-body p.ringkasan { font-size: 13px; color: var(--teks-abu); margin: 0; }
.meta {
  font-size: 11.5px;
  color: var(--teks-abu);
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

/* ===== SIDEBAR ===== */
.sidebar-box {
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 20px;
}
.sidebar-box h4 {
  color: var(--ungu-tua);
  font-size: 15px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ungu-pucat);
}
.trending-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}
.trending-item:last-child { border-bottom: none; }
.trending-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--ungu-terang);
  width: 24px;
  flex-shrink: 0;
}
.trending-item h5 { font-size: 13px; margin: 0; line-height: 1.35; }

.kategori-list a {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--border);
  color: var(--teks);
}
.kategori-list a:last-child { border-bottom: none; }
.kategori-list a:hover { color: var(--ungu); }
.kategori-list span { color: var(--teks-abu); font-size: 12px; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 30px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  background: var(--putih);
}
.pagination a:hover { background: var(--ungu-pucat); }
.pagination .aktif { background: var(--ungu); color: #fff; border-color: var(--ungu); }

/* ===== HALAMAN DETAIL BERITA ===== */
.detail-berita { background: var(--putih); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.detail-berita h1 { font-size: 26px; color: var(--teks); margin: 12px 0; line-height: 1.35; }
.detail-berita .meta-detail {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--teks-abu);
  padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.detail-berita img.cover {
  width: 100%; border-radius: var(--radius); margin-bottom: 18px; max-height: 460px; object-fit: cover;
}
.detail-berita .isi-berita { font-size: 16px; color: #2c2440; }
.detail-berita .isi-berita p { margin: 0 0 14px; }
.sumber-asli-box {
  margin-top: 24px; padding: 16px; background: var(--ungu-pucat);
  border-radius: var(--radius); font-size: 13.5px;
}
.sumber-asli-box a { color: var(--ungu-tua); font-weight: 700; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--ungu-tua);
  color: #e9d8fd;
  margin-top: 40px;
  padding: 34px 0 18px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 7px; font-size: 13.5px; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  text-align: center; font-size: 12.5px; opacity: .75;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15);
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--teks-abu); }
.empty-state svg { width: 60px; height: 60px; color: var(--ungu-terang); margin-bottom: 14px; }

/* ===== ADMIN ===== */
body.admin-body { background: var(--ungu-pucat-2); }
.admin-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--ungu-tua), var(--ungu-terang));
}
.admin-login-box {
  background: #fff; padding: 36px 32px; border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 360px;
}
.admin-login-box h2 { color: var(--ungu-tua); margin-top: 0; text-align: center; }
.admin-login-box .logo-mini { text-align: center; margin-bottom: 6px; font-size: 34px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--teks); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--ungu); }
.btn {
  display: inline-block; background: var(--ungu); color: #fff; border: none;
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--ungu-tua); }
.btn.btn-block { width: 100%; }
.btn.btn-danger { background: var(--merah); }
.btn.btn-danger:hover { background: #b91c1c; }
.btn.btn-outline { background: #fff; color: var(--ungu); border: 1.5px solid var(--ungu); }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-success { background: #dcfce7; color: #166534; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; background: var(--ungu-tua); color: #f3e8ff; flex-shrink: 0;
  padding: 20px 0;
}
.admin-sidebar .brand { padding: 0 20px 20px; font-weight: 800; font-size: 18px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 12px;}
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 11px 20px; font-size: 14px; color: #e9d8fd;
}
.admin-sidebar a:hover, .admin-sidebar a.aktif { background: rgba(255,255,255,.1); color: #fff; }
.admin-main { flex: 1; padding: 26px 30px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.admin-topbar h1 { font-size: 21px; color: var(--ungu-tua); margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--ungu-tua); }
.stat-card .label { font-size: 12.5px; color: var(--teks-abu); }

table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.admin-table th, table.admin-table td { padding: 11px 14px; font-size: 13.5px; text-align: left; border-bottom: 1px solid var(--border); }
table.admin-table th { background: var(--ungu-pucat); color: var(--ungu-tua); font-weight: 700; }
table.admin-table img.thumb-mini { width: 60px; height: 42px; object-fit: cover; border-radius: 4px; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-aktif { background: #dcfce7; color: #166534; }
.badge-nonaktif { background: #fee2e2; color: #b91c1c; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
