/* Natytech News — application de lecture (mobile d'abord) */
@font-face { font-family: "Newsreader"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/newsreader-latin-opsz-normal.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; }
@font-face { font-family: "Newsreader"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/newsreader-latin-ext-opsz-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fonts/inter-latin-wght-normal.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; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fonts/inter-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #f4f6f9;
  --card: #ffffff;
  --ink: #101b33;
  --ink-2: #3a465c;
  --muted: #6b7588;
  --line: #e2e7ee;
  --brand: #2453d6;
  --brand-soft: #e6edfd;
  --danger: #c2410c;
  --shadow: 0 10px 40px rgba(16, 27, 51, .16);
  --scale: 1;
  --tab-h: 62px;
  --top-h: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0d1526;
  --card: #141e33;
  --ink: #e8ecf4;
  --ink-2: #c3cbd9;
  --muted: #8d97ab;
  --line: #233049;
  --brand: #7a9cff;
  --brand-soft: #1b2a4d;
  --danger: #fb923c;
  --shadow: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1526; --card: #141e33; --ink: #e8ecf4; --ink-2: #c3cbd9; --muted: #8d97ab;
    --line: #233049; --brand: #7a9cff; --brand-soft: #1b2a4d; --danger: #fb923c; --shadow: 0 10px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-size="small"] { --scale: .92; }
:root[data-size="large"] { --scale: 1.12; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: var(--paper); }
body {
  font-family: var(--sans); color: var(--ink); background: var(--paper);
  font-size: calc(15px * var(--scale)); line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.ic { width: 22px; height: 22px; flex: none; }

.shell { max-width: 680px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }

/* ---------- Barre du haut ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 14px 0 16px;
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 23px; letter-spacing: -.015em; font-variation-settings: "opsz" 72; display: flex; align-items: center; gap: 7px; }
.wordmark::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.wordmark span { font-weight: 400; }
.top-title { font-family: var(--serif); font-size: 21px; font-weight: 650; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { border: 0; background: none; padding: 8px; margin-left: -8px; border-radius: 10px; display: grid; place-items: center; color: var(--ink); }
.icon-btn:active { background: var(--line); }
.country-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px;
  border-radius: 17px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.country-pill .flags { font-size: 15px; letter-spacing: 1px; line-height: 1; }
.country-pill .ic { width: 17px; height: 17px; color: var(--muted); }

/* ---------- Rubriques ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); background: transparent;
  font-size: calc(13.5px * var(--scale)); font-weight: 550; color: var(--ink-2); scroll-snap-align: start; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Fil d'actualité ---------- */
main { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); outline: none; }
.group { font-size: calc(13px * var(--scale)); font-weight: 650; color: var(--muted); padding: 18px 16px 6px; }
.feed { list-style: none; margin: 0; padding: 0; }
.story { position: relative; padding: 14px 16px 12px 30px; border-bottom: 1px solid var(--line); }
.story::before { content: ""; position: absolute; left: 16px; top: 16px; bottom: 16px; width: 4px; border-radius: 2px; background: var(--c, var(--muted)); }
.story:active { background: color-mix(in srgb, var(--line) 45%, transparent); }
.meta { display: flex; align-items: center; gap: 8px; font-size: calc(12.5px * var(--scale)); color: var(--muted); min-width: 0; }
.meta .src { font-weight: 650; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .flag { font-size: 14px; line-height: 1; }
.meta time { margin-left: auto; flex: none; }
.headline {
  display: block; font-family: var(--serif); font-weight: 600; font-size: calc(19px * var(--scale)); line-height: 1.28;
  letter-spacing: -.005em; margin: 5px 0 5px; font-variation-settings: "opsz" 24; text-wrap: pretty; color: var(--ink);
}
.excerpt { font-size: calc(14px * var(--scale)); color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.foot { display: flex; align-items: center; gap: 4px; margin-top: 6px; min-height: 30px; }
.cat { font-size: calc(12.5px * var(--scale)); font-weight: 600; color: var(--c); filter: saturate(1.1); }
:root[data-theme="dark"] .cat { filter: brightness(1.35); }
.tr { font-size: 11.5px; color: var(--muted); margin-left: 8px; display: inline-flex; align-items: center; gap: 3px; }
.tr .ic { width: 13px; height: 13px; }
.act { margin-left: auto; display: flex; }
.act button { border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.act button .ic { width: 19px; height: 19px; }
.act button.on { color: var(--brand); }
.act button:active { background: var(--line); }

/* Article principal */
.lead { margin: 6px 12px 4px; padding: 16px 16px 12px; background: var(--card); border-radius: 18px; border: 1px solid var(--line); position: relative; overflow: hidden; }
.lead::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c, var(--brand)); }
.lead .headline { font-size: calc(26px * var(--scale)); line-height: 1.16; font-weight: 650; margin: 10px 0 8px; font-variation-settings: "opsz" 60; letter-spacing: -.015em; }
.lead .excerpt { -webkit-line-clamp: 3; font-size: calc(15px * var(--scale)); }

.state { text-align: center; color: var(--muted); padding: 48px 28px; font-size: 14.5px; }
.state .ic { width: 34px; height: 34px; display: block; margin: 0 auto 12px; opacity: .7; }
.state .btn { margin-top: 14px; }
.sentinel { height: 1px; }
.loading-more { text-align: center; padding: 18px; color: var(--muted); font-size: 13px; }
.end { text-align: center; padding: 22px 16px 8px; color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 12px; text-align: center; padding: 6px 24px 18px; }
.skel { height: 104px; margin: 0 16px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; left: 14px; right: 0; top: 18px; height: 60px; border-radius: 8px;
  background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 40%, transparent) 50%, var(--line) 75%); background-size: 300% 100%; animation: sk 1.3s linear infinite; }
@keyframes sk { to { background-position: -150% 0; } }

/* ---------- Nouveaux articles / hors ligne ---------- */
.new-pill {
  position: fixed; z-index: 35; left: 50%; transform: translateX(-50%); top: calc(var(--top-h) + var(--safe-t) + 8px);
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px 0 12px; border-radius: 18px; border: 0;
  background: var(--brand); color: #fff; font-weight: 650; font-size: 13.5px; box-shadow: var(--shadow);
}
.new-pill .ic { width: 17px; height: 17px; }
.offline { display: flex; align-items: center; gap: 8px; margin: 0 12px 6px; padding: 8px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--ink-2); font-size: 13px; }
.offline .ic { width: 17px; height: 17px; }

/* ---------- Barre d'onglets ---------- */
.tabs {
  position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 680px;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 550; color: var(--muted); }
.tabs a .ic { width: 23px; height: 23px; stroke-width: 1.8; }
.tabs a.on { color: var(--brand); }
.tabs a.on .ic { stroke-width: 2.3; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14.5px; color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; }
.btn .ic { width: 19px; height: 19px; }
.btn.block { width: 100%; }

/* ---------- Feuilles (article, pays) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 28, .45); opacity: 0; transition: opacity .2s; }
.sheet-bg.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 51; left: 50%; bottom: 0; width: 100%; max-width: 680px; max-height: 88vh; max-height: 88dvh;
  transform: translate(-50%, 100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  background: var(--card); border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  display: flex; flex-direction: column; padding-bottom: var(--safe-b);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 9px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 20px; flex: none; }
.sheet-head h2 { font-family: var(--serif); font-size: 21px; margin: 0; flex: 1; font-weight: 650; }
.sheet-body { overflow-y: auto; padding: 4px 20px 20px; -webkit-overflow-scrolling: touch; }
.sheet .headline { font-size: calc(24px * var(--scale)); line-height: 1.2; margin: 10px 0 10px; font-weight: 650; }
.sheet .excerpt { -webkit-line-clamp: unset; font-size: calc(16px * var(--scale)); line-height: 1.55; }
.sheet .pubnote { font-size: 12.5px; color: var(--muted); margin: 14px 0 16px; }
.sheet-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.sheet-actions .btn { flex-direction: column; height: 64px; gap: 4px; font-size: 12px; font-weight: 550; padding: 0 6px; }
.sheet-actions .btn.on { color: var(--brand); border-color: var(--brand); }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-bg { transition: none; } .skel::after { animation: none; } }

/* ---------- Listes (explorer, réglages) ---------- */
.section { padding: 8px 16px 4px; }
.section h2 { font-family: var(--serif); font-weight: 650; font-size: calc(20px * var(--scale)); margin: 14px 0 8px; }
.section p.hint { margin: -2px 0 10px; color: var(--muted); font-size: 13px; }
.rows { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; font-size: calc(15px * var(--scale)); }
.row:last-child { border-bottom: 0; }
.row:active { background: color-mix(in srgb, var(--line) 50%, transparent); }
.row .lbl { flex: 1; min-width: 0; }
.row .lbl small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.row .val { color: var(--muted); font-size: 13.5px; }
.row .ic.chev { width: 18px; height: 18px; color: var(--muted); }
.row .flag { font-size: 22px; line-height: 1; width: 28px; text-align: center; }
.row .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.row .count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.row .tick { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; }
.row .tick .ic { width: 15px; height: 15px; stroke-width: 3; }
.row[aria-checked="true"] .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.seg button { height: 38px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 27, 51, .12); }
.select { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 12px; font-size: 16px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 15px; background: var(--line); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.search-box { position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 5; padding: 6px 16px 10px; background: var(--paper); }
.search-box label { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.search-box label:focus-within { border-color: var(--brand); }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; }
.search-box .ic { color: var(--muted); }
.filter-search { margin: 0 20px 10px; }

/* ---------- Pages légales ---------- */
.legal { padding: 4px 20px 30px; max-width: 64ch; }
.legal h1 { font-family: var(--serif); font-size: calc(30px * var(--scale)); line-height: 1.15; margin: 10px 0 6px; font-weight: 650; letter-spacing: -.01em; }
.legal .upd { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.legal h2 { font-family: var(--serif); font-size: calc(21px * var(--scale)); margin: 26px 0 8px; font-weight: 650; }
.legal h3 { font-size: 16px; margin: 20px 0 6px; }
.legal p, .legal li { font-size: calc(15.5px * var(--scale)); line-height: 1.62; color: var(--ink-2); }
.legal a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.legal .table { overflow-x: auto; margin: 12px 0; }
.legal table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.legal th, .legal td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--ink); font-weight: 650; }

/* ---------- Bandeau cookies ---------- */
.cookie { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); width: calc(100% - 20px); max-width: 660px; bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.cookie-in { padding: 14px 16px 14px; }
.cookie p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.cookie strong { color: var(--ink); }
.cookie-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cookie-actions .btn { height: 40px; font-size: 14px; }

.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 550; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }

@media (min-width: 700px) {
  .shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.tabs a span { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Favicon de la source */
.meta .fav { width: 16px; height: 16px; flex: none; border-radius: 4px; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px var(--line); margin-right: -2px; }
.meta .fav.off { display: none; }
.lead .meta .fav { width: 18px; height: 18px; }

/* Articles déjà vus */
.story.seen, .lead.seen { opacity: .55; }
.state.caught { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.state.caught .ic { color: var(--brand); opacity: 1; margin-bottom: 4px; }
.state.caught b { color: var(--ink); font-size: 17px; font-weight: 700; }
.state.caught span { max-width: 300px; line-height: 1.45; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.linkbtn .ic { width: 16px; height: 16px; }
.legal .table.kv td:first-child { color: var(--muted); width: 38%; white-space: nowrap; }
@media (max-width: 420px) { .legal .table.kv td:first-child { white-space: normal; } }

/* ---------- En-têtes de page, fil d'Ariane, liens (référencement) ---------- */
a.chip { text-decoration: none; }
.page-head { padding: 4px 18px 10px; }
.page-head:empty { display: none; }
.page-head h1 { font-family: var(--serif); font-size: calc(24px * var(--scale)); line-height: 1.15; font-weight: 650; margin: 2px 0 6px; letter-spacing: -.01em; color: var(--ink); }
.page-head .intro { margin: 0; color: var(--muted); font-size: calc(13.5px * var(--scale)); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.page-head.home { padding: 0 18px 2px; }
.page-head.home h1 { font-family: var(--sans, inherit); font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 6px 18px 0; font-size: 12.5px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: inherit; text-decoration: none; }
.seo-links { padding: 10px 18px 30px; color: var(--muted); font-size: 13.5px; }
.seo-links h2 { font-family: var(--serif); font-size: 17px; color: var(--ink); margin: 18px 0 8px; font-weight: 650; }
.seo-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.seo-links a { color: var(--ink-2); text-decoration: none; }
