/*
Theme Name: Postingan.id - Portal Berita Modern
Theme URI: https://postingan.id/
Author: postingan.id
Description: Tema portal berita modern, cepat, responsif, dan SEO-friendly untuk postingan.id.
Version: 2.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: postinganid
*/

:root {
    --primary-blue: #004b93;
    --dark-blue: #0b2545;
    --accent-green: #00a651;
    --light-green: #10b981;
    --bg-gray: #f4f6f9;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --white: #fff;
    --shadow: 0 4px 18px rgba(15, 23, 42, .07);
    --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg-gray); color: var(--text-dark); line-height: 1.6; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
.site-container { width: min(1280px, calc(100% - 30px)); margin-inline: auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.top-bar { background: var(--dark-blue); color: #fff; font-size: 12px; }
.top-bar-inner { min-height: 34px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.date-time { color: #cbd5e1; }
.top-links { color: #9be7c1; font-weight: 700; }

.main-header { background: #fff; border-bottom: 3px solid var(--accent-green); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.main-header-inner { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.logo { min-width: 0; width: 260px; max-width: 45vw; line-height: 0; overflow: hidden; }
.custom-logo-link { display: inline-flex; align-items: center; width: 100%; max-width: 260px; line-height: 0; }
.custom-logo, .logo img { display: block !important; width: auto !important; max-width: 260px !important; max-height: 68px !important; height: auto !important; object-fit: contain; }
.header-search { width: min(360px, 100%); }
.search-form { display: flex; align-items: center; position: relative; }
.search-field { width: 100%; height: 42px; padding: 0 48px 0 16px; border: 1px solid #cbd5e1; border-radius: 24px; outline: none; font: inherit; background: #fff; }
.search-field:focus { border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(0,75,147,.1); }
.search-submit { position: absolute; right: 4px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--primary-blue); color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }

.nav-container { background: var(--primary-blue); position: sticky; top: 0; z-index: 999; box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.nav-inner { position: relative; }
.category-menu-wrap { overflow: hidden; }
.category-menu { display: flex; overflow-x: auto; white-space: nowrap; padding: 0; margin: 0; list-style: none; scrollbar-width: none; }
.category-menu::-webkit-scrollbar { display: none; }
.category-menu li { flex: 0 0 auto; }
.category-menu a { display: block; padding: 13px 14px 10px; color: #fff; font-weight: 700; font-size: 13px; text-decoration: none; border-bottom: 3px solid transparent; transition: .2s ease; }
.category-menu a:hover, .category-menu .current-menu-item > a, .category-menu .current-category-ancestor > a, .category-menu li.active > a { background: rgba(255,255,255,.1); border-bottom-color: var(--light-green); }
.mobile-menu-toggle { display: none; }

.wrapper { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 25px; margin-top: 25px; margin-bottom: 30px; }
.headline-section { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 15px; margin-bottom: 25px; }
.main-headline { position: relative; height: 390px; overflow: hidden; border-radius: var(--radius); background: #dbeafe; box-shadow: var(--shadow); }
.main-headline > a { display: block; height: 100%; text-decoration: none; }
.main-headline img, .image-placeholder { width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-blue), var(--accent-green)); color: #fff; font-size: 48px; font-weight: 900; }
.caption { position: absolute; inset: auto 0 0; padding: 28px 22px 20px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.9)); }
.caption h2 { margin: 8px 0 3px; font-size: clamp(21px, 2.2vw, 29px); line-height: 1.2; }
.headline-meta { font-size: 12px; color: #dbeafe; }
.badge-cat { display: inline-block; background: var(--accent-green); color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 10px; line-height: 1.2; font-weight: 800; text-transform: uppercase; }
.badge-cat.small { font-size: 8px; padding: 3px 5px; }
.sub-headlines { display: flex; flex-direction: column; gap: 12px; }
.sub-card { display: flex; min-height: 84px; gap: 10px; padding: 10px; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 2px 8px rgba(15,23,42,.03); }
.sub-thumb, .news-thumb { flex: 0 0 auto; display: block; overflow: hidden; background: #e2e8f0; border-radius: 6px; text-decoration: none; }
.sub-thumb { width: 92px; height: 70px; }
.sub-thumb img, .news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sub-card h4 { margin: 5px 0 0; font-size: 13px; line-height: 1.3; }
.sub-card h4 a { text-decoration: none; }
.sub-card h4 a:hover { color: var(--primary-blue); }
.thumb-placeholder { display: grid; place-items: center; width: 100%; height: 100%; min-height: 70px; background: linear-gradient(135deg, var(--primary-blue), var(--accent-green)); color: #fff; font-weight: 900; font-size: 24px; }

.news-feed, .sidebar-box, .single-article { background: #fff; padding: 20px; border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-heading { margin-bottom: 18px; }
.section-title { margin: 0; padding-left: 10px; border-left: 4px solid var(--accent-green); color: var(--primary-blue); font-size: 19px; line-height: 1.2; text-transform: uppercase; }
.news-item { display: flex; gap: 15px; padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px solid var(--border-color); }
.news-item:last-of-type { margin-bottom: 0; }
.news-thumb { width: 160px; height: 105px; }
.news-detail { min-width: 0; }
.news-detail h2, .news-detail h3 { margin: 6px 0 4px; font-size: 17px; line-height: 1.3; }
.news-detail h2 a, .news-detail h3 a { color: var(--text-dark); text-decoration: none; }
.news-detail h2 a:hover, .news-detail h3 a:hover { color: var(--primary-blue); }
.news-excerpt { margin: 5px 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.news-meta, .single-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-muted); font-size: 11px; margin-top: 7px; }

.sidebar-box { margin-bottom: 20px; }
.sidebar-title { border-left-color: var(--primary-blue); }
.trending-list { list-style: none; counter-reset: trending; padding: 0; margin: 16px 0 0; }
.trending-list li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; counter-increment: trending; }
.trending-list li::before { content: counter(trending); flex: 0 0 25px; font-size: 20px; line-height: 1; font-weight: 900; color: var(--accent-green); }
.trending-list a { text-decoration: none; color: var(--text-dark); font-size: 14px; line-height: 1.35; font-weight: 700; }
.trending-list a:hover { color: var(--primary-blue); }
.no-trending { color: var(--text-muted); font-size: 13px; }
.ad-box { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #e2e8f0; color: var(--text-muted); }
.ad-box span { font-size: 11px; letter-spacing: 1px; }
.ad-box strong { margin-top: 6px; color: var(--primary-blue); font-size: 22px; }
.ad-box small { margin-top: 5px; }
.about-box p { margin-bottom: 0; color: var(--text-muted); font-size: 13px; }

.pagination-wrap { padding-top: 20px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 7px; }
.page-numbers { display: inline-block; padding: 7px 11px; border: 1px solid var(--border-color); border-radius: 6px; color: var(--primary-blue); text-decoration: none; font-size: 13px; font-weight: 700; }
.page-numbers.current, .page-numbers:hover { background: var(--primary-blue); color: #fff; }
.empty-state { padding: 45px 20px; text-align: center; color: var(--text-muted); }
.empty-state h3 { color: var(--text-dark); margin-top: 0; }

.single-layout { align-items: start; }
.single-article { padding: clamp(20px, 4vw, 38px); }
.single-category { margin-bottom: 12px; }
.single-title { margin: 0 0 10px; font-size: clamp(30px, 4vw, 46px); line-height: 1.12; color: var(--text-dark); }
.single-featured-image { margin: 25px 0; }
.single-featured-image img { width: 100%; display: block; border-radius: 8px; }
.single-featured-image figcaption { margin-top: 6px; color: var(--text-muted); font-size: 11px; }
.entry-content { font-size: 17px; line-height: 1.85; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content img { border-radius: 7px; }
.entry-content a { color: var(--primary-blue); }
.post-tags { margin-top: 25px; display: flex; flex-wrap: wrap; gap: 7px; }
.post-tags a { display: inline-block; padding: 5px 9px; background: #eef2f7; border-radius: 5px; text-decoration: none; font-size: 12px; }
.post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.post-navigation div { background: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; }
.post-navigation div:last-child { text-align: right; }
.post-navigation a { text-decoration: none; color: var(--primary-blue); font-weight: 700; font-size: 13px; }
.button-primary { display: inline-block; margin-top: 15px; padding: 10px 16px; border-radius: 7px; background: var(--primary-blue); color: #fff; text-decoration: none; font-weight: 700; }
.error-code { font-size: 70px; line-height: 1; font-weight: 900; color: var(--primary-blue); }

.site-footer { margin-top: 45px; padding: 35px 0; background: var(--dark-blue); color: #fff; border-top: 4px solid var(--accent-green); }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-inner h3 { margin: 0 0 8px; color: var(--accent-green); }
.footer-inner p { max-width: 550px; margin: 0; color: #cbd5e1; font-size: 13px; }
.footer-copy { align-self: end; }

@media (max-width: 900px) {
    .wrapper { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .sidebar-box { margin-bottom: 0; }
}

@media (max-width: 700px) {
    .site-container { width: min(100% - 20px, 1280px); }
    .top-bar-inner { min-height: 30px; }
    .top-links { display: none; }
    .main-header-inner { min-height: 75px; gap: 15px; }
    .logo { width: 210px; max-width: 52vw; }
    .custom-logo-link { max-width: 210px; }
    .custom-logo, .logo img { max-width: 210px !important; max-height: 55px !important; }
    .header-search { width: 42px; flex: 0 0 42px; }
    .search-field { position: absolute; right: 0; top: 48px; width: min(300px, 82vw); display: none; z-index: 10; }
    .search-submit { position: relative; right: auto; width: 42px; height: 42px; }
    .header-search:focus-within .search-field, .header-search:hover .search-field { display: block; }
    .mobile-menu-toggle { display: none; }
    .category-menu a { padding-inline: 11px; font-size: 12px; }
    .headline-section { grid-template-columns: 1fr; }
    .main-headline { height: 300px; }
    .sub-headlines { display: grid; grid-template-columns: 1fr 1fr; }
    .sub-card { min-width: 0; }
    .sub-card h4 { font-size: 12px; }
    .news-feed, .sidebar-box { padding: 15px; }
    .news-item { gap: 10px; }
    .news-thumb { width: 110px; height: 78px; }
    .news-detail h2, .news-detail h3 { font-size: 14px; }
    .news-excerpt { display: none; }
    .sidebar { grid-template-columns: 1fr; }
    .single-title { font-size: 29px; }
    .entry-content { font-size: 16px; }
    .post-navigation { grid-template-columns: 1fr; }
    .post-navigation div:last-child { text-align: left; }
}

@media (max-width: 430px) {
    .logo { width: 175px; max-width: 58vw; }
    .custom-logo-link { max-width: 175px; }
    .custom-logo, .logo img { max-width: 175px !important; max-height: 48px !important; }
    .sub-headlines { grid-template-columns: 1fr; }
    .sub-card { min-height: 72px; }
    .sub-thumb { width: 82px; height: 62px; }
    .main-headline { height: 260px; }
    .caption { padding: 22px 15px 15px; }
    .caption h2 { font-size: 19px; }
}

/* Logo safety: keep the site logo confined to the header. */
.main-header .logo img[src*="postingan.id.png"] { width: auto !important; max-width: 260px !important; max-height: 68px !important; height: auto !important; }
@media (max-width: 700px) { .main-header .logo img[src*="postingan.id.png"] { max-width: 210px !important; max-height: 55px !important; } }
@media (max-width: 430px) { .main-header .logo img[src*="postingan.id.png"] { max-width: 175px !important; max-height: 48px !important; } }
