/* ---------- Thème clair (défaut) : papier crème chic ---------- */
:root {
  --bg: #f2ecdf;
  --panel: #faf5ea;
  --panel-2: #ece3d1;
  --line: #d9cdb6;
  --cream: #2b2620;
  --muted: #6e6557;
  --label: #4a4338;
  --red: #c62828;
  --gold: #9a7b1e;
  --green: #2e8b46;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}

/* ---------- Thème sombre ---------- */
[data-theme="dark"] {
  --bg: #1d1a16;
  --panel: #282420;
  --panel-2: #322d27;
  --line: #4a443b;
  --cream: #faf4e8;
  --muted: #c0b49e;
  --label: #d8cdb8;
  --red: #e84343;
  --gold: #dfc05c;
  --green: #5bbf6a;
}

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

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 32px 20px 60px; }

/* Liens du contenu : rouge site (jamais bleu navigateur) */
main a { color: var(--red); text-decoration: none; font-weight: 500; }
main a:hover { text-decoration: underline; }

/* ---------- Nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 700;
  color: var(--cream); text-decoration: none; display: flex; align-items: center; gap: 10px;
}
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); display: inline-block; }
.nav-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tab {
  font-family: var(--serif); font-weight: 700; font-size: 1rem; text-decoration: none;
  color: var(--muted); padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  display: inline-flex; align-items: center; gap: 9px;
  transition: background .15s, color .15s, border-color .15s;
}
.tab:hover { color: var(--cream); background: var(--panel-2); }
.tab.active { background: var(--red); border-color: var(--red); color: #fff; }
.tab.active .brand-dot { background: #fff; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-tag { color: var(--muted); font-size: 0.8rem; }
.theme-btn {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  font-size: 1rem; cursor: pointer; padding: 5px 9px; line-height: 1;
  transition: filter .15s, transform .15s;
}
.theme-btn:hover { filter: brightness(1.06); transform: scale(1.05); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 54px 0 34px; }
.hero h1 {
  font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700;
  letter-spacing: -0.5px;
}
.hero h1 em { font-style: italic; color: var(--red); }
.tagline { color: var(--muted); max-width: 560px; margin: 14px auto 0; line-height: 1.6; }

/* ---------- Cards / formulaire ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px;
}
.form-card { margin-top: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.options { margin-top: 16px; display: flex; gap: 18px; flex-wrap: wrap; }
.options .check { flex-direction: row; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; }
.options .check input { width: 16px; height: 16px; accent-color: var(--red); }
.row2 { display: flex; align-items: flex-end; gap: 18px; margin-top: 18px; }
.row2 .hint { flex: 1; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.row2 .btn { margin-top: 0; width: auto; padding: 13px 26px; white-space: nowrap; }
label { font-size: 0.82rem; font-weight: 600; color: var(--label); display: flex; flex-direction: column; gap: 7px; }
input, select {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--cream); padding: 11px 13px; font-size: 0.95rem; font-family: var(--sans);
  outline: none; width: 100%;
}
input:focus, select:focus { border-color: var(--red); }
.btn {
  display: inline-block;
  margin-top: 20px; width: auto; padding: 14px 26px;
  border: none; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 1rem; font-weight: 700;
  font-family: var(--sans); cursor: pointer; text-decoration: none;
  text-align: center; transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.alert {
  background: rgba(198, 40, 40, .1); border: 1px solid rgba(198, 40, 40, .45);
  color: var(--red); padding: 13px 16px; border-radius: 10px; margin-bottom: 18px; line-height: 1.5;
  font-weight: 500;
}

/* ---------- Autocomplétion villes ---------- */
.autocomplete { position: relative; }
.suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  list-style: none; margin: 0; padding: 6px; z-index: 50;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  max-height: 260px; overflow-y: auto;
}
.suggestions li {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px; border-radius: 7px; cursor: pointer;
}
.suggestions li:hover, .suggestions li.active { background: var(--panel-2); }
.suggestions strong { font-size: .9rem; color: var(--cream); font-weight: 600; }
.suggestions span { font-size: .75rem; color: var(--muted); }

/* ---------- How to ---------- */
.howto { margin-top: 40px; }
.card + .card, .howto + .card { margin-top: 24px; }
.howto h2 { font-family: var(--serif); font-size: 1.4rem; margin-bottom: 16px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 18px 22px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 12px;
  color: var(--muted); font-size: 0.92rem; line-height: 1.5;
}
.step p { margin: 0; }
.step em { color: var(--cream); font-style: normal; font-weight: 600; }
.num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(150deg, #ef5350 0%, var(--red) 55%, #8e1d1d 100%);
  color: #fff; font-weight: 700; font-size: 1rem;
  font-family: var(--sans);
  line-height: 1;
  box-shadow: 0 4px 10px rgba(198, 40, 40, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  border: 2px solid var(--panel);
  vertical-align: middle; margin-right: 0;
}

/* ---------- Résultat ---------- */
.result-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: 18px 0 24px; }
.crumb a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.crumb a:hover { color: var(--cream); }
.result-head h1 { font-family: var(--serif); font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-top: 8px; }
.result-head h1 em { font-style: italic; color: var(--red); }
.stats { display: flex; gap: 14px; }
.stat { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; min-width: 86px; }
.stat-num { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }
.stat-lbl { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; }

.map-card { padding: 10px; }
#map { height: 420px; border-radius: 8px; background: var(--panel-2); }
.note { color: var(--muted); font-size: 0.8rem; margin-top: 8px; text-align: center; }

.share { display: flex; gap: 10px; margin-top: 12px; padding: 0 4px; }
.share input {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--muted); padding: 10px 13px; font-size: 0.85rem; font-family: var(--sans);
}
.btn-share {
  background: var(--panel-2); border: 1px solid var(--gold); color: var(--gold);
  border-radius: 9px; padding: 10px 18px; font-weight: 600; cursor: pointer;
  font-family: var(--sans); font-size: 0.88rem; white-space: nowrap; transition: filter .15s;
}
.btn-share:hover { filter: brightness(1.2); }

.itinerary { margin-top: 26px; display: flex; flex-direction: column; gap: 0; }
.stop { display: flex; align-items: center; gap: 18px; padding: 18px 22px; }
.stop-rank {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--red); color: #fff; font-weight: 700; font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
}
.stop-rank.home { background: var(--panel-2); border: 1px solid var(--line); }
.stop-body { flex: 1; min-width: 0; }
.stop-body h3 { font-family: var(--serif); font-size: 1.12rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.green { font-size: 0.95rem; }
.stop-meta { color: var(--gold); font-size: 0.9rem; margin-top: 4px; font-weight: 600; }
.award { color: var(--muted); font-weight: 500; }
.stop-loc { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.stop-budget { color: var(--muted); font-size: 0.82rem; margin-top: 5px; }
.stop-budget strong { color: var(--cream); }
.stop-leg { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; gap: 3px; }
.leg-time { font-weight: 700; font-size: 1.02rem; }
.leg-km { color: var(--muted); font-size: 0.82rem; }
.guide-link { color: var(--red); font-size: 0.82rem; text-decoration: none; font-weight: 600; }
.guide-link:hover { text-decoration: underline; }
.connector { text-align: center; color: #8a8070; font-size: 1.1rem; padding: 4px 0; }
.stop-end { opacity: .94; }

/* ---------- Fiches resto & articles ---------- */
.fiche-link { color: var(--muted); font-size: .82rem; text-decoration: none; font-weight: 600; white-space: nowrap; }
.fiche-link:hover { color: var(--red); text-decoration: underline; }
.closed-badge { font-size: .72rem; font-weight: 600; color: #b3261e; border: 1px solid #e2a9a2; border-radius: 999px; padding: 1px 9px; margin-left: 8px; vertical-align: 2px; white-space: nowrap; }
[data-theme="dark"] .closed-badge { color: #ffb4a8; border-color: #6b3a33; }
.alert { background: #fdecea; border: 1px solid #f2b8b0; color: #a01f17; padding: 12px 16px; border-radius: 12px; font-weight: 500; }
[data-theme="dark"] .alert { background: #3a241f; border-color: #6b3a33; color: #ffb4a8; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.stat-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.stat-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); color: var(--label); }
.stat-table td:last-child { text-align: right; font-size: 1.05rem; }
.stat-table .stat-total td { border-top: 2px solid var(--line); border-bottom: none; font-weight: 700; color: var(--cream); }
.stat-table .stat-note td { border-bottom: none; color: var(--muted); font-style: italic; }
.stat-legend { margin-top: 12px; font-size: .85rem; color: var(--muted); }
.stat-green { margin-top: 12px; padding: 10px 14px; background: rgba(46, 125, 50, .08); border: 1px solid rgba(46, 125, 50, .35); border-radius: 10px; font-size: .85rem; color: var(--label); }
[data-theme="dark"] .stat-green { background: rgba(91, 191, 106, .1); border-color: rgba(91, 191, 106, .4); }
.art-h2 { margin: 26px 6px 4px; font-family: var(--serif); font-size: 1.35rem; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem;
  text-align: center; padding: 20px;
}
.footer a { color: var(--muted); }

/* Marqueurs Leaflet numérotés */
.stop-icon {
  background: var(--red); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: var(--serif); font-size: 1rem;
  border: 2px solid var(--cream); box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.leaflet-popup-content { font-family: var(--sans); }

/* ---------- Carte Europe ---------- */
.map-page { max-width: 1280px; }
.map-head h1 { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.3rem); }
.map-head .tagline { margin: 8px 0 0; text-align: left; color: var(--muted); max-width: 660px; line-height: 1.55; }
.map-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 20px 0 14px; font-size: .9rem;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 15px; font-family: var(--sans); font-size: .88rem; font-weight: 600;
  color: var(--cream); cursor: pointer; transition: border-color .15s, background .15s, opacity .15s;
}
.chip:hover { border-color: var(--red); }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; }
.chip .ic { font-size: 1rem; line-height: 1; }
.chip .cnt { font-size: .75rem; color: var(--muted); font-weight: 600; }
.chip.active .cnt { color: rgba(255, 255, 255, .85); }
.chip.dim { opacity: .4; }
.map-count {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 15px; color: var(--muted); font-size: .82rem; font-weight: 500;
  line-height: 1.2;
}
.map-count b { color: var(--red); font-size: 1rem; line-height: 1.2; }
.map-wrap { position: relative; }
.loc-btn {
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.loc-btn:hover { border-color: var(--red); }
.loc-btn.busy { opacity: .55; cursor: wait; }
#loc-toast {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(6px);
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font-size: .85rem; font-weight: 500;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18); max-width: min(92%, 520px); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 1000;
}
#loc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- recherche par nom --- */
.map-search { position: relative; }
.map-search input {
  width: 250px; padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: inherit; font-size: .85rem; outline: none;
}
.map-search input:focus { border-color: var(--red); }
.map-search .suggestions {
  width: 330px; max-height: 330px; z-index: 1200;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.map-search .suggestions li { flex-direction: column; }
.map-search .suggestions strong { color: var(--text); }

/* --- filtre par pays --- */
.map-pays { position: relative; }
.pays-btn .caret { font-size: .7rem; margin-left: 4px; opacity: .7; }
.pays-list {
  position: absolute; top: calc(100% + 6px); left: 0; width: 280px; max-height: 340px; overflow-y: auto;
  list-style: none; margin: 0; padding: 6px; z-index: 1200;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.pays-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: .85rem;
}
.pays-list li:hover { background: var(--panel-2); }
.pays-list li.on { background: var(--panel-2); font-weight: 600; }
.pays-list .cnt { margin-left: auto; color: var(--muted); font-size: .75rem; font-weight: 400; }

/* --- panneau « autour de moi » --- */
.nearby-chip .ic { font-size: .95rem; }
.nearby {
  position: absolute; top: 12px; left: 12px; width: min(330px, calc(100% - 24px));
  max-height: calc(100% - 24px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); z-index: 650; overflow: hidden;
  transform: translateX(-10px); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.nearby.show { transform: none; opacity: 1; pointer-events: auto; }
.nearby-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .85rem;
}
.nearby-head label {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
  color: var(--muted); font-size: .75rem;
}
.nearby-head select {
  font: inherit; font-size: .8rem; border: 1px solid var(--line); border-radius: 8px;
  padding: 3px 6px; background: var(--panel-2); color: var(--text);
}
.nearby-close {
  border: 0; background: none; font-size: 1.2rem; line-height: 1;
  cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px;
}
.nearby-close:hover { color: var(--red); }
.nearby-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.nearby-item {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
.nearby-item:hover { background: var(--panel-2); }
.nearby-rank {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.nearby-info { min-width: 0; }
.nearby-info strong {
  display: block; font-size: .85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nearby-meta { color: var(--muted); font-size: .75rem; }
.nearby-empty { padding: 16px; text-align: center; color: var(--muted); font-size: .82rem; }
#map { height: calc(100dvh - 330px); min-height: 520px; border-radius: 14px; border: 1px solid var(--line); }
.rg-cluster div {
  border-radius: 50%; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  border: 2px solid rgba(255, 255, 255, .8); box-shadow: 0 3px 12px rgba(0, 0, 0, .35);
}
.mdot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); border: 2.5px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
}
.rg-popup { font-family: var(--sans); font-size: .85rem; line-height: 1.55; }
.rg-popup strong { font-size: .95rem; }
.rg-popup a { color: var(--red); font-weight: 600; text-decoration: none; }
.rg-popup a:hover { text-decoration: underline; }
.pbadge { color: var(--gold); font-weight: 600; }
.pprice { color: var(--muted); }

@media (max-width: 720px) {
  .nav-tag { display: none; }
  #map { height: calc(100dvh - 300px); min-height: 420px; }
  .map-count { margin-left: 0; }
  .map-search input { width: 100%; }
  .map-search .suggestions { width: min(330px, calc(100vw - 32px)); }
  .nearby {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%;
    max-height: 46%; border-radius: 16px 16px 0 0;
  }
}

/* ── Pages de contenu SEO ─────────────────────────────────────── */
.footer-links { margin-bottom: 6px; font-weight: 500; }
.footer-links a { color: var(--red); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

.page-head { text-align: center; padding: 1.2rem 0 .4rem; }
.page-head h1 { font-size: 1.9rem; }
.page-sub { color: var(--muted); max-width: 640px; margin: .4rem auto 1rem; }
.card .page-sub { margin: .4rem 0 1rem; text-align: left; }
.crumb { color: var(--muted); font-size: .85rem; margin: 0 0 .6rem; }
.crumb a { color: var(--red); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.page-head .btn { margin-top: 10px; }
.card.howto p:has(.btn) { text-align: center; margin-top: 14px; }
.card.howto p:has(.btn) .btn { margin-top: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.city-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: .4rem .9rem;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem;
  transition: border-color .15s, transform .15s;
}
.city-chip:hover { border-color: var(--red); transform: translateY(-1px); }
.city-chip-count { color: var(--muted); font-weight: 400; font-size: .8rem; }

.resto-list { display: flex; flex-direction: column; gap: .6rem; margin-top: .8rem; }
.resto-item {
  display: flex; align-items: center; gap: .9rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: .7rem .9rem;
}
.resto-rank {
  flex: 0 0 2rem; height: 2rem; border-radius: 50%;
  background: var(--red); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.resto-body { flex: 1; min-width: 0; }
.resto-body h3 { margin: 0; font-size: 1.02rem; }
.resto-meta { margin: .15rem 0 0; font-size: .85rem; color: var(--muted); }
.resto-loc { margin: 0; font-size: .8rem; color: var(--muted); }

.faq-list { padding: 0; }
.faq-item { border-bottom: 1px solid var(--line); padding: .9rem 1.1rem; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  cursor: pointer; font-weight: 700; font-size: 1rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::after { content: "＋"; color: var(--red); font-weight: 400; }
.faq-item[open] summary::after { content: "－"; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { margin: .6rem 0 0; color: var(--muted); line-height: 1.6; }

.lexique { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .8rem; }
.lex-item h2 { font-size: 1.05rem; margin: 0 0 .35rem; }
.lex-item p { margin: 0; color: var(--muted); line-height: 1.6; }
