/* =====================================================================
   SIG FIER II – géoportail plein écran (complète portail.css)
   ===================================================================== */
.page-geoportail { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.page-geoportail .messages { display: none; }
.page-geoportail .entete { padding-top: .35rem; padding-bottom: .35rem; box-shadow: 0 2px 8px rgba(22,36,79,.18); position: relative; z-index: 60; }
.page-geoportail .marque img { width: 36px; height: 36px; }
.nav-principale a.lien-geoportail { font-weight: 700; }

.gp { flex: 1; min-height: 0; display: grid; grid-template-columns: 400px 1fr; position: relative; }

/* ---------- Panneau ---------- */
.gp-panneau { display: flex; flex-direction: column; min-height: 0; background: var(--blanc); border-right: 1px solid var(--trait); position: relative; z-index: 10;
  box-shadow: 2px 0 12px rgba(22,36,79,.06); }
.gp-poignee { display: none; }
.gp-onglets { display: flex; gap: .25rem; padding: .5rem .6rem 0; border-bottom: 1px solid var(--trait); background: var(--blanc); }
.gp-onglets [role=tab] { flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--gris); background: none; border: 0; border-bottom: 3px solid transparent; padding: .65rem .3rem .6rem; cursor: pointer; border-radius: 6px 6px 0 0; }
.gp-onglets [role=tab]:hover { color: var(--bleu-fonce); background: var(--surface); }
.gp-onglets [role=tab][aria-selected=true] { color: var(--bleu); border-bottom-color: var(--bleu); }
.gp-onglets svg, .gp-bouton svg, .gp-icone svg, .gp-ctrl-ensemble svg, .gp-ctrl-position svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.gp-compteur { min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: var(--bleu); color: #fff; font-size: .75rem;
  display: inline-flex; align-items: center; justify-content: center; }
.gp-compteur[hidden] { display: none; }
.gp-sections { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.gp-bloc { padding: 1rem 1.1rem; border-bottom: 1px solid #EDF0F5; }
.gp-bloc h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); margin: 0 0 .6rem; }
.gp-aide { font-size: .85rem; color: var(--gris); margin: 0 0 .6rem; }
.gp-note { padding: 0 1.1rem 1.5rem; margin-top: .8rem; }
.gp-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }

/* Catalogue */
.gp-theme { border: 1px solid var(--trait); border-left: 4px solid var(--c); border-radius: 10px; margin-bottom: .6rem; background: var(--blanc); overflow: hidden; }
.gp-theme > summary { display: flex; align-items: center; gap: .55rem; padding: .7rem .8rem; cursor: pointer; list-style: none; font-weight: 600; }
.gp-theme > summary::-webkit-details-marker { display: none; }
.gp-theme > summary::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid var(--gris); border-bottom: 2px solid var(--gris);
  transform: rotate(45deg); margin-left: .3rem; transition: transform .15s; }
.gp-theme[open] > summary::after { transform: rotate(-135deg); }
.gp-theme-nom { flex: 1; }
.gp-theme-nb { font-size: .78rem; color: var(--gris); font-weight: 600; }
.gp-pastille-theme { width: .65rem; height: .65rem; border-radius: 50%; background: var(--c); flex: none; }
.gp-theme ul { list-style: none; margin: 0; padding: 0 .4rem .4rem; }
.gp-theme > .gp-aide { padding: 0 .9rem .7rem; margin: 0; }
.gp-carte-item { display: flex; align-items: center; gap: .4rem; padding: .15rem 0; }
.gp-interrupteur { flex: 1; display: flex; align-items: center; gap: .7rem; padding: .5rem .45rem; border-radius: 8px; cursor: pointer; min-width: 0; }
.gp-interrupteur:hover { background: var(--surface); }
.gp-interrupteur input { appearance: none; -webkit-appearance: none; flex: none; width: 2.3rem; height: 1.3rem; border-radius: 999px; background: #C9D0DC;
  position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.gp-interrupteur input::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.gp-interrupteur input:checked { background: var(--c, var(--bleu)); }
.gp-interrupteur input:checked::after { transform: translateX(1rem); }
.gp-interrupteur input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gp-carte-texte { display: flex; flex-direction: column; min-width: 0; }
.gp-carte-titre { font-size: .93rem; line-height: 1.3; }
.gp-carte-zone { font-size: .8rem; color: var(--gris); }
.gp-lien-fiche { font-size: .8rem; color: var(--bleu); padding: .3rem .5rem; border-radius: 6px; text-decoration: none; white-space: nowrap; }
.gp-lien-fiche:hover { background: var(--bleu-pale); }
.gp-reperes { list-style: none; margin: 0 0 .5rem; padding: 0; }
.gp-reperes .gp-interrupteur input { --c: var(--bleu-fonce); }
.gp-fond { border: 0; padding: 0; margin: .4rem 0 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.gp-fond legend { font-size: .85rem; color: var(--gris); margin-bottom: .35rem; padding: 0; width: 100%; }
.gp-fond label { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--trait); border-radius: 999px; padding: .3rem .8rem; cursor: pointer; font-size: .88rem; }
.gp-fond label:has(input:checked) { border-color: var(--bleu); background: var(--bleu-pale); color: var(--bleu-fonce); font-weight: 600; }
.gp-fond input { accent-color: var(--bleu); margin: 0; }

/* Couches affichées */
.gp-actives { list-style: none; margin: 0; padding: 0; }
.gp-actives li { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; border-radius: 8px; background: var(--surface); margin-bottom: .35rem; }
.gp-active-titre { flex: 1; font-size: .9rem; font-weight: 600; line-height: 1.25; }
.gp-icone { width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; border-radius: 6px;
  cursor: pointer; color: var(--gris); font-size: 1.25rem; line-height: 1; flex: none; }
.gp-icone:hover { background: #E2E7F0; color: var(--encre); }

/* Territoire */
.gp-recherche input { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid #A9B3C4; border-radius: 10px; background: var(--blanc); }
.gp-recherche input:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(43,81,151,.18); }
.gp-resultats { list-style: none; margin: .4rem 0 .6rem; padding: 0; }
.gp-resultats [data-i] { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem .6rem; border-radius: 8px; cursor: pointer; }
.gp-resultats [data-i]:hover, .gp-resultats [data-i]:focus { background: var(--bleu-pale); outline: none; }
.gp-res-nom { font-weight: 600; }
.gp-res-type { font-size: .8rem; color: var(--gris); text-align: right; }
.gp-bouton { display: inline-flex; align-items: center; gap: .5rem; font: inherit; font-size: .92rem; font-weight: 600; border-radius: 10px; padding: .6rem .9rem; cursor: pointer; }
.gp-bouton-ligne { width: 100%; justify-content: center; border: 1px solid var(--bleu); color: var(--bleu); background: var(--blanc); margin: .3rem 0 .5rem; }
.gp-bouton-ligne:hover { background: var(--bleu-pale); }
.gp-arbre .gp-region { border-bottom: 1px solid #EDF0F5; }
.gp-arbre summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .2rem; cursor: pointer; list-style: none; }
.gp-arbre summary::-webkit-details-marker { display: none; }
.gp-arbre ul { list-style: none; margin: 0 0 .5rem; padding: 0 0 0 .9rem; border-left: 2px solid var(--bleu-pale); }
.gp-arbre li { display: flex; justify-content: space-between; align-items: center; padding: .25rem .2rem; }
.gp-lien { font: inherit; border: 0; background: none; color: var(--bleu-fonce); font-weight: 600; cursor: pointer; padding: .15rem 0; text-align: left; }
.gp-lien:hover { color: var(--bleu); text-decoration: underline; }

/* Chiffres clés */
.gp-surtitre { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); }
.gp-titre-territoire { font-size: 1.25rem !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--bleu-fonce) !important; margin: .1rem 0 .9rem !important; }
.gp-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.gp-kpi { position: relative; border: 1px solid var(--trait); border-radius: 12px; padding: .75rem .8rem .8rem; background: var(--blanc); display: flex; flex-direction: column; gap: .15rem;
  border-top: 4px solid var(--c, var(--bleu)); }
.gp-kpi:first-child { grid-column: 1 / -1; }
.gp-kpi-lib { font-size: .8rem; color: var(--gris); font-weight: 600; }
.gp-kpi strong { font-size: 1.75rem; line-height: 1.1; color: var(--encre); font-variant-numeric: tabular-nums; }
.gp-kpi:first-child strong { font-size: 2.2rem; }
.gp-kpi-sous { font-size: .8rem; color: var(--gris); }
.gp-kpi-detail { list-style: none; margin: .45rem 0 0; padding: .45rem 0 0; border-top: 1px dashed var(--trait); font-size: .82rem; }
.gp-kpi-detail li { display: flex; justify-content: space-between; gap: .5rem; padding: .1rem 0; }
.gp-kpi-detail b { font-variant-numeric: tabular-nums; }
.gp-kpi-carte { align-self: flex-start; margin-top: .45rem; font: inherit; font-size: .8rem; font-weight: 600; color: var(--bleu); background: var(--bleu-pale);
  border: 0; border-radius: 999px; padding: .25rem .65rem; cursor: pointer; }
.gp-kpi-carte:hover { background: #D3DEF0; }
.gp-kpi-neutre { --c: #9AA4B5; }
.gp-kpi-indispo strong, .gp-kpi-attente strong { color: #9AA4B5; }
.gp-entete-bloc { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.gp-entete-bloc h2 { margin: 0; }
.gp-entete-bloc select { font: inherit; font-size: .85rem; padding: .3rem .5rem; border: 1px solid var(--trait); border-radius: 8px; background: var(--blanc); }
.gp-barres { list-style: none; margin: 0; padding: 0; }
.gp-barre { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .15rem .6rem; font: inherit; text-align: left; border: 0; background: none;
  padding: .35rem .3rem; border-radius: 8px; cursor: pointer; color: var(--encre); }
.gp-barre:hover:not([disabled]) { background: var(--surface); }
.gp-barre[disabled] { cursor: default; }
.gp-barre-nom { font-size: .88rem; }
.gp-barre-val { font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.gp-barre-fond { grid-column: 1 / -1; height: .45rem; border-radius: 999px; background: #EDF0F5; overflow: hidden; }
.gp-barre-fond span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--bleu), #5C7FC4); }

/* ---------- Carte ---------- */
.gp-carte { position: relative; min-height: 0; background: #EEF1F5; }
.gp-carte.gp-fond-osm { background: #F2EFE9; }
.gp-carte:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.gp-pastille { position: absolute; top: .75rem; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: .3rem;
  background: var(--bleu-fonce); color: #fff; border-radius: 999px; padding: .35rem .4rem .35rem .95rem; box-shadow: 0 4px 14px rgba(22,36,79,.3); font-size: .9rem; font-weight: 600; max-width: calc(100% - 7rem); }
.gp-pastille[hidden] { display: none; }
.gp-pastille-texte { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-pastille button { border: 0; background: rgba(255,255,255,.18); color: #fff; width: 1.6rem; height: 1.6rem; border-radius: 50%; cursor: pointer; font-size: 1.1rem; line-height: 1; flex: none; }
.gp-pastille button:hover { background: rgba(255,255,255,.32); }
.gp-carte .alerte { top: 3.6rem; }
.gp-legende { position: absolute; right: .75rem; bottom: 2.4rem; z-index: 5; width: 260px; max-height: 55%; display: flex; flex-direction: column;
  background: rgba(255,255,255,.97); border: 1px solid var(--trait); border-radius: 12px; box-shadow: 0 6px 20px rgba(22,36,79,.16); overflow: hidden; padding: 0; margin: 0; }
.gp-legende.vide { display: none; }
.gp-legende-titre { display: flex; justify-content: space-between; align-items: center; font: inherit; font-weight: 700; font-size: .9rem; color: var(--encre);
  background: none; border: 0; padding: .6rem .8rem; cursor: pointer; text-align: left; }
.gp-legende-titre::after { content: ""; width: .45rem; height: .45rem; border-right: 2px solid var(--gris); border-bottom: 2px solid var(--gris); transform: rotate(-135deg); margin-top: .2rem; }
.gp-legende.ferme .gp-legende-titre::after { transform: rotate(45deg); margin-top: -.2rem; }
.gp-legende-contenu { overflow-y: auto; padding: 0 .8rem .7rem; }
.gp-legende.ferme .gp-legende-contenu { display: none; }
.gp-legende figure { margin: 0 0 .5rem; }
.gp-legende figcaption { font-size: .8rem; font-weight: 600; margin-bottom: .15rem; }
.gp-legende img { display: block; max-width: 100%; }

.page-geoportail .ol-zoom { top: .75rem; left: .75rem; }
.gp-ctrl-ensemble { top: 5.1rem; left: .75rem; }
.gp-ctrl-position { top: 7.4rem; left: .75rem; }
.gp-ctrl-export { top: 9.7rem; left: .75rem; }
.gp-ctrl-export svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gp-export-menu { position: absolute; left: 2.6rem; top: 0; min-width: 11rem; background: var(--blanc); border-radius: 10px; padding: .35rem;
  box-shadow: 0 4px 14px rgba(22,36,79,.22); }
.page-geoportail .gp-ctrl-export .gp-export-menu button { width: 100%; height: auto; justify-content: flex-start; font-size: .9rem; font-weight: 600; padding: .5rem .7rem;
  margin: 0 0 2px; box-shadow: none; border-radius: 7px; white-space: nowrap; }
.page-geoportail .gp-ctrl-export .gp-export-menu button:disabled { opacity: .55; cursor: wait; }
.gp-export-etat { margin: .2rem .4rem .1rem; font-size: .78rem; color: var(--gris); }
.gp-export-etat:empty { display: none; }
.page-geoportail .ol-control { background: transparent; padding: 0; }
.page-geoportail .ol-control button { width: 2.25rem; height: 2.25rem; margin: 0 0 2px; border-radius: 8px; font-size: 1.25rem;
  background: var(--blanc) !important; color: var(--bleu-fonce) !important; box-shadow: 0 2px 6px rgba(22,36,79,.2); display: flex; align-items: center; justify-content: center; }
.page-geoportail .ol-control button:hover { background: var(--bleu-pale) !important; }
.page-geoportail .ol-zoom .ol-zoom-in { border-radius: 8px 8px 0 0; }
.page-geoportail .ol-zoom .ol-zoom-out { border-radius: 0 0 8px 8px; }
.page-geoportail .ol-scale-line { left: .75rem; bottom: .75rem; }
.page-geoportail .ol-attribution button { width: 1.6rem; height: 1.6rem; font-size: .9rem; }

/* ---------- Mobile : panneau en feuille glissante sur la carte ---------- */
@media (max-width: 820px) {
  .page-geoportail .entete { padding: .3rem .75rem; flex-wrap: nowrap; }
  .gp { grid-template-columns: 1fr; }
  .gp-carte { grid-row: 1; grid-column: 1; }
  .gp-panneau { grid-row: 1; grid-column: 1; position: absolute; left: 0; right: 0; bottom: 0; border-right: 0; border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 24px rgba(22,36,79,.22); height: 46%; transition: height .25s ease; }
  .gp-panneau[data-etat=reduit] { height: 7.2rem; }
  .gp-panneau[data-etat=plein] { height: 88%; }
  .gp-poignee { display: flex; justify-content: center; align-items: center; height: 1.4rem; border: 0; background: none; cursor: pointer; padding: 0; flex: none; }
  .gp-poignee span { width: 2.6rem; height: .3rem; border-radius: 999px; background: #C3CAD6; }
  .gp-onglets { padding-top: 0; }
  .gp-onglets [role=tab] { font-size: .82rem; flex-direction: column; gap: .15rem; padding: .4rem .2rem .45rem; }
  .gp-onglets [role=tab] .gp-compteur { position: absolute; margin: -.2rem 0 0 2.2rem; }
  .gp-onglets [role=tab] { position: relative; }
  .gp-legende { top: .75rem; right: .75rem; bottom: auto; width: min(240px, 60vw); max-height: 40%; }
  .gp-pastille { top: auto; bottom: calc(46% + .75rem); transition: bottom .25s ease; }
  .gp-panneau[data-etat=reduit] ~ .gp-carte .gp-pastille { bottom: calc(7.2rem + .75rem); }
  .page-geoportail .ol-scale-line { display: none; }
  .gp-kpi strong { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .gp-panneau, .gp-interrupteur input, .gp-interrupteur input::after { transition: none; } }


/* Légende dessinée par le portail (cercles proportionnels à leur vraie taille) */
.legende-cercles { list-style: none; margin: .2rem 0 0; padding: 0; }
.legende-cercles li { display: flex; align-items: center; gap: .5rem; min-height: 1.2rem; font-size: .8rem; line-height: 1.1; }
.legende-cercles svg { flex: none; display: block; }
.legende-note { font-size: .75rem; color: var(--gris); margin: .3rem 0 0; }
