/* Country statistics pages (countries-src/build.mjs). Colours: tokens from /shared/colors.css only (never literals);
   dark is the default theme, the light overrides live in colors.css. Fonts: the same self-hosted Inter as the atlas. */
@font-face{font-family:Inter;font-style:normal;font-weight:400 800;font-display:swap;src:url(/assets/fonts/inter-cyrillic-ext.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:Inter;font-style:normal;font-weight:400 800;font-display:swap;src:url(/assets/fonts/inter-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Inter;font-style:normal;font-weight:400 800;font-display:swap;src:url(/assets/fonts/inter-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Inter;font-style:normal;font-weight:400 800;font-display:swap;src:url(/assets/fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root{--radius:16px; --maxw:1120px}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0; background:var(--bg); color:var(--text);
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:16px; line-height:1.6; -webkit-font-smoothing:antialiased}
a{color:var(--accent-hi)}
img{max-width:100%}
/* Locales (README, "Locales"): CJK gets a CJK font stack and no negative tracking; Arabic must never be letter-spaced (it breaks the joins).
   Numbers in the chart stay left-to-right in every direction. Layout uses logical properties only (start/end, inline), so RTL needs no mirror rules. */
:lang(zh-Hans) body{font-family:Inter,-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC","Noto Sans SC","Segoe UI",Roboto,Helvetica,Arial,sans-serif}
:lang(zh-Hans) h1,:lang(zh-Hans) h2,:lang(zh-Hans) .live-num{letter-spacing:0}
:lang(zh-Hans) thead th{letter-spacing:0; text-transform:none}
:lang(ar) h1,:lang(ar) h2,:lang(ar) thead th,:lang(ar) .live-num{letter-spacing:0}
:lang(ar) thead th{text-transform:none}
.chart{direction:ltr}
.wrap{width:100%; max-width:var(--maxw); margin:0 auto; padding:0 16px}
@media (min-width:700px){ .wrap{padding:0 24px} }
.crumbs{font-size:13px; color:var(--muted); margin:18px 0 6px; display:flex; flex-wrap:wrap; gap:6px}
.crumbs a{color:var(--accent-hi); text-decoration:none}
.crumbs a:hover{text-decoration:underline}
h1{font:600 clamp(28px,5.2vw,42px)/1.1 var(--serif); letter-spacing:-.8px; margin:4px 0 14px; font-variant-numeric:lining-nums}
h2{font:600 22px/1.2 var(--serif); letter-spacing:-.3px; margin:38px 0 12px; font-variant-numeric:lining-nums}
h3{font-size:16px; margin:20px 0 8px}
p{margin:0 0 12px}
.flag{display:inline-block; vertical-align:middle; width:32px; height:auto; border-radius:3px; border:1px solid var(--line-2); margin-inline-end:10px}
h1 .flag{width:44px; margin-inline-end:12px; vertical-align:baseline; position:relative; top:2px}
td .flag{width:24px; margin-inline-end:8px}

/* The answer block: one fact per paragraph, each readable alone. */
.answer{max-width:780px; margin:0 0 8px}
.answer p{margin:0 0 8px; color:var(--text)}
.answer p:first-child{font-size:19px; line-height:1.45; font-weight:600}
.answer p:not(:first-child){color:var(--muted)}

.live-box{margin:18px 0 6px; padding:16px 18px; background:var(--bg-2); border:1px solid var(--line); border-radius:var(--radius); max-width:780px}
.live-num{font:600 clamp(26px,6vw,38px)/1.1 var(--serif); font-variant-numeric:tabular-nums lining-nums; letter-spacing:-.5px}
.live-note{margin:6px 0 0; font-size:13px; color:var(--dim)}

dl.kf{display:grid; grid-template-columns:1fr; gap:0; margin:0; max-width:780px; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--card)}
dl.kf > div{display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 16px; padding:10px 14px; border-bottom:1px solid var(--line)}
dl.kf > div:last-child{border-bottom:0}
dl.kf dt{color:var(--muted); font-size:14px}
dl.kf dd{margin:0; font-weight:600; font-variant-numeric:tabular-nums; text-align:end}
dl.kf dd small{display:block; font-weight:400; color:var(--dim); font-size:12px}
@media (max-width:480px){ dl.kf > div{grid-template-columns:1fr} dl.kf dd{text-align:start} }

.tbl{overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--line); border-radius:12px; background:var(--card)}
.tbl.long{max-height:460px; overflow-y:auto}
table{width:100%; border-collapse:collapse; font-size:15px}
th,td{text-align:start; padding:9px 10px; border-bottom:1px solid var(--line); vertical-align:top}
tr:last-child td{border-bottom:0}
thead th{color:var(--dim); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.05em; white-space:nowrap; background:var(--card); position:sticky; top:0}
td.num,th.num{text-align:end; font-variant-numeric:tabular-nums; white-space:nowrap}
td.dim{color:var(--dim)}
.tn th:nth-child(n+2),.tn td:nth-child(n+2){text-align:end; font-variant-numeric:tabular-nums; white-space:nowrap}
tr.me td{background:var(--gh-active); font-weight:600}
tr.proj td{color:var(--muted)}
tr:target td{background:var(--gh-active)}
td small{color:var(--dim)}

.chart{width:100%; max-width:640px; height:auto; display:block; background:var(--bg-2); border:1px solid var(--line); border-radius:12px}
.chart .gr{stroke:var(--line-2); stroke-width:1}
.chart .ax{fill:var(--muted); font-size:12px; font-family:inherit}
.chart .ln{fill:none; stroke:var(--accent); stroke-width:2.4; stroke-linejoin:round; stroke-linecap:round}
.chart .ln.proj{stroke-dasharray:5 5}
.chart-note{font-size:13px; color:var(--dim); margin:6px 0 0}

.chips{display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; list-style:none}
.chips a{display:inline-block; font-size:14px; padding:6px 12px; border-radius:999px; background:var(--card); border:1px solid var(--line); text-decoration:none; color:var(--text)}
.chips a:hover{border-color:var(--accent)}
.cols{display:grid; gap:24px}
@media (min-width:900px){ .cols{grid-template-columns:1fr 1fr} }

details.faq{border-bottom:1px solid var(--line); padding:12px 0}
details.faq summary{cursor:pointer; font-weight:600; list-style:none}
details.faq summary::-webkit-details-marker{display:none}
details.faq p{margin:8px 0 0; color:var(--muted)}
.faq-list{max-width:780px}
.note{color:var(--dim); font-size:14px}
.src{max-width:780px; color:var(--muted); font-size:15px}
.src ul{padding-inline-start:20px; margin:0 0 12px}
.src li{margin:0 0 6px}
time{font-variant-numeric:tabular-nums}

.hub-group{margin:28px 0 0}
.hub-group h2{margin:0 0 10px}

.cta{margin:48px 0 0; text-align:center; background:linear-gradient(180deg,var(--bg-2),var(--card)); border:1px solid var(--line); border-radius:var(--radius); padding:32px 20px}
.cta h2{margin:0 0 8px}
.cta p{color:var(--muted); max-width:560px; margin:0 auto 18px}
footer{border-top:1px solid var(--line); margin-top:56px; padding:24px 0 36px; font-size:13px; color:var(--dim)}
footer .wrap{display:flex; flex-wrap:wrap; gap:14px 22px; justify-content:space-between}
footer a{color:var(--dim); text-decoration:none}
footer a:hover{color:var(--text)}
footer .langs{display:flex; flex-wrap:wrap; gap:12px}
footer .langs a[aria-current]{color:var(--text); font-weight:600}
.sr{position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap}

/* RTL (Arabic) - logical properties above already mirror margins, paddings, text-align:start/end, flex, grid and the key-figures rows; this block only fixes what they cannot. */
[dir="rtl"] body{line-height:1.8}
[dir="rtl"] h1,[dir="rtl"] h2{letter-spacing:0; line-height:1.35}   /* negative tracking breaks Arabic letter joining */
[dir="rtl"] h1{font-size:clamp(26px,5vw,38px)}
[dir="rtl"] h3{line-height:1.5}
[dir="rtl"] .answer p:first-child{line-height:1.7}
[dir="rtl"] thead th{letter-spacing:0; text-transform:none; font-size:13px}
[dir="rtl"] .crumbs span[aria-hidden]{display:inline-block; transform:scaleX(-1)}   /* "/" leans the other way */
[dir="rtl"] time,[dir="rtl"] .live-num,[dir="rtl"] bdi{unicode-bidi:isolate}
[dir="rtl"] .live-num{letter-spacing:0; text-align:start}
[dir="rtl"] dl.kf dd{unicode-bidi:isolate}
[dir="rtl"] td.num,[dir="rtl"] th.num{unicode-bidi:isolate}
/* by-year and projection tables: pure numbers, signed values ("+1,234", "-0.5%"): left-to-right cells, units digits aligned on the right edge */
[dir="rtl"] .tn th:nth-child(n+2),[dir="rtl"] .tn td:nth-child(n+2){text-align:right}
[dir="rtl"] .tn td:nth-child(n+2){direction:ltr; unicode-bidi:isolate}
/* the chart is a time axis: years run left to right whatever the page direction */
[dir="rtl"] .chart{direction:ltr; unicode-bidi:isolate}
[dir="rtl"] .chart text{letter-spacing:0}
/* helper for Latin codes and domains inside Arabic text: <span class="ltr">DZD</span> (same effect as <bdi dir="ltr">) */
[dir="rtl"] .ltr{direction:ltr; unicode-bidi:isolate; display:inline-block}
