/* ── Base ── */
:root {
    --brand: #f59e0b;
    --brand-dark: #d97706;
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2128;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --ai: #38bdf8;
    --it: #4ade80;
    --pol: #fb923c;
    --health: #f472b6;
    --market: #a78bfa;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Navbar ── */
.site-navbar {
    background: rgba(13, 17, 23, .95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: .75rem 0;
    z-index: 1030;
}

.site-navbar .navbar-brand {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.4rem;
    color: #fff;
    font-weight: 700;
}

.site-navbar .nav-link {
    color: var(--text-muted) !important;
    font-size: .9rem;
    transition: color .2s;
}

.site-navbar .nav-link:hover { color: var(--text) !important; }

.site-navbar .navbar-toggler {
    border-color: var(--border);
    color: var(--text);
}

.site-navbar .navbar-toggler-icon {
    filter: invert(1);
}

.search-input {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text);
    min-width: 200px;
}

.search-input:focus {
    background: var(--bg-card);
    border-color: var(--brand);
    color: var(--text);
    box-shadow: 0 0 0 .2rem rgba(245, 158, 11, .2);
}

.search-input::placeholder { color: var(--text-muted); }

/* ── Category Badges ── */
.badge-cat {
    display: inline-block;
    padding: .2em .55em;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.cat-ai     { background: rgba(56, 189, 248, .15); color: var(--ai);     border: 1px solid rgba(56, 189, 248, .3); }
.cat-it     { background: rgba(74, 222, 128, .15); color: var(--it);     border: 1px solid rgba(74, 222, 128, .3); }
.cat-pol    { background: rgba(251, 146, 60, .15); color: var(--pol);    border: 1px solid rgba(251, 146, 60, .3); }
.cat-health { background: rgba(244, 114, 182, .15); color: var(--health); border: 1px solid rgba(244, 114, 182, .3); }
.cat-market { background: rgba(167, 139, 250, .15); color: var(--market); border: 1px solid rgba(167, 139, 250, .3); }

/* ── Hero ── */
.hero-section {
    background-size: cover;
    background-position: center;
    padding: 5rem 0 4rem;
    min-height: 480px;
    display: flex;
    align-items: center;
}

.hero-empty { min-height: 360px; background: linear-gradient(135deg, #0f0c29, #302b63, #24243e); }

.hero-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    color: #fff;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.hero-summary {
    color: rgba(255,255,255,.7);
    font-size: 1.05rem;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

/* ── Category Quick Cards ── */
.cat-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    transition: all .25s;
    color: var(--text);
}

.cat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(245, 158, 11, .15);
    color: var(--text);
}

.cat-card-inner { display: flex; align-items: center; gap: .85rem; }

.cat-card-icon { font-size: 1.6rem; }

.cat-ai .cat-card-icon         { color: var(--ai); }
.cat-it .cat-card-icon         { color: var(--it); }
.cat-politics .cat-card-icon,
.cat-pol .cat-card-icon        { color: var(--pol); }
.cat-healthcare .cat-card-icon { color: var(--health); }
.cat-markets .cat-card-icon    { color: var(--market); }

.cat-card-label { font-weight: 600; font-size: .95rem; }

.cat-card-latest { font-size: .78rem; color: var(--text-muted); max-width: 200px; }

/* ── Section Headers ── */
.section-header { border-bottom: 1px solid var(--border); padding-bottom: .75rem; }
.section-title { font-size: 1.25rem; font-weight: 700; color: var(--text); margin: 0; }

/* ── Post Cards ── */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all .25s;
}

.post-card:hover {
    border-color: var(--brand);
    box-shadow: 0 4px 24px rgba(245, 158, 11, .12);
    transform: translateY(-3px);
}

.post-card-img-link { display: block; overflow: hidden; }

.post-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform .4s;
}

.post-card:hover .post-card-img { transform: scale(1.04); }

.post-card-body { padding: 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }

.post-card-title { font-size: .95rem; font-weight: 600; line-height: 1.4; margin-bottom: .5rem; }

.post-title-link { color: var(--text); text-decoration: none; transition: color .2s; }
.post-title-link:hover { color: var(--brand); }

.post-card-summary { font-size: .83rem; color: var(--text-muted); line-height: 1.5; flex: 1; margin-bottom: .75rem; }

.post-card-footer { display: flex; justify-content: space-between; align-items: center; }

.post-date { color: var(--text-muted); }

.read-more { font-size: .8rem; color: var(--brand); text-decoration: none; font-weight: 500; }
.read-more:hover { color: var(--brand-dark); }

/* ── Horizontal Post Card ── */
.post-card-h {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.post-card-h-img-link { flex-shrink: 0; }

.post-card-h-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.post-card-h-title {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: .25rem;
}

/* ── Sidebar ── */
.sticky-sidebar { position: sticky; top: 80px; }

.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: popular;
}

.popular-list li {
    counter-increment: popular;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    padding-left: 2rem;
}

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

.popular-list li::before {
    content: counter(popular);
    position: absolute;
    left: 0;
    top: .7rem;
    font-weight: 700;
    font-size: .9rem;
    color: var(--brand);
}

.popular-link {
    color: var(--text);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.4;
    display: block;
}

.popular-link:hover { color: var(--brand); }

.popular-meta { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Detail Page ── */
.detail-hero {
    background-size: cover;
    background-position: center;
    padding: 4rem 0 3rem;
}

.detail-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: clamp(1.5rem, 3.5vw, 2.4rem);
    line-height: 1.25;
    margin-bottom: .75rem;
}

.detail-summary { font-size: 1.05rem; color: rgba(255,255,255,.65); max-width: 700px; }

.article-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
}

.article-content h2 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: .75rem;
    color: var(--text);
    border-left: 3px solid var(--brand);
    padding-left: .85rem;
}

.article-content p { margin-bottom: 1.3rem; }

.article-content ul, .article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.3rem;
}

.article-content li { margin-bottom: .4rem; }

.article-content strong { color: var(--text); }

.source-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: 8px;
    padding: .85rem 1rem;
    font-size: .9rem;
    color: var(--text-muted);
}

.source-box a { color: var(--brand); }

/* ── News References ── */
.references-box {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}

.references-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

.references-list {
    list-style: decimal;
    padding-left: 1.4rem;
    margin: 0;
}

.references-list li {
    margin-bottom: .5rem;
    font-size: .83rem;
    line-height: 1.45;
}

.ref-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
}

.ref-link:hover { color: var(--brand); }

.ref-meta {
    display: block;
    font-size: .72rem;
    color: #555e6a;
    margin-top: .1rem;
}

.ref-meta span + span { margin-left: .3rem; }

/* ── AI Disclaimer ── */
.ai-disclaimer {
    font-size: .72rem;
    color: #4a5260;
    letter-spacing: .02em;
}

/* ── Share Bar ── */
.share-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.btn-outline-secondary {
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--brand);
    color: var(--brand);
}

/* ── Category Hero ── */
.cat-hero {
    padding: 3rem 0;
    background: linear-gradient(135deg, #0d1117, #161b22);
    border-bottom: 1px solid var(--border);
}

.cat-hero-ai         { background: linear-gradient(135deg, #0c1a2e, #0d2137); }
.cat-hero-it         { background: linear-gradient(135deg, #0c1a11, #0d2117); }
.cat-hero-politics   { background: linear-gradient(135deg, #1a0e00, #251400); }
.cat-hero-healthcare { background: linear-gradient(135deg, #1a0a14, #250d1a); }
.cat-hero-markets    { background: linear-gradient(135deg, #100d1a, #160f25); }

/* ── Pagination ── */
.page-link {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-muted);
}

.page-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--brand);
    color: var(--brand);
}

.page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #000;
    font-weight: 600;
}

/* ── Footer ── */
.site-footer {
    background: #090d13;
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    color: #a0aab4;
}

.site-footer h5,
.site-footer h6 { color: #e6edf3; }

.site-footer p,
.site-footer .text-muted { color: #a0aab4 !important; }

.footer-link { color: #c0c8d0; text-decoration: none; display: block; margin-bottom: .4rem; font-size: .9rem; }
.footer-link:hover { color: var(--brand); }
.footer-divider { border-color: var(--border); margin: 2rem 0 1rem; }

/* ── Buttons ── */
.btn-warning { background: var(--brand); border-color: var(--brand); color: #000; font-weight: 600; }
.btn-warning:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #000; }

.btn-outline-info { border-color: var(--ai); color: var(--ai); }
.btn-outline-info:hover { background: rgba(56,189,248,.1); color: var(--ai); }

.btn-outline-success { border-color: var(--it); color: var(--it); }
.btn-outline-success:hover { background: rgba(74,222,128,.1); color: var(--it); }

.btn-outline-warning { border-color: var(--brand); color: var(--brand); }
.btn-outline-warning:hover { background: rgba(245,158,11,.1); color: var(--brand); }

/* ── Empty State ── */
.empty-state { padding: 4rem 0; }
.empty-state i { opacity: .3; }

/* ── Breadcrumb ── */
.breadcrumb-dark .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.3); }

/* ── Bootstrap overrides for dark mode ── */
.navbar-collapse { background: var(--bg); }

@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 1rem 0;
        border-top: 1px solid var(--border);
        margin-top: .5rem;
    }
    .sticky-sidebar { position: static; }
    .hero-section { padding: 3rem 0 2.5rem; min-height: auto; }
    .detail-hero { padding: 2.5rem 0 2rem; }
}

@media (max-width: 575.98px) {
    .hero-title { font-size: 1.5rem; }
    .detail-title { font-size: 1.4rem; }
    .post-card-img { height: 160px; }
}
