/* ============================================================
   Sentiers #5 — feuille de style
   Fond noir, texte blanc, Circular auto-hébergée (woff2).
   Unités fluides (clamp/rem) → responsive, lisible sur mobile.
   Transitions de vue animées (View Transitions API).
   ============================================================ */

/* ---------- Police Circular (auto-hébergée, assets/fonts/) ---------- */
@font-face{
  font-family:"Circular";
  src:url("assets/fonts/circular-400.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Circular";
  src:url("assets/fonts/circular-400i.woff2") format("woff2");
  font-weight:400; font-style:italic; font-display:swap;
}
@font-face{
  font-family:"Circular";
  src:url("assets/fonts/circular-500.woff2") format("woff2");
  font-weight:500; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Circular";
  src:url("assets/fonts/circular-700.woff2") format("woff2");
  font-weight:700; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Circular";
  src:url("assets/fonts/circular-800.woff2") format("woff2");
  font-weight:800; font-style:normal; font-display:swap;
}

:root{
  --bg:#000;
  --fg:#fff;
  --muted:#9a9a9a;
  --line:#2a2a2a;
  --accent:#fff;
  --maxw:1200px;
  --pad:clamp(1.1rem, 5vw, 4rem);
  --font:"Circular", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease:cubic-bezier(.22,.9,.3,1);   /* sortie douce, décélérée */
}

*{box-sizing:border-box;}

html{scroll-behavior:smooth;}

body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family:var(--font);
  font-weight:500;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}

a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}

.wrap{max-width:var(--maxw);margin:0 auto;padding-inline:var(--pad);}
.loading{padding:4rem 0;color:var(--muted);}

/* ============================================================
   Transitions de vue (accueil ⇄ fiche lieu)
   Le titre et le numéro du lieu voyagent d'une vue à l'autre ;
   le reste glisse et fond en douceur.
   ============================================================ */
@media (prefers-reduced-motion: no-preference){
  ::view-transition-old(root){
    animation:vt-leave .22s var(--ease) both;
  }
  ::view-transition-new(root){
    animation:vt-enter .34s var(--ease) both;
  }
  /* Éléments partagés : morph géré nativement, on adoucit juste la courbe */
  ::view-transition-group(lieu-title),
  ::view-transition-group(lieu-num){
    animation-duration:.36s;
    animation-timing-function:var(--ease);
  }
  ::view-transition-old(lieu-title),::view-transition-new(lieu-title),
  ::view-transition-old(lieu-num),::view-transition-new(lieu-num){
    height:100%;
    object-fit:none;
    object-position:left top;
  }
}
@keyframes vt-leave{
  to{opacity:0;transform:translateY(-.6rem);}
}
@keyframes vt-enter{
  from{opacity:0;transform:translateY(.9rem);}
}

/* Entrée en cascade des cartes au premier rendu */
@media (prefers-reduced-motion: no-preference){
  .card{animation:card-in .5s var(--ease) both;animation-delay:calc(var(--i,0) * 28ms);}
  @keyframes card-in{
    from{opacity:0;transform:translateY(.8rem);}
  }
}

/* ---------- En-tête / logo ---------- */
.site-header{
  position:sticky;top:0;z-index:1000;
  padding:1rem var(--pad);
  background:linear-gradient(to bottom, rgba(0,0,0,.95) 60%, rgba(0,0,0,0));
  backdrop-filter:blur(4px);
}
.site-header a.logo{
  font-weight:800;
  font-size:clamp(1.1rem,3.5vw,1.5rem);
  letter-spacing:.02em;
  display:inline-flex;align-items:center;gap:.5rem;
  min-height:44px;
}
.site-header .logo .hash{color:var(--muted);}

/* ---------- Hero ---------- */
.hero{padding:clamp(2rem,7vw,5rem) 0 clamp(1.5rem,5vw,3rem);}
.hero h1{
  font-weight:800;
  font-size:clamp(2.4rem, 9vw, 6rem);
  line-height:.98;
  letter-spacing:-.02em;
  margin:0 0 .6rem;
}
.hero .subtitle{
  font-size:clamp(1.05rem,3.2vw,1.6rem);
  font-weight:700;
  margin:0 0 1.4rem;
}
.hero .meta{
  display:flex;flex-wrap:wrap;gap:.6rem 1.4rem;
  font-size:clamp(.95rem,2.6vw,1.1rem);
  color:var(--fg);
  margin-bottom:1.6rem;
}
.hero .meta .chip{
  border:1px solid var(--line);
  border-radius:999px;
  padding:.35rem .9rem;
  white-space:nowrap;
}
.hero .intro{
  max-width:62ch;
  font-size:clamp(1rem,2.6vw,1.2rem);
  font-weight:400;
  color:#e7e7e7;
}

/* ---------- Carte ---------- */
.map-section{padding:clamp(1rem,4vw,2rem) 0 clamp(2rem,6vw,3rem);}
.section-title{
  font-size:clamp(1.4rem,5vw,2.2rem);
  font-weight:800;letter-spacing:-.01em;
  margin:0 0 1rem;
}
.map-shell{position:relative;}
#map{
  width:100%;
  height:clamp(340px, 58vh, 600px);
  border:1px solid var(--line);
  border-radius:14px;
  background:#e9e9e9;
  z-index:1;
}
/* Voile « toucher pour activer » : la page reste scrollable sur mobile */
.map-veil{
  position:absolute;inset:0;z-index:500;
  display:flex;align-items:flex-end;justify-content:center;
  border-radius:14px;
  background:transparent;
  cursor:pointer;border:0;padding:0 0 .9rem;
  font-family:var(--font);
}
.map-veil span{
  background:rgba(0,0,0,.78);color:#fff;
  font-size:.85rem;font-weight:700;
  border-radius:999px;padding:.5rem 1rem;
  backdrop-filter:blur(3px);
  pointer-events:none;
}
.map-hint{color:var(--muted);font-size:.9rem;margin-top:.6rem;}

/* Marqueurs numérotés — pastille foncée + anneau blanc = lisible sur fond clair ou sombre */
.pin{
  width:38px;height:38px;border-radius:50%;
  background:#111;color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:1.02rem;
  border:3px solid #fff;
  box-shadow:0 2px 8px rgba(0,0,0,.45);
  transition:transform .15s var(--ease);
}
.pin.todo{background:#8a8a8a;}
.pin:hover{transform:scale(1.14);}

/* Popup Leaflet en thème sombre */
.leaflet-popup-content-wrapper{
  background:#111;color:#fff;border:1px solid var(--line);border-radius:10px;
}
.leaflet-popup-tip{background:#111;border:1px solid var(--line);}
.leaflet-popup-content{margin:.7rem .9rem;font-family:var(--font);font-size:.95rem;}
.leaflet-popup-content b{font-weight:800;}
.leaflet-popup-content a.more{
  display:inline-block;margin-top:.5rem;padding:.2rem 0;
  border-bottom:1px solid var(--fg);font-weight:700;
}
.leaflet-container{font-family:var(--font);}

/* Infobulle au survol des pastilles (souris) — même thème sombre que les popups */
.leaflet-tooltip.pin-tip{
  background:#111;color:#fff;
  border:1px solid var(--line);border-radius:10px;
  padding:.55rem .85rem;
  font-family:var(--font);font-size:.95rem;line-height:1.35;
  box-shadow:0 4px 14px rgba(0,0,0,.35);
  white-space:normal;width:max-content;max-width:260px;
}
.leaflet-tooltip.pin-tip b{font-weight:800;}
.leaflet-tooltip.pin-tip i{color:#dcdcdc;font-weight:400;}
.pin-tip .tip-more{display:block;margin-top:.3rem;color:#9a9a9a;font-size:.8rem;font-weight:700;}
.leaflet-tooltip-top.pin-tip::before{border-top-color:#111;}
.leaflet-tooltip-bottom.pin-tip::before{border-bottom-color:#111;}
.leaflet-container a.leaflet-popup-close-button{
  width:32px;height:32px;font-size:18px;padding:6px 4px 0 0;color:#bbb;
}

/* ---------- Grille des lieux ---------- */
.lieux-section{padding:clamp(1rem,4vw,2rem) 0 clamp(3rem,8vw,5rem);}
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));
  gap:clamp(.8rem,2vw,1.2rem);
}
.card{
  border:1px solid var(--line);
  border-radius:14px;
  padding:1.2rem 1.3rem 1.3rem;
  display:flex;flex-direction:column;gap:.5rem;
  transition:border-color .18s var(--ease), transform .18s var(--ease), background .18s var(--ease);
  min-height:170px;
  -webkit-tap-highlight-color:rgba(255,255,255,.06);
}
.card:hover{border-color:var(--fg);transform:translateY(-3px);background:#0b0b0b;}
.card:active{transform:scale(.985);}
.card .num{
  font-size:.85rem;color:var(--muted);font-weight:700;letter-spacing:.06em;
  width:fit-content;
}
.card h3{margin:0;font-size:clamp(1.15rem,3vw,1.4rem);font-weight:800;line-height:1.1;width:fit-content;}
.card .theme{font-weight:400;color:#dcdcdc;font-size:1rem;font-style:italic;}
.card .addr{color:var(--muted);font-size:.9rem;margin-top:auto;}
.card .tags{display:flex;flex-wrap:wrap;gap:.35rem;}
.card .tag{font-size:.72rem;border:1px solid var(--line);border-radius:999px;padding:.15rem .55rem;color:#cfcfcf;}
.badge-todo{
  align-self:flex-start;font-size:.68rem;font-weight:700;letter-spacing:.05em;
  text-transform:uppercase;color:#000;background:#c9c9c9;border-radius:999px;padding:.12rem .5rem;
}

/* ---------- Fiche lieu (vue détail) ---------- */
.detail{padding:clamp(1.5rem,5vw,3rem) 0 clamp(3rem,8vw,5rem);}
.back{
  display:inline-flex;align-items:center;gap:.4rem;
  color:var(--muted);font-weight:700;margin-bottom:1.6rem;
  min-height:44px;padding-right:.6rem;
}
.back:hover{color:var(--fg);}
.detail .num{color:var(--muted);font-weight:700;letter-spacing:.06em;width:fit-content;}
.detail h1{
  font-size:clamp(2rem,7vw,3.6rem);font-weight:800;line-height:1;
  margin:.2rem 0 .5rem;letter-spacing:-.02em;width:fit-content;
}
.detail .theme{font-size:clamp(1.1rem,3.4vw,1.5rem);font-style:italic;color:#e7e7e7;margin:0 0 1.4rem;}
.detail .layout{display:grid;grid-template-columns:1fr;gap:2rem;}
@media(min-width:820px){.detail .layout{grid-template-columns:1.4fr .9fr;gap:3rem;}}
.detail .desc{font-weight:400;font-size:clamp(1rem,2.6vw,1.15rem);color:#ececec;max-width:65ch;}
.detail .aside{display:flex;flex-direction:column;gap:1.3rem;}
.detail .block h4{margin:0 0 .5rem;font-size:.8rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:700;}
.detail .artistes li{list-style:none;margin:0 0 .35rem;}
.detail .artistes{padding:0;margin:0;}
.detail .artistes .role{color:var(--muted);font-size:.85rem;}
.detail .contacts li{margin-bottom:.45rem;line-height:1.35;}
.detail .contact-link{border-bottom:1px solid var(--muted);word-break:break-word;padding:.15rem 0;display:inline-block;}
.detail .contact-link:hover{border-color:var(--fg);}
.detail ul{padding-left:0;}
.detail .links a{
  display:inline-flex;align-items:center;gap:.4rem;
  border:1px solid var(--fg);border-radius:999px;
  padding:.55rem 1rem;min-height:44px;
  font-weight:700;margin:0 .5rem .5rem 0;
  transition:background .15s,color .15s;
}
.detail .links a:hover{background:var(--fg);color:#000;}
.detail .addr-line{color:#e7e7e7;}
.detail .addr-line a{border-bottom:1px solid var(--muted);}
#detail-map{width:100%;height:280px;border:1px solid var(--line);border-radius:12px;margin-top:.8rem;background:#e9e9e9;}
.detail .gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:.6rem;margin-top:1.4rem;}
.detail .gallery img{border-radius:10px;width:100%;height:100%;object-fit:cover;}

/* ---------- Footer ---------- */
.site-footer{
  border-top:1px solid var(--line);
  padding:clamp(2rem,5vw,3rem) 0;
  color:var(--muted);font-size:.9rem;
  display:flex;flex-wrap:wrap;gap:.5rem 2rem;justify-content:space-between;
}
.site-footer .footer-mail{
  color:#dcdcdc;border-bottom:1px solid var(--muted);
  padding:.15rem 0;display:inline-block;
}
.site-footer .footer-mail:hover{color:var(--fg);border-color:var(--fg);}

/* ---------- Bandeau mode calibrage ---------- */
.edit-banner{
  position:fixed;bottom:0;left:0;right:0;z-index:2000;
  background:#161616;border-top:1px solid var(--line);
  padding:.7rem var(--pad);font-size:.9rem;color:#eee;
  display:flex;gap:1rem;align-items:center;flex-wrap:wrap;
}
.edit-banner b{color:#fff;}
.edit-banner .out{font-family:ui-monospace,monospace;color:#8fd;}
.edit-banner button{background:#fff;color:#000;border:0;border-radius:8px;padding:.45rem .9rem;font-weight:700;cursor:pointer;font-family:var(--font);}

.hidden{display:none !important;}

/* Réduction d'animations si demandé */
@media(prefers-reduced-motion:reduce){
  *{transition:none !important;animation:none !important;scroll-behavior:auto;}
}
