/* =====================================================================
   Pages « Grands projets » (#197). Complète core/css/simplanter.css (#184) : mêmes jetons, grille de 8 px,
   corps 16/24, rien sous 12 px, cibles tactiles de 44 px, aucun débordement horizontal.
   ===================================================================== */

/* Navigation locale des pages « Grands projets » : défile dans son cadre sur petit écran */
.gp-nav { margin: -16px 0 32px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.gp-nav ul { display: flex; gap: 8px; margin: 0; padding: 4px; list-style: none; width: max-content; }
.gp-nav a { display: inline-flex; align-items: center; min-height: var(--tap, 40px); padding: 0 12px; border-radius: var(--r-sm, 8px); color: var(--c-action, #0066CC);
    font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.gp-nav a:hover { background: var(--c-bg-2, #F1F5F9); }
.gp-nav a[aria-current="page"] { background: var(--c-brand-soft, #DBEAFE); color: var(--c-text, #0F172A); }
.gp-nav a:focus-visible { outline: 2px solid var(--ui-focus, #1D4ED8); outline-offset: 2px; }
@media (pointer: coarse), (max-width: 1023.98px) { .gp-nav a { min-height: 44px; } }

.gp-note-langue { margin: 0 0 24px; }
.gp-appel { margin: 0 0 32px; }
.gp-suite { margin-top: 16px; }

/* Chiffres : la valeur peut passer sur deux lignes (« plus de 23 millions »), la source est un lien */
.gp-figs .si-fig__n { white-space: normal; overflow-wrap: anywhere; font-size: 22px; line-height: 28px; }
@media (min-width: 1024px) { .gp-figs .si-fig__n { font-size: 26px; line-height: 32px; } }
.gp-figs .si-fig__s { margin-top: auto; padding-top: 4px; overflow-wrap: anywhere; }
.gp-figs .si-fig__s a, .gp-src a, .gp-sources a { color: var(--c-action, #0066CC); }
.gp-figs .si-fig__l { overflow-wrap: anywhere; }
@media (max-width: 479.98px) { .gp-figs { grid-template-columns: minmax(0, 1fr); } }

/* Listes de faits rédigés, source entre parenthèses */
.gp-liste { margin: 0; padding: 0 0 0 20px; font-size: 16px; line-height: 24px; color: var(--c-text-body, #1E293B); }
.gp-liste li { margin: 0 0 12px; overflow-wrap: anywhere; }
.gp-liste li:last-child { margin-bottom: 0; }
.gp-src, .gp-millesime { font-size: 13px; line-height: 18px; color: var(--c-text-2, #475569); }

/* Sources en pied de page */
.gp-sources ol { margin: 0; padding: 0 0 0 24px; font-size: 14px; line-height: 20px; color: var(--c-text-body, #1E293B); }
.gp-sources li { margin: 0 0 8px; overflow-wrap: anywhere; }

/* Bloc contact de bas de page */
.gp-contact__carte { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; border-color: #93C5FD; }
.gp-contact__carte .si-lead, .gp-contact__carte .si-actions { margin: 8px 0 0; }
.gp-contact__carte > div { min-width: 0; flex: 1 1 320px; }
@media (max-width: 639.98px) { .gp-contact__carte .ui-btn, .gp-appel .ui-btn { width: 100%; } }

/* Interlocuteur (affiché seulement quand le CEEVO l'a fourni) */
.gp-interlocuteur__nom { margin: 8px 0 0; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--c-text, #0F172A); }
.gp-interlocuteur__nom span { display: block; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--c-text-2, #475569); }

/* Formulaire de projet confidentiel */
.gp-projet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 16px; }
@media (min-width: 1024px) { .gp-projet { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.gp-form { display: flex; flex-direction: column; gap: 24px; }
.gp-form__bloc { display: flex; flex-direction: column; gap: 16px; border: 0; margin: 0; padding: 0; min-width: 0; }
.gp-form__bloc > legend { padding: 0; margin: 0 0 16px; }
.gp-form__ligne { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .gp-form__ligne { grid-template-columns: repeat(3, minmax(0, 1fr)); } .gp-form__ligne--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gp-form__surface { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; align-items: end; }
.gp-form textarea.ui-input { min-height: 144px; padding-top: 8px; padding-bottom: 8px; resize: vertical; }
.gp-form .ui-label { margin-bottom: 0; }
.gp-facultatif { font-weight: 400; color: var(--c-text-2, #475569); }
.gp-erreur { margin: 0; font-size: 13px; line-height: 18px; color: #B91C1C; font-weight: 600; }
.gp-champ--erreur .ui-input { border-color: #B91C1C; }
.gp-case { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; font-size: 14px; line-height: 20px; color: var(--c-text-body, #1E293B); cursor: pointer; }
.gp-case input { flex-shrink: 0; width: 20px; height: 20px; margin: 2px 0 0; }
.gp-captcha img { display: block; margin: 0 0 8px; border: 1px solid var(--c-border, #E2E8F0); border-radius: var(--r-sm, 8px); max-width: 100%; height: auto; }
.gp-captcha input[type="text"] { width: 100%; max-width: 240px; min-height: var(--tap, 40px); border: 1px solid var(--c-border-field, #94A3B8); border-radius: var(--r-sm, 8px); padding: 0 12px; font-size: 16px; }
.gp-captcha input[type="text"]:focus { outline: 2px solid var(--ui-focus, #1D4ED8); outline-offset: 2px; }
.gp-confidentialite .ui-h3 { display: flex; align-items: center; gap: 8px; }
.gp-confidentialite ul { margin: 16px 0; padding: 0 0 0 20px; font-size: 14px; line-height: 20px; color: var(--c-text-body, #1E293B); }
.gp-confidentialite li { margin: 0 0 8px; }

/* Grands terrains */
.gp-tranche { display: flex; align-items: center; gap: 8px; margin: 24px 0 16px; }
.gp-corps .si-table th[scope="row"] { overflow-wrap: anywhere; min-width: 200px; }
@media (max-width: 767.98px) { .gp-corps .si-table--cards .si-num { text-align: left; } .gp-corps .si-table th[scope="row"] { min-width: 0; } }

/* Étapes d'un grand projet */
.gp-avertissement { margin: 0 0 24px; background: #FEF3C7; border-color: #FCD34D; color: #78350F; }
.gp-etapes { counter-reset: etape; display: grid; gap: 16px; margin: 0 0 32px; padding: 0; list-style: none; }
.gp-etapes > li { counter-increment: etape; position: relative; padding-left: 64px; scroll-margin-top: 96px; }
.gp-etapes > li::before { content: counter(etape); position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; border-radius: 9999px; background: var(--c-brand, #1853A2); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; }
@media (min-width: 1024px) { .gp-etapes > li { padding-left: 80px; } .gp-etapes > li::before { left: 24px; top: 24px; } }
.gp-etapes p { margin: 8px 0 0; max-width: 80ch; font-size: 16px; line-height: 24px; color: var(--c-text-body, #1E293B); overflow-wrap: anywhere; }
.gp-etapes .gp-acteur { font-size: 14px; line-height: 20px; color: var(--c-text-2, #475569); }
.gp-etapes .ui-source { font-size: 13px; line-height: 18px; margin-top: 16px; }
/* Présentation par thèmes (#197, audits juridiques) : pas de numéro, l'ordre n'est pas une chronologie. */
.gp-etapes--themes { margin-bottom: 0; }
.gp-etapes--themes > li { counter-increment: none; padding-left: 16px; }
.gp-etapes--themes > li::before { content: none; }
@media (min-width: 1024px) { .gp-etapes--themes > li { padding-left: 24px; } }
.gp-etapes h3 { margin: 0; overflow-wrap: anywhere; }
.gp-etapes ul { margin: 8px 0 0; padding-left: 24px; max-width: 80ch; font-size: 16px; line-height: 24px; color: var(--c-text-body, #1E293B); }
.gp-etapes ul li { margin: 0 0 4px; overflow-wrap: anywhere; }
.gp-theme > .ui-h2 { margin-bottom: 16px; }
.gp-ordre { margin: 0 0 32px; overflow-wrap: anywhere; }
.gp-ordre__titre { margin: 0 0 8px; font-size: 16px; line-height: 24px; font-weight: 700; color: inherit; }
.gp-ordre p { margin: 0; }
.gp-ordre li { margin: 0 0 4px; }
.gp-ordre a, .gp-role a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.gp-role { margin: 0 0 32px; }

/* Frise des projets publics */
.gp-frise { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; border-left: 2px solid #93C5FD; }
.gp-frise > li { position: relative; margin-left: 24px; }
.gp-frise > li::before { content: ""; position: absolute; left: -33px; top: 24px; width: 16px; height: 16px; border-radius: 9999px; background: var(--c-brand, #1853A2); border: 3px solid #fff; box-shadow: 0 0 0 1px #93C5FD; }
.gp-frise__date { margin: 0 0 4px; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--c-brand, #1853A2); font-variant-numeric: tabular-nums; }
.gp-frise p { margin: 8px 0 0; font-size: 16px; line-height: 24px; color: var(--c-text-body, #1E293B); overflow-wrap: anywhere; }
.gp-ecart { margin-top: 8px; padding: 8px 12px; border-radius: var(--r-sm, 8px); background: #FEF3C7; color: #78350F; font-size: 14px; line-height: 20px; }

/* Cartes (population à proximité, projets publics) */
.gp-carte { position: relative; z-index: 0; isolation: isolate; aspect-ratio: 4 / 3; border: 1px solid var(--c-border, #E2E8F0); border-radius: var(--r-md, 12px); overflow: hidden; background: #E2E8F0; }
@media (min-width: 1024px) { .gp-carte { aspect-ratio: 16 / 9; } }
.gp-carte > div { position: absolute; inset: 0; }
.gp-carte .leaflet-container { font-family: inherit; }
@media (pointer: coarse), (max-width: 1023.98px) { .gp-carte .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; } }
.gp-points { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.gp-points button { min-height: 44px; padding: 0 16px; border-radius: 9999px; border: 1px solid #CBD5E1; background: #fff; color: var(--c-text-body, #1E293B); font-size: 14px; font-weight: 600; cursor: pointer; }
.gp-points button[aria-pressed="true"] { background: var(--c-brand, #1853A2); border-color: var(--c-brand, #1853A2); color: #fff; }
.gp-points button:focus-visible { outline: 2px solid var(--ui-focus, #1D4ED8); outline-offset: 2px; }

/* Fiches (terrain prêt, cas réel) */
.gp-fiche { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gp-citation blockquote { margin: 0; font-size: 18px; line-height: 28px; color: var(--c-text, #0F172A); }
.gp-citation figcaption { margin-top: 8px; font-size: 14px; line-height: 20px; color: var(--c-text-2, #475569); }

/* Renvoi vers « Grands projets » depuis les fiches de commune et d'intercommunalité */
.gp-renvoi { margin: 24px 0 0; }

/* Un lien-bouton long passe à la ligne plutôt que de déborder */
.gp-corps .ui-btn--link, .gp-voir .ui-btn--link { max-width: 100%; white-space: normal; text-align: left; }

/* Un lien dans une phrase se reconnaît sans la couleur : il est souligné */
.gp-src a, .gp-corps .ui-source a, .gp-liste a, .gp-sources a, .gp-frise a, .gp-etapes a, .gp-confidentialite a, .gp-corps .si-lead a { text-decoration: underline; text-underline-offset: 2px; }
