/* ==========================================
   Responsive Supplement
   ========================================== */

/* Reading progress bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--clr-primary);
    z-index: 9999;
    transition: width .1s linear;
}

/* Skip to content */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    background: var(--clr-primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 99999;
    font-size: .9rem;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Ad notice label */
.bk-ad-widget .ad-notice {
    display: block;
    font-size: .65rem;
    text-align: center;
    color: var(--clr-text-light);
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Sidebar sticky */
@media (min-width: 900px) {
    .sidebar .widget:first-child,
    .sidebar .ad-panel:first-child {
        position: sticky;
        top: 80px;
    }
}

/* Print reading progress bar hidden */
@media print {
    #reading-progress { display: none; }
}

/* High contrast / accessibility */
@media (prefers-contrast: high) {
    :root {
        --clr-border: #888;
        --clr-text-muted: #555;
    }
    .news-card { border-width: 2px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .ticker-inner { animation: none; }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Only apply if no explicit theme class set */
    body:not(.light-mode) {
        --clr-bg: #111218;
        --clr-bg-white: #1C1C2A;
        --clr-text: #E8E8E8;
        --clr-text-muted: #A8A8B0;
        --clr-text-light: #6A6A78;
        --clr-border: #2E2E3E;
        --clr-border-dark: #3E3E50;
        --clr-accent-light: rgba(240,165,0,.1);
    }
    body:not(.light-mode) .site-header { background: var(--clr-bg-white); }
    body:not(.light-mode) .ad-panel { background: linear-gradient(135deg, #1a1a28 0%, #222233 100%); }
}

/* ── Ad Zone Wrapper ── */
.bk-ad-zone {
    margin: var(--gap-md) 0;
    text-align: center;
    position: relative;
}
.bk-ad-label {
    display: block;
    font-size: .62rem;
    color: var(--clr-text-light);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.bk-ad-zone img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════════════════
   HERO FALLBACK PANELS (headlines + popular)
   ══════════════════════════════════════════ */
.hero-headline-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-decoration: none;
    transition: background .15s;
    flex-wrap: wrap;
}
.hero-headline-item:hover { background: rgba(255,255,255,.05); }
.hero-headline-item:last-child { border-bottom: none; }

.hero-headline-cat {
    display: inline-block;
    font-size: .62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 2px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}
.hero-headline-title {
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255,255,255,.88);
    line-height: 1.4;
    flex: 1;
}
.hero-headline-time {
    font-size: .68rem;
    color: rgba(255,255,255,.35);
    white-space: nowrap;
    align-self: flex-end;
    width: 100%;
    padding-left: 2px;
    margin-top: 2px;
}

.hero-popular-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-decoration: none;
    transition: background .15s;
}
.hero-popular-item:hover { background: rgba(255,255,255,.05); }
.hero-popular-item:last-child { border-bottom: none; }

.hero-popular-num {
    width: 26px;
    height: 26px;
    min-width: 26px;
    background: rgba(255,255,255,.12);
    color: var(--clr-accent);
    font-weight: 800;
    font-size: .8rem;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hero-popular-item:first-child .hero-popular-num { background: var(--clr-accent); color: var(--clr-secondary); }
.hero-popular-item:nth-child(2) .hero-popular-num { background: rgba(170,170,170,.3); color: #ccc; }
.hero-popular-item:nth-child(3) .hero-popular-num { background: rgba(180,100,40,.3); color: #cd7f32; }

.hero-popular-title {
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ══════════════════════════════════════════
   TABS — guaranteed display fix
   ══════════════════════════════════════════ */
.tab-pane { display: none; }
.tab-pane.active { display: block; }
