/* =====================================================================
   Pages de contenu « S'implanter dans le Val-d'Oise » (#186).
   Charte DA (docs/design/CHARTE.md) : grille de 8 px, corps 16/24, rien sous 13 px, cibles tactiles de 44 px,
   aucun débordement horizontal de 390 à 1440 px. Jetons de couleur : core/static/core/css/styles.css.
   Préfixe « sp- » : aucune classe partagée avec la rubrique #184 (simplanter.css).
   ===================================================================== */
.sp-page { --sp-texte: var(--c-text-body, #1E293B); --sp-secondaire: var(--c-text-2, #475569); --sp-bord: var(--c-border, #E2E8F0);
    --sp-marque: var(--c-brand, #1853A2); --sp-action: var(--c-action, #0066CC); }
.sp-page a:focus-visible { outline: 2px solid var(--ui-focus, #1D4ED8); outline-offset: 2px; border-radius: 4px; }
.sp-lien { color: var(--sp-action); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.sp-lien:hover { text-decoration-thickness: 2px; }

/* Fil d'Ariane */
.sp-ariane { margin: 0 0 16px; font-size: 14px; line-height: 20px; color: var(--sp-secondaire); }
.sp-ariane ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.sp-ariane li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.sp-ariane li + li::before { content: "›"; color: var(--c-text-muted, #64748B); }
.sp-ariane a { display: inline-flex; align-items: center; min-height: 24px; color: var(--sp-action); text-decoration: none; }
.sp-ariane a:hover { text-decoration: underline; }
.sp-ariane [aria-current] { color: var(--sp-texte); font-weight: 600; }
@media (pointer: coarse), (max-width: 1023.98px) { .sp-ariane a { min-height: 44px; } .sp-ariane ol { gap: 0 8px; } }

/* En-tête */
.sp-entete { margin: 0 0 24px; }
.sp-surtitre { margin: 0 0 8px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--sp-marque); }
.sp-chapo { margin: 8px 0 0; max-width: 70ch; font-size: 18px; line-height: 28px; color: var(--sp-texte); }

/* Navigation locale : six pages, défilement horizontal dans son cadre sur petit écran */
.sp-nav { margin: 0 0 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.sp-nav ul { display: flex; gap: 8px; margin: 0; padding: 4px; list-style: none; width: max-content; }
.sp-nav a { display: inline-flex; align-items: center; min-height: var(--tap, 40px); padding: 0 16px; border: 1px solid #CBD5E1; border-radius: 9999px;
    background: #fff; color: var(--sp-texte); font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.sp-nav a:hover { background: var(--c-bg-2, #F1F5F9); }
.sp-nav a[aria-current="page"] { background: var(--sp-marque); border-color: var(--sp-marque); color: #fff; }
.sp-note-langue { margin: 0 0 24px; padding: 12px 16px; max-width: 90ch; border: 1px solid #93C5FD; border-radius: var(--r-sm, 8px); background: #DBEAFE; color: #1E3A8A; font-size: 14px; line-height: 20px; }

/* Corps */
.sp-corps { color: var(--sp-texte); font-size: 16px; line-height: 24px; }
.sp-corps section { margin: 0 0 40px; scroll-margin-top: 96px; }
.sp-corps section > .ui-h2 { margin: 0 0 16px; }
.sp-corps h3 { margin: 24px 0 8px; font-size: 18px; line-height: 26px; font-weight: 700; color: var(--c-text, #0F172A); }
.sp-corps p { margin: 0 0 16px; max-width: 75ch; }
.sp-corps ul.sp-liste { margin: 0 0 16px; padding: 0 0 0 24px; max-width: 75ch; list-style: disc; }
.sp-corps ul.sp-liste li { margin: 0 0 8px; }
.sp-corps strong { font-weight: 700; color: var(--c-text, #0F172A); }
.sp-corps a:not(.ui-btn) { color: var(--sp-action); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* Sommaire */
.sp-sommaire { margin: 0 0 32px; padding: 16px; max-width: 75ch; background: #fff; border: 1px solid var(--sp-bord); border-radius: var(--r-md, 12px); }
.sp-sommaire h2 { margin: 0 0 8px; font-size: 14px; line-height: 20px; font-weight: 700; color: var(--sp-secondaire); }
.sp-sommaire ol { margin: 0; padding: 0 0 0 24px; columns: 1; list-style: decimal; }
.sp-sommaire li { margin: 0; }
.sp-sommaire a { display: inline-flex; align-items: center; min-height: 32px; }
@media (min-width: 768px) { .sp-sommaire ol { columns: 2; column-gap: 32px; } }
@media (pointer: coarse), (max-width: 1023.98px) { .sp-sommaire a { min-height: 44px; } }

/* Source et millésime, sous chaque bloc */
.sp-source { margin: 16px 0 0; max-width: 90ch; font-size: 13px; line-height: 18px; color: var(--sp-secondaire); }
.sp-corps p.sp-source { margin: 16px 0; }
.sp-corps section > p.sp-source:last-child { margin-bottom: 0; }
.sp-source strong { font-weight: 600; color: var(--sp-texte); }

/* Chiffres clés */
.sp-chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 16px; padding: 0; list-style: none; }
@media (min-width: 1024px) { .sp-chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.sp-chiffre { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px; background: #fff; border: 1px solid var(--sp-bord); border-radius: var(--r-md, 12px); box-shadow: var(--sh-2, 0 4px 16px rgba(15, 23, 42, .08)); }
.sp-chiffre__n { font-size: 22px; line-height: 30px; font-weight: 700; color: var(--c-text, #0F172A); font-variant-numeric: tabular-nums; }
.sp-chiffre__l { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--sp-texte); }
.sp-chiffre__s { font-size: 13px; line-height: 18px; color: var(--sp-secondaire); }
@media (min-width: 1024px) { .sp-chiffre { padding: 24px; } .sp-chiffre__n { font-size: 28px; line-height: 36px; } }

/* Tableaux : lisibles sans défilement. Sous 640 px chaque ligne devient une fiche, chaque cellule porte son libellé. */
.sp-cadre { margin: 0 0 16px; max-width: 960px; background: #fff; border: 1px solid var(--sp-bord); border-radius: var(--r-md, 12px); box-shadow: var(--sh-2, 0 4px 16px rgba(15, 23, 42, .08)); overflow: hidden; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; color: var(--sp-texte); }
.sp-table caption { padding: 12px 16px; text-align: left; font-size: 14px; line-height: 20px; font-weight: 700; color: var(--c-text, #0F172A); background: var(--c-bg, #F8FAFC); border-bottom: 1px solid var(--sp-bord); }
.sp-table th, .sp-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--sp-bord); }
.sp-table tbody tr:last-child > * { border-bottom: 0; }
.sp-table thead th { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--sp-secondaire); background: var(--c-bg, #F8FAFC); }
.sp-table tbody th { font-weight: 600; color: var(--c-text, #0F172A); }
.sp-table .sp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 639.98px) {
    .sp-table, .sp-table tbody, .sp-table tr, .sp-table th, .sp-table td { display: block; }
    .sp-table caption { display: block; }
    .sp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .sp-table tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--sp-bord); }
    .sp-table tbody tr:last-child { border-bottom: 0; }
    .sp-table tbody th, .sp-table tbody td { padding: 0; border: 0; }
    .sp-table tbody th { margin: 0 0 4px; font-size: 16px; line-height: 24px; }
    .sp-table tbody td { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
    .sp-table tbody td::before { content: attr(data-label); flex: 0 1 auto; font-size: 13px; line-height: 22px; font-weight: 600; color: var(--sp-secondaire); }
    .sp-table tbody td.sp-texte { display: block; }
    .sp-table tbody td.sp-texte::before { display: block; }
    .sp-table .sp-num { text-align: right; white-space: normal; }
}

/* Fiches (dispositifs, lignes, interlocuteurs) */
.sp-fiches { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0 0 16px; padding: 0; list-style: none; }
@media (min-width: 768px) { .sp-fiches { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
@media (min-width: 1280px) { .sp-fiches--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sp-fiche { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; background: #fff; border: 1px solid var(--sp-bord); border-radius: var(--r-md, 12px); box-shadow: var(--sh-2, 0 4px 16px rgba(15, 23, 42, .08)); }
@media (min-width: 1024px) { .sp-fiche { padding: 24px; } }
.sp-corps .sp-fiche h3 { margin: 0; }
.sp-corps .sp-fiche p { margin: 0; font-size: 15px; line-height: 22px; }
.sp-fiche__qui { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--sp-secondaire); }
.sp-fiche__pied { margin-top: auto; padding-top: 8px; font-size: 14px; line-height: 20px; }
.sp-corps .sp-fiche__pied a { display: inline-flex; align-items: center; min-height: 32px; }
@media (pointer: coarse), (max-width: 1023.98px) { .sp-corps .sp-fiche__pied a { min-height: 44px; } }

/* Étapes numérotées (démarches) */
.sp-etapes { margin: 0 0 16px; padding: 0; list-style: none; max-width: 960px; }
.sp-etape { position: relative; margin: 0 0 16px; padding: 16px 16px 16px 72px; background: #fff; border: 1px solid var(--sp-bord); border-radius: var(--r-md, 12px); box-shadow: var(--sh-2, 0 4px 16px rgba(15, 23, 42, .08)); scroll-margin-top: 96px; }
.sp-etape::before { content: attr(data-n); position: absolute; left: 16px; top: 16px; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 9999px; background: var(--sp-marque); color: #fff; font-size: 16px; line-height: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-corps .sp-etape h3 { margin: 0 0 8px; padding-top: 6px; }
.sp-corps .sp-etape p { margin: 0 0 8px; }
.sp-etape__qui { font-size: 14px; line-height: 20px; }
.sp-etape__liens { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 20px; }
.sp-corps .sp-etape__liens a { display: inline-flex; align-items: center; min-height: 32px; }
@media (pointer: coarse), (max-width: 1023.98px) { .sp-corps .sp-etape__liens a { min-height: 44px; } }
@media (max-width: 639.98px) { .sp-etape { padding: 64px 16px 16px; } .sp-corps .sp-etape h3 { padding-top: 0; } }

/* Avertissement (aides, démarches) */
.sp-avis { margin: 0 0 24px; padding: 16px; max-width: 90ch; border: 1px solid #93C5FD; border-radius: var(--r-sm, 8px); background: #DBEAFE; color: #1E3A8A; font-size: 15px; line-height: 22px; }
.sp-corps .sp-avis p { margin: 0; max-width: none; }
.sp-corps .sp-avis a { color: #1E3A8A; }

/* Contact, sources, voir aussi */
.sp-contact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin: 0 0 32px; padding: 24px; background: #fff; border: 1px solid #93C5FD; border-radius: var(--r-md, 12px); box-shadow: var(--sh-2, 0 4px 16px rgba(15, 23, 42, .08)); }
.sp-contact .ui-h2 { margin: 0 0 8px; }
.sp-coordonnees { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; font-size: 15px; line-height: 22px; color: var(--sp-texte); }
.sp-coordonnees div { display: flex; flex-wrap: wrap; gap: 0 8px; min-width: 0; }
.sp-coordonnees dt { font-weight: 600; color: var(--sp-secondaire); }
.sp-coordonnees dt::after { content: " :"; }
.sp-coordonnees dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sp-coordonnees a { display: inline-flex; align-items: center; min-height: 24px; }
@media (pointer: coarse), (max-width: 1023.98px) { .sp-coordonnees a { min-height: 44px; } .sp-coordonnees div { align-items: center; } }
.sp-actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; }
@media (max-width: 639.98px) { .sp-contact { padding: 16px; } .sp-actions, .sp-actions .ui-btn { width: 100%; } }
.sp-sources { margin: 0 0 32px; }
.sp-sources .ui-h2, .sp-voir .ui-h2 { margin: 0 0 16px; }
.sp-sources ol { margin: 0 0 16px; padding: 0 0 0 32px; list-style: decimal; max-width: 110ch; font-size: 14px; line-height: 20px; color: var(--sp-texte); }
.sp-sources li { margin: 0 0 4px; overflow-wrap: anywhere; }
.sp-sources a { display: inline; color: var(--sp-action); text-decoration: underline; text-underline-offset: 2px; }
@media (pointer: coarse), (max-width: 1023.98px) { .sp-sources li { margin-bottom: 0; } .sp-sources a { display: block; padding: 12px 0 0; min-height: 44px; } .sp-millesime { display: block; padding: 0 0 8px; } }
.sp-millesime { color: var(--sp-secondaire); }
.sp-dates { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--sp-texte); }
.sp-voir ul { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 22px; }
.sp-voir a { display: inline-flex; align-items: center; min-height: 32px; }
@media (pointer: coarse), (max-width: 1023.98px) { .sp-voir a { min-height: 44px; } }

/* #223 : navigation locale limitée aux pages sœurs du groupe — elle passe à la ligne au lieu de défiler horizontalement */
.sp-nav ul { width: auto; flex-wrap: wrap; }
/* sur mobile, la liste est repliée derrière un bouton « groupe · page affichée » (core/includes/nav_locale.html) */
@media (max-width: 639.98px) { .sp-nav { overflow: visible; } .sp-nav ul { display: none; flex-direction: column; padding: 8px 0 0; } .sp-nav.est-ouvert ul { display: flex; } .sp-nav a { width: 100%; } }
