/* ==========================================================
   BVI 2027 x Good Boats - theme "carte marine"
   Palette
   --encre   #142B3D  encre marine (texte, fonds sombres)
   --papier  #F5F1E6  papier de carte
   --hautfond #8AD4CC aqua des hauts-fonds
   --bouee   #D64533  rouge bouee (accents, CTA)
   --sable   #E8DCC3  sable (cartouches)
   ========================================================== */

:root {
  --encre: #142B3D;
  --encre-70: rgba(20, 43, 61, 0.7);
  --encre-40: rgba(20, 43, 61, 0.4);
  --encre-15: rgba(20, 43, 61, 0.15);
  --papier: #F5F1E6;
  --papier-fonce: #EDE7D6;
  --hautfond: #8AD4CC;
  --hautfond-clair: #C4EAE5;
  --bouee: #D64533;
  --sable: #E8DCC3;
  --blanc: #FDFCF8;

  --display: "Bricolage Grotesque", "Plus Jakarta Sans", sans-serif;
  --body: "Plus Jakarta Sans", -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1080px;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--body);
  background: var(--papier);
  color: var(--encre);
  line-height: 1.65;
  font-size: 16px;
  /* trame de fond facon quadrillage de carte */
  background-image:
    linear-gradient(var(--encre-15) 1px, transparent 1px),
    linear-gradient(90deg, var(--encre-15) 1px, transparent 1px);
  background-size: 72px 72px;
  background-attachment: fixed;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: var(--encre);
  color: var(--papier);
  border-bottom: 3px solid var(--bouee);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--papier);
  font-size: 1.05rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.brand .tag {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--hautfond);
  border: 1px solid var(--hautfond);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
}
.nav-links { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav-links a {
  color: var(--papier);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
}
.nav-links a:hover { background: rgba(255,255,255,0.12); }
.nav-links a.active { background: var(--bouee); color: var(--blanc); }
.nav-links a:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid var(--hautfond);
  outline-offset: 2px;
}

/* ---------- Structure commune ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
main { padding-bottom: 4rem; }

.page-head { padding: 2.75rem 0 1.5rem; }
.coords {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--encre-70);
  text-transform: uppercase;
}
.coords::before { content: "+ "; color: var(--bouee); font-weight: 700; }
h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0.4rem 0 0.75rem;
}
.lede { font-size: 1.08rem; max-width: 46rem; color: var(--encre-70); }

h2 {
  font-family: var(--display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
h2::after {
  content: "";
  flex: 1;
  border-bottom: 2px dashed var(--encre-40);
  transform: translateY(2px);
}
h3 { font-family: var(--display); font-size: 1.1rem; margin: 1.4rem 0 0.5rem; }
p + p { margin-top: 0.8rem; }
a { color: var(--bouee); }

/* ---------- Hero (accueil) ---------- */
.hero {
  background: var(--encre);
  color: var(--papier);
  overflow: hidden;
  position: relative;
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 0;
  position: relative;
}
.hero .coords { color: var(--hautfond); }
.hero h1 { color: var(--blanc); max-width: 15ch; }
.hero .lede { color: rgba(245, 241, 230, 0.8); }
.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 1.75rem 0 2.5rem;
}
.stat { font-family: var(--mono); }
.stat b { display: block; font-size: 1.5rem; color: var(--hautfond); font-weight: 700; }
.stat span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(245,241,230,0.6); }

/* Ligne de route SVG du hero */
.routeline { display: block; width: 100%; height: auto; margin-top: 1rem; }

/* ---------- Cartouches / cartes ---------- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--blanc);
  border: 1.5px solid var(--encre);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: 4px 4px 0 var(--encre-15);
}
.card.accent { border-color: var(--bouee); box-shadow: 4px 4px 0 rgba(214, 69, 51, 0.25); }
.card.sea { background: var(--hautfond-clair); }
.card h3 { margin-top: 0; }
.card .k {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--encre-70);
  display: block;
  margin-bottom: 0.35rem;
}
.big { font-family: var(--display); font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.big small { font-size: 0.95rem; font-weight: 600; color: var(--encre-70); }

/* ---------- Tableaux ---------- */
.table-scroll { overflow-x: auto; border: 1.5px solid var(--encre); border-radius: var(--radius); background: var(--blanc); box-shadow: 4px 4px 0 var(--encre-15); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
th {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  background: var(--encre);
  color: var(--papier);
  padding: 0.6rem 0.9rem;
}
td { padding: 0.6rem 0.9rem; border-top: 1px solid var(--encre-15); vertical-align: top; }
tr:nth-child(even) td { background: var(--papier); }
td.mono, .mono { font-family: var(--mono); font-size: 0.85rem; white-space: nowrap; }
td b { font-weight: 700; }

/* ---------- Timeline vols ---------- */
.timeline { list-style: none; border-left: 2px dashed var(--encre-40); margin: 1rem 0 1rem 0.5rem; padding-left: 1.5rem; }
.timeline li { position: relative; padding: 0.45rem 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 7px);
  top: 0.95rem;
  width: 12px; height: 12px;
  background: var(--papier);
  border: 3px solid var(--bouee);
  border-radius: 50%;
}
.timeline li.calm::before { border-color: var(--hautfond); }
.timeline .t { font-family: var(--mono); font-weight: 700; margin-right: 0.6rem; }
.timeline .d { color: var(--encre-70); font-size: 0.9rem; }

/* ---------- Etiquettes ---------- */
.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1.5px solid var(--encre);
  background: var(--blanc);
  margin: 0 0.3rem 0.3rem 0;
}
.pill.ok { border-color: #2E7D5B; color: #2E7D5B; }
.pill.warn { border-color: var(--bouee); color: var(--bouee); }
.pill.sea { border-color: #2A8C82; color: #2A8C82; background: var(--hautfond-clair); }

/* ---------- Cartes Leaflet ---------- */
.map-frame {
  border: 1.5px solid var(--encre);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--encre-15);
}
#map, #map-tips { height: 520px; width: 100%; }
@media (max-width: 640px) { #map, #map-tips { height: 400px; } }

.leaflet-popup-content-wrapper {
  background: var(--blanc);
  color: var(--encre);
  border: 1.5px solid var(--encre);
  border-radius: 8px;
  font-family: var(--body);
}
.leaflet-popup-content { margin: 10px 14px; }
.popup-title { font-family: var(--display); font-weight: 700; }
.popup-meta { font-family: var(--mono); font-size: 0.72rem; color: var(--encre-70); }

.wp-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #10222f;
  background: var(--papier);
  border: 1.5px solid #10222f;
  border-radius: 999px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 2px 2px 0 rgba(16,34,47,0.3);
}
.wp-label.tip { background: var(--hautfond); border-radius: 4px; }

/* ---------- Etapes (liste sous la carte) ---------- */
.etape {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px dashed var(--encre-40);
}
.etape:last-child { border-bottom: none; }
.etape .num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--blanc);
  background: var(--encre);
  border-radius: 6px;
  height: 2.2rem;
  display: flex; align-items: center; justify-content: center;
}
.etape h3 { margin: 0 0 0.15rem; }
.etape .meta { font-family: var(--mono); font-size: 0.75rem; color: var(--encre-70); margin-bottom: 0.3rem; }
.etape p { font-size: 0.95rem; }

/* ---------- Meteo ---------- */
.meteo-live { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.windy-frame { border: 1.5px solid var(--encre); border-radius: var(--radius); overflow: hidden; box-shadow: 4px 4px 0 var(--encre-15); }
.windy-frame iframe { display: block; width: 100%; height: 480px; border: 0; }

/* ---------- Notes / encadres ---------- */
.note {
  border-left: 4px solid var(--bouee);
  background: var(--blanc);
  padding: 0.9rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
  font-size: 0.95rem;
}
.note.sea { border-left-color: #2A8C82; background: var(--hautfond-clair); }

ul.clean { list-style: none; }
ul.clean li { padding: 0.35rem 0 0.35rem 1.4rem; position: relative; }
ul.clean li::before { content: "+"; position: absolute; left: 0.2rem; color: var(--bouee); font-weight: 800; font-family: var(--mono); }

/* ---------- Pied de page ---------- */
footer {
  background: var(--encre);
  color: rgba(245,241,230,0.75);
  margin-top: 3rem;
  padding: 2rem 0;
  font-size: 0.85rem;
}
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer a { color: var(--hautfond); }
footer .mono { font-size: 0.72rem; }

/* ---------- Divers ---------- */
.btn {
  display: inline-block;
  background: var(--bouee);
  color: var(--blanc);
  font-weight: 700;
  text-decoration: none;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  border: 1.5px solid var(--encre);
  box-shadow: 3px 3px 0 var(--encre);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--encre); }
.btn.ghost { background: var(--blanc); color: var(--encre); }

.updated { font-family: var(--mono); font-size: 0.72rem; color: var(--encre-70); margin-top: 0.75rem; }
