/* Carte marine illustrée (ADR 0002) : se charge après style.css et en reprend la mise en page, avec l'habillage de la carte. */
@font-face { font-family: 'IM Fell'; src: url(fonts/IMFeENrm28P.ttf); font-display: swap; }
@font-face { font-family: 'IM Fell'; font-style: italic; src: url(fonts/IMFeENit28P.ttf); font-display: swap; }
@font-face { font-family: 'IM Fell SC'; src: url(fonts/IMFeENsc28P.ttf); font-display: swap; }

:root {
  --ink: #3a2a1e;        /* encre brune */
  --navy: #3a2a1e;
  --red: #9c2a20;        /* rouge des caps et du titre */
  --paper: #eee2c6;      /* parchemin */
  --card: #f2ead4;       /* cartouche */
  --wash: #e3d4b0;
  --hand: 'IM Fell', Georgia, serif;
  --text: 'IM Fell', Georgia, serif;
  --sketch: 2px;
  --filet: 0 0 0 3px var(--card), 0 0 0 4.5px var(--ink);   /* double filet, comme le cartouche */
}

.leaflet-bar { border: 1.5px solid var(--ink) !important; border-radius: 2px !important; box-shadow: var(--filet) !important; }
.leaflet-bar a { background: var(--card); }
.leaflet-control-attribution { background: rgba(242, 234, 212, .9) !important; font-style: italic; }
.son button { background: var(--card); }

.top h1 {
  font-style: italic; color: var(--red); background: var(--card);
  border: 1.5px solid var(--ink); box-shadow: var(--filet); margin: 5px 5px 0;
}
.top h1 span { font-family: 'IM Fell SC', Georgia, serif; font-style: normal; color: var(--ink); letter-spacing: .06em; }
#q { background: var(--card); border: 1.5px solid var(--ink); box-shadow: var(--filet); margin: 0 5px; width: calc(100% - 10px); }
#q:focus { box-shadow: var(--filet), 0 0 0 7px rgba(156, 42, 32, .18); }
#results { background: var(--card); border: 1.5px solid var(--ink); border-radius: 2px; margin: 10px 5px 0; }
#results li { border-radius: 2px; }
#results li small { font-style: italic; }
#hint { font-style: italic; background: rgba(242, 234, 212, .95); border: 1.5px solid var(--ink); box-shadow: var(--filet); }

#backdrop { background: rgba(58, 42, 30, .12); }
#fiche { transform: translate(-50%, -50%); background: var(--card); border: 1.5px solid var(--ink); border-radius: 2px; box-shadow: var(--filet), 6px 8px 18px rgba(58, 42, 30, .25); }
#f-kind { font-family: 'IM Fell SC', Georgia, serif; color: var(--red); letter-spacing: .08em; }
#f-name { font-style: italic; color: var(--ink); }
#f-img { border: 1.5px solid var(--ink); border-radius: 2px; }
#f-text { color: var(--ink); }
#f-fig a, #f-more a, #f-share a { color: var(--red); }
#f-coord, #f-share { font-style: italic; }
@media (max-width: 640px) { #fiche { transform: none; border-radius: 2px 2px 0 0; box-shadow: 0 -2px 0 var(--card), 0 -3.5px 0 var(--ink); } }

#ouverture p { font-style: italic; color: var(--red); }
#ouverture span { font-family: 'IM Fell SC', Georgia, serif; font-style: normal; color: var(--ink); }
#ouverture .route { stroke: var(--ink); opacity: .6; }

/* Ambiance : bateaux et mouettes à l'encre brune ; les vaguelettes sont dessinées par le shader (mer-marine.js) */
.ambiance .halo { stroke: var(--paper); }
.ambiance .voile { fill: #f6eed8; }
.vague { display: none; }
#nuage stop { stop-color: #3a2a1e; }

/* Fiche : tiroir latéral qui laisse la carte visible et explorable (pas de fond grisé) ; en bas sur téléphone */
#backdrop { display: none; }
#f-portee { font-style: italic; color: var(--red); }
@media (min-width: 641px) {
  #fiche { top: 0; right: 0; bottom: 0; left: auto; transform: none; width: min(400px, 100vw); max-height: none; border-width: 0 0 0 1.5px; box-shadow: -3px 0 0 var(--card), -4.5px 0 0 var(--ink), -6px 0 18px rgba(58, 42, 30, .25); }
  body:has(#fiche:not([hidden])) .leaflet-right { right: min(400px, 100vw); }
}
@media (max-width: 640px) { #fiche { max-height: 50vh; } }

/* Réglages */
.reglages { background: var(--card); }
.reglages button { display: block; width: 30px; height: 30px; padding: 0; border: 0; background: var(--card); color: var(--ink); cursor: pointer; font-size: 18px; line-height: 30px; }
.reglages button:hover { background: var(--wash); }
.reglages button:focus-visible, .reglages input:focus-visible { outline: 2px solid var(--red); outline-offset: -3px; }
.reglages fieldset { margin: 0; padding: 6px 12px 10px; border: 0; border-top: 1.5px solid var(--ink); background: var(--card); font: 16px var(--text); color: var(--ink); }
.reglages legend { float: left; width: 100%; margin-bottom: 4px; font-family: 'IM Fell SC', Georgia, serif; color: var(--red); letter-spacing: .06em; }
.reglages label { clear: both; display: flex; align-items: center; gap: 8px; padding: 3px 0; white-space: nowrap; cursor: pointer; }
.reglages input { accent-color: var(--red); width: 16px; height: 16px; margin: 0; }

/* Mode nuit (voile posé par reglages.js) : toute la page passe en bleu nuit ; ni nuages, ni bateaux, ni mouettes.
   --paper = le parchemin vu sous le voile (#eee2c6 sous #0b1433 à 62 %), pour que la Marge prolonge le bord du dessin */
body.nuit { --paper: #61626b; --card: #1b2340; --wash: #2a3358; --ink: #e9dcb8; --navy: #e9dcb8; --red: #f0a07a; }
.nuit .leaflet-control-attribution { background: rgba(27, 35, 64, .9) !important; }
.nuit #hint { background: rgba(27, 35, 64, .95); }
.nuit #q::placeholder { color: #e9dcb8; opacity: .6; }
.nuit .ambiance .ciel, .nuit .ambiance .bateau, .nuit .ambiance .mouette { display: none; }
.sans-faisceaux .ambiance .phares { display: none; }
.ambiance .portee { fill: none; stroke: var(--red); stroke-width: 1.5px; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.nuit .ambiance .portee { stroke: #f0b429; }
.ambiance .portee:not(.ouverte) { stroke-width: 1px; stroke-opacity: .55; }   /* Portée de tous les phares : le Phare ouvert ressort */
