/* Styles of the public map, taken from the demonstrator's modele.html (ADR 0003).
   Fonts served by the application (static/vendor/fonts, SIL OFL 1.1): no request to Google Fonts. */
@font-face{font-family:"Lexend";font-style:normal;font-weight:400;font-display:swap;src:url(/static/vendor/fonts/lexend-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"Lexend";font-style:normal;font-weight:500;font-display:swap;src:url(/static/vendor/fonts/lexend-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:"Lexend";font-style:normal;font-weight:600;font-display:swap;src:url(/static/vendor/fonts/lexend-latin-600-normal.woff2) format("woff2")}
@font-face{font-family:"Public Sans";font-style:normal;font-weight:400;font-display:swap;src:url(/static/vendor/fonts/public-sans-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"Public Sans";font-style:normal;font-weight:500;font-display:swap;src:url(/static/vendor/fonts/public-sans-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:"Public Sans";font-style:normal;font-weight:600;font-display:swap;src:url(/static/vendor/fonts/public-sans-latin-600-normal.woff2) format("woff2")}

/* Layout: header with logo and title, figure tiles (the service tiles are filters), then IGN map and search/card panel. */
:root{
  --petrol:#033b4f; --turquoise:#14bad0; --mint:#98e3c9;
  --bg:#f4f8f9; --surface:#ffffff; --fg:#0d2530; --muted:#55707b; --line:#d6e3e7;
  --accent:#033b4f; --accent-soft:#e2f3f5; --brand2:#0e9fb3;
  --pcs:#1f5fbf; --pics:#0e9fb3; --dicrim:#d9951a; --exercice:#e0522b; --exinter:#7b4bb7;
  --off:#8a97a8; --land:#e6eef0; --logo-bg:transparent; --logo-pad:0;
  --sea:#d7e6ec; --landfill:#fbfcfc; --ink:#22343c; --halo:#ffffff;
  --f-display:"Lexend", "Segoe UI", system-ui, sans-serif;
  --f-body:"Public Sans", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#071a22; --surface:#0d2530; --fg:#e4f1f4; --muted:#93afb8; --line:#1d3a46;
  --accent:#14bad0; --accent-soft:#103644; --brand2:#14bad0;
  --pcs:#5b93e6; --pics:#22c3d8; --dicrim:#f0b445; --exercice:#f07a57; --exinter:#a77fe0;
  --off:#6b7d8c; --land:#163340; --logo-bg:#f4f8f9; --logo-pad:6px 8px; color-scheme:dark;
  --sea:#0a1f29; --landfill:#173544; --ink:#d6e6eb; --halo:#0a1f29;
}}
:root[data-theme="dark"]{
  --bg:#071a22; --surface:#0d2530; --fg:#e4f1f4; --muted:#93afb8; --line:#1d3a46;
  --accent:#14bad0; --accent-soft:#103644; --brand2:#14bad0;
  --pcs:#5b93e6; --pics:#22c3d8; --dicrim:#f0b445; --exercice:#f07a57; --exinter:#a77fe0;
  --off:#6b7d8c; --land:#163340; --logo-bg:#f4f8f9; --logo-pad:6px 8px; color-scheme:dark;
  --sea:#0a1f29; --landfill:#173544; --ink:#d6e6eb; --halo:#0a1f29;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{background:var(--bg);color:var(--fg);font-family:var(--f-body);font-size:15px;line-height:1.5;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:20px 40px}
.wrap{max-width:1280px;margin:0 auto;display:flex;flex-direction:column;gap:20px}
h1,h2,h3{font-family:var(--f-display);text-wrap:balance;margin:0;line-height:1.2;font-weight:600}
h1{font-size:clamp(24px,3.2vw,34px);color:var(--accent);letter-spacing:-.01em}
h3{font-size:19px}
.eyebrow{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:600}
.num{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}

/* header */
header{display:flex;flex-direction:column;gap:14px}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none}
.brand img{width:64px;height:auto;display:block;box-sizing:content-box;background:var(--logo-bg);border-radius:10px;padding:var(--logo-pad)}
.brand-txt{display:flex;flex-direction:column;line-height:1.05;font-family:var(--f-display)}
.brand-txt b{font-size:26px;font-weight:500;color:var(--accent)}
.brand-txt span{font-size:14px;font-weight:500;color:var(--brand2)}
.intro{display:flex;flex-direction:column;gap:6px}
.intro p{margin:0;color:var(--muted);max-width:72ch}

/* figures */
.stats{display:flex;flex-direction:column;gap:10px}
.grid{display:grid;gap:1px;background:var(--line);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.g6{grid-template-columns:repeat(6,minmax(0,1fr))}
@media (max-width:980px){.g6{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:600px){.g4,.g6{grid-template-columns:repeat(2,minmax(0,1fr))}}
.kpi{background:var(--surface);padding:14px 16px;display:flex;flex-direction:column;gap:4px;text-align:left;font:inherit;color:inherit;border:0;min-width:0}
.kpi b{font-family:var(--f-display);font-size:30px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums}
.kpi span{color:var(--muted);font-size:13px;line-height:1.35}
button.kpi{cursor:pointer;position:relative}
button.kpi:hover{background:var(--accent-soft)}
button.kpi[aria-pressed="true"]{background:var(--accent-soft);box-shadow:inset 0 -3px 0 var(--c,var(--accent))}
button.kpi .sw{display:inline-block;width:10px;height:10px;border-radius:3px;background:var(--c);margin-right:6px}
button.kpi b{color:var(--c,var(--fg))}
.hint{font-size:13px;color:var(--muted);margin:0}
.scope{margin:0;font-family:var(--f-display);font-size:15px;font-weight:500;color:var(--brand2)}
:focus-visible{outline:2px solid var(--brand2);outline-offset:2px}

/* map and panel */
.main{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:16px;align-items:start}
@media (max-width:900px){.main{grid-template-columns:minmax(0,1fr)}}
.mapbox{position:relative;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--land)}
#map{height:clamp(420px,72vh,740px);width:100%;background:var(--land)}
.mapmsg{padding:24px;color:var(--muted)}
.leaflet-container{font-family:var(--f-body)}
/* IGN basemaps in greys, to leave the colours to the services */
.base-plan .leaflet-tile-pane{filter:grayscale(1) contrast(.92) brightness(1.03)}
.base-photo .leaflet-tile-pane{filter:grayscale(1) contrast(.9) brightness(.95)}
.leaflet-container.base-plan{background:#eef0f1}
.basemaps{position:absolute;z-index:1000;top:10px;left:10px;display:flex;background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:3px;gap:2px;box-shadow:0 1px 4px rgba(0,0,0,.12)}
.basemaps button{font:inherit;font-size:13px;font-weight:500;border:0;background:transparent;color:var(--fg);padding:5px 10px;border-radius:6px;cursor:pointer}
.basemaps button[aria-pressed="true"]{background:var(--accent);color:var(--surface)}
.legend{position:absolute;z-index:1000;left:10px;bottom:22px;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-size:12px;display:flex;flex-direction:column;gap:3px;color:var(--fg);box-shadow:0 1px 4px rgba(0,0,0,.12);max-width:calc(100% - 20px)}
.legend div{display:flex;align-items:center;gap:6px}
.legend i{width:11px;height:11px;border-radius:3px;display:inline-block;flex:none}
.leaflet-tooltip{font-family:var(--f-body);font-size:13px}

.panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:14px;min-width:0}
.panel label{font-size:13px;color:var(--muted);font-weight:500;display:block;margin-bottom:4px}
.panel input,.panel select{width:100%;font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--fg)}
.results{list-style:none;margin:0;padding:0;max-height:260px;overflow:auto;border:1px solid var(--line);border-radius:8px}
.results li.h{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);padding:7px 10px 3px;font-weight:600;background:var(--bg)}
.results li button{all:unset;display:flex;justify-content:space-between;gap:8px;width:100%;box-sizing:border-box;padding:7px 10px;cursor:pointer;font-size:14px}
.results li button:hover,.results li button:focus-visible{background:var(--accent-soft)}
.results small{color:var(--muted);text-align:right;flex:none}
.detail{border-top:1px solid var(--line);padding-top:14px;display:flex;flex-direction:column;gap:12px}
.detail .empty{color:var(--muted);font-size:14px;margin:0}
.facts{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;font-size:14px;margin:0}
.facts dt{color:var(--muted)}
.facts dd{margin:0;min-width:0}
.badges{display:flex;flex-wrap:wrap;gap:6px}
.badge{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;padding:3px 9px;border-radius:6px;border:1px solid var(--c);color:var(--c);background:var(--surface)}
.badge span{font-weight:400;color:var(--fg)}
.link{all:unset;color:var(--brand2);font-weight:600;font-size:14px;cursor:pointer}
.link:hover{text-decoration:underline}
.clist{display:flex;flex-wrap:wrap;gap:4px 6px;max-height:180px;overflow:auto;font-size:13px}
.clist button{all:unset;cursor:pointer;color:var(--fg);border-bottom:1px dotted var(--muted)}
.clist button:hover{color:var(--brand2)}
footer{color:var(--muted);font-size:12px;display:flex;flex-wrap:wrap;gap:4px 16px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
