/*
Theme Name: Kabar Modern Media (Kumparan Style)
Theme URI: https://kabarsulbar.com
Author: Maczcod Studio
Description: Tema WordPress portal berita modern bergaya media digital (Kumparan-style) dengan stabilisasi gambar postingan (anti-CLS, rasio terkunci, object-fit stabil), logo Seputar Sulbar proporsional, Stories Circle, Topic Pills, Hero + Trending, Polling, Video Vertikal 9:16, dan Blok Kategori 3-Kolom.
Version: 2.2
License: GNU General Public License v2 or later
Text Domain: kabar-kumparan
*/

:root {
  --teal: #00a8b5;
  --teal-dark: #00828c;
  --navy: #14213d;
  --red-accent: #e63946;
  --bg: #f4f6f8;
  --white: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; font-size: 14px; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 14px; }

/* 1. STICKY HEADER & LOGO PROPORSIONAL */
.top-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
.header-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }

.brand-wrap { display: flex; align-items: center; flex-shrink: 0; }
.brand-wrap img,
.custom-logo-link img {
  height: 44px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
}

.search-bar { flex: 1; max-width: 440px; position: relative; }
.search-bar input { width: 100%; padding: 8px 38px 8px 14px; border: 1px solid #d1d5db; border-radius: 20px; background: #f9fafb; font-size: 13px; outline: none; }
.search-bar input:focus { border-color: var(--teal); background: var(--white); }
.search-bar button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); cursor: pointer; font-weight: bold; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-outline { border: 1px solid var(--teal); color: var(--teal); padding: 6px 14px; border-radius: 18px; font-weight: 600; font-size: 12px; }
.btn-solid { background: var(--teal); color: var(--white); padding: 6px 14px; border-radius: 18px; font-weight: 600; font-size: 12px; }
.btn-solid:hover { background: var(--teal-dark); }

/* Sub-Navigasi Kanal & Sub-Menu */
.kanal-nav { border-top: 1px solid #f1f5f9; padding: 8px 0; overflow-x: auto; white-space: nowrap; }
.kanal-nav ul { list-style: none; display: flex; gap: 18px; align-items: center; }
.kanal-nav li a { font-size: 13px; font-weight: 600; color: #374151; }
.kanal-nav li a:hover { color: var(--teal); }
.sub-kanal-strip { background: #f8fafc; border-top: 1px solid #f1f5f9; padding: 6px 0; font-size: 12px; color: var(--muted); overflow-x: auto; white-space: nowrap; }
.sub-kanal-strip a { margin-right: 14px; font-weight: 500; }
.sub-kanal-strip a.badge-hot { background: #fee2e2; color: #dc2626; padding: 2px 8px; border-radius: 10px; font-weight: 700; }

/* 2. BANNER LEADERBOARD & STORIES CIRCLE */
.leaderboard-ad { margin: 14px auto; text-align: center; background: linear-gradient(90deg, #00a8b5, #0077b6); color: var(--white); padding: 18px; border-radius: 8px; font-weight: 700; }
.stories-row { display: flex; gap: 14px; overflow-x: auto; padding: 10px 0 14px; scrollbar-width: none; }
.story-item { flex: 0 0 76px; text-align: center; }
.story-ring { width: 68px; height: 68px; margin: 0 auto 6px; border-radius: 50%; padding: 3px; background: linear-gradient(45deg, #00a8b5, #f59e0b, #ec4899); }
.story-ring img { width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 50%; border: 2px solid var(--white); background: #1f2937; }
.story-title { font-size: 11px; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }

/* Topic Pills */
.topic-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; }
.topic-pill { background: var(--white); border: 1px solid #d1d5db; color: #1e3a8a; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 16px; white-space: nowrap; }
.topic-pill:hover { background: var(--teal); color: var(--white); border-color: var(--teal); }

/* 3. HERO + TRENDING SECTION (ANTI-CLS IMAGE CONTAINERS) */
.hero-box { background: var(--white); border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 20px; display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; }
.hero-main-card { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 16/9; width: 100%; background: #111827; margin-bottom: 12px; }
.hero-main-card a { display: block; width: 100%; height: 100%; }
.hero-main-card img { width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: 0.9; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.88) 12%, rgba(0,0,0,0.08) 72%); display: flex; flex-direction: column; justify-content: flex-end; padding: 18px; color: var(--white); }
.hero-badge { background: var(--teal); color: var(--white); font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 4px; width: fit-content; margin-bottom: 8px; text-transform: uppercase; display: inline-block; }
.hero-overlay h2 { font-size: 20px; line-height: 1.3; margin-bottom: 6px; }
.hero-meta { font-size: 11px; color: #d1d5db; }

.hero-sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-sub-card { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 16/10; width: 100%; background: #1f2937; }
.hero-sub-card a { display: block; width: 100%; height: 100%; }
.hero-sub-card img { width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: 0.88; }
.hero-sub-card .hero-overlay { padding: 10px; }
.hero-sub-card h3 { font-size: 13px; line-height: 1.3; }

/* Trending List (Kanan Hero) */
.block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.block-title { font-size: 16px; font-weight: 800; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.block-title::before { content: ""; width: 4px; height: 16px; background: var(--teal); border-radius: 2px; display: inline-block; }
.see-all { font-size: 12px; font-weight: 700; color: var(--teal); }
.trending-list { display: flex; flex-direction: column; gap: 12px; }
.trending-item { display: flex; gap: 10px; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.trending-item:last-child { border-bottom: none; padding-bottom: 0; }
.trending-title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.35; margin-bottom: 4px; display: block; }
.trending-title:hover { color: var(--teal); }
.trending-thumb-wrap { width: 68px; height: 68px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: #e5e7eb; }
.trending-thumb { width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* 4. SECTION POLLING (3 KOLOM) */
.section-card { background: var(--white); border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 20px; }
.poll-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.poll-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; }
.poll-q { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--navy); }
.poll-opt { display: block; width: 100%; text-align: left; padding: 7px 10px; margin-bottom: 6px; border: 1px solid #cbd5e1; border-radius: 6px; background: #f8fafc; font-size: 12px; font-weight: 600; cursor: pointer; }
.poll-opt:hover { border-color: var(--teal); background: #ecfeff; color: var(--teal-dark); }

/* 5. VIDEO VERTIKAL (9:16) & KREATOR TERBAIK */
.vertical-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.video-card { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 9/15; width: 100%; background: #0f172a; display: block; }
.video-card img { width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0.88; }
.play-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; background: rgba(0,0,0,0.6); border: 2px solid #fff; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.video-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 10px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.3; }

/* 6. PROMO APP BANNER (BIRU) */
.app-promo-banner { background: linear-gradient(135deg, #0096c7, #023e8a); border-radius: 10px; padding: 24px; color: var(--white); display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.app-promo-banner h3 { font-size: 20px; margin-bottom: 6px; }
.app-badges { display: flex; gap: 10px; margin-top: 12px; }
.app-badge-btn { background: #111827; color: #fff; padding: 7px 14px; border-radius: 6px; font-size: 12px; font-weight: 700; }

/* 7. BLOK KATEGORI BERULANG (3 KOLOM) */
.cat-block-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 16px; }
.cat-featured { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4/4; min-height: 280px; width: 100%; background: #111827; }
.cat-featured a { display: block; width: 100%; height: 100%; }
.cat-featured img { width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: 0.88; }
.cat-col-list { display: flex; flex-direction: column; gap: 12px; }
.cat-col-header { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; border-bottom: 2px solid #f1f5f9; padding-bottom: 6px; margin-bottom: 4px; }
.mini-news { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.mini-news:last-child { border-bottom: none; padding-bottom: 0; }
.mini-news h4 { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text); margin-bottom: 4px; }
.mini-news h4 a:hover { color: var(--teal); }
.mini-thumb-wrap { width: 62px; height: 62px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: #e5e7eb; }
.mini-thumb { width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* 8. SINGLE POST - STABILISASI FOTO POSTINGAN & GAMBAR DI DALAM ARTIKEL */
.single-wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin: 20px auto 40px; align-items: start; }
.article-card { background: var(--white); border-radius: 10px; padding: 26px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow: hidden; }
.article-card h1 { font-size: 28px; line-height: 1.3; color: var(--navy); margin: 12px 0; }

/* Wadah Featured Image Terkunci Rasionya (Anti Loncat / Anti CLS saat Loading) */
.article-featured-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 460px;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  margin-bottom: 18px;
}
.article-featured-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.article-caption {
  font-size: 12px;
  color: var(--muted);
  margin-top: -10px;
  margin-bottom: 18px;
  font-style: italic;
}

/* Stabilisasi Semua Gambar di Dalam Isi Konten Berita (Gutenberg / Classic Editor) */
.article-body { font-size: 16px; line-height: 1.8; margin-top: 18px; color: #1f2937; }
.article-body p { margin-bottom: 16px; }
.article-body figure,
.article-body .wp-block-image,
.article-body .wp-caption {
  max-width: 100% !important;
  width: 100%;
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
}
.article-body img,
.article-body .wp-block-image img {
  width: 100%;
  height: auto !important;
  max-height: 540px;
  object-fit: contain;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}
.article-body figcaption,
.article-body .wp-caption-text {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  text-align: center;
  background: #f8fafc;
}

.site-footer { background: var(--white); border-top: 1px solid var(--border); padding: 32px 0 20px; margin-top: 30px; color: var(--muted); }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; margin-bottom: 20px; }
.footer-logo img { height: 42px; width: auto; max-width: 240px; object-fit: contain; margin-bottom: 10px; }

/* Responsive */
@media (max-width: 900px) {
  .hero-box, .cat-block-grid, .single-wrap, .footer-cols { grid-template-columns: 1fr; }
  .poll-grid { grid-template-columns: 1fr; }
  .vertical-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .header-main { flex-wrap: wrap; }
  .brand-wrap img, .custom-logo-link img { height: 34px; max-width: 200px; }
  .search-bar { order: 3; max-width: 100%; width: 100%; }
  .article-card { padding: 18px; }
  .article-card h1 { font-size: 22px; }
  .article-featured-box { aspect-ratio: 16 / 10; }
}
