/* ==========================================================================
   Pages de contenu (fiche, pages commune/département, pages statiques, 404)
   S'appuie sur ds.css (tokens et composants).
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-base)/var(--lh) var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--action-text); }

/* En-tête */
.p-entete {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-4); background: var(--surface); box-shadow: var(--ombre-1);
}
.p-marque { display: flex; align-items: center; gap: var(--s-2); min-height: var(--cible); margin-right: auto; color: var(--text); text-decoration: none; font: 700 var(--fs-md)/1 var(--font); }
.p-marque svg { width: 36px; height: 36px; flex-shrink: 0; }
.p-marque span span { font-weight: 400; color: var(--text-muted); }
.p-nav { display: flex; gap: var(--s-1); }
.p-nav a { display: inline-flex; align-items: center; min-height: var(--cible); padding: 0 var(--s-3); border-radius: var(--r-champ); color: var(--text); text-decoration: none; font-weight: 700; }
.p-nav a:hover, .p-nav a[aria-current="page"] { background: var(--surface-2); }
@media (max-width: 640px) { .p-nav { display: none; } .p-marque > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* Mise en page */
.p-main { max-width: 760px; margin: 0 auto; padding: var(--s-5) var(--s-4) var(--s-10); }
.p-main--large { max-width: 1000px; }
.p-ariane ol { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); margin: 0 0 var(--s-4); padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--text-muted); }
.p-ariane li + li::before { content: "›"; margin-right: var(--s-2); }
.p-ariane a { color: var(--action-text); font-weight: 700; }
.p-titre { margin: 0 0 var(--s-2); font: 700 var(--fs-xl)/1.2 var(--font); }
.p-sous-titre { margin: 0 0 var(--s-4); color: var(--text-muted); }
.p-carte { background: var(--surface); border-radius: var(--r-carte); padding: var(--s-5); box-shadow: var(--ombre-1); margin-bottom: var(--s-4); }
.p-carte > h2, .p-section > h2 { margin: 0 0 var(--s-3); font: 700 var(--fs-lg)/1.25 var(--font); }
.p-section { margin: var(--s-8) 0 var(--s-4); }
.p-badges { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.p-actions { display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-5) 0; }
@media (min-width: 640px) { .p-actions { flex-direction: row; flex-wrap: wrap; } .p-actions .ds-btn { flex: 1 1 220px; } }

/* Listes de faits */
.p-faits { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-3); margin: 0; }
.p-faits div { padding: var(--s-3); background: var(--surface-2); border-radius: var(--r-champ); }
.p-faits dt { font-size: var(--fs-sm); color: var(--text-muted); }
.p-faits dd { margin: 0; font-weight: 700; font-size: var(--fs-md); }
.p-faits dd small { display: block; font-weight: 400; font-size: var(--fs-sm); color: var(--text-muted); }

/* Chiffres */
.p-chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin: 0 0 var(--s-4); }
@media (min-width: 640px) { .p-chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.p-chiffres div { padding: var(--s-3) var(--s-4); background: var(--surface); border-radius: var(--r-carte); box-shadow: var(--ombre-1); }
.p-chiffres dt { font-size: var(--fs-sm); color: var(--text-muted); }
.p-chiffres dd { margin: 0; font: 700 var(--fs-xl)/1.1 var(--font); }

/* Citation / commentaire */
.p-citation { margin: var(--s-4) 0 0; padding: var(--s-3) var(--s-4); border-left: 4px solid var(--border-strong); background: var(--surface-2); border-radius: 0 var(--r-champ) var(--r-champ) 0; overflow-wrap: anywhere; }

/* Photos */
.p-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.p-photos a { display: block; aspect-ratio: 4 / 3; border-radius: var(--r-champ); overflow: hidden; background: var(--surface-2); }
.p-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Mini-carte */
.p-minicarte { height: 240px; border-radius: var(--r-carte); overflow: hidden; margin-bottom: var(--s-4); background: var(--surface-2); }

/* Listes de signalements / communes */
.p-liste { display: flex; flex-direction: column; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.p-liste a, .p-liste > li > div { display: flex; gap: var(--s-3); align-items: flex-start; min-height: var(--cible); padding: var(--s-3) var(--s-4); background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-champ); color: var(--text); text-decoration: none; }
.p-liste a:hover { border-color: var(--border-strong); }
.p-liste svg { width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.p-liste strong { display: block; }
.p-liste small { display: block; color: var(--text-muted); font-size: var(--fs-sm); }
.p-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.p-grille a { display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: var(--s-2) var(--s-3); background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-champ); color: var(--text); text-decoration: none; }
.p-grille a:hover { border-color: var(--border-strong); }
.p-grille small { color: var(--text-muted); font-size: var(--fs-sm); }
.p-grille .p-nb { color: var(--action-text); font-weight: 700; font-size: var(--fs-sm); }

/* Texte courant (pages statiques) */
.p-texte h2 { margin: var(--s-8) 0 var(--s-3); font: 700 var(--fs-lg)/1.25 var(--font); }
.p-texte h3 { margin: var(--s-5) 0 var(--s-2); font: 700 var(--fs-md)/1.3 var(--font); }
.p-texte p, .p-texte li { max-width: 70ch; }
.p-texte ul, .p-texte ol { padding-left: 1.3em; display: flex; flex-direction: column; gap: var(--s-1); }
.p-texte code, .p-texte pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--fs-sm); background: var(--surface-2); border-radius: 6px; }
.p-texte code { padding: 1px 6px; }
.p-texte pre { padding: var(--s-3); overflow-x: auto; }
.p-texte table { width: 100%; border-collapse: collapse; }
.p-texte th, .p-texte td { text-align: left; padding: var(--s-2); border-bottom: 1px solid var(--border); }

/* Pied de page */
.p-pied { max-width: 1000px; margin: 0 auto; padding: var(--s-6) var(--s-4) var(--s-8); border-top: 2px solid var(--border); font-size: var(--fs-sm); color: var(--text-muted); }
.p-pied ul { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); margin: 0 0 var(--s-2); padding: 0; list-style: none; }
.p-pied a { display: inline-flex; align-items: center; min-height: var(--cible); color: var(--text); font-weight: 700; }
