* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #F5F4EF;
  --bg-card: #FBFAF6;
  --bg-subtle: #EDEBE2;
  --text: #222222;
  --text-2: #52504A;
  --text-3: #8B897F;
  --border: #E2E0D5;
  --cream: #F3EEE0;
  --cream-ink: #142138;
  --accent: #4A90D9;
  --accent-bright: #6FB1E8;
  --on-accent: #FFFFFF;
  --accent-2: #2C6E6A;
  --honey: #E9A821;
  --topbar: #142138;
  --nav: #5B9BD5;
  --footer-bg: #142138;
  --footer-text: #A8B3C6;
  --footer-heading: #F2F2ED;
  --shadow: rgba(27, 54, 93, 0.07);
  --shadow-hover: rgba(27, 54, 93, 0.14);
}

body.dark-mode {
  --bg: #121212;
  --bg-card: #1E1E1E;
  --bg-subtle: #262626;
  --text: #E0E0E0;
  --text-2: #B3B6BC;
  --text-3: #84888F;
  --border: #2D2D2D;
  --cream: #E8E2D2;
  --cream-ink: #142138;
  --accent: #7EB3E8;
  --accent-bright: #7EB3E8;
  --on-accent: #0E1F35;
  --accent-2: #60A5FA;
  --honey: #FBBF24;
  --topbar: #0D0D0D;
  --nav: #152A45;
  --footer-bg: #0D0D0D;
  --footer-text: #9A9EA5;
  --footer-heading: #E8E8E8;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-hover: rgba(0, 0, 0, 0.6);
}

::selection { background: var(--cream); color: var(--cream-ink); }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

.container { max-width: 1440px; margin: 0 auto; padding: 0 20px; }

/* ===== NAV KRAMANEWS ===== */
nav { background: var(--nav); position: relative; }
.nav-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 1440px; margin: 0 auto; padding: 3px 10px;
  flex-wrap: wrap;
}
.nav-side { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.nav-side.nav-right { margin-left: auto; }
.nav-icon-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text-2); font-size: 13px; cursor: pointer;
  transition: all 0.3s; flex-shrink: 0;
}
.nav-icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; margin: 1px 6px; }

/* ═══ LOGO KN: SAMA di light & dark — rim putih, dalam merah, KN putih ═══ */
.logo-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: #E11D2E;
  border: 2.5px solid #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  flex-shrink: 0;
}
.kn-text {
  font-family: 'Playfair Display', serif;
  font-weight: 900; font-size: 12px; letter-spacing: 1px;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

@keyframes spinOnce { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spinFast { from { transform: rotate(0deg); } to { transform: rotate(720deg); } }
.logo-circle.spin-once { animation: spinOnce 1s ease; }
.logo-circle.spin-fast { animation: spinFast 0.7s ease; }
.nav-brand:hover .logo-circle { animation: spinOnce 1.2s linear infinite; }

/* ═══ TULISAN KramaNews: MERAH dengan tepi huruf PUTIH (sama di dark & light) ═══ */
.brand-text {
  font-family: 'Playfair Display', serif;
  font-weight: 900; font-size: 18px; white-space: nowrap;
  color: #E11D2E;
  text-shadow:
    -1px -1px 0 #FFFFFF, 1px -1px 0 #FFFFFF,
    -1px  1px 0 #FFFFFF, 1px  1px 0 #FFFFFF,
     0   -1px 0 #FFFFFF, 0    1px 0 #FFFFFF,
    -1px  0   0 #FFFFFF, 1px  0   0 #FFFFFF;
}
.brand-text span { color: #E11D2E; }

.nav-menu {
  display: flex; align-items: center; gap: 2px;
  flex-wrap: wrap; justify-content: center;
}
.nav-menu a {
  flex-shrink: 0; padding: 8px 12px; text-decoration: none;
  color: #FFFFFF; font-size: 13px; font-weight: 600; transition: all 0.3s;
  white-space: nowrap;
}
.nav-menu a:hover { background: rgba(255,255,255,0.22); }
.nav-menu a.active { background: #1B365D; }

/* ═══ TANGGAL: teks putih mengambang, tanpa kapsul ═══ */
.nav-date {
  display: flex; align-items: center;
  font-size: 12px; font-weight: 600; color: #FFFFFF;
  white-space: nowrap; flex-shrink: 0;
  background: none; border: none; padding: 0;
}
body.dark-mode .nav-date { color: #FFFFFF; }

.dark-mode-btn {
  background: none; border: 2px solid var(--border); border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer; font-size: 11px;
  color: var(--text); transition: all 0.3s; margin-left: 4px;
}
.dark-mode-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ═══ DESKTOP: menu di TENGAH, ikon search+darkmode di SUDUT KANAN ═══ */
@media (min-width: 901px) {
  .nav-menu { order: 3; flex: 1; justify-content: center; margin: 0 10px; }
  .nav-side.nav-right { order: 4; margin-left: 0; flex-shrink: 0; }
}

/* ═══ TOMBOL HOME MENGAMBANG ═══ */
.float-home {
  position: fixed; bottom: 22px; right: 22px; z-index: 1400;
  border: none; background: transparent; cursor: pointer; padding: 0;
  opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.9);
  transition: all 0.3s;
}
.float-home.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.float-home .logo-circle { width: 46px; height: 46px; box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.float-home .kn-text { font-size: 15px; }
.float-home:hover .logo-circle { animation: spinOnce 1.2s linear infinite; }

/* Popup pencarian */
.search-pop {
  display: none; position: absolute; top: 100%; right: 12px; z-index: 1600;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  padding: 10px; width: 300px;
}
.search-pop.open { display: block; }
.search-pop-inner {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-subtle); border-radius: 50px; padding: 9px 14px;
}
.search-pop-inner:focus-within { border-color: var(--accent); }
.search-pop-inner i { color: var(--text-3); }
.search-pop-inner input { border: none; outline: none; background: transparent; flex: 1; font-size: 14px; font-family: 'Inter', sans-serif; color: var(--text); }

/* ===== TICKER ===== */
.ticker-wrap { display: flex; flex-direction: column; overflow: hidden; }
.ticker-bar { background: var(--cream); overflow: hidden; white-space: nowrap; padding: 10px 0; }
body.dark-mode .ticker-bar { background: #23211B; }
.ticker-content {
  display: inline-block; animation: scroll 45s linear infinite;
  font-size: 14px; padding-left: 30px; color: #33302A;
}
body.dark-mode .ticker-content { color: #FFFFFF; }
.ticker-content:hover { animation-play-state: paused; }
.tick-item { cursor: pointer; }
.tick-item:hover b { text-decoration: underline; }
.ticker-content b { color: var(--accent); margin-right: 8px; font-size: 12px; letter-spacing: 1px; }
.ticker-content .tt { opacity: 0.7; font-size: 12px; margin-left: 6px; }
.ticker-content .sep { margin: 0 22px; opacity: 0.4; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ticker-label {
  background: var(--topbar); color: #FFFFFF;
  padding: 7px 18px; font-weight: 700; font-size: 12px; letter-spacing: 2px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  text-transform: uppercase;
}
.ticker-label .blink { width: 8px; height: 8px; background: #E5484D; border-radius: 50%; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ===== HERO ===== */
.hero-section { padding: 14px 0 10px; }
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; }
.hero-left { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero-main {
  position: relative; border-radius: 16px; overflow: hidden;
  cursor: pointer; height: 460px; transition: transform 0.3s;
}
.hero-main:hover { transform: scale(1.01); }
.hero-main img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.hero-main:hover img { transform: scale(1.05); }
.hero-main .hero-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 40px 30px 30px; color: #F5F5F0;
}
.hero-main h2 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.hero-meta { font-size: 13px; opacity: 0.85; display: flex; gap: 20px; flex-wrap: wrap; }
.hero-meta i { margin-right: 5px; }
.hero-side { display: flex; flex-direction: column; gap: 20px; }
.hero-small { position: relative; flex: 1; border-radius: 16px; overflow: hidden; cursor: pointer; min-height: 220px; }
.hero-small img { position: absolute; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.hero-small:hover img { transform: scale(1.05); }
.hero-small .hero-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 20px; color: #F5F5F0;
}
.hero-small h3 { font-size: 16px; margin-bottom: 5px; }
.hero-small .hero-meta { font-size: 11px; }

/* ═══ KOLOLASI KATEGORI — LEBAR PENUH ═══ */
.collage-section { padding: 4px 0 10px; }
.collage-section .collage-grid { grid-template-columns: repeat(4, 1fr); }
.collage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.col-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; box-shadow: 0 2px 8px var(--shadow);
}
.col-head {
  font-weight: 800; font-size: 13px; cursor: pointer; color: var(--text);
  padding-bottom: 7px; border-bottom: 2px solid var(--accent); margin-bottom: 4px;
  display: flex; justify-content: space-between; align-items: center;
}
.col-head:hover { color: var(--accent); }
.col-head i { font-size: 10px; color: var(--accent); }
.col-item {
  display: flex; gap: 8px; padding: 6px 2px;
  border-bottom: 1px dashed var(--border); cursor: pointer; border-radius: 6px;
}
.col-item:last-child { border-bottom: none; }
.col-item:hover { background: var(--bg-subtle); }
.col-item img { width: 52px; height: 38px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.col-item h5 {
  font-size: 11.5px; line-height: 1.35; color: var(--text); font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.col-item span { font-size: 10px; color: var(--text-3); }
.col-empty { font-size: 11px; color: var(--text-3); padding: 6px 2px; }

/* ===== BADGE ===== */
.badge {
  display: inline-block; padding: 5px 14px; border-radius: 50px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 12px; color: #F2F1EC;
}
.badge-nasional      { background: #1B365D; }
.badge-internasional { background: #2C6E6A; }
.badge-ekonomi       { background: #7B2D3E; }
.badge-olahraga      { background: #335E43; }
.badge-teknologi     { background: #47548C; }
.badge-hiburan       { background: #6E4470; }
.badge-kesehatan     { background: #1F6F54; }
body.dark-mode .badge-nasional      { background: #24385C; color: #9DC1F0; }
body.dark-mode .badge-internasional { background: #1E403C; color: #8FD0CA; }
body.dark-mode .badge-ekonomi       { background: #4A2430; color: #EFA9B8; }
body.dark-mode .badge-olahraga      { background: #26432F; color: #A9D8B6; }
body.dark-mode .badge-teknologi     { background: #2E3658; color: #AEB8EE; }
body.dark-mode .badge-hiburan       { background: #402A48; color: #D5B2E6; }
body.dark-mode .badge-kesehatan     { background: #1D4234; color: #9BE3C4; }

/* ===== SECTION TITLE ===== */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin: 35px 0 12px; border-bottom: 2px solid var(--border); padding-bottom: 10px;
}
.section-header h2 { font-family: 'Playfair Display', serif; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.section-header h2::before { content: ''; width: 5px; height: 26px; background: var(--accent); border-radius: 3px; display: inline-block; }
.view-all { color: var(--accent-2); text-decoration: none; font-size: 13px; font-weight: 600; }
.view-all:hover { text-decoration: underline; }

/* ===== LAYOUT ===== */
.content-layout { display: grid; grid-template-columns: 1fr 340px; gap: 30px; padding-bottom: 50px; }

/* ===== DAFTAR BERITA ===== */
.news-list { display: flex; flex-direction: column; }
.news-list-item {
  display: flex; gap: 18px; padding: 18px 12px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.2s; border-radius: 10px;
}
.news-list-item:hover { background: var(--bg-card); }
.nl-text { flex: 1; min-width: 0; }
.nl-source {
  font-size: 11px; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;
}
.nl-source .nl-cat { text-transform: uppercase; letter-spacing: 1px; }
.nl-source .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.nl-source .nl-time { color: var(--text-3); font-weight: 500; }
.news-list-item h3 {
  font-size: 18px; font-weight: 700; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-list-item p {
  font-size: 13.5px; color: var(--text-3); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nl-meta { font-size: 12px; color: var(--text-3); margin-top: 8px; display: flex; gap: 15px; flex-wrap: wrap; }
.nl-meta i { margin-right: 4px; }
.nl-thumb {
  width: 210px; height: 138px; object-fit: cover;
  border-radius: 10px; flex-shrink: 0; background: var(--bg-subtle);
}

/* ===== SIDEBAR ===== */
.sidebar > div {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; margin-bottom: 25px;
  box-shadow: 0 2px 10px var(--shadow);
}
.sidebar-title {
  font-size: 17px; font-weight: 800; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.sidebar-title i { color: var(--accent); }

/* ═══ TERPOPULER — GAYA KOMPAS ═══ */
.trending-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: transform 0.2s;
  align-items: flex-start;
}
.trending-item:last-child { border-bottom: none; }
.trending-item:hover { transform: translateX(5px); }
.trending-item:hover .trending-num { transform: scale(1.08); }
.trending-num {
  font-family: 'Playfair Display', serif;
  font-size: 44px; font-weight: 900;
  color: #E11D2E; line-height: 0.9;
  min-width: 46px; transition: transform 0.2s;
}
.trending-item h4 { font-size: 14.5px; font-weight: 800; line-height: 1.4; color: var(--text); }
.trending-item span { font-size: 11px; color: var(--text-3); }
body.dark-mode .trending-num { color: #F87171; }

.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--bg-subtle); border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all 0.3s;
}
.cat-item:hover { background: var(--accent); color: var(--on-accent); }
.cat-item .count { background: var(--cream); color: var(--cream-ink); font-size: 11px; padding: 2px 10px; border-radius: 50px; }
.cat-item:hover .count { background: var(--bg-card); color: var(--accent); }
.newsletter-box { background: linear-gradient(135deg, #3E7CB8, #2C5F8A) !important; border: none !important; color: #E8ECF2; }
body.dark-mode .newsletter-box { background: linear-gradient(135deg, #1E3A5C, #16324F) !important; }
.newsletter-box .sidebar-title { color: #F5F7FA; }
.newsletter-box .sidebar-title i { color: #BBD9F2; }
.newsletter-box p { font-size: 13px; opacity: 0.9; margin-bottom: 15px; }
.newsletter-box input {
  width: 100%; padding: 12px 15px; border: none; border-radius: 10px;
  margin-bottom: 10px; font-family: 'Inter', sans-serif; outline: none;
  background: #F7F6F1; color: #222222;
}
.newsletter-box button {
  width: 100%; padding: 12px; background: var(--cream); color: var(--cream-ink);
  border: none; border-radius: 10px; font-weight: 700; cursor: pointer;
  transition: all 0.3s; font-family: 'Inter', sans-serif;
}
.newsletter-box button:hover { background: #FFFFFF; }

/* ===== FOOTER ===== */
footer { background: var(--footer-bg); color: var(--footer-text); padding: 50px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-grid h4 { color: var(--footer-heading); margin-bottom: 18px; font-size: 15px; }
.footer-grid .logo { color: var(--footer-heading); }
.footer-grid .logo span { color: var(--accent-bright); }
.footer-grid p { font-size: 13px; line-height: 1.8; }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid ul a { color: inherit; text-decoration: none; font-size: 13px; transition: color 0.3s; }
.footer-grid ul a:hover { color: var(--accent-bright); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); text-align: center; padding: 20px 0; font-size: 13px; }
.footer-bottom .admin-link { color: var(--accent-bright); cursor: pointer; text-decoration: none; }
.social-links { margin-top: 15px; }
.social-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: rgba(255,255,255,0.08);
  border-radius: 50%; color: inherit; margin-right: 8px;
  text-decoration: none; transition: all 0.3s;
}
.social-links a:hover { background: var(--accent-bright); color: #142138; transform: translateY(-3px); }

/* ===== HALAMAN BACA BERITA ===== */
.modal-overlay {
  position: fixed; inset: 0; background: var(--bg);
  display: none; z-index: 2000; overflow-y: auto;
}
.modal-overlay.active { display: block; }
.modal {
  background: var(--bg-card); width: 100%; max-width: 100%;
  min-height: 100vh; animation: articleIn 0.3s ease; position: relative;
}
@keyframes articleIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.article-layout { display: grid; grid-template-columns: 1fr 340px; min-height: 100vh; }
.article-main { padding-bottom: 50px; }
.article-img-wrap { max-width: 900px; margin: 28px auto 0; padding: 0 40px; }
.article-main img#modalImg {
  width: 100%; height: auto; max-height: 480px; object-fit: cover;
  border-radius: 16px; box-shadow: 0 4px 20px var(--shadow);
  background: var(--bg-subtle); display: block;
}
.article-content { padding: 26px 40px 40px; max-width: 900px; margin: 0 auto; }
.article-content h2 { font-size: 30px; margin-bottom: 12px; line-height: 1.3; color: var(--text); }
.modal-meta {
  display: flex; gap: 20px; font-size: 13px; color: var(--text-3);
  padding-bottom: 16px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.modal-meta i { margin-right: 5px; color: var(--accent); }

/* ═══ ISI BERITA: rata kiri-kanan (justify) ═══ */
.modal-content-text { font-size: 16.5px; line-height: 1.95; color: var(--text-2); text-align: justify; text-justify: inter-word; }
body.dark-mode .modal-content-text { color: #F5F5F5; }
body.dark-mode .modal-meta { color: #C8CBD0; }
body.dark-mode .article-content h2 { color: #FAFAFA; }
.modal-content-text p { margin-bottom: 16px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 14px 0; margin-bottom: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.share-label { font-size: 13px; font-weight: 700; color: var(--text-3); }
.share-btn { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; text-decoration: none; transition: transform 0.2s, filter 0.2s; }
.share-btn:hover { transform: translateY(-3px); filter: brightness(1.1); }
.share-btn.wa { background: #25D366; }
.share-btn.tg { background: #229ED9; }
.share-btn.fb { background: #1877F2; }
.share-btn.x  { background: #14171A; }

/* ═══ TOMBOL BACK — desktop: dekat garis pembatas artikel/sidebar ═══ */
.close-btn {
  position: fixed; top: 16px;
  right: calc(340px + 40px);
  height: 42px; padding: 0 20px; border-radius: 50px;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s; z-index: 2100;
  box-shadow: 0 3px 12px var(--shadow);
  display: flex; align-items: center; gap: 8px;
}
.close-btn i { font-size: 13px; }
.close-btn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.article-side { border-left: 1px solid var(--border); background: var(--bg-subtle); padding: 24px 20px; }

/* ===== KOTAK IKLAN ===== */
.ad-box {
  border: 2px dashed var(--border); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; color: var(--text-3);
  background: var(--bg-card); margin-bottom: 22px;
  position: relative; overflow: hidden;
}
.ad-box .ad-label {
  font-size: 9.5px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase; background: var(--bg-subtle);
  color: var(--text-3); padding: 3px 12px; border-radius: 50px;
  border: 1px solid var(--border);
}
.ad-box .ad-size { font-size: 11px; opacity: 0.75; }
.ad-box .ad-icon { font-size: 20px; opacity: 0.5; }
.ad-box.ad-square  { min-height: 250px; }
.ad-box.ad-tall    { min-height: 420px; }
.ad-box.ad-inarticle { min-height: 110px; margin: 26px 0; flex-direction: row; gap: 14px; }

.related-box h3 {
  font-size: 15px; font-weight: 800; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.related-box h3::before { content: ''; width: 4px; height: 18px; background: var(--accent); border-radius: 3px; }
.related-sub { font-size: 11.5px; color: var(--text-3); margin-bottom: 14px; }
.related-item {
  display: flex; gap: 12px; padding: 10px; border-radius: 10px;
  cursor: pointer; transition: background 0.2s, transform 0.2s;
  border: 1px solid transparent; margin-bottom: 6px;
}
.related-item:hover { background: var(--bg-card); border-color: var(--border); transform: translateX(3px); }
.related-item img { width: 86px; height: 62px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.related-item h5 {
  font-size: 12.5px; line-height: 1.45; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body.dark-mode .related-item h5 { color: #F0F0F0; }
.related-item span { font-size: 11px; color: var(--text-3); display: block; margin-top: 4px; }
.related-empty { font-size: 12.5px; color: var(--text-3); padding: 10px 4px; }

/* ===== FILTER ===== */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-btn {
  padding: 8px 18px; border-radius: 50px; border: 1.5px solid var(--border);
  background: var(--bg-card); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.3s; font-family: 'Inter', sans-serif; color: var(--text-2);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 25px; right: 25px; background: #23262D; color: #F0F0EA;
  padding: 14px 22px; border-radius: 12px; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  transform: translateY(100px); opacity: 0; transition: all 0.4s;
  z-index: 5000; box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}
body.dark-mode .toast { background: #2E2E2E; }
.toast.show { transform: translateY(0); opacity: 1; }

/* ===== TAB DRAFT/TERBIT ===== */
.admin-tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.admin-tab { padding: 8px 18px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-2); font-weight: 700; font-size: 13px; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.3s; }
.admin-tab.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tab-counts { font-size: 12px; color: var(--text-3); margin-left: auto; }
.btn-draft {
  padding: 12px 20px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--bg-subtle); color: var(--text);
  font-weight: 800; font-size: 14px; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.3s;
}
.btn-draft:hover { border-color: var(--accent); color: var(--accent); }

/* ===== PANEL ADMIN ===== */
.admin-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px); display: none;
  justify-content: center; align-items: center; z-index: 3000; padding: 20px;
}
.admin-overlay.active { display: flex; }
.conn-badge {
  font-size: 11px; font-weight: 700; padding: 4px 12px;
  border-radius: 50px; margin-left: 10px; white-space: nowrap;
}
.conn-badge.ok  { background: #2EA86E33; color: #4ADE80; }
.conn-badge.bad { background: #E5484D33; color: #F87171; }
.login-box {
  background: var(--bg-card); border-radius: 20px; padding: 40px;
  width: 100%; max-width: 400px; text-align: center;
  animation: articleIn 0.3s ease;
}
.login-box .lock-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--cream); color: var(--cream-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 18px;
}
.login-box h3 { font-size: 20px; margin-bottom: 6px; }
.login-box p { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }
.login-box input {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 2px solid var(--border); background: var(--bg-subtle);
  color: var(--text); font-size: 15px; outline: none;
  font-family: 'Inter', sans-serif; text-align: center; letter-spacing: 2px;
}
.login-box input:focus { border-color: var(--accent); }
.login-box .btn-login {
  width: 100%; margin-top: 14px; padding: 13px; border: none;
  border-radius: 12px; background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: 15px; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.3s;
}
.login-box .btn-login:hover { filter: brightness(1.1); }
.login-box .btn-cancel {
  width: 100%; margin-top: 10px; padding: 12px; border: none;
  border-radius: 12px; background: var(--bg-subtle); color: var(--text-2);
  font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif;
}
.login-error { color: #E5484D; font-size: 13px; margin-top: 10px; display: none; }
.shake { animation: shake 0.4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.admin-panel {
  background: var(--bg-card); border-radius: 20px;
  width: 100%; max-width: 960px; max-height: 90vh;
  overflow-y: auto; animation: articleIn 0.3s ease;
}
.admin-head {
  position: sticky; top: 0; z-index: 5;
  background: var(--topbar); color: #F2F2ED;
  padding: 18px 28px; display: flex;
  justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.admin-head h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-head-actions { display: flex; gap: 10px; align-items: center; }
.admin-head-actions button {
  padding: 8px 16px; border-radius: 10px; border: none;
  font-weight: 700; font-size: 12.5px; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: all 0.3s;
}
.btn-publish { background: #2EA86E; color: #fff; }
.btn-publish:hover { filter: brightness(1.1); }
.btn-logout { background: rgba(255,255,255,0.12); color: #fff; }
.admin-body { padding: 28px; }
.admin-section-title {
  font-size: 14px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-3); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.admin-form .full { grid-column: 1/-1; }
.admin-form label { font-size: 12px; font-weight: 700; color: var(--text-2); display: block; margin-bottom: 6px; }
.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--bg-subtle);
  color: var(--text); font-size: 14px; outline: none;
  font-family: 'Inter', sans-serif; transition: border 0.3s;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--accent); }
.admin-form textarea { resize: vertical; }
.admin-form textarea#fContent { min-height: 130px; }
.img-preview {
  width: 100%; height: 120px; object-fit: cover; border-radius: 10px;
  margin-top: 8px; border: 1px solid var(--border); display: none;
}
.admin-form-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.btn-save-news {
  padding: 12px 28px; border: none; border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: 14px; cursor: pointer; font-family: 'Inter', sans-serif;
}
.btn-cancel-edit {
  padding: 12px 20px; border: none; border-radius: 12px;
  background: var(--bg-subtle); color: var(--text-2);
  font-weight: 700; font-size: 14px; cursor: pointer; display: none;
  font-family: 'Inter', sans-serif;
}
.admin-divider { border: none; border-top: 2px dashed var(--border); margin: 28px 0; }
.admin-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 10px; background: var(--bg-subtle);
}
.admin-row img { width: 70px; height: 50px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.admin-row .row-info { flex: 1; min-width: 0; }
.admin-row .row-info b {
  font-size: 13.5px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.admin-row .row-info span { font-size: 11.5px; color: var(--text-3); }
.admin-row .row-actions { display: flex; gap: 8px; }
.admin-row .row-actions button {
  width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--bg-card); cursor: pointer; font-size: 14px; transition: all 0.3s;
}
.admin-row .row-actions .btn-edit:hover { border-color: var(--accent); }
.admin-row .row-actions .btn-del:hover { border-color: #E5484D; background: #E5484D22; }
.admin-row .row-actions .btn-pub:hover { border-color: #2EA86E; background: #2EA86E22; }
.admin-row .row-actions .btn-unpub:hover { border-color: #E9A82166; background: #E9A82122; }
.admin-row .row-actions .btn-brk { color: var(--text-3); }
.admin-row .row-actions .btn-brk:hover { border-color: var(--accent); }
.admin-row .row-actions .btn-brk.on { color: #E9A821; border-color: #E9A82166; background: #E9A82122; }
.admin-empty { text-align: center; padding: 30px; color: var(--text-3); font-size: 14px; }
.admin-hint {
  background: var(--cream); border-radius: 12px; padding: 16px 18px;
  font-size: 13px; color: var(--cream-ink); line-height: 1.7; margin-top: 24px;
}
body.dark-mode .admin-hint { background: #23211B; color: #E8E2D2; }
.btn-reset {
  margin-top: 12px; padding: 10px 18px; border-radius: 10px;
  border: 1.5px solid #E5484D66; background: transparent; color: #E5484D;
  font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: 'Inter', sans-serif;
}
.btn-reset:hover { background: #E5484D15; }
.admin-float {
  position: fixed; bottom: 25px; left: 25px; z-index: 1500;
  background: var(--topbar); color: #F2F2ED;
  border-radius: 50px; padding: 10px 18px;
  display: none; align-items: center; gap: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3); font-size: 13px; font-weight: 600;
}
.admin-float.show { display: flex; }
.admin-float button {
  border: none; border-radius: 50px; padding: 6px 14px;
  font-weight: 700; font-size: 12px; cursor: pointer; font-family: 'Inter', sans-serif;
}
.admin-float .af-open { background: var(--accent); color: #fff; }
.admin-float .af-out { background: rgba(255,255,255,0.15); color: #fff; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-side { border-left: none; border-top: 1px solid var(--border); }
  .collage-section .collage-grid { grid-template-columns: 1fr 1fr; }
  .close-btn { right: 16px; }
}
@media (max-width: 968px) {
  .hero-grid { grid-template-columns: 1fr; }
  .content-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-form { grid-template-columns: 1fr; }
  .article-content { padding: 22px 22px 30px; }
  .article-img-wrap { padding: 0 22px; margin-top: 20px; }
  .nl-thumb { width: 150px; height: 100px; }
}

/* ═══ MOBILE NAV: 1 baris (tanggal | logo | ikon) + menu rapat di bawah ═══ */
@media (max-width: 900px) {
  .nav-inner { flex-wrap: wrap; padding: 6px 10px; row-gap: 2px; }
  .nav-side { order: 1; gap: 3px; }
  .nav-brand { order: 2; margin: 0 auto; gap: 7px; }
  .nav-side.nav-right { order: 3; margin-left: 0; }
  .nav-menu { order: 4; width: 100%; flex-wrap: wrap; justify-content: center; gap: 0; margin-top: 2px; }
  .nav-menu a { padding: 4px 8px; font-size: 11.5px; }
  .logo-circle { width: 28px; height: 28px; }
  .kn-text { font-size: 10.5px; }
  .brand-text { font-size: 15px; }
  .nav-icon-btn { width: 28px; height: 28px; font-size: 11px; }
  .dark-mode-btn { width: 26px; height: 26px; font-size: 10px; margin-left: 2px; }
  .nav-date { font-size: 10.5px; font-weight: 600; }
}

@media (max-width: 600px) {
  .hero-main { height: 330px; }
  .hero-main h2 { font-size: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .article-content h2 { font-size: 22px; }
  .article-main img#modalImg { max-height: 300px; }
  .news-list-item { gap: 12px; padding: 14px 6px; }
  .news-list-item h3 { font-size: 15.5px; }
  .news-list-item p { font-size: 12.5px; }
  .nl-thumb { width: 104px; height: 74px; }
  .nl-meta { display: none; }
  .collage-section .collage-grid { grid-template-columns: 1fr; }
  .ticker-content { animation-duration: 90s; }
  .float-home { bottom: 16px; right: 16px; }
  .float-home .logo-circle { width: 42px; height: 42px; }
  .close-btn { top: 12px; right: 12px; height: 38px; padding: 0 14px; font-size: 13px; }
}
@media (max-width: 400px) {
  .ticker-content { animation-duration: 120s; }
  .nav-date { font-size: 9.5px; }
  .brand-text { font-size: 14px; }
}
/* ═══ BADGE DAERAH ═══ */
.badge-daerah { background: #8A5A2B; }
body.dark-mode .badge-daerah { background: #4A3418; color: #E8C99A; }
/* ═══ FIX: tombol KN vs badge Netlify ═══ */
#netlify-badge,
.netlify-badge,
a[href*="netlify.com"] {
  display: none !important;
}
.float-home { bottom: 22px; }
@media (max-width: 600px) {
  .float-home { bottom: 16px; }
}
/* ═══ DATELINE LOKASI DI BAWAH JUDUL ARTIKEL ═══ */
.modal-dateline {
  font-size: 13px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: #E11D2E;
  margin: -6px 0 14px; display: flex; align-items: center; gap: 6px;
}
.modal-dateline::before { content: '\f3c5'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 11px; }
body.dark-mode .modal-dateline { color: #F87171; }
/* ═══ V4.3 FIX: TOMBOL KN TENGAH LAYAR + SEMBUNYIKAN BADGE NETLIFY + TOMBOL MUAT BERITA ═══ */

/* Badge Netlify hilang permanen (desktop & HP) */
#netlify-badge,
.netlify-badge,
a[href*="netlify.com"] {
  display: none !important;
}

/* Tombol KN mengambang: sisi KANAN, vertikal TENGAH (50% tinggi layar) */
.float-home {
  top: 50%;
  bottom: auto;
  right: 16px;
  transform: translateY(-50%) scale(0.9);
}
.float-home.show {
  transform: translateY(-50%) scale(1);
}
@media (max-width: 600px) {
  .float-home {
    right: 10px;
  }
  .float-home .logo-circle { width: 40px; height: 40px; }
  .float-home .kn-text { font-size: 13px; }
}

/* Tombol "Muat Berita Lainnya" di akhir daftar */
.news-more {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin: 22px 0 10px; padding: 14px 20px;
  border: 1.5px solid var(--border); border-radius: 50px;
  background: var(--bg-card); color: var(--text-2);
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.3s;
}
.news-more:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--bg-subtle);
}
/* ═══ V4.4 FINAL FIX: NETLIFY BADGE HILANG + KN TENGAH LAYAR ═══ */
#netlify-badge,
.netlify-badge,
a[href*="netlify.com"] {
  display: none !important;
}
.float-home {
  top: 50%;
  bottom: auto;
  right: 16px;
  transform: translateY(-50%) scale(0.9);
}
.float-home.show {
  transform: translateY(-50%) scale(1);
}
@media (max-width: 600px) {
  .float-home { right: 10px; }
  .float-home .logo-circle { width: 40px; height: 40px; }
  .float-home .kn-text { font-size: 13px; }
}
/* Pemburu badge Netlify versi garis keras */
div[id*="netlify"],
a[href*="netlify"],
a[href*="netlify.com"],
#netlify-badge {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
}