/* blog-template — feuille de style
   Les couleurs et polices sont injectées dans :root par base.html depuis site.json. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

:root {
  --wrap: 72rem;
  --prose: 44rem;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.12);
  --ease: 180ms ease;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .15em; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }
.center .lead { margin-inline: auto; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; }
.count { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 .5em; margin-left: .25em; line-height: 1.6; }
.empty { color: var(--muted); padding: 2rem 0; }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: var(--radius-sm); z-index: 100; }
.skip:focus { left: .5rem; }

/* ---------- header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); transform: rotate(12deg); }
.brand-logo { height: 32px; width: auto; }
.header-actions { display: flex; align-items: center; gap: .25rem; order: 3; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; transition: background var(--ease); }
.icon-btn:hover { background: var(--surface); text-decoration: none; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; order: 2; flex: 1 1 0; min-width: 0; justify-content: flex-end; }
.site-nav.nav-wrapped { flex-basis: 100%; order: 4; justify-content: flex-start; padding-bottom: .5rem; }
.site-nav a { color: var(--ink); padding: .45rem .8rem; border-radius: 999px; font-weight: 500; font-size: .95rem; white-space: nowrap; transition: background var(--ease); }
.site-nav a:hover { background: var(--surface); text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.site-nav .btn-cta { height: 2.4rem; padding: 0 1.1rem; margin-left: .6rem; background: var(--accent); color: var(--accent-ink); font-size: .92rem; white-space: nowrap; flex-shrink: 0; }
/* menu de débordement « Plus » (alimenté par main.js quand la nav ne tient pas sur une ligne) */
.nav-more { position: relative; flex-shrink: 0; }
.nav-more[hidden] { display: none; }
.nav-more summary { display: inline-flex; align-items: center; gap: .3rem; list-style: none; cursor: pointer; color: var(--ink); padding: .45rem .8rem; border-radius: 999px; font-weight: 500; font-size: .95rem; white-space: nowrap; transition: background var(--ease); }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary:hover, .nav-more[open] summary { background: var(--surface); }
.nav-more.has-current summary { background: var(--accent-soft); color: var(--accent); }
.nav-more-menu { position: absolute; top: calc(100% + .4rem); right: 0; z-index: 60; min-width: 13rem; display: flex; flex-direction: column; gap: .1rem; padding: .4rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.nav-more-menu a { display: block; border-radius: var(--radius-sm); }
.site-nav .btn-cta:hover { background: var(--accent); filter: brightness(1.08); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; align-items: center; border-radius: var(--radius-sm); }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform var(--ease), opacity var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- sections */
main { padding-block: 2.5rem 4rem; }
.section { margin-block: 3rem; }
.section-title { font-size: 1.1rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; margin-bottom: 1.25rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.hero { padding-block: 2rem 1rem; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); }
.page-header { margin-bottom: 2rem; }
.page-header.with-promo { display: flex; align-items: center; justify-content: space-between; gap: 2.5rem; }
.page-header-text { min-width: 0; flex: 1; }
.page-header-text > :last-child { margin-bottom: 0; }
.author-header { display: flex; gap: 1.5rem; align-items: flex-start; }
.post-header.page-header { max-width: none; }

/* ---------- chips & tags */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.chip { display: inline-flex; align-items: center; gap: .3em; padding: .35rem .85rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: .9rem; font-weight: 500; background: var(--bg); transition: border-color var(--ease), background var(--ease); }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.chips-lg .chip { font-size: 1rem; padding: .5rem 1rem; }

/* ---------- cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.5rem; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow: hidden; transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-title { font-size: 1.2rem; margin: 0; }
.card-title a { color: var(--ink); }
.card-excerpt { color: var(--muted); font-size: .95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: .75rem; }
.card-large { display: grid; grid-template-columns: 1.2fr 1fr; }
.card-large .card-cover { aspect-ratio: auto; min-height: 16rem; }
.card-large .card-body { padding: 2rem; justify-content: center; gap: .6rem; }
.card-large .card-title { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.card-large .card-excerpt { -webkit-line-clamp: 4; font-size: 1.05rem; }
.card-author { flex-direction: row; align-items: center; padding: 1.25rem; gap: 1rem; color: inherit; }
.card-author:hover { text-decoration: none; }
.card-author .card-body { padding: 0; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .875rem; color: var(--muted); margin: 0; }
.meta-author { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink); font-weight: 500; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface); }
.avatar-xs { width: 22px; height: 22px; }
.avatar-lg { width: 96px; height: 96px; }

/* ---------- categories (hub) */
.hub-header { display: flex; justify-content: space-between; gap: 2.5rem; align-items: center; margin-bottom: 1rem; padding: 2rem 2.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, var(--surface), var(--bg)); }
.hub-header h1 { margin-bottom: .35em; }
.hub-header .lead { margin-bottom: .75em; }
.hub-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .9rem; color: var(--muted); margin-bottom: .5rem; }
.hub-stats strong { color: var(--ink); font-weight: 600; }
.hub-header-text { min-width: 0; flex: 1; }
/* liste verticale des catégories (index + sous-catégories) */
.catlist, .catlist-root { list-style: none; margin: 0; padding: 0; }
.catlist-root { max-width: var(--prose); }
.catlist-item { margin: 0; }
.catlist-root > .catlist-item + .catlist-item { margin-top: 2.25rem; }
.catlist .catlist { margin-top: .35rem; padding-left: 1.75rem; }
.catlist .catlist .catlist-item + .catlist-item { margin-top: .15rem; }
.catlist-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; padding: .55rem .75rem; margin: 0 -.75rem; border-radius: var(--radius-sm); color: var(--ink); transition: background var(--ease); }
.catlist-row:hover { background: var(--surface); text-decoration: none; }
.catlist-row:hover .catlist-title { color: var(--accent); }
.catlist-label { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.catlist-title { font-weight: 500; }
.level-0 > .catlist-row .catlist-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; }
.level-1 > .catlist-row .catlist-title { font-size: 1.05rem; }
.level-2 > .catlist-row .catlist-title, .level-3 > .catlist-row .catlist-title { font-size: 1rem; color: var(--muted); }
.level-2 > .catlist-row:hover .catlist-title { color: var(--accent); }
.catlist-desc { color: var(--muted); font-size: .95rem; }
.catlist-count { flex-shrink: 0; display: inline-flex; align-items: baseline; gap: .35rem; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.catlist-count .num { font-weight: 600; color: var(--ink); min-width: 1.5ch; text-align: right; }
.level-0 > .catlist-row .catlist-count .num { font-size: 1.05rem; }
.catlist-count .unit { font-size: .8rem; }

/* liste d'articles (pages catégorie) */
.post-list { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 14rem 1fr; gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.row:first-child { padding-top: 0; }
.row-compact { grid-template-columns: 1fr; padding: 1rem 0; }
.row-cover { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.row-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--ease); }
.row:hover .row-cover img { transform: scale(1.03); }
.row-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.row-title { font-size: 1.35rem; margin: 0; }
.row-title a { color: var(--ink); }
.row-title a:hover { color: var(--accent); text-decoration: none; }
.row-excerpt { color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .meta { margin-top: .35rem; }

/* ---------- breadcrumb & pagination */
.breadcrumb { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .875rem; color: var(--muted); margin-bottom: 1.25rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 500; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2.5rem; }
.btn { display: inline-flex; align-items: center; height: 2.75rem; padding: 0 1.25rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; transition: filter var(--ease); }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- article */
.post-header { max-width: var(--prose); margin-bottom: 2rem; }
.post-header .meta { margin-top: .5rem; }
.post-cover { margin: 0 0 2.5rem; border-radius: var(--radius); overflow: hidden; }
.post-cover img { width: 100%; max-height: 32rem; object-fit: cover; }
.post-layout { display: grid; grid-template-columns: minmax(0, var(--prose)) 1fr; gap: 3rem; align-items: start; }
.sidebar { order: 2; position: sticky; top: 5.5rem; display: flex; flex-direction: column; min-width: 0; }
.sidebar:empty { display: none; }
.toc { font-size: .9rem; padding: 1rem 1.25rem; border-left: 2px solid var(--line); max-width: 18rem; }
.toc-title { font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--muted); margin-bottom: .5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc ol ol { padding-left: 1rem; margin-top: .2rem; }
.toc li { margin: .3rem 0; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--accent); }
.post-footer { max-width: var(--prose); margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.author-box { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; background: var(--surface); border-radius: var(--radius); margin: 1.5rem 0; }
.author-box p { margin: 0; }
.author-name { font-weight: 600; }
.author-name a { color: var(--ink); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.post-nav a { display: flex; flex-direction: column; gap: .2rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 500; }
.post-nav a:hover { border-color: var(--accent); text-decoration: none; }
.post-nav .right { text-align: right; }

/* ---------- prose (contenu markdown) */
.prose { max-width: var(--prose); min-width: 0; }
.prose-sm { font-size: .95rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin-top: 2.25em; padding-top: .25em; }
.prose h3 { margin-top: 1.75em; }
.prose h4 { margin-top: 1.5em; font-size: 1.05rem; }
.prose .headerlink { opacity: 0; margin-left: .35em; font-weight: 400; color: var(--muted); text-decoration: none; }
.prose h2:hover .headerlink, .prose h3:hover .headerlink, .prose h4:hover .headerlink, .prose .headerlink:focus { opacity: 1; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.25em; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: .35em 0; }
.prose li > p { margin-bottom: .5em; }
.prose a { text-decoration: underline; text-underline-offset: .15em; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose img { border-radius: var(--radius-sm); margin: 1.5em 0; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { font-size: .875rem; color: var(--muted); text-align: center; margin-top: .5em; }
.prose blockquote { margin: 1.5em 0; padding: .25em 0 .25em 1.25em; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font-family: var(--font-mono); font-size: .875em; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: .1em .4em; }
.prose pre { margin: 1.5em 0; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow-x: auto; line-height: 1.55; }
.prose pre code { background: none; border: 0; padding: 0; font-size: .875rem; }
.prose .highlight { margin: 1.5em 0; }
.prose .highlight pre { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .6em .9em; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; background: var(--surface); }
.prose dl { margin: 1.25em 0; }
.prose dt { font-weight: 600; margin-top: .75em; }
.prose dd { margin: .25em 0 0 1.25em; color: var(--muted); }
.prose abbr { text-decoration: underline dotted; cursor: help; }
.prose .footnote { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.prose .footnote ol { padding-left: 1.25em; }
.prose .footnote-ref { text-decoration: none; font-weight: 600; }
.prose .footnote-backref { text-decoration: none; margin-left: .25em; }
.prose kbd { font-family: var(--font-mono); font-size: .8em; padding: .1em .45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.prose mark { background: var(--accent-soft); color: inherit; padding: 0 .2em; border-radius: 3px; }

/* admonitions (!!! note "Titre") */
.prose .admonition { margin: 1.5em 0; padding: 1rem 1.25rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.prose .admonition-title { font-weight: 600; margin: 0 0 .35em; font-family: var(--font-heading); }
.prose .admonition p:last-child { margin-bottom: 0; }
.prose .admonition.warning, .prose .admonition.attention { border-left-color: #d98b1c; }
.prose .admonition.danger, .prose .admonition.error { border-left-color: #d1434b; }
.prose .admonition.tip, .prose .admonition.success { border-left-color: #2a9d63; }

/* FAQ (frontmatter faq:) */
.faq { margin-top: 3em; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: .6em 0; background: var(--surface); }
.faq-item summary { cursor: pointer; padding: .85rem 1.1rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 1.1rem 1rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* dark mode : la coloration Pygments garde un fond clair → surcharge (data-theme=dark ou préférence système) */
:root[data-theme="dark"] .prose .highlight pre, :root[data-theme="dark"] .prose pre { background: #0b0e12; border-color: var(--line); }
:root[data-theme="dark"] .prose .highlight, :root[data-theme="dark"] .prose .highlight pre { color: #d7dde5; }
:root[data-theme="dark"] .prose .highlight .c, :root[data-theme="dark"] .prose .highlight .c1, :root[data-theme="dark"] .prose .highlight .cm { color: #7a8794; }
:root[data-theme="dark"] .prose .highlight .k, :root[data-theme="dark"] .prose .highlight .kn, :root[data-theme="dark"] .prose .highlight .kd { color: #c792ea; }
:root[data-theme="dark"] .prose .highlight .s, :root[data-theme="dark"] .prose .highlight .s1, :root[data-theme="dark"] .prose .highlight .s2, :root[data-theme="dark"] .prose .highlight .sd { color: #a5d6a7; }
:root[data-theme="dark"] .prose .highlight .n, :root[data-theme="dark"] .prose .highlight .nn, :root[data-theme="dark"] .prose .highlight .nf, :root[data-theme="dark"] .prose .highlight .nc { color: #e6edf3; }
:root[data-theme="dark"] .prose .highlight .m, :root[data-theme="dark"] .prose .highlight .mi, :root[data-theme="dark"] .prose .highlight .mf { color: #f78c6c; }
:root[data-theme="dark"] .prose .highlight .o, :root[data-theme="dark"] .prose .highlight .p { color: #b0bcc9; }
:root[data-theme="dark"] .prose .highlight .nb, :root[data-theme="dark"] .prose .highlight .bp { color: #82aaff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prose .highlight pre, :root:not([data-theme="light"]) .prose pre { background: #0b0e12; border-color: var(--line); }
  :root:not([data-theme="light"]) .prose .highlight, :root:not([data-theme="light"]) .prose .highlight pre { color: #d7dde5; }
  :root:not([data-theme="light"]) .prose .highlight .c, :root:not([data-theme="light"]) .prose .highlight .c1, :root:not([data-theme="light"]) .prose .highlight .cm { color: #7a8794; }
  :root:not([data-theme="light"]) .prose .highlight .k, :root:not([data-theme="light"]) .prose .highlight .kn, :root:not([data-theme="light"]) .prose .highlight .kd { color: #c792ea; }
  :root:not([data-theme="light"]) .prose .highlight .s, :root:not([data-theme="light"]) .prose .highlight .s1, :root:not([data-theme="light"]) .prose .highlight .s2, :root:not([data-theme="light"]) .prose .highlight .sd { color: #a5d6a7; }
  :root:not([data-theme="light"]) .prose .highlight .n, :root:not([data-theme="light"]) .prose .highlight .nn, :root:not([data-theme="light"]) .prose .highlight .nf, :root:not([data-theme="light"]) .prose .highlight .nc { color: #e6edf3; }
  :root:not([data-theme="light"]) .prose .highlight .m, :root:not([data-theme="light"]) .prose .highlight .mi, :root:not([data-theme="light"]) .prose .highlight .mf { color: #f78c6c; }
  :root:not([data-theme="light"]) .prose .highlight .o, :root:not([data-theme="light"]) .prose .highlight .p { color: #b0bcc9; }
  :root:not([data-theme="light"]) .prose .highlight .nb, :root:not([data-theme="light"]) .prose .highlight .bp { color: #82aaff; }
}

/* ---------- recherche */
.search-form { max-width: 36rem; margin: .5rem 0 .75rem; }
.search-input { width: 100%; height: 3rem; padding: 0 1.1rem; font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; outline: none; transition: border-color var(--ease); }
.search-input:focus { border-color: var(--accent); background: var(--bg); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
#search-results mark { background: var(--accent-soft); color: inherit; padding: 0 .1em; border-radius: 3px; }

/* ---------- encarts promo (site.json → promo.banner / sidebar / menu) */
.promo { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.promo a { display: block; width: 100%; border-radius: var(--radius); overflow: hidden; transition: opacity var(--ease); }
.promo a:hover { opacity: .92; }
.promo img { width: 100%; height: auto; border-radius: var(--radius); }
.promo-label { align-self: flex-end; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.promo-banner { margin: 3rem auto 0; max-width: 60rem; }
.promo-banner.promo-top { margin: 0 auto 2.5rem; }
.promo-sidebar { margin-top: 1.5rem; max-width: 18rem; }
.promo-header { flex: 0 0 auto; width: min(28rem, 42%); }
.promo-header a, .promo-header img { border-radius: var(--radius-sm); }
.promo-sidebar a, .promo-sidebar img { border-radius: var(--radius); }

/* ---------- footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 2.5rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; align-items: start; }
.footer-brand { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; margin-bottom: .25rem; }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: flex-end; }
.social { display: flex; flex-direction: row; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.social li { display: block; margin: 0; padding: 0; }
.social-link { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); background: var(--bg); transition: color var(--ease), border-color var(--ease), background var(--ease); }
.social-link:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.footer-links a { color: var(--ink); font-size: .95rem; }
.footer-inner > p { grid-column: 1 / -1; margin: 0; }

/* ---------- responsive */
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .sidebar { display: contents; }
  .toc { order: 0; position: static; max-width: none; border-left: 0; padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius-sm); }
  .promo-sidebar { order: 3; max-width: 22rem; margin: .5rem auto 0; }
  .card-large { grid-template-columns: 1fr; }
  .hub-header { padding: 1.5rem; }
  .promo-header { display: none; }
  .card-large .card-cover { aspect-ratio: 16 / 9; min-height: 0; }
}
@media (max-width: 960px) {
  .nav-toggle { display: flex; }
  /* mobile : le header ne passe jamais à la ligne ; c'est la marque qui se compacte, pas les icônes qui descendent */
  .header-inner { flex-wrap: nowrap; }
  .brand { min-width: 0; flex-shrink: 1; font-size: 1.1rem; }
  .brand > span { white-space: normal; line-height: 1.15; overflow-wrap: anywhere; }
  .header-actions { flex-shrink: 0; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; padding: .75rem 1.25rem 1rem; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); flex: none; }
  .site-nav a { white-space: normal; }
  .nav-more { display: none !important; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .7rem .9rem; border-radius: var(--radius-sm); }
  .btn-cta { margin: .5rem 0 0; justify-content: center; }
}
@media (max-width: 680px) {
  body { font-size: 1rem; }
  .author-header { flex-direction: column; }
  .post-nav { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: .75rem; }
  .catlist .catlist { padding-left: 1rem; }
  .level-0 > .catlist-row .catlist-title { font-size: 1.3rem; }
  .catlist-count .unit { display: none; }
  .row-title { font-size: 1.2rem; }
  .post-nav .right { text-align: left; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-right { align-items: flex-start; }
  .footer-links { justify-content: flex-start; }
  .pagination { flex-direction: column; }
}
