/* ══════════════════════════════════════════════════════════
   menu.css
   Komponen MENU/NAVIGASI yang dipakai bersama di semua halaman,
   KECUALI halaman artikel (artikel punya versi sendiri di artikel.css,
   karena struktur header-nya beda — pakai kanal-bar, bukan nav-list).

   Cakupan file ini:
   - Reset dasar + variabel warna
   - Header (logo, search bar, tombol tulis/sign-in)
   - Nav (Nasional/Internasional/Finansial/Tekno/Plus + dropdown-all)
   - Iklan atas khusus HP (.mob-top-ad)
   - Progress bar baca
   - Search overlay
   - Drawer mobile (hamburger menu slide-in)
   - Bottom nav mobile
   - Footer
══════════════════════════════════════════════════════════ */

:root {
  --red: #e03131;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e8e8e8;
  --bg: #f5f5f5;
  --white: #fff;
}
*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Roboto', sans-serif; color: var(--text); background: var(--white); }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── TOPBAR (logo, search, tombol kanan) ── */
header { position: sticky; top: 0; z-index: 202; }
.topbar-top { background: var(--white); border-bottom: 1px solid var(--border); position: relative; }
.topbar-top-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; padding: 0 20px; height: 60px; gap: 14px; }
@media (min-width: 769px) {
  .topbar-top-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
  .hamburger, .logo { grid-column: 1; justify-self: start; }
  .logo { margin-left: 34px; }
  .topbar-search { grid-column: 2; justify-self: center; }
  .topbar-search-icon, .topbar-right { grid-column: 3; justify-self: end; }
  .nav-item-all { margin-left: 34px; }
}
.logo { display: flex; align-items: center; height: 100%; }
.logo img { height: 28px; width: auto; max-height: 100%; }

/* ── Iklan atas khusus HP ── */
.mob-top-ad{display:none;}
@media(max-width:768px){
  .mob-top-ad{
    display:block;
    background:var(--white);
  }
  .mob-top-ad-label{font-size:9px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#bbb;text-align:center;padding:4px 0 3px;background:var(--bg);}
  .mob-top-ad iframe{
    width:100%;
    border:none;
    display:block;
    height:250px;
    min-height:50px;
    background:var(--bg);
    transition:height .15s ease;
  }
}

/* ── NAV (bar abu-abu di bawah header) ── */
.topbar-nav { position: sticky; top: 60px; z-index: 200; background: var(--bg); border-bottom: 1px solid var(--border); overflow: visible; }
.topbar-nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; padding: 0 20px; height: 40px; overflow: visible; }
.logo-sticky { display: none; align-items: center; flex-shrink: 0; }
.logo-sticky img { height: 22px; }
.logo-sticky.show { display: flex; }
.logo-sticky-sep { width: 1px; height: 20px; background: var(--border); margin: 0 10px; display: none; flex-shrink: 0; }
.logo-sticky-sep.show { display: block; }
.nav-home-btn { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; color: #8a8a8a; margin-left: 8px; }
.nav-home-btn.show { display: flex; }
.nav-home-btn:hover { color: var(--red); }
.nav-home-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-sticky-right { display: none; align-items: center; gap: 8px; margin-left: 8px; }
.nav-sticky-right.show { display: flex; }
.topbar-search { flex: 1; max-width: 520px; display: flex; align-items: center; border: 1px solid var(--border); border-radius: 4px; height: 38px; cursor: pointer; overflow: hidden; transition: border-color .15s; }
.topbar-search:hover { border-color: #aaa; }
.topbar-search-input { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 100%; }
.topbar-search-input svg { width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.topbar-search-placeholder { font-size: 13px; color: #bbb; white-space: nowrap; }
.topbar-search-go { background: var(--red); width: 42px; height: 38px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topbar-search-go svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; }
.topbar-search-icon { display: none; background: none; border: none; cursor: pointer; align-items: center; justify-content: center; width: 32px; height: 32px; color: var(--muted); padding: 0; }
.topbar-search-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.nav-scroll { flex: 1; min-width: 0; overflow: visible; }
.nav-list { display: flex; list-style: none; white-space: nowrap; overflow: visible; scrollbar-width: none; align-items: center; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-item { position: relative; flex-shrink: 0; display: flex; align-items: center; }
.nav-item-dd { display: flex; align-items: center; position: relative; }
.nav-link-main { display: flex; align-items: center; padding: 0 2px 0 13px; height: 40px; font-size: 12.5px; font-weight: 500; color:#555555; white-space: nowrap; }
.nav-link-main:hover { color: var(--red); }
.nav-dd-toggle { display: flex; align-items: center; justify-content: center; padding: 0 12px 0 4px; height: 40px; background: none; border: none; cursor: pointer; color: var(--muted); }
.nav-dd-toggle svg { width: 9px; height: 9px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.nav-item-dd:hover .nav-dd-toggle { color: var(--red); }
.nav-link-plus { color: #555555 !important; }
.nav-item-dd.nav-item-plus:hover .nav-link-main { color: #2c2c2c !important; }
.nav-item-dd.nav-item-plus:hover .nav-dd-toggle { color: #2c2c2c; }
.nav-link-all { display: flex; align-items: center; justify-content: center; padding: 6px; color: #666666; cursor: pointer; background: none; border: none; }
.nav-link-all svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.nav-item-all { margin-right: 2px; position: relative; }
.nav-item-all::after { content: ''; position: absolute; top: 40px; left: 0; right: 0; height: 8px; }
.dropdown-all { position: fixed; min-width: 600px; padding: 18px 20px; display: none; grid-template-columns: repeat(3,1fr); gap: 18px 24px; top: 0; right: 0; z-index: 9999; background: var(--white); border: 1px solid var(--border); border-top: 2px solid var(--red); border-radius: 0 0 6px 6px; box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.dropdown-all-group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--red); margin-bottom: 8px; font-weight: 700; }
.dropdown-all-group a { display: block; padding: 4px 0; font-size: 13px; color: var(--text); border-bottom: none; font-weight: 500; }
.dropdown-all-group a:hover { color: var(--red); background: none; }
.dropdown-all-group .sub-link { padding-left: 10px; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.dropdown-all-group .sub-link:hover { color: var(--red); }
@media(max-width:640px){
  .dropdown-all{ min-width:auto; width:94vw; grid-template-columns:1fr 1fr; }
}
.nav-link { display: flex; align-items: center; gap: 4px; padding: 0 13px; height: 40px; font-size: 12.5px; font-weight: 500; color:#555555; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav-link:hover { color: var(--red); }
.nav-link svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.dropdown { position: fixed; background: var(--white); border: 1px solid var(--border); border-top: 2px solid var(--red); border-radius: 0 0 6px 6px; box-shadow: 0 8px 24px rgba(0,0,0,.1); min-width: 160px; z-index: 9999; display: none; }
.dropdown a { display: block; padding: 10px 16px; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border); }
.dropdown a:last-child { border-bottom: none; }
.dropdown a:hover { background: var(--bg); color: var(--red); }

/* ── Tombol kanan header (Tulis Artikel / Sign In / avatar) ── */
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.home-icon-btn { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; color: #8a8a8a; }
.home-icon-btn:hover { color: var(--red); }
.home-icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media(max-width:768px){.home-icon-btn{display:none;}}
.write-btn { background: var(--red); color: #fff; border: none; border-radius: 4px; padding: 7px 16px; font-size: 13px; font-weight: 700; font-family: 'Roboto', sans-serif; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.write-btn:hover { background: #c92a2a; }
.signin-btn { display: flex; align-items: center; padding: 0 14px; height: 32px; background: var(--red); color: #fff; border-radius: 4px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.signin-btn:hover { background: #a8221c; }
.user-nav-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; flex-shrink: 0; }
.user-nav-initial { font-size: 13px; font-weight: 700; }
.user-nav-wrap { position: relative; }
.user-dropdown { display: none; position: absolute; right: 0; top: 40px; background: #fff; border: 1px solid #e5e5e5; border-radius: 6px; min-width: 140px; box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 9999; }
.user-dropdown a { display: block; padding: 10px 16px; font-size: 13px; color: #222; text-decoration: none; border-bottom: 1px solid #f3f3f3; }
.user-dropdown a:last-child { border-bottom: none; }
.user-dropdown a:hover { background: #fafafa; color: var(--red); }
.user-nav-wrap.open .user-dropdown { display: block; }

/* ── Search overlay ── */
.search-overlay { display: none; position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); align-items: flex-start; justify-content: center; padding-top: 80px; }
.search-overlay.open { display: flex; }
.search-box { background: var(--white); border-radius: 10px; width: 100%; max-width: 600px; box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: hidden; }
.search-input-wrap { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.search-input-wrap svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search-input { flex: 1; border: none; outline: none; font-size: 16px; font-family: 'Roboto', sans-serif; color: var(--text); }
.search-input::placeholder { color: #bbb; }
.search-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--muted); }
.search-results { max-height: 360px; overflow-y: auto; }
.search-result-item { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); cursor: pointer; }
.search-result-item:hover { background: var(--bg); }
.search-result-item:last-child { border-bottom: none; }
.sri-thumb { width: 60px; height: 44px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: var(--border); }
.sri-info { flex: 1; min-width: 0; }
.sri-kanal { font-size: 11px; color: var(--red); font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.sri-title { font-size: 13px; font-weight: 600; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-empty { padding: 32px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.search-see-all { padding: 10px 20px; text-align: center; font-size: 12px; color: var(--red); cursor: pointer; border-top: 1px solid var(--border); font-weight: 600; }
.search-see-all:hover { background: var(--bg); }

/* ── Progress bar baca (nempel di tepi bawah header, munculnya
   dikontrol lewat JS begitu header udah sticky di top:0) ── */
.progress-bar { position: absolute; bottom: 0; left: 0; height: 3px; background: var(--red); z-index: 202; transition: width .1s linear; width: 0%; }

/* ── Hamburger icon (dipakai buka drawer mobile) ── */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 4px; flex-shrink: 0; flex-direction: column; justify-content: center; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; margin: 5px 0; transition: all .25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .topbar-search { display: none; }
  .topbar-search-icon { display: flex; margin-left: auto; }
  .topbar-top-inner { height: 52px; }
  .write-btn { display: none; }
  .topbar-right { gap: 6px; }
  .topbar-top { position: sticky; top: 0; width: 100%; z-index: 201; }
  .topbar-nav { position: sticky; top: 52px; height: 40px; z-index: 201; }
  .topbar-nav-inner { height: 40px; padding: 0 16px; }
  .nav-link-main, .nav-link, .nav-link-all, .nav-dd-toggle { height: 40px; }
  .nav-scroll { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav-scroll::-webkit-scrollbar { display: none; }
  .logo-sticky, .logo-sticky-sep, .nav-home-btn, .nav-sticky-right { display: none !important; }
  body { padding-bottom: 62px; }

  /* Sembunyiin hamburger di header khusus mobile — fungsinya sudah
     dicakup oleh ikon "≡" di gray bar (sebelah "Nasional"), sama
     kayak pola di kanal.css (.topbar-top .hamburger { display:none }),
     biar cuma ada 1 ikon menu yang keliatan. */
  .topbar-top .hamburger { display: none; }
}

/* ── Drawer mobile (slide-in dari hamburger) ── */
.mob-drawer { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 800; flex-direction: column; }
.mob-drawer.open { display: flex; }
.mob-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.mob-nav { position: relative; width: 260px; max-width: 80vw; background: #fff; height: 100%; overflow-y: auto; padding: 60px 0 24px; box-shadow: 2px 0 16px rgba(0,0,0,.15); }
.mob-nav-item { border-bottom: 1px solid #f3f3f3; }
.mob-nav-link { display: flex; align-items: center; justify-content: space-between; padding: 13px 20px; font-size: 14px; font-weight: 600; color: #222; text-decoration: none; }
.mob-nav-link:hover, .mob-nav-link.active { color: var(--red); }
.mob-nav-link svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; transition: transform .2s; }
.mob-nav-sub { display: none; background: #fafafa; }
.mob-nav-item.open .mob-nav-sub { display: block; }
.mob-nav-item.open .mob-nav-link svg { transform: rotate(180deg); }
.mob-nav-sub a { display: block; padding: 10px 20px 10px 32px; font-size: 13px; color: #555; text-decoration: none; border-top: 1px solid #f0f0f0; }
.mob-nav-sub a:hover { color: var(--red); }
.mob-close-btn { position: absolute; top: 14px; right: 14px; background: none; border: none; cursor: pointer; padding: 4px; }
.mob-close-btn svg { width: 20px; height: 20px; stroke: #555; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── Bottom nav mobile ── */
.mob-bottom-nav { display: none; }
@media (max-width: 768px) {
  .mob-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
    background: #fff; border-top: 1px solid var(--border);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  }
  .mbn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; font-family: 'Roboto', sans-serif; color: #999; font-size: 10px; font-weight: 600; cursor: pointer; padding: 4px 0; }
  .mbn-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mbn-item.active { color: var(--red); }
}

/* ── Skeleton loader (utility, dipakai di banyak halaman selagi fetch data) ── */
.skel { background: linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%); background-size: 200% 100%; animation: skel-anim 1.4s infinite; border-radius: 4px; }
@keyframes skel-anim { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.skel-box { border-radius: 3px; }
.fetch-error { color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }

/* ── FOOTER ── */
.site-footer {
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  margin-top: 48px;
  padding: 40px 20px 0;
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 48px;
  align-items: start;
  padding-bottom: 36px;
}
.footer-brand-logo { height: 30px; margin-bottom: 22px; }
.footer-social-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #888; margin-bottom: 10px; }
.footer-social-icons { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-social-icons a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 1px solid #ddd; transition: border-color .15s, box-shadow .15s; flex-shrink: 0; }
.footer-social-icons a:hover { border-color: #aaa; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.footer-social-icons img { width: 17px; height: 17px; object-fit: contain; }
.footer-col-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #1a1a1a; margin-bottom: 16px; }
.footer-col-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.footer-col-links a { font-size: 13px; color: #555; text-decoration: none; line-height: 1.4; }
.footer-col-links a:hover { color: var(--red); }
.footer-info-links { display: flex; flex-direction: column; gap: 10px; }
.footer-info-links a { font-size: 13px; color: #555; text-decoration: none; line-height: 1.4; }
.footer-info-links a:hover { color: var(--red); }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding: 16px 0; border-top: 1px solid #e0e0e0; font-size: 12px; color: #aaa; }
@media (max-width: 768px) {
  .site-footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-col-links { grid-template-columns: 1fr 1fr; }
  .site-footer { margin-bottom: 62px; }
}
#toroida-menu-top,
#toroida-menu-bottom {
  display: contents;
}
