/* TapBerita — portal berita umum, putih bersih dengan aksen merah. Pola tata letak portal nasional:
   bar atas, masthead, menu rubrik, headline + daftar samping, daftar terkini, sidebar terpopuler. */
:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --soft: #f3f4f6;
    --soft-2: #eef3fb;
    --ink: #111827;
    --ink-2: #374151;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #c8102e;
    --brand-ink: #ffffff;
    --title: #111111;
    --deep: #3a3f47;
    --radius: 10px;
    --radius-sm: 6px;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1117;
        --surface: #151b23;
        --soft: #1c232d;
        --soft-2: #18212e;
        --ink: #f3f4f6;
        --ink-2: #d1d5db;
        --muted: #9ca3af;
        --line: #273140;
        --brand: #e5384f;
        --title: #f3f4f6;
        --deep: #c3c7ce;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Bar atas ---------- */
.topbar { background: var(--surface); color: var(--muted); font-size: .78rem; border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 36px; }
.topbar nav { display: none; gap: 16px; }
.topbar a:hover { color: var(--brand); }
.topbar .social { margin-left: auto; display: flex; gap: 4px; }
.topbar .social a { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; }
.topbar .social .icon { width: 16px; height: 16px; }

/* ---------- Masthead ---------- */
.masthead { background: var(--surface); }
.masthead .wrap { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.55rem; letter-spacing: -.04em; white-space: nowrap; line-height: 1; }
.logo img { height: 34px; width: auto; }
.logo-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.05rem; }
.logo .a { color: var(--brand); }
.logo .b { color: var(--title); }
.masthead-search { display: none; flex: 1; max-width: 420px; margin-left: auto; }
.masthead-search form, .search-page { display: flex; }
.masthead-search input, .search-page input {
    flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 999px 0 0 999px; padding: 0 16px;
    background: var(--soft); color: var(--ink); font: inherit; font-size: .9rem;
}
.masthead-search button, .search-page button { height: 40px; border: 0; border-radius: 0 999px 999px 0; padding: 0 16px; background: var(--brand); color: #fff; cursor: pointer; font-weight: 700; }
.masthead-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 700; font-size: .9rem; background: var(--title); color: var(--bg); }
.btn-accent { background: var(--brand); color: var(--brand-ink); }
.btn-ghost { background: var(--soft); color: var(--ink); }
.mobile-search { display: none; padding: 0 16px 12px; background: var(--surface); }
.mobile-search.open { display: block; }
.mobile-search form { display: flex; }
.mobile-search input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 999px 0 0 999px; padding: 0 16px; background: var(--soft); color: var(--ink); font: inherit; }
.mobile-search button { height: 42px; border: 0; border-radius: 0 999px 999px 0; padding: 0 16px; background: var(--brand); color: #fff; font-weight: 700; }

/* ---------- Menu rubrik ---------- */
.mainnav { position: sticky; top: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 3px solid var(--brand); }
.mainnav .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.mainnav .wrap::-webkit-scrollbar { display: none; }
.mainnav a { flex: 0 0 auto; padding: 12px; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-2); }
.mainnav a:hover, .mainnav a.active { color: var(--brand); }
.mainnav a.loker { color: var(--brand); }

/* ---------- Topik & ticker ---------- */
.topics { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 0 2px; }
.topics::-webkit-scrollbar { display: none; }
.topics a { flex: 0 0 auto; border: 1px solid var(--line); padding: 6px 12px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; border-radius: 4px; color: var(--ink-2); }
.topics a:hover { border-color: var(--brand); color: var(--brand); }
.ticker { display: flex; align-items: center; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.ticker strong { flex: 0 0 auto; background: var(--brand); color: #fff; font-size: .72rem; letter-spacing: .06em; padding: 9px 12px; }
.ticker .track { overflow: hidden; flex: 1; }
.ticker ul { display: flex; gap: 32px; margin: 0; padding: 0 0 0 16px; list-style: none; white-space: nowrap; animation: ticker 70s linear infinite; width: max-content; }
.ticker:hover ul { animation-play-state: paused; }
.ticker li { font-size: .85rem; font-weight: 600; }
.ticker li a:hover { color: var(--brand); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Bagian ---------- */
.section { margin: 26px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; border-bottom: 2px solid var(--line); }
.section-title { margin: 0 0 -2px; padding-bottom: 8px; border-bottom: 2px solid var(--brand); font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; color: var(--title); }
.section-link { font-size: .78rem; font-weight: 700; color: var(--muted); padding-bottom: 8px; white-space: nowrap; }
.section-link:hover { color: var(--brand); }
.kicker { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.chip { display: inline-block; padding: 3px 8px; border-radius: 3px; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.meta { font-size: .76rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

/* ---------- Gambar ---------- */
.media { position: relative; overflow: hidden; background: var(--soft); isolation: isolate; }
.media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.media .placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, #e8eaee, #f6d4da); color: var(--brand); font-weight: 800; font-size: 1.6rem; }
a:hover .media img { transform: scale(1.03); }

/* ---------- Headline ---------- */
.headline-grid { display: grid; gap: 16px; margin-top: 16px; }
.headline { position: relative; display: block; border-radius: var(--radius); overflow: hidden; }
.headline .media { aspect-ratio: 16 / 10; }
.headline::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .82)); pointer-events: none; z-index: 1; }
.headline-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 18px; color: #fff; }
.headline-title { margin: 8px 0 6px; font-size: clamp(1.3rem, 4.6vw, 2.1rem); line-height: 1.2; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.headline .meta { color: rgba(255, 255, 255, .82); }
.headline-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }

/* ---------- Baris berita ---------- */
.row { display: grid; grid-template-columns: 1fr 108px; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.row .media { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); }
.row h3 { margin: 2px 0 6px; font-size: 1rem; line-height: 1.35; font-weight: 700; color: var(--title); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row:hover h3 { color: var(--brand); }
.row .lead { margin: 0 0 6px; font-size: .86rem; color: var(--ink-2); display: none; }
.row-list .row:last-child { border-bottom: 0; }
.headline-side .row { grid-template-columns: 84px 1fr; padding: 11px 0; gap: 12px; }
.headline-side .row:last-child { border-bottom: 0; }
.headline-side .row .media { order: -1; }
.headline-side .row h3 { font-size: .9rem; }

/* ---------- Kartu ---------- */
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.card .media { aspect-ratio: 3 / 2; border-radius: var(--radius-sm); margin-bottom: 8px; }
.card h3 { margin: 4px 0; font-size: .95rem; line-height: 1.35; font-weight: 700; color: var(--title); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card:hover h3 { color: var(--brand); }

/* ---------- Blok rubrik ---------- */
.cat-grid { display: grid; gap: 8px 28px; grid-template-columns: minmax(0, 1fr); }
.cat-block .lead-card .media { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); margin-bottom: 10px; }
.cat-block .lead-card h3 { margin: 0 0 6px; font-size: 1.08rem; line-height: 1.3; font-weight: 800; color: var(--title); }
.cat-block .lead-card:hover h3 { color: var(--brand); }
.cat-block .lead-card p { margin: 0 0 6px; font-size: .88rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-block ul { list-style: none; margin: 8px 0 0; padding: 0; }
.cat-block li a { display: block; padding: 9px 0; border-top: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.cat-block li a:hover { color: var(--brand); }

/* ---------- Layout utama + sidebar ---------- */
.layout { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.layout > *, .card-grid > *, .cat-grid > *, .job-grid > * { min-width: 0; }
.sidebar { display: grid; gap: 22px; align-content: start; }

.popular { list-style: none; margin: 0; padding: 0; counter-reset: pop; }
.popular li { counter-increment: pop; }
.popular a { display: grid; grid-template-columns: 30px 1fr 72px; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.popular a::before { content: counter(pop); font-size: 1.5rem; font-weight: 800; line-height: 1; color: var(--brand); }
.popular h3 { margin: 0 0 4px; font-size: .88rem; line-height: 1.35; font-weight: 700; color: var(--title); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.popular a:hover h3 { color: var(--brand); }
.popular .media { width: 72px; height: 54px; border-radius: 4px; }
.popular .placeholder { font-size: .9rem; }

.topic-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.topic-bars a { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; font-size: .82rem; font-weight: 700; }
.topic-bars a:hover { color: var(--brand); }
.topic-bars .count { color: var(--muted); font-weight: 600; font-size: .76rem; }
.topic-bars .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.topic-bars .bar span { display: block; height: 100%; background: var(--brand); border-radius: 0 3px 3px 0; }

/* ---------- Listing ---------- */
.page-head { padding: 22px 0 4px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--title); }
.page-head p { margin: 0; color: var(--muted); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.pagination { display: flex; justify-content: center; gap: 8px; margin: 24px 0; }
.pagination a, .pagination span { min-width: 44px; height: 40px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; background: var(--soft); }
.pagination .current { background: var(--title); color: var(--bg); }

/* ---------- Artikel ---------- */
.article { padding-top: 16px; }
.crumbs { font-size: .78rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.crumbs a:hover { color: var(--brand); }
.article h1 { margin: 6px 0 12px; font-size: clamp(1.5rem, 5.5vw, 2.25rem); line-height: 1.22; font-weight: 800; letter-spacing: -.025em; color: var(--title); text-wrap: balance; }
.article-lead { font-size: 1.06rem; color: var(--ink-2); margin: 0 0 14px; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 12px; font-size: .8rem; color: var(--muted); }
.byline strong { color: var(--ink); }
.article-figure { margin: 0 0 18px; }
.article-figure .media { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); }
.article-figure figcaption { padding-top: 6px; font-size: .75rem; color: var(--muted); }
.points { background: var(--soft); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 20px; }
.points strong { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: 4px; }
.points ul { margin: 0; padding-left: 20px; }
.points li { margin: 4px 0; font-weight: 600; font-size: .95rem; }
.prose { font-size: 1.05rem; line-height: 1.8; color: var(--ink-2); }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: 1.26rem; line-height: 1.3; color: var(--title); margin: 1.5em 0 .6em; }
.prose h3 { font-size: 1.1rem; color: var(--title); margin: 1.3em 0 .5em; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 1.3em 0; padding: 4px 0 4px 16px; border-left: 4px solid var(--brand); font-weight: 600; color: var(--ink); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose strong { color: var(--ink); }
.read-also { margin: 1.2em 0 1.4em; padding: 10px 14px; border-left: 4px solid var(--brand); background: var(--soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .95rem; line-height: 1.5; }
.read-also span { font-weight: 800; color: var(--brand); margin-right: 6px; }
.prose .read-also a { font-weight: 700; color: var(--title); text-decoration: none; }
.prose .read-also a:hover { color: var(--brand); }
.source-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 22px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.source-card small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.source-card .btn { height: 36px; font-size: .82rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; align-items: center; }
.tags b { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tags a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 4px; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.tags a:hover { border-color: var(--brand); color: var(--brand); }
.share { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.share span { font-size: .78rem; font-weight: 700; color: var(--muted); margin-right: 2px; }
.share a, .share button { height: 32px; padding: 0 12px; border-radius: 4px; border: 0; display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; cursor: pointer; color: #fff; }
.share .wa { background: #1b8f49; } .share .x { background: #111; } .share .fb { background: #1664d0; } .share .tg { background: #1a7fb3; } .share .copy { background: var(--soft); color: var(--ink); }
.preview-bar { position: sticky; top: 0; z-index: 60; background: #ffb800; color: #111; text-align: center; font-weight: 700; font-size: .85rem; padding: 8px 16px; }
.static { max-width: 760px; margin: 0 auto; padding: 18px 0 40px; }

/* ---------- Loker ---------- */
.job-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.job-card { display: flex; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s; }
.job-card:hover { border-color: var(--brand); }
.job-logo { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; }
.job-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.job-title { font-weight: 800; line-height: 1.3; color: var(--title); }
.job-card:hover .job-title { color: var(--brand); }
.job-company { color: var(--ink-2); font-size: .88rem; }
.job-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.job-tags span { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: var(--soft); color: var(--ink-2); }
.side-jobs .job-card { padding: 10px 12px; }
.side-jobs .job-logo { width: 38px; height: 38px; font-size: 1rem; }
.job-filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.job-filters input, .job-filters select { height: 42px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--soft); color: var(--ink); padding: 0 14px; font: inherit; min-width: 0; }
.job-filters #job-q, .job-filters #job-edu, .job-filters .btn { grid-column: 1 / -1; }
.job-filters .btn { border-radius: var(--radius-sm); height: 42px; }
.job-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 18px; }
.job-facts div { background: var(--soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.job-facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.job-facts dd { margin: 2px 0 0; font-weight: 700; }
.notice { font-size: .85rem; color: var(--ink-2); background: #fff7e6; border-left: 4px solid #f59e0b; padding: 10px 14px; border-radius: var(--radius-sm); margin: 16px 0; }
.notice-closed { border-left-color: var(--muted); background: var(--soft); }
.notice a { color: var(--brand); font-weight: 700; }
@media (prefers-color-scheme: dark) { .notice { background: #2a2414; } }

/* ---------- Iklan ---------- */
.ad-slot { margin: 22px 0; min-height: 110px; text-align: center; }
.ad-label { display: block; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 44px; background: var(--soft); color: var(--muted); font-size: .86rem; padding: 30px 0 22px; border-top: 3px solid var(--brand); }
.site-footer a:hover { color: var(--brand); }
.footer-grid { display: grid; gap: 24px; }
.footer-grid h4 { margin: 0 0 10px; color: var(--ink); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-bottom { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; font-size: .78rem; }
.footer-bottom a { color: var(--ink); font-weight: 600; }

/* ---------- Breakpoint ---------- */
@media (min-width: 640px) {
    .card-grid { grid-template-columns: repeat(4, 1fr); }
    .row { grid-template-columns: 1fr 150px; }
    .row .lead { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .job-grid { grid-template-columns: repeat(2, 1fr); }
    .job-filters { grid-template-columns: 2fr 1.2fr 1fr 1fr auto; }
    .job-filters #job-q, .job-filters #job-edu, .job-filters .btn { grid-column: auto; }
    .job-facts { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1.4fr 1.6fr 1fr; }
}

@media (min-width: 1000px) {
    .topbar nav { display: flex; }
    .masthead-search { display: block; }
    .search-toggle { display: none; }
    .headline-grid { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); }
    .headline .media { aspect-ratio: auto; height: 100%; min-height: 420px; }
    .headline-side { display: flex; flex-direction: column; justify-content: space-between; }
    .layout { grid-template-columns: minmax(0, 1fr) 330px; }
    .sidebar { position: sticky; top: 64px; }
    .side-jobs .job-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
