/* ==========================================
   THEME PORTAL BERITA — TRIBUN TIMUR
   Mobile-first, warna biru-merah khas Tribun
   ========================================== */

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

:root {
  --biru: #0066b1;
  --biru-terang: #0088cc;
  --biru-gelap: #004c8a;
  --merah: #ec2029;
  --merah-gelap: #c41a22;
  --hitam: #1a1a1a;
  --abu: #ebebeb;
  --abu-muda: #f5f5f5;
  --abu-gelap: #ddd;
  --abu-teks: #888;
  --biru-teks: #023167;
  --putih: #fff;
  --font: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-headline: 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--abu);
  color: var(--hitam);
  line-height: 1.5;
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--merah); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 10px; }

/* ===== HEADER ===== */
.header {
  background: var(--biru);
  color: var(--putih);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.header-top {
  padding: 8px 0;
}

.header-top .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-logo a {
  display: flex;
  align-items: baseline;
  color: var(--putih) !important;
}

.logo-text {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
}

.logo-sub {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 2px;
  display: inline;
}

.logo-domain {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  margin-left: 2px;
  align-self: flex-end;
  padding-bottom: 2px;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--putih);
  font-size: 26px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.header-search {
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

/* NAV */
.header-nav {
  background: var(--merah);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.header-nav::-webkit-scrollbar { display: none; }

.nav-list {
  display: flex;
  list-style: none;
  gap: 0;
  white-space: nowrap;
  padding: 0;
}

.nav-list li { flex-shrink: 0; }

.nav-list a {
  display: block;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 700;
  color: var(--putih);
  letter-spacing: 0.3px;
  transition: background 0.15s;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255,255,255,0.12);
}

.nav-list a.active {
  border-bottom: 3px solid var(--putih);
  padding-bottom: 6px;
}

/* ===== TRENDING ===== */
.trending-bar {
  background: var(--putih);
  border-bottom: 2px solid var(--abu-gelap);
  padding: 5px 0;
  font-size: 12px;
  overflow: hidden;
  border-top: 3px solid var(--merah);
}

.trending-bar .container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trending-label {
  background: var(--merah);
  color: var(--putih);
  padding: 2px 8px;
  font-weight: 700;
  font-size: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.trending-items {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.trending-items span {
  color: #555;
  cursor: pointer;
  font-weight: 500;
}

.trending-items span:hover { color: var(--merah); }

.trending-items::-webkit-scrollbar { display: none; }

/* ===== MAIN ===== */
.main {
  padding: 14px 0;
  background: var(--abu);
}

.section {
  margin-bottom: 20px;
  background: var(--putih);
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 3px solid var(--merah);
  padding-bottom: 6px;
}

.section-header h2 {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--biru);
  letter-spacing: 0.5px;
}

/* ===== TRENDING TOPIK ===== */
.trending-topik-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topik-item {
  display: inline-block;
  padding: 6px 14px;
  background: var(--abu);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  transition: all 0.2s;
}

.topik-item:hover {
  background: var(--merah);
  color: var(--putih) !important;
}

/* ===== HEADLINE ===== */
.headline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.headline-main {
  background: var(--putih);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.headline-main a { display: block; }

.headline-img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #ccc;
}

.headline-body { padding: 12px; }

.headline-body h1 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  margin: 8px 0;
  color: var(--biru-teks);
}

.headline-body p {
  font-size: 13px;
  color: var(--abu-teks);
  margin-top: 6px;
  display: none;
}

.headline-side { display: grid; gap: 10px; }

.hs-item {
  background: var(--putih);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.hs-item a {
  display: flex;
  gap: 10px;
}

.hs-img {
  width: 100px;
  min-height: 75px;
  background-size: cover;
  background-position: center;
  background-color: #ccc;
  flex-shrink: 0;
}

.hs-body { padding: 8px; flex: 1; }

.hs-body h3 {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin: 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-label {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cat-politik { background: #e74c3c; color: #fff; }
.cat-makassar { background: #2ecc71; color: #fff; }
.cat-olahraga { background: #f39c12; color: #fff; }
.cat-ekonomi { background: #3498db; color: #fff; }
.cat-teknologi { background: #9b59b6; color: #fff; }
.cat-hukum { background: #1abc9c; color: #fff; }
.cat-sepakbola { background: #e67e22; color: #fff; }
.cat-sehat { background: #e91e63; color: #fff; }

.meta {
  font-size: 11px;
  color: var(--abu-teks);
  margin-top: 4px;
}

/* ===== POPULER ===== */
.popular-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.popular-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--abu);
}

.popular-card:last-child { border-bottom: none; }

.popular-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--merah);
  min-width: 30px;
  line-height: 1;
  margin-top: 2px;
}

.popular-body h3 {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.popular-body h3 a:hover { color: var(--merah); }

/* ===== NEWS GRID ===== */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.news-card {
  background: var(--abu-muda);
  border-radius: 6px;
  overflow: hidden;
}

.news-card a { display: block; }

.news-img {
  width: 100%;
  height: 170px;
  background-size: cover;
  background-position: center;
  background-color: #ccc;
}

.news-body { padding: 10px; }

.news-body h3 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin: 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== TWO COLUMN ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* KANAL LIST */
.kanal-list {
  display: grid;
  gap: 8px;
}

.kanal-item {
  background: var(--abu-muda);
  border-radius: 6px;
  overflow: hidden;
}

.kanal-item a {
  display: flex;
  gap: 10px;
}

.kanal-img {
  width: 120px;
  min-height: 80px;
  background-size: cover;
  background-position: center;
  background-color: #ccc;
  flex-shrink: 0;
}

.kanal-body { padding: 8px 10px; flex: 1; }

.kanal-body h3 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar-list {
  display: grid;
  gap: 8px;
}

.sb-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--abu);
}

.sb-item:last-child { border-bottom: none; }

.sb-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--merah);
  min-width: 26px;
  line-height: 1;
  margin-top: 2px;
}

.sb-body h4 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

/* ===== TOPIK POPULER ===== */
.topik-populer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topik-badge {
  display: inline-block;
  padding: 5px 12px;
  background: var(--abu);
  border: 1px solid var(--abu-gelap);
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  transition: all 0.2s;
}

.topik-badge:hover {
  background: var(--merah);
  color: var(--putih) !important;
  border-color: var(--merah);
}

/* ===== REKOMENDASI ===== */
.rekom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rekom-card {
  background: var(--abu-muda);
  border-radius: 6px;
  overflow: hidden;
}

.rekom-card a { display: block; }

.rekom-img {
  width: 100%;
  height: 100px;
  background-size: cover;
  background-position: center;
  background-color: #ccc;
}

.rekom-body { padding: 8px; }

.rekom-body h3 {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== FOOTER ===== */
.footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.8);
  padding: 28px 0 0;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.footer-col h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--merah);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-col p {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.5);
}

.footer-col ul { list-style: none; }

.footer-col ul li { margin-bottom: 4px; }

.footer-col ul li a {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

.footer-col ul li a:hover { color: var(--merah); }

.social-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: var(--putih) !important;
  transition: background 0.2s;
}

.social-icon:hover { background: var(--merah); }

.footer-bottom {
  text-align: center;
  padding: 14px 0;
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-bottom p {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* ===== TABLET (min 600px) ===== */
@media (min-width: 600px) {
  .headline-side { grid-template-columns: 1fr 1fr; }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .headline-img { height: 280px; }
  .headline-body h1 { font-size: 22px; }
  .headline-body p { display: block; }
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== DESKTOP (min 900px) ===== */
@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .header-search { display: none; }
  
  .headline { grid-template-columns: 2fr 1fr; }
  .headline-side { grid-template-columns: 1fr; }
  .headline-img { height: 360px; }
  .headline-body h1 { font-size: 26px; }
  
  .news-grid { grid-template-columns: repeat(3, 1fr); }
  .news-img { height: 160px; }
  
  .two-col { grid-template-columns: 2fr 1fr; }
  
  .popular-grid { grid-template-columns: 1fr 1fr; }
  
  .hs-img { width: 130px; min-height: 90px; }
}

/* ===== DESKTOP LARGE (min 1100px) ===== */
@media (min-width: 1100px) {
  .headline-img { height: 400px; }
  .headline-body h1 { font-size: 30px; }
  .headline-body { padding: 20px; }
}

/* ===== RESPONSIVE NAV (mobile) ===== */
@media (max-width: 599px) {
  .header-nav { display: none; }
  .nav-open .header-nav { display: block; }
  
  .nav-list {
    flex-direction: column;
    white-space: normal;
    padding: 4px 0;
  }
  
  .nav-list a {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  
  .nav-list a.active { border-bottom: 1px solid rgba(255,255,255,0.08); }
  
  .headline-body h1 { font-size: 16px; }
  
  .section { padding: 10px; }
}
