/* ==========================================================================
   L'Univers Ferrières — carte interactive
   ========================================================================== */

@font-face {
  font-family: "Jost";
  src: url("../fonts/Jost.ttf") format("truetype-variations"),
       url("../fonts/Jost.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --noir: #101010;
  --blanc: #ffffff;
  --rouge: #b8322f;
  --gris: #f2f1ef;
  --gris-txt: #7c7a77;
  --barre-h: 58px;
  --ailleurs-h: 116px;
  --rayon: 4px;
  --ombre: 0 2px 10px rgba(0, 0, 0, .18);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  background: var(--blanc);
  color: var(--noir);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.vue {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }

/* ---------- barre du haut ---------- */
.barre {
  flex: 0 0 auto;
  height: var(--barre-h);
  padding: 0 16px 0 18px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--barre-h) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e8e6e3;
  background: var(--blanc);
  z-index: 3;
}

.marque {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marque span { font-weight: 700; }

.btn-liste {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--blanc);
  background: var(--noir);
  border-radius: 999px;
  white-space: nowrap;
  transition: background .18s;
}
.btn-liste:hover { background: var(--rouge); }
.btn-liste svg { font-size: 13px; }

/* ---------- zone carte ---------- */
.carte-zone {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  background: var(--blanc);
  touch-action: none;
  cursor: grab;
}
.carte-zone.glisse { cursor: grabbing; }

.carte-scene {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.carte-scene.anime { transition: transform .35s cubic-bezier(.22, .61, .36, 1); }

.carte-img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.reperes { position: absolute; inset: 0; }

/* ---------- repères numérotés ---------- */
.repere {
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--inv, 1));
  transform-origin: 50% 50%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--noir);
  background: var(--blanc);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28), 0 6px 16px rgba(0, 0, 0, .18);
  transition: color .16s, background .16s;
}
.repere::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
}
.repere:hover, .repere:focus-visible {
  color: var(--blanc);
  background: var(--rouge);
  outline: none;
}
.repere:focus-visible { box-shadow: 0 0 0 3px rgba(184, 50, 47, .45); }
/* repères sans fiche : présents sur la carte, mais pas cliquables */
.repere-inerte { cursor: default; }
.repere-inerte:hover { color: var(--noir); background: var(--blanc); }
.repere .etoile {
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 11px;
  line-height: 1;
  color: var(--rouge);
}
.repere:hover .etoile, .repere:focus-visible .etoile { color: var(--blanc); }

/* ---------- outils de zoom ---------- */
.carte-outils {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  z-index: 2;
}
.carte-outils button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 36px;
  font-size: 17px;
  line-height: 1;
  background: var(--blanc);
  transition: background .16s, color .16s;
}
.carte-outils button svg { font-size: 14px; }
.carte-outils button:hover { color: var(--blanc); background: var(--noir); }

.astuce {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 7px 13px;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blanc);
  background: rgba(16, 16, 16, .82);
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .5s;
}
.astuce.efface { opacity: 0; }

/* ---------- bandeau "ailleurs" ---------- */
.ailleurs {
  flex: 0 0 auto;
  height: var(--ailleurs-h);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  height: calc(var(--ailleurs-h) + env(safe-area-inset-bottom));
  border-top: 1px solid #e8e6e3;
  background: var(--blanc);
}
.ailleurs-titre {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gris-txt);
  text-align: center;
}
.ailleurs-liste {
  display: flex;
  justify-content: center;
  gap: 14px;
}
.rond {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 98px;
  text-align: center;
}
.rond img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 1.5px solid var(--noir);
  border-radius: 50%;
  transition: border-color .18s, transform .18s;
}
.rond span {
  font-size: 9px;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.rond:hover img, .rond:focus-visible img { border-color: var(--rouge); transform: scale(1.06); }
.rond:focus-visible { outline: none; }
.rond:focus-visible span { color: var(--rouge); }

/* ==========================================================================
   Fiche lieu
   ========================================================================== */
#vue-lieu { background: var(--noir); }

.carrousel {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  background: var(--noir);
  touch-action: pan-y;
}

.pistes {
  display: flex;
  height: 100%;
  will-change: transform;
}
.pistes.anime { transition: transform .38s cubic-bezier(.22, .61, .36, 1); }

.diapo {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
}
.diapo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
/* voile bas pour lisibilité */
.carrousel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent);
  pointer-events: none;
}

.retour {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 17px 10px 13px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--blanc);
  background: var(--noir);
  border-radius: 999px;
  transition: background .18s;
}
.retour:hover { background: var(--rouge); }
.retour svg { font-size: 13px; }

.compteur {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 3;
  margin: 0;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--blanc);
  background: rgba(16, 16, 16, .55);
  backdrop-filter: blur(6px);
  border-radius: 999px;
}

.nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: none;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  font-size: 20px;
  color: var(--blanc);
  background: rgba(16, 16, 16, .45);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  transition: background .18s;
}
.nav:hover { background: var(--rouge); }
.prec { left: 14px; }
.suiv { right: 14px; }

.puces {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
}
.puce {
  width: 7px;
  height: 7px;
  padding: 0;
  background: rgba(255, 255, 255, .45);
  border-radius: 50%;
  transition: background .2s, width .2s;
}
.puce[aria-selected="true"] { width: 20px; background: var(--blanc); border-radius: 999px; }

.legende {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  color: var(--blanc);
  background: var(--noir);
}
.legende-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 14px;
  font-weight: 600;
  color: var(--noir);
  background: var(--blanc);
  border-radius: 50%;
}
.legende-num:empty { display: none; }
.legende-titre {
  margin: 0;
  font-size: clamp(17px, 4.6vw, 26px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.legende-en {
  margin: 3px 0 0;
  font-size: 11.5px;
  font-style: italic;
  letter-spacing: .07em;
  color: #a5a2a0;
}
.badge-soon {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 6px 11px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blanc);
  background: var(--rouge);
  border-radius: 999px;
}

/* ==========================================================================
   Panneau liste
   ========================================================================== */
.voile {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(16, 16, 16, .45);
  animation: fondu .2s;
}
@keyframes fondu { from { opacity: 0; } }

.panneau {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  width: min(380px, 88vw);
  height: 100%;
  background: var(--blanc);
  box-shadow: -4px 0 24px rgba(0, 0, 0, .2);
  animation: glisse .26s cubic-bezier(.22, .61, .36, 1);
}
@keyframes glisse { from { transform: translateX(100%); } }

.panneau-tete {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 20px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--barre-h) + env(safe-area-inset-top));
  border-bottom: 1px solid #e8e6e3;
}
.panneau-tete p {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.panneau-tete button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 15px;
  border-radius: 50%;
}
.panneau-tete button:hover { color: var(--blanc); background: var(--noir); }

.panneau-corps {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 0 calc(16px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.entree {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 20px;
  border-bottom: 1px solid #f1efec;
  transition: background .16s;
}
.entree:hover, .entree:focus-visible { background: var(--gris); outline: none; }
.entree-inerte { cursor: default; }
.entree-inerte:hover { background: none; }
.entree-inerte .entree-num, .entree-inerte .entree-fr { color: var(--gris-txt); }
.entree-inerte .entree-num { border-color: #d5d2cf; }
.entree-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--noir);
  border-radius: 50%;
}
.entree-txt { min-width: 0; }
.entree-fr {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.entree-en {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-style: italic;
  color: var(--gris-txt);
}
.entree-soon {
  margin-left: auto;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rouge);
  white-space: nowrap;
}
.panneau-section {
  margin: 0;
  padding: 18px 20px 7px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gris-txt);
}

/* ==========================================================================
   Desktop
   ========================================================================== */
@media (min-width: 760px) {
  :root { --barre-h: 66px; --ailleurs-h: 118px; }
  .marque { font-size: 17px; }
  .repere { width: 38px; height: 38px; font-size: 15px; }
  .nav { display: grid; }
  .astuce { display: none; }
  .rond { width: 130px; }
  .rond img { width: 56px; height: 56px; }
  .rond span { font-size: 10.5px; }
  .ailleurs-liste { gap: 40px; }
  .legende { padding: 20px 34px calc(22px + env(safe-area-inset-bottom)); }
  .retour, .compteur { top: calc(20px + env(safe-area-inset-top)); }
  .retour { left: 24px; }
  .compteur { right: 24px; }
  .carte-outils { right: 18px; bottom: 18px; }
}

@media (max-width: 400px) {
  .marque { font-size: 12.5px; letter-spacing: .1em; }
  .btn-liste { padding: 8px 12px; font-size: 10px; }
  .repere { width: 32px; height: 32px; font-size: 13px; }
}

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