/* Jeunesse Solidaire - static multilingual site */
:root {
  --bg: #fbf8f3;
  --bg-header: rgba(251, 248, 243, 0.85);
  --text: #1f1d1a;
  --muted: #6b655c;
  --accent: #c2410c;
  --accent-soft: #fdebd8;
  --gold: #b8860b;
  --border: #e6e0d6;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --header-h: 4rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f;
    --bg-header: rgba(22, 20, 15, 0.85);
    --text: #ece7de;
    --muted: #a39b8d;
    --accent: #f08a4b;
    --accent-soft: #2a2119;
    --gold: #d9a93a;
    --border: #3a352c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px; z-index: 100; padding: .5rem 1rem;
  background: var(--accent); color: #fff; border-radius: 6px; text-decoration: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-header);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: .6rem 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem;
}
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--text); line-height: 1.25; margin-right: auto; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1.15rem; }
.brand-tagline { display: none; font-size: .78rem; color: var(--muted); max-width: 34ch; }
.main-nav { display: flex; gap: .25rem; order: 3; width: 100%; }
.main-nav a {
  padding: .35rem .8rem; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-weight: 500; font-size: .95rem; line-height: 1.4;
}
.main-nav a:hover { color: var(--text); }
.main-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.lang-switch { display: flex; gap: .3rem; }
.lang-switch button {
  font: inherit; font-size: .8rem; font-weight: 500; letter-spacing: .04em; line-height: 1.2;
  padding: .3rem .65rem; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
}
.lang-switch button:hover { color: var(--text); border-color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) {
  .lang-switch button[aria-pressed="true"] { color: #16140f; }
}
@media (min-width: 720px) {
  .header-inner { flex-wrap: nowrap; }
  .main-nav { order: 0; width: auto; }
  .brand { margin-right: 0; flex: 1 1 auto; }
  .brand-tagline { display: block; }
}

/* ---------- Layout ---------- */
main { padding: 2rem 16px 3rem; scroll-margin-top: var(--header-h); }
.article-head, .article-body, .sources-view { max-width: 72ch; margin-left: auto; margin-right: auto; }
.article-layout { max-width: 72ch; margin: 0 auto; }
section[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

h1 { color: var(--accent); font-weight: 700; font-size: 1.6rem; line-height: 1.2; margin: 0 0 1.25rem; }
.intro p { font-size: 1.125rem; margin: 0 0 1.1rem; }
.intro p:first-child { font-weight: 500; }

h2 { margin: 3rem 0 1rem; font-size: 1.5rem; line-height: 1.25; font-weight: 700; }
h2 .num { display: block; font-size: .95rem; font-weight: 500; letter-spacing: .12em; color: var(--gold); margin-bottom: .15rem; }
h3 { color: var(--accent); font-weight: 500; font-size: 1.2rem; line-height: 1.35; margin: 2rem 0 .5rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; margin: 0 0 1.25rem; }
li { margin-bottom: .6rem; padding-left: .2rem; }
li::marker { color: var(--gold); }

cite { font-style: normal; font-size: .85em; color: var(--muted); }
cite a { color: inherit; text-decoration: none; }
cite a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Table of contents ---------- */
.toc { border: 1px solid var(--border); border-radius: 10px; margin: 1.5rem 0 0; padding: 0 1rem; }
.toc summary { cursor: pointer; font-weight: 700; padding: .7rem 0; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "▾"; float: right; color: var(--muted); }
.toc[open] summary::after { content: "▴"; }
.toc ol { list-style: none; padding: 0 0 .6rem; margin: 0; }
.toc li { margin: 0; padding: 0; }
.toc a { display: block; padding: .3rem 0; text-decoration: none; color: var(--text); font-size: .95rem; line-height: 1.4; }
.toc a:hover { color: var(--accent); }
.toc a .n { color: var(--gold); font-weight: 500; margin-right: .3rem; }

@media (min-width: 720px) {
  h1 { font-size: 2.2rem; }
  main { padding-top: 3rem; }
}
@media (min-width: 1100px) {
  .article-layout {
    max-width: none; display: grid; justify-content: center;
    grid-template-columns: 15rem minmax(0, 72ch); column-gap: 3rem;
    grid-template-areas: "toc head" "toc body"; grid-template-rows: auto 1fr;
  }
  .article-head { grid-area: head; margin: 0; max-width: none; }
  .article-body { grid-area: body; margin: 0; max-width: none; }
  .toc {
    grid-area: toc; position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start;
    margin: .6rem 0 0; border: 0; border-left: 1px solid var(--border); border-radius: 0; padding: 0 0 0 1rem;
  }
  .toc summary { cursor: default; pointer-events: none; padding-top: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
  .toc summary::after { content: none; }
  .toc a { font-size: .9rem; }
}

/* ---------- "Go further" box ---------- */
.more { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 10px; margin: 1rem 0 1.5rem; }
.more summary {
  display: flex; align-items: center; gap: .75rem; cursor: pointer; list-style: none;
  padding: .7rem 1rem; border-radius: 10px; flex-wrap: wrap;
}
.more summary::-webkit-details-marker { display: none; }
.more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more .icon {
  flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; line-height: 1; font-weight: 500;
  transition: transform .25s ease;
}
.more[open] .icon { transform: rotate(45deg); } /* "+" becomes "x" */
.more .label { font-weight: 500; color: var(--accent); }
.more .hint { font-size: .8rem; color: var(--muted); }
.more .more-body { padding: .25rem 1rem .5rem; font-size: 1rem; animation: fadeIn .3s ease; }
.more .more-body p:last-child { margin-bottom: .5rem; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 1.25rem 0 1.75rem; padding: 0 0 0 1.5rem; border-left: 2px solid var(--border); }
.timeline li { position: relative; margin: 0 0 1.25rem; padding: 0; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.5rem - 7px); top: .5rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
}
.timeline .date { display: block; font-weight: 700; color: var(--accent); }

/* ---------- Figure & callout ---------- */
figure { margin: 2rem 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 10px; }
figcaption { margin-top: .5rem; font-size: .88rem; font-style: italic; color: var(--muted); }
figure.no-img figcaption { margin: 0; padding: 1.5rem 1rem; border: 2px dashed var(--border); border-radius: 10px; text-align: center; }
.callout { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; padding: 1rem 1.25rem; margin: 1.75rem 0; }
.callout > :last-child { margin-bottom: 0; }

/* ---------- Sources ---------- */
.sources-count { color: var(--muted); font-size: .9rem; margin: 1.5rem 0 1rem; }
ol.sources { padding-left: 1.6rem; }
ol.sources li { padding: .2rem 0 .8rem .3rem; border-bottom: 1px solid var(--border); margin: 0 0 .8rem; }
ol.sources li::marker { color: var(--gold); font-weight: 500; }
ol.sources .src-title { display: block; }
ol.sources .src-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-top: .4rem; font-size: .85rem; color: var(--muted); }
.btn {
  display: inline-block; padding: .25rem .8rem; border-radius: 999px; border: 1px solid var(--accent);
  color: var(--accent); text-decoration: none; font-size: .85rem; font-weight: 500; line-height: 1.5;
}
.btn:hover { background: var(--accent); color: #fff; }
.host { color: var(--muted); font-size: .8rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 16px 3rem; color: var(--muted); font-size: .9rem; text-align: center; }
.site-footer p { max-width: 72ch; margin: 0 auto .5rem; }
.site-footer strong { color: var(--text); }
.site-footer .contact a { color: var(--accent); font-weight: 500; }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-header, .site-footer, .skip-link, .toc { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main { padding: 0; }
  .more { break-inside: avoid; background: none; }
  .more .icon, .more .hint { display: none; }
  a { color: inherit; }
}
