/* =========================================================================
   Feuille de style principale
   Toutes les couleurs, polices et dimensions sont définies dans :root,
   pour que le visuel définitif se règle à un seul endroit.
   Polices système uniquement : aucun appel à un service tiers (RGPD).
   ========================================================================= */

:root {
  /* Couleurs */
  --ink: #1b2a41;          /* bleu nuit : menu, pied de page, titres */
  --ink-soft: #2f4a73;     /* liens */
  --accent: #9e1b32;       /* rouge profond : survol, focus, citations */
  --paper: #ffffff;
  --surface: #f3f5f8;      /* fonds secondaires */
  --text: #1f2329;
  --muted: #5c6470;
  --rule: #dde1e7;

  /* Typographie */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;

  /* Dimensions */
  --nav-h: 4rem;
  --banner-h: clamp(11rem, 31.58vw, 37.5rem); /* 1900 × 600 → ratio 31,58 % */
  --content-max: 80rem;
  --gutter: clamp(1rem, 3vw, 2.5rem);
  --radius: 4px;
}

/* --- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1rem); /* ancres non masquées par le menu */
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* pied de page toujours en bas, même sur une page courte */
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--ink-soft); text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -4rem; left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* --- Menu fixe, superposé au bandeau -------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  margin-bottom: calc(-1 * var(--nav-h)); /* le bandeau passe dessous */
  color: #fff;
  background: rgb(14 22 36 / 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
/* Ajouté par site.js dès que le bandeau a défilé hors de vue */
.site-nav.is-solid {
  background: var(--ink);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.18);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-nav__brand {
  margin-right: auto;
  font-family: var(--font-read);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__brand:hover { color: #fff; }

.site-nav__panel { display: flex; align-items: center; gap: 1.25rem; }

.site-nav__menu {
  display: flex;
  gap: 0.15rem;
  margin: 0; padding: 0;
  list-style: none;
}
.site-nav__menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
}
.site-nav__menu a:hover,
.site-nav__menu a[aria-current="page"] {
  color: #fff;
  background: rgb(255 255 255 / 0.15);
}

.site-nav__account {
  padding: 0.4rem 0.9rem;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: var(--radius);
}
.site-nav__account:hover { color: var(--ink); background: #fff; }

.site-nav__toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: #fff;
  background: none;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: var(--radius);
  cursor: pointer;
}
.site-nav__toggle-bars,
.site-nav__toggle-bars::before,
.site-nav__toggle-bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
}
.site-nav__toggle-bars { position: relative; }
.site-nav__toggle-bars::before,
.site-nav__toggle-bars::after { content: ""; position: absolute; left: 0; }
.site-nav__toggle-bars::before { top: -6px; }
.site-nav__toggle-bars::after { top: 6px; }

/* Menu mobile : panneau déroulant sous la barre */
@media (max-width: 60rem) {
  .site-nav__toggle { display: inline-flex; }

  .site-nav__panel {
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--ink);
    box-shadow: 0 8px 16px rgb(0 0 0 / 0.2);
  }
  .site-nav.is-open { background: var(--ink); }
  .site-nav.is-open .site-nav__panel { display: flex; }

  .site-nav__menu { flex-direction: column; }
  .site-nav__menu a { padding: 0.75rem; }
  .site-nav__account { text-align: center; padding: 0.75rem; }
}

/* --- Bandeau --------------------------------------------------------------- */

.banner {
  height: var(--banner-h);
  overflow: hidden;
  background: var(--ink); /* visible le temps du chargement de l'image */
}
.banner__image { width: 100%; height: 100%; object-fit: cover; }

/* --- Grille trois colonnes -------------------------------------------------- */

.page-grid {
  width: 100%;
  display: grid;
  gap: 2.5rem var(--gutter);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter);
  /* Mobile : une colonne */
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "search" "main" "archives" "tags";
}
.area-search { grid-area: search; }
.area-main { grid-area: main; min-width: 0; }
.area-archives { grid-area: archives; }
.area-tags { grid-area: tags; }

/* Tablette : contenu + une colonne latérale */
@media (min-width: 48rem) {
  .page-grid {
    grid-template-columns: minmax(0, 1fr) 15rem;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "main search"
      "main archives"
      "main tags";
  }
}

/* Ordinateur : trois colonnes */
@media (min-width: 64rem) {
  .page-grid {
    grid-template-columns: 14rem minmax(0, 1fr) 14rem;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "search main tags"
      "archives main tags";
  }
}

.single {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) 4rem;
}

/* --- Colonnes latérales ----------------------------------------------------- */

.side__title {
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  font-size: 1rem;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}
.side__empty { margin: 0; font-size: 0.9rem; color: var(--muted); }
.count { color: var(--muted); font-size: 0.85em; }

.search__label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--ink);
}
.search__row { display: flex; gap: 0.4rem; }
.search__input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  font: inherit;
  border: 1px solid #b9c0ca;
  border-radius: var(--radius);
}
.search__button {
  padding: 0.55rem 0.8rem;
  font: inherit;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.search__button:hover { background: var(--accent); }

/* Le bouton passe sous le champ dans la colonne étroite de l'ordinateur */
@media (min-width: 64rem) {
  .search__row { flex-direction: column; }
}

.archives__year + .archives__year { margin-top: 0.4rem; }
.archives summary { cursor: pointer; font-weight: 600; padding: 0.2rem 0; }
.archives__months {
  margin: 0.25rem 0 0.5rem;
  padding: 0 0 0 1rem;
  list-style: none;
  font-size: 0.95rem;
}
.archives__months li { padding: 0.15rem 0; }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
  margin: 0; padding: 0;
  list-style: none;
  line-height: 1.3;
}
.tag-cloud__item { text-decoration: none; white-space: nowrap; }
.tag-cloud__item:hover { text-decoration: underline; }

/* --- Listes d'articles ------------------------------------------------------ */

.listing__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-read);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  line-height: 1.2;
  color: var(--ink);
}
.listing__count { margin: 0 0 1rem; color: var(--muted); font-size: 0.9rem; }
.listing__empty { padding: 2rem 0; color: var(--muted); }

/* Indicateur de chargement HTMX */
.listing.htmx-request { opacity: 0.55; transition: opacity 0.15s; }

.entry { padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.entry:first-of-type { border-top: 0; }
.entry__title {
  margin: 0 0 0.3rem;
  font-family: var(--font-read);
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  line-height: 1.25;
}
.entry__title a { color: var(--text); text-decoration: none; }
.entry__title a:hover { color: var(--accent); text-decoration: underline; }
.entry__meta { margin: 0 0 0.6rem; font-size: 0.875rem; color: var(--muted); }
.entry__intro { margin: 0; max-width: 42rem; }

/* Lien « Lire la suite » : indispensable sur mobile, où rien ne signale
   que le titre est cliquable */
.entry__more { margin: 0.75rem 0 0; }
.entry__more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
}
.entry__more-link:hover { color: #fff; background: var(--ink); }
.entry__more-link span[aria-hidden] { transition: transform 0.15s; }
.entry__more-link:hover span[aria-hidden] { transform: translateX(3px); }

/* Badges de réactions (pouces, commentaires) dans les listes */
.badge-count {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.5rem;
  padding: 0.1rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  text-decoration: none;
  vertical-align: 0.05em;
  background: var(--surface);
  border-radius: 999px;
}
.badge-count svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
a.badge-count:hover { color: #fff; background: var(--ink); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.9rem 0 0; padding: 0;
  list-style: none;
}
.tags a {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--surface);
  border-radius: 999px;
}
.tags a:hover { color: #fff; background: var(--ink); }

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.pagination__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0; padding: 0;
  list-style: none;
}
.pagination__page {
  display: inline-block;
  min-width: 2.4rem;
  padding: 0.4rem 0.5rem;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.pagination__page[aria-current="page"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.pagination__gap { padding: 0.4rem 0.25rem; color: var(--muted); }
.pagination__step { font-weight: 600; }

@media (max-width: 30rem) {
  .pagination { justify-content: center; }
  .pagination__pages { order: -1; width: 100%; justify-content: center; }
}

/* --- Article ------------------------------------------------------------------ */

.article__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-read);
  font-size: clamp(1.9rem, 4.2vw, 2.7rem);
  line-height: 1.15;
  color: var(--ink);
}
.article__meta { margin: 0 0 1.75rem; color: var(--muted); font-size: 0.9rem; }
.article__cover { max-width: 40rem; margin: 0 0 2rem; }

.article__intro {
  max-width: 40rem;
  margin: 0 0 2rem;
  font-family: var(--font-read);
  font-size: 1.25rem;
  line-height: 1.6;
}
.article__footer { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }

.prose {
  max-width: 40rem;
  font-family: var(--font-read);
  font-size: 1.125rem;
  line-height: 1.75;
}
.prose h2 { margin: 2.5rem 0 0.75rem; font-size: 1.6rem; line-height: 1.25; color: var(--ink); }
.prose h3 { margin: 2rem 0 0.5rem; font-size: 1.3rem; line-height: 1.3; color: var(--ink); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.25rem; }
.prose li + li { margin-top: 0.35rem; }
/* Images d'article : jamais plus de 600 px de haut (ni 80 % de l'écran),
   proportions conservées, centrées si elles sont étroites */
.article__cover img,
.prose img {
  width: auto;
  max-width: 100%;
  max-height: min(600px, 80vh);
  margin: 2rem auto;
  border-radius: var(--radius);
}
.article__cover img { margin-top: 0; }
.prose blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  font-style: italic;
  color: #3d434c;
  border-left: 3px solid var(--accent);
}
.prose code { font-size: 0.9em; padding: 0.1em 0.3em; background: var(--surface); border-radius: 3px; }
.prose pre { overflow-x: auto; padding: 1rem; background: var(--surface); border-radius: var(--radius); }
.prose pre code { padding: 0; background: none; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-family: var(--font-ui); font-size: 0.95rem; }
.prose th, .prose td { padding: 0.5rem 0.75rem; text-align: left; border: 1px solid var(--rule); }
.prose th { background: var(--surface); }
.prose hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--rule); }

.cta {
  max-width: 40rem;
  margin: 2.5rem 0 0;
  padding: 1.25rem 1.5rem;
  font-size: 1.05rem;
  background: var(--surface);
  border-left: 4px solid var(--ink);
}
.cta p { margin: 0; }

/* --- Pages légales et erreurs ------------------------------------------------- */

.legal h1, .error-page h1 {
  font-family: var(--font-read);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.2;
  color: var(--ink);
}
.legal h2 { margin-top: 2rem; font-size: 1.25rem; color: var(--ink); }
.legal__todo {
  padding: 0.75rem 1rem;
  background: #fff6d6;
  border-left: 4px solid #d9a400;
}
.error-page__code { margin: 0; font-weight: 600; color: var(--accent); }

/* --- Formulaires ---------------------------------------------------------------- */

.form-page { max-width: 30rem; margin: 0 auto; }
.form-page h1 {
  margin: 0 0 1rem;
  font-family: var(--font-read);
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  line-height: 1.2;
  color: var(--ink);
}
.form-page h2 { margin: 2.5rem 0 0.5rem; font-size: 1.2rem; color: var(--ink); }
.form-page__intro { margin: 0 0 1.5rem; color: var(--muted); }
.form-page__switch { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }

.form { display: grid; gap: 1.25rem; }
.form__aside { margin: -0.25rem 0 0; font-size: 0.9rem; }

.field { display: grid; gap: 0.35rem; }
.field__label { font-weight: 600; color: var(--ink); }
.field__help { margin: 0; font-size: 0.875rem; color: var(--muted); }
.field__input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--paper);
  border: 1px solid #b9c0ca;
  border-radius: var(--radius);
}
.field__input:focus-visible { border-color: var(--ink); }
.field--error .field__input { border-color: #b3261e; border-width: 2px; }
.field__error { margin: 0; font-size: 0.9rem; font-weight: 600; color: #b3261e; }

.button {
  display: inline-block;
  justify-self: start;
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
}
.button:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.button--secondary { color: var(--ink); background: transparent; }
.button--secondary:hover { color: #fff; background: var(--ink); border-color: var(--ink); }

.notice { margin: 0 0 1.25rem; padding: 0.8rem 1rem; border-left: 4px solid; border-radius: var(--radius); }
.notice p { margin: 0; }
.notice--info { background: #eaf1fb; border-color: var(--ink-soft); }
.notice--success { background: #e8f5ec; border-color: #2e7d4f; }
.notice--error { background: #fdecea; border-color: #b3261e; }
.notice--correction { background: #e7effb; border-color: #1f4f8f; }
.notice--correction p + p, .notice--correction blockquote + p { margin-top: 0.6rem; }

/* Bouton « œil » des mots de passe (ajouté par site.js) */
.password-field { position: relative; }
.password-field .field__input { padding-right: 3rem; }
.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  padding: 0.4rem;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.password-field__toggle:hover { color: var(--ink); }
.password-field__toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Champ piège anti-robots : hors de l'écran, ignoré des lecteurs d'écran */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.account-summary { display: grid; gap: 0.6rem; margin: 0 0 1rem; }
.account-summary div { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.account-summary dt { min-width: 11rem; color: var(--muted); }
.account-summary dd { margin: 0; font-weight: 600; }

.stats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.stats li { flex: 1 1 10rem; padding: 0.9rem 1rem; color: var(--muted); background: var(--surface); border-radius: var(--radius); }
.stats__value { display: block; font-family: var(--font-read); font-size: 1.8rem; font-weight: 700; color: var(--ink); line-height: 1.1; }

/* --- Pouce et commentaires ------------------------------------------------------- */

.like {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  max-width: 40rem;
  margin: 2.5rem 0 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.like__button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.like__icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.like__button:hover { color: var(--accent); border-color: var(--accent); }
.like__button[aria-pressed="true"] { color: #fff; background: var(--ink); }
.like__button[aria-pressed="true"] .like__icon { fill: currentColor; }
.like__button[aria-pressed="true"]:hover { background: var(--accent); border-color: var(--accent); }
.like__count { margin: 0; color: var(--muted); }
/* Petit rebond quand on lève le pouce : la réponse à un geste du visiteur */
.like__button[aria-pressed="true"] .like__icon { animation: like-pop 0.3s ease-out; }
@keyframes like-pop { 50% { transform: scale(1.3) rotate(-8deg); } }

/* Pouce et partage, côte à côte sous l'article */
.article__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  max-width: 40rem;
  margin: 2.5rem 0 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.article__actions .like { margin: 0; padding: 0; border: 0; }

.share { position: relative; }
.share__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}
.share__toggle::-webkit-details-marker { display: none; }
.share__toggle:hover, .share[open] .share__toggle { color: #fff; background: var(--ink); }
.share__toggle svg, .share__item svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share__menu {
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + 0.4rem);
  min-width: 13rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.share__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}
.share__item:hover, .share__item:focus-visible { color: var(--ink); background: var(--surface); }
/* Emplacement d'icône réservé sur chaque ligne : les libellés restent alignés */
.share__icon { display: inline-flex; flex-shrink: 0; width: 18px; height: 18px; }
/* Sur petit écran, le menu prend la largeur disponible sous le bouton */
@media (max-width: 30rem) {
  .share { position: static; }
  .article__actions { position: relative; }
  .share__menu { left: 0; right: 0; }
}

.comments { max-width: 40rem; margin-top: 2.5rem; }
.comments__title { margin: 0 0 1.25rem; font-family: var(--font-read); font-size: 1.5rem; color: var(--ink); }
.comments__list { margin: 0 0 2rem; padding: 0; list-style: none; }
.comment { padding: 1rem 0; border-top: 1px solid var(--rule); }
.comment:first-child { border-top: 0; padding-top: 0; }
.comment:focus { outline: 3px solid var(--accent); outline-offset: 4px; }
.comment__meta { margin: 0 0 0.4rem; font-size: 0.875rem; color: var(--muted); }
.comment__author { font-weight: 700; color: var(--ink); }
.comment__body p { margin: 0 0 0.6rem; overflow-wrap: anywhere; }
.comment__body p:last-child { margin-bottom: 0; }
.comments__empty { color: var(--muted); }
.comments__form textarea { resize: vertical; min-height: 7rem; }
.comments__login { padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius); }

/* --- Back-office ------------------------------------------------------------------- */

/* Pages sans bandeau : le menu ne se superpose plus à rien */
.no-banner .site-nav { margin-bottom: 0; background: var(--ink); }

.bo {
  width: 100%;
  display: grid;
  gap: 2rem var(--gutter);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.5rem) var(--gutter) 4rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 56rem) {
  .bo { grid-template-columns: 13rem minmax(0, 1fr); }
}

.bo__nav-title {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.bo__nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.bo__nav ul + .bo__nav-title { margin-top: 1.25rem; }
@media (min-width: 56rem) {
  .bo__nav { position: sticky; top: calc(var(--nav-h) + 1rem); align-self: start; }
  .bo__nav ul { flex-direction: column; }
}
.bo__count {
  display: inline-block;
  min-width: 1.5rem;
  margin-left: 0.25rem;
  padding: 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
}
.bo__nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
}
.bo__nav a:hover { background: var(--surface); color: var(--ink); }
.bo__nav a[aria-current="page"] { color: #fff; background: var(--ink); }

.bo__main { min-width: 0; }
.bo-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
}
.bo-header h1 { margin: 0; font-family: var(--font-read); font-size: clamp(1.6rem, 3vw, 2rem); color: var(--ink); }

/* Badges de statut */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}
.badge--soumis { background: #fff3cd; color: #7a5600; }
.badge--publie { background: #e8f5ec; color: #1e6b3f; }
.badge--refuse, .badge--archive { background: #fdecea; color: #9b1c15; }
.badge--a_corriger { background: #e7effb; color: #1f4f8f; }
.bo-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }

/* Liste des articles */
.bo-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.bo-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.bo-list__main { min-width: 0; flex: 1 1 20rem; }
.bo-list__title { font-weight: 600; font-size: 1.05rem; }
.bo-list__meta { margin: 0.2rem 0 0; font-size: 0.875rem; color: var(--muted); }
.bo-empty { padding: 2rem; text-align: center; background: var(--surface); border-radius: var(--radius); }

/* Éditeur */
.bo-editor { gap: 1.5rem; }
.field__input--title { font-family: var(--font-read); font-size: 1.35rem; }
.field__optional { font-weight: 400; color: var(--muted); }
[data-counter-for] { white-space: nowrap; }
[data-counter-for].is-over { color: #9b1c15; font-weight: 600; }

.bo-editor__body { display: grid; gap: 1.5rem; }
@media (min-width: 80rem) {
  .bo-editor__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .bo-preview { position: sticky; top: calc(var(--nav-h) + 1rem); max-height: calc(100vh - var(--nav-h) - 2rem); overflow-y: auto; }
}

.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid #b9c0ca;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.md-toolbar button {
  padding: 0.3rem 0.6rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
}
.md-toolbar button:hover { border-color: var(--ink); }
.md-area {
  min-height: 24rem;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  border-radius: 0 0 var(--radius) var(--radius);
  resize: vertical;
}

.bo-preview { padding: 1rem 1.25rem; background: var(--paper); border: 1px dashed #b9c0ca; border-radius: var(--radius); }
.bo-preview__title { margin: 0 0 0.75rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.bo-preview__meta { margin: 0 0 1rem; font-size: 0.875rem; color: var(--muted); }
.bo-preview__empty { color: var(--muted); }
.bo-preview .prose { font-size: 1rem; }
.notice ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }

.bo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}
.bo-actions__warning { flex-basis: 100%; margin: 0; padding: 0.75rem 1rem; background: #fff3cd; border-left: 4px solid #d9a400; }
.bo-actions__note { margin: 0; color: var(--muted); }

/* Panneau d'images */
.bo-panel { margin-top: 2rem; padding: 1.5rem; background: var(--surface); border-radius: var(--radius); }
.bo-panel h2 { margin: 0 0 0.5rem; font-size: 1.2rem; color: var(--ink); }
.bo-panel__help { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.9rem; }
.bo-images { display: grid; gap: 1rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.bo-image {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.75rem;
  background: var(--paper);
  border-radius: var(--radius);
}
.bo-image img { width: 8rem; height: 6rem; object-fit: cover; border-radius: 3px; }
.bo-image__alt { margin: 0 0 0.4rem; font-weight: 600; overflow-wrap: anywhere; }
.bo-image p { margin: 0 0 0.4rem; }
.bo-image__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
@media (max-width: 30rem) {
  .bo-image { grid-template-columns: minmax(0, 1fr); }
  .bo-image img { width: 100%; height: auto; }
}
.bo-upload { padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.checkbox { display: flex; align-items: flex-start; gap: 0.5rem; }
.checkbox input { margin-top: 0.2rem; flex-shrink: 0; }
.checkbox input { width: 1.1rem; height: 1.1rem; }

.button--small { padding: 0.35rem 0.75rem; font-size: 0.875rem; }
.button--danger { color: #9b1c15; background: transparent; border-color: #9b1c15; }
.button--danger:hover { color: #fff; background: #9b1c15; border-color: #9b1c15; }
.bo-danger { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.account-workspace { margin: 0 0 1.5rem; }

/* --- Modération ---------------------------------------------------------------------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1.25rem;
  border-bottom: 2px solid var(--rule);
}
.tabs__item {
  margin-bottom: -2px;
  padding: 0.5rem 0.9rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.tabs__item:hover { color: var(--ink); }
.tabs__item[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

.bo-back { margin: 0 0 1rem; font-size: 0.9rem; }

.review { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 75rem) {
  .review { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
  .review__side { position: sticky; top: calc(var(--nav-h) + 1rem); }
}
.review__article { padding: 1.5rem; border: 1px dashed #b9c0ca; border-radius: var(--radius); }
.review__caption { margin-top: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.review__meta { display: grid; gap: 0.5rem; margin: 2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 0.9rem; }
.review__meta dt { font-weight: 600; color: var(--ink); }
.review__meta dd { margin: 0; color: var(--muted); }
.review__panel { margin-top: 0; }
.review__panel + .review__panel { margin-top: 1rem; }
.review__panel p { margin: 0 0 0.75rem; }
.review__decision { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.review__alert { font-weight: 600; color: #9b1c15; }

.history { margin: 0; padding: 0; list-style: none; }
.history li { padding: 0.6rem 0; border-top: 1px solid var(--rule); }
.history li:first-child { border-top: 0; padding-top: 0; }
.history p { margin: 0; }
.history__meta { font-size: 0.8rem; color: var(--muted); }
.history__reason { margin-top: 0.3rem !important; font-size: 0.9rem; font-style: italic; }

.mod-comments { margin: 0; padding: 0; list-style: none; }
.mod-comment { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.mod-comment__meta { margin: 0 0 0.4rem; font-size: 0.875rem; color: var(--muted); }
.mod-comment__body { margin-bottom: 0.6rem; overflow-wrap: anywhere; }
.mod-comment__body p { margin: 0 0 0.5rem; }
.mod-comment__action summary { cursor: pointer; color: #9b1c15; font-size: 0.9rem; font-weight: 600; }
.mod-comment__action .form { margin-top: 0.75rem; max-width: 32rem; gap: 0.75rem; }

/* --- Sélecteur de thèmes ------------------------------------------------------------- */

.tag-picker { margin: 0; padding: 0; border: 0; min-width: 0; }
.tag-picker legend { padding: 0; margin-bottom: 0.35rem; }
.tag-picker__list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.5rem 0; }
.tag-picker__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
}
.tag-picker__item:has(input:checked) { color: #fff; background: var(--ink); border-color: var(--ink); }
.tag-picker__item:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.tag-picker__item input { accent-color: var(--ink); margin: 0; }

/* --- Administration des thèmes ------------------------------------------------------- */

.theme-add { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: 30rem; }
.theme-add .field__input { flex: 1 1 14rem; }
.theme-list { margin: 1.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.theme { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.theme__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.theme__name { font-weight: 700; font-size: 1.05rem; }
.theme__slug { font-size: 0.8rem; color: var(--muted); }
.theme__counts { font-size: 0.875rem; color: var(--muted); }
.theme__actions summary { margin-top: 0.4rem; cursor: pointer; font-size: 0.9rem; color: var(--ink-soft); }
.theme__forms { display: grid; gap: 1rem; margin-top: 0.75rem; padding: 1rem; background: var(--surface); border-radius: var(--radius); }
.theme-form { display: grid; gap: 0.35rem; }
.theme-form__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.theme-form__row .field__input { flex: 1 1 14rem; max-width: 24rem; }

/* --- Administration du partage --------------------------------------------------------- */

.share-admin { width: 100%; max-width: 34rem; border-collapse: collapse; }
.share-admin th, .share-admin td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--rule); }
.share-admin th { font-size: 0.85rem; color: var(--muted); }
.share-admin input[type="checkbox"] { width: 1.1rem; height: 1.1rem; }
.share-admin__pos { width: 4.5rem; padding: 0.35rem 0.5rem; }

/* --- Messages de contact ---------------------------------------------------------------- */

.bo-list__item--unread .bo-list__title { font-weight: 800; }
.bo-list__item--unread .bo-list__title::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.5rem;
  vertical-align: middle;
  background: var(--accent);
  border-radius: 50%;
}
.contact-message {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border-left: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.contact-message p { margin: 0 0 0.6rem; }
.contact-message p:last-child { margin-bottom: 0; }

/* --- Corrections : demande et différences ---------------------------------------------- */

.corrections { margin: 0 0 1.5rem; }
.corrections__request {
  margin: 0.6rem 0;
  padding: 0.6rem 1rem;
  font-style: italic;
  background: var(--paper);
  border-left: 3px solid #1f4f8f;
  border-radius: var(--radius);
}
.corrections__request p { margin: 0 0 0.4rem; }
.corrections__request p:last-child { margin-bottom: 0; }
.diff {
  padding: 1rem 1.25rem;
  font-family: var(--font-read);
  line-height: 1.65;
  background: var(--paper);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.diff p { margin: 0 0 0.75rem; white-space: pre-wrap; }
.diff p:last-child { margin-bottom: 0; }
.diff__equal { color: var(--muted); }
.diff__skip { font-family: var(--font-ui); font-size: 0.85rem; font-style: italic; color: var(--muted); text-align: center; }
.corrections del { color: #8a1c13; background: #fde2df; text-decoration: line-through; }
.corrections ins { color: #14532d; background: #dcf5e3; text-decoration: none; }
.diff__delete, .diff__insert { padding: 0.15rem 0.4rem; border-radius: 3px; }
.diff__delete { background: #fdf0ee; }
.diff__insert { background: #eefaf1; }

/* --- Membres --------------------------------------------------------------------------- */

.member-search { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; max-width: 36rem; }
.member-search .field__input { flex: 1 1 16rem; }
.member-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.member-confirm { display: grid; gap: 0.35rem; margin: 0.25rem 0 0.5rem; }
.member-confirm .field__help { max-width: 34rem; }
.member-action + .member-action { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
select.field__input { padding-right: 2rem; cursor: pointer; }

/* --- Vidéo d'en-tête ------------------------------------------------------------------ */

.video { max-width: 40rem; margin: 0 0 2rem; }
.video__frame,
.video__player {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: var(--ink);
  border: 0;
  border-radius: var(--radius);
}
.video__poster { width: 100%; height: 100%; object-fit: cover; }
.video__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem 5rem;
  font-family: var(--font-read);
  font-size: 1.3rem;
  text-align: center;
  color: #fff;
}
.video__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(transparent 60%, rgb(0 0 0 / 0.35));
}
.video__play svg path:first-child { fill: rgb(20 20 20 / 0.8); transition: fill 0.15s; }
.video__play-arrow { fill: #fff; }
.video__frame:hover .video__play svg path:first-child,
.video__frame:focus-visible .video__play svg path:first-child { fill: var(--accent); }
.video__external {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: #fff;
  background: rgb(20 20 20 / 0.8);
  border-radius: 999px;
}
.video__frame:hover .video__external { background: var(--accent); }
.video__caption { margin-top: 0.4rem; font-size: 0.8rem; color: var(--muted); }

/* État de la vidéo dans l'éditeur */
.video-status {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius);
}
.video-status img { width: 10rem; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.video-status p { margin: 0 0 0.25rem; }
@media (max-width: 30rem) { .video-status { flex-direction: column; align-items: flex-start; } }

/* --- Page « À propos » --------------------------------------------------------------- */

.about__lead { font-size: 1.2rem; font-weight: 600; }
.about__conclusion { padding: 1rem 1.25rem; background: var(--surface); border-left: 4px solid var(--ink); border-radius: var(--radius); }

/* --- Page « Participer » ----------------------------------------------------------- */

/* Page plus large que les autres pages à une colonne : deux cartes côte à côte */
.single:has(.participate) { max-width: 70rem; }
.participate h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-read);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--ink);
}
/* Titre et introduction : même colonne centrée que les autres pages,
   tandis que les deux blocs du dessous gardent toute la largeur */
.participate h1,
.participate__intro {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}
.participate__intro { margin-bottom: 2rem; font-size: 1.05rem; }
.participate__intro p { margin: 0 0 0.4rem; }
.participate__intro ul { margin: 0; padding-left: 1.2rem; }
.participate__grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 56rem) {
  .participate__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.participate__card { padding: 1.5rem; background: var(--surface); border-radius: var(--radius); }
.participate__card h2 { margin: 0 0 0.75rem; font-family: var(--font-read); font-size: 1.45rem; color: var(--ink); }
.participate__card ul { padding-left: 1.2rem; }
.participate__card li + li { margin-top: 0.3rem; }
.participate__card .form { margin-top: 1.25rem; }
.participate__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.participate__small { font-size: 0.9rem; color: var(--muted); }
.participate__done { padding: 0.75rem 1rem; background: var(--paper); border-radius: var(--radius); }

/* --- Pied de page ------------------------------------------------------------- */

.site-footer { margin-top: auto; color: #cfd6e0; background: var(--ink); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem var(--gutter);
}
.site-footer__brand { margin: 0; font-family: var(--font-read); font-size: 1.15rem; font-weight: 700; color: #fff; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #fff; text-decoration-thickness: 2px; }
.site-footer__copy { margin: 0; font-size: 0.875rem; }

/* --- Préférences de l'utilisateur ----------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-nav, .banner, .area-search, .area-archives, .area-tags, .site-footer, .pagination { display: none; }
  .page-grid { display: block; padding: 0; }
  .prose, .article__intro { max-width: none; }
}
