:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #e63946;
    --nav: #0f172a;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Tahoma, sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; }
.container { width: min(1060px, 100% - 32px); margin: 0 auto; }

.page-shell { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px; gap: 10px; align-items: start; min-height: 100vh; }
.content-shell { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.ad-rail { position: sticky; top: 72px; height: calc(100vh - 160px); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.ad-rail { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.ad-rail > script { display: block; }
.ad-rail iframe,
.ad-rail ins,
.ad-rail div[id^="container-"],
.ad-rail a {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}
.ad-frame {
    border: 0;
    height: 100%;
    min-height: 420px;
}
.ad-placeholder {
    width: 100%;
    min-height: 420px;
    border: 1px dashed #94a3b8;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
}
.ad-rail iframe { margin: 0 0 10px 0 !important; }
.ad-rail, .ad-rail * { writing-mode: horizontal-tb !important; text-orientation: mixed !important; }
.ad-rail a { word-break: normal !important; overflow-wrap: anywhere; }

.main-nav { background: var(--nav); position: sticky; top: 0; z-index: 30; width: calc(100% + 320px); margin-left: -160px; }
.nav-row { display: flex; align-items: center; gap: 18px; min-height: 58px; }
.logo h1 { margin: 0; color: #fff; font-size: 22px; letter-spacing: 1px; }
.logo span { color: var(--accent); }
.logo-link { text-decoration: none; color: inherit; display: inline-block; }

.mobile-menu-toggle { display: none; border: 1px solid #334155; background: #0b1220; color: #cbd5e1; border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 12px; }
.translate-btn { border: 1px solid #334155; background: #0b1220; color: #cbd5e1; border-radius: 8px; padding: 6px 8px; font-weight: 700; font-size: 11px; cursor: pointer; }
.translate-hidden { display: none; }
.translate-popover { display: none; margin-bottom: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.translate-popover.open { display: block; }
.desktop-only { display: inline-block; }
.mobile-only { display: none; }

.nav-links { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; flex: 1; justify-content: center; }
.nav-links a { color: #cbd5e1; text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: 1px; position: relative; padding-bottom: 4px; }
.nav-links > li > a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform 0.2s ease; }
.nav-links > li:hover > a::after, .nav-links > li > a.active-link::after { transform: scaleX(1); }

.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: #111827; border: 1px solid #1f2937; border-radius: 8px; min-width: 220px; padding: 8px 0; z-index: 40; }
.dropdown:hover > .dropdown-menu { display: block; }
.dropdown-menu li { list-style: none; }
.dropdown-menu a { display: block; padding: 8px 12px; }
.dropdown-menu a:hover { background: #1f2937; color: #fff; }
.dropdown-sub { position: relative; }
.sub-menu { left: 100%; top: -8px; display: none; min-width: 260px; z-index: 45; }
.dropdown-sub.active-submenu > .sub-menu { display: block; }
.continent-trigger, .subregion-trigger { cursor: default; }
.all-link {
    margin: 4px 8px;
    border: 1px solid #334155;
    background: linear-gradient(135deg, #172554, #1d4ed8);
    color: #ffffff !important;
    border-radius: 8px;
    font-weight: 700;
}
.all-link span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.all-link span::before {
    content: "↗";
    font-size: 12px;
    opacity: 0.9;
}
.all-link:hover { background: linear-gradient(135deg, #1e3a8a, #2563eb) !important; }

.mobile-menu-backdrop { display: none; }
.mobile-menu { display: none; }
.mobile-menu-head { display: none; }
.mobile-menu a, .mobile-menu summary { color: #cbd5e1; font-size: 13px; font-weight: 700; text-decoration: none; display: block; padding: 6px 0; }
.mobile-menu details a { padding-left: 12px; font-weight: 600; color: #93c5fd; }
.mobile-menu details details { margin-left: 8px; border-left: 1px solid #334155; padding-left: 8px; }

.nav-meta { color: #cbd5e1; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.live-indicator { background: var(--accent); color: #fff; border-radius: 12px; padding: 1px 8px; font-size: 10px; font-weight: 700; }
.mobile-live { display: none; }
.live-indicator { animation: livePulse 1.1s ease-in-out infinite; }
@keyframes livePulse {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(230,57,70,0.5); }
    50% { opacity: 0.65; box-shadow: 0 0 0 6px rgba(230,57,70,0); }
    100% { opacity: 1; box-shadow: 0 0 0 0 rgba(230,57,70,0); }
}

.list-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.content-shell > main.container { flex: 1; }
.list-header h2 { margin: 0; font-size: 20px; letter-spacing: 1px; }
.country-highlight {
    color: #ef4444;
    margin-left: 8px;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}
.list-meta { color: var(--muted); font-size: 13px; }

.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.home-intro { background: #ffffff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.home-intro h3 { margin: 0 0 8px; font-size: 22px; }
.home-intro p { margin: 0 0 8px; color: #334155; line-height: 1.55; font-size: 14px; }
.home-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.kpi-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; display: grid; gap: 4px; }
.kpi-box strong { font-size: 20px; line-height: 1; color: #0f172a; }
.kpi-box span { color: #475569; font-size: 12px; }
.home-note { color: #475569; font-size: 13px; margin: 0; }
.home-motion { position: relative; overflow: hidden; border: 1px solid #1f2937; border-radius: 12px; background: linear-gradient(135deg, #0b1220, #111827); padding: 18px; margin-bottom: 12px; min-height: 220px; }
.home-motion-canvas { position: absolute; inset: 0; pointer-events: none; }
.home-motion-content { position: relative; z-index: 2; max-width: 720px; }
.home-motion-content h3 { color: #fff; margin: 0 0 8px; font-size: 28px; }
.home-motion-content p { color: #cbd5e1; margin: 0 0 12px; line-height: 1.55; }
.home-pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.home-pill-row span { background: rgba(59,130,246,0.18); border: 1px solid rgba(96,165,250,0.35); color: #dbeafe; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.home-coverage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.coverage-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.coverage-card h4 { margin: 0 0 6px; font-size: 14px; letter-spacing: 0.4px; }
.coverage-card p { margin: 0; color: #64748b; font-size: 12px; }

.news-list { display: grid; gap: 12px; margin-bottom: 16px; }
.news-row { display: flex; gap: 14px; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px; }
.thumb { width: 130px; min-width: 130px; height: 78px; border-radius: 8px; object-fit: cover; background: #e5e7eb; }
.thumb.no-image { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 800; letter-spacing: 1px; background: linear-gradient(135deg, #111827, #1f2937); }

.news-content { flex: 1; min-width: 0; }
.news-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tag { background: #efe8ff; color: #6d28d9; border-radius: 4px; font-size: 10px; font-weight: 700; padding: 2px 8px; letter-spacing: 1px; }
.tag-continent { background: #e0f2fe; color: #075985; }
.tag-region { background: #ede9fe; color: #5b21b6; }
.tag-country { background: #fee2e2; color: #991b1b; }
.time { color: var(--muted); font-size: 12px; }
.news-content h3 { margin: 0; font-size: 27px; line-height: 1.35; }
.news-content a { color: var(--ink); text-decoration: none; }
.news-content a:hover { text-decoration: underline; }

.empty { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; color: var(--muted); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 10px 0 22px; }
.page-btn { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; }
.page-btn.disabled { color: #9ca3af; pointer-events: none; }
.page-current { font-size: 13px; color: var(--muted); }

.main-footer { background: #0b1220; color: #e5e7eb; margin-top: 14px; width: calc(100% + 320px); margin-left: -160px; position: relative; z-index: 5; }
.footer-row { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.muted { color: #94a3b8; font-size: 12px; }
.mobile-inline-ad { display: none; margin-bottom: 10px; }
.mobile-ad-frame { min-height: 120px; max-height: 140px; }
.mobile-ad-placeholder { min-height: 120px; }
.mobile-bottom-ad-popup { display: none; }

@media (max-width: 1280px) {
    .main-nav { width: 100%; margin-left: 0; }
    .main-footer { width: 100%; margin-left: 0; }
    .page-shell { grid-template-columns: 1fr; }
    .ad-rail { display: none; }
}

@media (max-width: 900px) {
    body { padding-bottom: 80px; }
    body.mobile-ad-closed { padding-bottom: 0; }
    .container { width: min(100%, 100% - 16px); }
    .nav-row { min-height: 54px; }
    .desktop-menu, .nav-meta { display: none; }
    .desktop-only { display: none; }
    .mobile-only { display: inline-block; margin-left: auto; }
    .mobile-live { display: inline-block; margin: 0 8px; }
    .mobile-menu-toggle { display: inline-block; }
    .mobile-menu-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, 0.55); z-index: 90; }
    .mobile-menu { position: fixed; top: 0; right: -100%; width: min(360px, 92vw); height: 100vh; background: #0b1220; padding: 14px; z-index: 100; overflow-y: auto; transition: right 0.25s ease; display: block; }
    .mobile-menu.open { right: 0; }
    .mobile-menu-head { display: flex; align-items: center; justify-content: space-between; color: #fff; margin-bottom: 8px; }
    .mobile-menu-head button { border: 1px solid #334155; background: transparent; color: #cbd5e1; border-radius: 8px; padding: 4px 8px; }
    .list-header { padding-top: 12px; margin-bottom: 10px; }
    .list-header h2 { font-size: 18px; }
    .home-grid { grid-template-columns: 1fr; }
    .home-kpis { grid-template-columns: 1fr; }
    .home-intro h3 { font-size: 20px; }
    .home-motion-content h3 { font-size: 22px; }
    .home-coverage-grid { grid-template-columns: 1fr 1fr; }
    .mobile-inline-ad { display: block; }
    .news-row { flex-direction: column; padding: 8px; }
    .thumb { width: 100%; min-width: 100%; height: 170px; }
    .news-content h3 { font-size: 23px; line-height: 1.3; }
    .pagination { justify-content: space-between; gap: 8px; }
    .mobile-bottom-ad-popup {
        display: block;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 120;
        background: #ffffff;
        border: 1px solid #d1d5db;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
        padding: 10px 10px 8px;
    }
    .mobile-bottom-ad-inner {
        height: 36px;
        border: 1px dashed #94a3b8;
        border-radius: 8px;
        background: #f8fafc;
        color: #334155;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.3px;
    }
    .mobile-bottom-ad-close {
        position: absolute;
        top: 4px;
        right: 6px;
        width: 20px;
        height: 20px;
        border: 0;
        border-radius: 999px;
        background: #e2e8f0;
        color: #334155;
        font-size: 14px;
        line-height: 20px;
        text-align: center;
        cursor: pointer;
        padding: 0;
    }
}
