:root{
  --bg:#f5f6f8;--surface:#ffffff;--fg:#0f1419;--muted:#5b6670;--line:#e3e7ec;
  --accent:#1d6fe0;--accent-fg:#ffffff;--chip:#eceff3;--radius:14px;--max:1180px;
  --gap:12px;--shadow:0 1px 2px rgba(15,20,25,.05);--shine:rgba(15,20,25,.07);
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#0b0f14;--surface:#131a22;--fg:#e8edf2;--muted:#9aa6b2;--line:#222c37;
    --accent:#5aa2ff;--accent-fg:#06121f;--chip:#1a2430;--shadow:none;--shine:rgba(255,255,255,.06);
  }
}
@media (min-width:1440px){:root{--max:1400px;--gap:20px}}
@media (min-width:1920px){:root{--max:1720px;--gap:22px}}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--fg);font:16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%;height:auto}
a:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
.wrap{max-width:var(--max);margin:0 auto;padding:0 14px}
@media (min-width:768px){.wrap{padding:0 24px}}

/* Header: brand + burger menu. Country and section lists open in the panel. */
.top{position:sticky;top:0;z-index:20;background:var(--bg);border-bottom:1px solid var(--line);padding-top:env(safe-area-inset-top,0px)}
.bar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:60px}
.brand{font-weight:800;font-size:18px;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.brand span{color:var(--muted);font-weight:600}
@media (min-width:768px){.bar{min-height:68px}.brand{font-size:20px}}

.menu{position:static;flex-shrink:0}
.menu summary{list-style:none;cursor:pointer;width:44px;height:44px;display:flex;align-items:center;justify-content:center;border-radius:12px;background:var(--chip)}
.menu summary::-webkit-details-marker{display:none}
.menu summary::marker{content:""}
.burger{position:relative;display:block;width:20px;height:14px}
.burger i{position:absolute;left:0;right:0;height:2px;border-radius:2px;background:var(--fg);transition:transform .2s ease,opacity .2s ease,top .2s ease}
.burger i:nth-child(1){top:0}
.burger i:nth-child(2){top:6px}
.burger i:nth-child(3){top:12px}
.menu[open] .burger i:nth-child(1){top:6px;transform:rotate(45deg)}
.menu[open] .burger i:nth-child(2){opacity:0}
.menu[open] .burger i:nth-child(3){top:6px;transform:rotate(-45deg)}

.panel{position:absolute;left:0;right:0;top:100%;background:var(--bg);border-bottom:1px solid var(--line);box-shadow:0 14px 28px rgba(15,20,25,.14);max-height:calc(100vh - 60px);overflow-y:auto;-webkit-overflow-scrolling:touch}
.panel .wrap{padding-top:8px;padding-bottom:20px}
.panel-label{margin:14px 0 8px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.panel-label:first-child{margin-top:4px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips a{display:inline-flex;align-items:center;min-height:40px;padding:0 16px;border-radius:999px;background:var(--chip);font-size:15px;font-weight:600;white-space:nowrap}
.chips a.on{background:var(--accent);color:var(--accent-fg)}

/* Main content */
main{padding:14px 0 56px}
.page-title{font-size:22px;line-height:1.25;margin:8px 0 14px;letter-spacing:-.01em}
@media (min-width:768px){.page-title{font-size:26px;margin:12px 0 18px}}

.block{margin-top:28px}
.block-head{display:flex;align-items:center;justify-content:space-between;margin:0 0 12px}
.block-head h2{margin:0;font-size:18px;letter-spacing:-.01em}
.block-head a{color:var(--accent);font-size:14px;font-weight:600;padding:6px 0}

/* Columns by screen width: 1 phone, 2 tablet, 3 laptop, 4 large, 5 wide */
.grid{display:grid;gap:var(--gap);grid-template-columns:repeat(1,minmax(0,1fr))}
@media (min-width:640px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:1024px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (min-width:1440px){.grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media (min-width:1920px){.grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
.grid > .ad{grid-column:1/-1}

/* Skeleton shimmer, shared by card images and the article hero */
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.skel{position:relative;background:var(--chip);overflow:hidden}
.skel::before{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(90deg,transparent 0%,var(--shine) 50%,transparent 100%);
  background-size:200% 100%;animation:shimmer 1.2s ease-in-out infinite;
}
.skel.done::before{display:none}
.lazy-img{opacity:0;transition:opacity .3s ease}
.lazy-img.is-loaded{opacity:1}
@media (prefers-reduced-motion:reduce){.skel::before{animation:none}}

/* Cards: same layout on every device, image on top */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);display:flex;flex-direction:column;min-width:0;overflow:hidden}
.card .thumb{display:block;width:100%;aspect-ratio:16/9}
.card .thumb img{width:100%;height:100%;object-fit:cover}
.card .body{padding:14px 16px 16px;display:flex;flex-direction:column;gap:8px;min-width:0;flex:1}
.card .title{margin:0;font-size:17px;line-height:1.3;font-weight:700;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.card .title a:hover{text-decoration:underline}

.meta{margin:auto 0 0;display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;color:var(--muted);font-size:13px;min-width:0;padding-top:4px}
.meta .fav{width:16px;height:16px;border-radius:4px;flex-shrink:0}
.meta .pub{font-weight:600;color:var(--fg);opacity:.85;max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.meta .author{max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.meta .sep{opacity:.5}

/* Lead story: full row on phones and tablets, two columns on laptops and up */
.card.feature .thumb{aspect-ratio:16/9}
.card.feature .title{font-size:21px;line-height:1.25;-webkit-line-clamp:4}
.card.feature .body{padding:16px 18px 18px}
.grid > .card.feature{grid-column:1/-1}
@media (min-width:1024px){
  .grid > .card.feature{grid-column:span 2}
  .card.feature .title{font-size:26px}
  .card.feature .body{padding:20px 22px 22px}
}

/* Ads: space is reserved so the layout does not jump */
.ad{margin:14px 0;text-align:center}
.ad-slot{min-height:100px;background:var(--surface);border:1px dashed var(--line);border-radius:10px}
.ad-feed .ad-slot{min-height:250px}
.ad-article .ad-slot{min-height:280px}

/* Story page */
.story{max-width:760px;margin:0 auto}
.crumbs{font-size:13px;color:var(--muted);margin:6px 0 10px}
.crumbs a{color:var(--accent);font-weight:600}
.story h1{font-size:26px;line-height:1.25;margin:0 0 12px;letter-spacing:-.015em}
@media (min-width:768px){.story h1{font-size:34px}}
.story .meta{font-size:14px;margin-bottom:16px;padding-top:0}

/* Hero: width fills the column, height follows the image's own proportions */
.hero-wrap{margin:0 0 18px;border-radius:var(--radius);min-height:200px}
.hero-wrap.done{min-height:0}
.hero{display:block;width:100%;height:auto;border-radius:var(--radius)}

.excerpt{font-size:18px;line-height:1.6;margin:0 0 20px}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 18px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--fg);font:inherit;font-size:15px;font-weight:600;cursor:pointer}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-fg);width:100%}
@media (min-width:520px){.btn.primary{width:auto}}

/* Country list on the root page */
.country-list{list-style:none;padding:0;margin:0;display:grid;gap:12px}
@media (min-width:640px){.country-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
.country-list a{display:block;padding:20px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);font-weight:700;font-size:18px;box-shadow:var(--shadow)}
.country-list a:hover{border-color:var(--accent)}

/* Footer */
.footer{border-top:1px solid var(--line);color:var(--muted);font-size:13px;padding:22px 0 calc(22px + env(safe-area-inset-bottom,0px))}
.footer p{margin:4px 0}
.footer a{color:var(--accent);font-weight:600}
