:root {
  --bg: #ffffff;
  --bg-soft: #f7fafc;
  --bg-tint: #ebf4fc;
  --text: #1a202c;
  --text-soft: #4a5568;
  --text-mute: #718096;
  --line: #e2e8f0;
  --brand: #2b6cb0;
  --brand-deep: #215387;
  --accent: #dd6b20;
  --focus: #ed8936;
  --measure: 68ch;
  --wide: 1120px;
  --gutter: 16px;
  --radius: 12px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #11151c; --bg-soft: #171c26; --bg-tint: #1b2535; --text: #edf2f7; --text-soft: #cbd5e0;
    --text-mute: #a0aec0; --line: #2d3748; --brand: #63b3ed; --brand-deep: #90cdf4; --accent: #f6ad55;
  }
}
:root[data-theme='dark'] {
  --bg: #11151c; --bg-soft: #171c26; --bg-tint: #1b2535; --text: #edf2f7; --text-soft: #cbd5e0;
  --text-mute: #a0aec0; --line: #2d3748; --brand: #63b3ed; --brand-deep: #90cdf4; --accent: #f6ad55;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.015em; margin: 1.8em 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin-top: 0; }
h2 { font-size: 1.6rem; } h3 { font-size: 1.25rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; padding-block: 12px; }
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--text); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--brand); }
.brand span { color: var(--accent); }
.primary-nav ul { display: flex; flex-wrap: wrap; gap: 2px 6px; list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-soft); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.primary-nav a:hover { background: var(--bg-tint); color: var(--text); }
.primary-nav a[aria-current='page'] { color: var(--brand); background: var(--bg-tint); }
.lang-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.lang-switch a, .lang-switch span { padding: 3px 11px; border-radius: 999px; text-decoration: none; letter-spacing: 0.04em; }
.lang-switch a { color: var(--text-soft); }
.lang-switch a:hover { background: var(--bg-tint); }
.lang-switch [aria-current='true'] { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .lang-switch [aria-current='true'] { color: #11151c; } }
@media (max-width: 640px) {
  .site-header .wrap { gap: 6px 12px; }
  .primary-nav { order: 3; width: 100%; overflow-x: auto; margin-inline: -4px; }
  .primary-nav ul { flex-wrap: nowrap; white-space: nowrap; }
}

/* hero */
.hero { position: relative; color: #fff; background: #1a202c url('/assets/images/illustrations/hero-en.svg') center 28%/cover; }
.hero:lang(fr) { background-image: url('/assets/images/illustrations/hero-fr.svg'); }
.hero .wrap { padding-block: clamp(56px, 11vw, 120px); }
.hero h1 { color: #fff; margin: 0 0 12px; font-size: clamp(2.2rem, 6vw, 3.6rem); }
.hero p { margin: 0; max-width: 40ch; font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: #bee3f8; }

/* post grid */
.section-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mute); margin: 48px 0 20px; font-weight: 700; }
.grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); padding: 0; list-style: none; margin: 0 0 24px; }
.card { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgb(26 32 44 / .1); }
.card-media { aspect-ratio: 16/9; background: var(--bg-tint); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card time, .meta { font-size: 0.85rem; color: var(--text-mute); }
.card h3 { margin: 0; font-size: 1.2rem; line-height: 1.3; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card { position: relative; }
.card h3 a:hover { color: var(--brand); }
.card p { margin: 0; color: var(--text-soft); font-size: 0.97rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 40px 0 64px; font-size: 0.95rem; }
.pagination a, .pagination span.btn { padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; }
.pagination a:hover { background: var(--bg-tint); }
.pagination .status { color: var(--text-mute); }

/* article */
.article { width: min(100% - 2 * var(--gutter), var(--measure)); margin-inline: auto; padding-block: 48px 72px; }
.article header { margin-bottom: 32px; }
.article .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.article .cover { margin: 0 0 32px; border-radius: var(--radius); overflow: hidden; background: var(--bg-tint); }
.article .cover img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.also { display: inline-flex; gap: 8px; margin-top: 12px; padding: 4px 12px; background: var(--bg-tint); border-radius: 999px; font-size: 0.85rem; }
.prose > :first-child { margin-top: 0; }
.prose img, .prose iframe, .prose video { border-radius: 8px; }
.prose iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--brand); color: var(--text-soft); }
.prose pre { background: #1a202c; color: #e2e8f0; padding: 16px 20px; border-radius: 10px; overflow-x: auto; font: 0.88rem/1.55 var(--mono); }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-tint); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose figure { margin: 1.5em 0; } .prose figcaption { font-size: 0.88rem; color: var(--text-mute); }

/* form */
.form { display: grid; gap: 16px; margin-top: 24px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.form input, .form textarea { font: inherit; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--text); }
.form textarea { min-height: 160px; resize: vertical; }
.form button { justify-self: start; font: inherit; font-weight: 700; padding: 11px 26px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; cursor: pointer; }
.form button:hover { background: var(--brand-deep); }
.dev-note { padding: 10px 14px; border-radius: 8px; background: var(--bg-tint); font-size: 0.88rem; }
.hp { position: absolute; left: -9999px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); color: var(--text-mute); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-block: 28px; }
.site-footer ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--text-soft); }

.notfound { text-align: center; padding-block: 56px 80px; }
.notfound img { max-width: 360px; width: 100%; border-radius: var(--radius); }
.notfound section + section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.notfound h1 { font-size: 1.8rem; margin: 16px 0 8px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* search */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.search-form { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); padding-left: 14px; }
.search-form:focus-within { border-color: var(--brand); }
.search-form input { border: 0; background: none; font: inherit; font-size: 0.9rem; color: var(--text); width: 140px; padding: 6px 0; outline: none; }
.search-form button { border: 0; background: none; color: var(--text-soft); cursor: pointer; padding: 6px 10px; display: flex; }
.search-form button:hover { color: var(--brand); }
@media (max-width: 640px) { .search-form { order: 2; flex: 1; } .search-form input { width: 100%; } }
.search-page .search-form { padding-left: 18px; margin-bottom: 8px; }
.search-page .search-form input { width: 100%; font-size: 1.05rem; padding: 12px 0; }
.search-status { color: var(--text-mute); margin: 16px 0 28px; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 28px; }
.result { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: start; }
.result img { width: 160px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--bg-tint); }
.result h2 { font-size: 1.2rem; margin: 0 0 6px; }
.result p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }
.result mark { background: color-mix(in srgb, var(--focus) 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
@media (max-width: 560px) { .result { grid-template-columns: 1fr; } .result img { width: 100%; } }
.form-error { padding: 10px 14px; border-radius: 8px; background: #fed7d7; color: #742a2a; margin: 0; }

/* consent preferences trigger (Didomi) */
.consent-btn { font: inherit; font-weight: 600; padding: 9px 20px; border: 1px solid var(--brand); border-radius: 999px; background: transparent; color: var(--brand); cursor: pointer; }
.consent-btn:hover { background: var(--bg-tint); }
