/* Plan des pistes interactif — La Stass' de Chartreuse
   Les variables --sapin, --glacier, --vert du site sont reprises si elles existent. */
.plan {
  --p-ink: var(--sapin, #12342b);
  --p-bg: var(--glacier, #eaf4f7);
  --p-accent: var(--vert, #00a455);
  --p-card: #fff;
  --p-line: rgba(18, 52, 43, .14);
  --p-title: var(--font-titre, 'Allerta Stencil', 'Arial Narrow', sans-serif);
  --p-text: var(--font-texte, 'Quicksand', system-ui, sans-serif);
  font-family: var(--p-text);
  color: var(--p-ink);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(255, 255, 255, .85), transparent 60%),
    var(--p-bg);
  padding: clamp(28px, 5vw, 64px) clamp(14px, 4vw, 48px);
  box-sizing: border-box;
}
.plan *, .plan *::before, .plan *::after { box-sizing: border-box; }
.plan button { font: inherit; color: inherit; cursor: pointer; }
.plan svg { display: block; }

/* ---------- En-tête ---------- */
.plan__head { max-width: 1240px; margin: 0 auto 26px; }
.plan__kicker {
  margin: 0 0 8px; font-weight: 700; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--p-accent);
}
.plan__head h2 {
  margin: 0 0 10px; font-family: var(--p-title); font-weight: 400; line-height: 1.02;
  font-size: clamp(2rem, 5.2vw, 3.6rem); letter-spacing: .01em;
}
.plan__lead { margin: 0; max-width: 62ch; font-size: 1.05rem; line-height: 1.55; opacity: .82; }

/* ---------- Mise en page ---------- */
.plan__layout {
  max-width: 1240px; margin: 0 auto;
  display: grid; gap: 22px;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  align-items: start;
}
@media (max-width: 980px) { .plan__layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Carte ---------- */
.plan__viewport {
  position: relative; width: min(100%, 86vh); aspect-ratio: 1 / 1; margin-inline: auto;
  overflow: hidden; border-radius: 22px; background: #dfeaee;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 18px 50px -22px rgba(18, 52, 43, .55), 0 0 0 1px var(--p-line);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.plan__viewport.is-zoomed { touch-action: none; cursor: grab; }
.plan__viewport.is-dragging { cursor: grabbing; }
.plan__world {
  --s: 1; position: absolute; inset: 0; transform-origin: 0 0; will-change: transform;
}
.plan__world.is-anim { transition: transform .55s cubic-bezier(.22, .8, .24, 1); }
.plan__img { width: 100%; height: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.plan__svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.plan__pins { position: absolute; inset: 0; pointer-events: none; }

/* Tracés mis en avant */
.shape { fill: none; stroke: var(--sc); stroke-linecap: round; stroke-linejoin: round; }
.shape--path {
  stroke-width: 7; filter: drop-shadow(0 0 4px rgba(255,255,255,.95)) drop-shadow(0 0 7px var(--sc));
  stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 1.1s ease forwards;
}
.shape--zone {
  stroke-width: 4; fill: color-mix(in srgb, var(--sc) 18%, transparent);
  stroke-dasharray: 9 7; animation: march 1.4s linear infinite;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes march { to { stroke-dashoffset: -32; } }

/* ---------- Repères (pins) ---------- */
.pin {
  --c: var(--p-accent);
  position: absolute; transform: translate(-50%, -50%) scale(calc(1 / var(--s, 1)));
  pointer-events: auto; padding: 0; border: 0; background: none; z-index: 1;
}
.pin[hidden] { display: none; }
.pin__dot {
  position: relative; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--c); color: #fff; border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(10, 30, 25, .4);
  transition: transform .18s ease, box-shadow .18s ease;
}
.pin__dot svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pin--small .pin__dot { width: 22px; height: 22px; border-width: 2px; }
.pin--small .pin__dot svg { width: 12px; height: 12px; }
.pin:hover, .pin:focus-visible, .pin.is-sel { z-index: 5; }
.pin:hover .pin__dot, .pin:focus-visible .pin__dot { transform: scale(1.18); }
.pin:focus-visible { outline: none; }
.pin:focus-visible .pin__dot { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--p-ink); }
.pin.is-sel { z-index: 6; }
.pin.is-sel .pin__dot { transform: scale(1.3); box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 6px 16px rgba(10, 30, 25, .5); }
.pin.is-sel .pin__dot::after {
  content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--c); opacity: 0;
  animation: ping 1.7s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }

.pin__label {
  position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translate(-50%, 4px);
  white-space: nowrap; max-width: 260px; padding: 6px 11px; border-radius: 9px;
  background: var(--p-ink); color: #fff; font-size: .82rem; font-weight: 700; letter-spacing: .01em;
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
}
.pin__label::after {
  content: ''; position: absolute; left: 50%; top: 100%; margin-left: -5px;
  border: 5px solid transparent; border-top-color: var(--p-ink);
}
.pin:hover .pin__label, .pin:focus-visible .pin__label { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Outils de zoom ---------- */
.plan__tools {
  position: absolute; top: 12px; right: 12px; z-index: 10; display: flex; flex-direction: column; gap: 6px;
  padding: 6px; border-radius: 16px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px -10px rgba(18, 52, 43, .5), 0 0 0 1px var(--p-line);
}
.plan__tools button {
  width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 11px;
  background: transparent; transition: background .15s;
}
.plan__tools button:hover:not(:disabled) { background: rgba(0, 164, 85, .14); }
.plan__tools button:disabled { opacity: .35; cursor: default; }
.plan__tools button:focus-visible { outline: 3px solid var(--p-ink); outline-offset: 1px; }
.plan__tools svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.plan__hint {
  position: absolute; right: 12px; bottom: 12px; z-index: 9; margin: 0; padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(6px); font-size: .76rem; font-weight: 700;
  box-shadow: 0 0 0 1px var(--p-line); pointer-events: none; transition: opacity .3s;
}
.plan__viewport.is-zoomed .plan__hint, .plan__viewport.has-card .plan__hint { opacity: 0; }
@media (hover: none) { .plan__hint { display: none; } }

/* ---------- Fiche d'un lieu ---------- */
.plan__card {
  --c: var(--p-accent);
  position: absolute; z-index: 12; left: 14px; bottom: 14px; width: min(340px, calc(100% - 28px));
  padding: 18px 18px 16px; border-radius: 18px; background: var(--p-card);
  box-shadow: 0 22px 50px -14px rgba(10, 30, 25, .6), 0 0 0 1px var(--p-line);
  border-top: 5px solid var(--c);
  animation: rise .28s cubic-bezier(.22, .8, .24, 1);
}
.plan__card[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.card__close {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(18, 52, 43, .07); font-size: 1.4rem; line-height: 1;
}
.card__close:hover { background: rgba(18, 52, 43, .15); }
.card__close:focus-visible { outline: 3px solid var(--p-ink); }
.card__tag {
  display: flex; align-items: center; gap: 7px; margin: 0 40px 8px 0; color: var(--c);
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.card__tag span { display: grid; place-items: center; }
.card__tag svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.card__title { margin: 0 0 8px; font-family: var(--p-title); font-weight: 400; font-size: 1.45rem; line-height: 1.12; }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; }
.card__meta span {
  padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, #fff);
  font-size: .8rem; font-weight: 700;
}
.card__meta .card__alt { background: var(--p-ink); color: #fff; }
.card__text { margin: 0; font-size: .96rem; line-height: 1.5; }
.card__link {
  display: inline-block; margin-top: 12px; padding: 8px 14px; border-radius: 999px; background: var(--p-accent);
  color: #fff; font-weight: 700; font-size: .9rem; text-decoration: none;
}
.card__link:hover { filter: brightness(.92); }
@media (max-width: 560px) {
  .plan__card { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 15px 15px 14px; }
  .card__title { font-size: 1.25rem; }
}

/* ---------- Profil « Monter en navette » ---------- */
.plan__profile {
  width: min(100%, 86vh); margin: 16px auto 0; padding: 18px 20px 20px; border-radius: 20px; background: var(--p-card);
  box-shadow: 0 0 0 1px var(--p-line);
}
.profile__title { margin: 0 0 14px; font-size: .78rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; opacity: .7; }
.profile__line { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); }
.profile__line::before {
  content: ''; position: absolute; left: 16.6%; right: 16.6%; top: 17px; height: 4px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, #d62839 0 12px, transparent 12px 20px);
}
.profile__stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 6px; border: 0; background: none; text-align: center; }
.profile__stop i {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--p-ink); color: #fff;
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--p-ink); font-style: normal; transition: transform .15s;
}
.profile__stop:hover i { transform: scale(1.1); }
.profile__stop:focus-visible { outline: 3px solid var(--p-ink); outline-offset: 4px; border-radius: 12px; }
.profile__stop i svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.profile__stop b { font-size: 1.15rem; font-family: var(--p-title); font-weight: 400; }
.profile__stop span { font-size: .84rem; line-height: 1.3; opacity: .8; }

/* ---------- Colonne latérale ---------- */
.plan__side {
  display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px; background: var(--p-card);
  box-shadow: 0 0 0 1px var(--p-line), 0 18px 40px -26px rgba(18, 52, 43, .5);
}
.side__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side__title { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; opacity: .7; }
.side__all { border: 0; background: none; padding: 4px 2px; font-size: .84rem; font-weight: 700; color: var(--p-accent); text-decoration: underline; text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  --c: var(--p-accent);
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px 7px 8px; border-radius: 999px;
  border: 1.5px solid var(--p-line); background: #fff; font-size: .86rem; font-weight: 700; transition: all .15s;
}
.chip__ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; }
.chip__ico svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chip__n { font-size: .74rem; opacity: .6; }
.chip[aria-pressed="false"] { opacity: .55; background: transparent; }
.chip[aria-pressed="false"] .chip__ico { background: #9aa9a4; }
.chip[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); }
.chip:hover { transform: translateY(-1px); }
.chip:focus-visible { outline: 3px solid var(--p-ink); outline-offset: 2px; }

.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; opacity: .55; }
.search input {
  width: 100%; padding: 12px 14px 12px 40px; border-radius: 13px; border: 1.5px solid var(--p-line);
  font: inherit; font-size: .95rem; background: #f6faf9; color: inherit;
}
.search input:focus { outline: 3px solid color-mix(in srgb, var(--p-accent) 45%, transparent); border-color: var(--p-accent); background: #fff; }
.side__count { margin: -4px 0 0; font-size: .82rem; opacity: .65; }

.list { margin: 0; padding: 0 6px 0 0; list-style: none; max-height: 430px; overflow: auto; scrollbar-width: thin; }
@media (max-width: 980px) { .list { max-height: none; } }
.list__group { margin: 0 0 12px; }
.list__group[hidden], .list li[hidden] { display: none; }
.list__group h3 { --c: var(--p-accent); display: flex; align-items: center; gap: 7px; margin: 0 0 4px; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.list__group h3 span svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.list__group ul { margin: 0; padding: 0; list-style: none; }
.list button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px;
  border: 0; border-radius: 11px; background: none; text-align: left; font-size: .93rem; font-weight: 600;
}
.list button:hover { background: rgba(0, 164, 85, .1); }
.list button.is-sel { background: var(--p-ink); color: #fff; }
.list button:focus-visible { outline: 3px solid var(--p-ink); outline-offset: -1px; }
.list__alt { flex: none; font-size: .78rem; font-weight: 700; opacity: .65; }
.plan__empty { margin: 4px 0; padding: 14px; border-radius: 12px; background: #f6faf9; font-size: .92rem; text-align: center; }
.plan__empty[hidden] { display: none; }

.infos { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--p-line); }
.infos a, .infos__dl {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: #f0f6f4;
  font-size: .88rem; font-weight: 700; text-decoration: none; color: inherit; border: 0;
}
.infos a:hover, .infos__dl:hover { background: var(--p-ink); color: #fff; }
.infos svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.infos [hidden] { display: none; }

/* ---------- Plein écran ---------- */
.plan.is-fs { overflow: auto; padding: 18px; }
.plan.is-fs .plan__viewport, .plan.is-fs .plan__profile { width: min(100%, calc(100vh - 60px)); }

@media (prefers-reduced-motion: reduce) {
  .plan *, .plan *::before, .plan *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .shape--path { stroke-dashoffset: 0; }
}

@media (max-width: 560px) {
  .pin__dot { width: 26px; height: 26px; border-width: 2px; }
  .pin__dot svg { width: 14px; height: 14px; }
  .pin--small .pin__dot { width: 19px; height: 19px; }
  .pin--small .pin__dot svg { width: 11px; height: 11px; }
  .plan__hint { display: none; }
  .plan__tools button { width: 36px; height: 36px; }
}

/* Pin mis en avant (Essarts : restaurant, hébergements…) */
.pin--feat .pin__dot { width: 36px; height: 36px; }
.pin--feat .pin__dot svg { width: 19px; height: 19px; }
.pin--feat .pin__dot::before {
  content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--c); opacity: 0;
  animation: ping 2.2s ease-out infinite;
}
.pin__badge {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap;
  padding: 5px 11px; border-radius: 999px; background: var(--p-accent); color: #fff; font-size: .78rem; font-weight: 700;
  box-shadow: 0 5px 14px rgba(0, 60, 30, .35); pointer-events: none; transition: opacity .15s;
}
.pin--feat:hover .pin__badge, .pin--feat:focus-visible .pin__badge { opacity: 0; }
.card__links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.card__links .card__link { margin-top: 0; }
.card__link--alt { background: #eef5f2; color: var(--p-ink); box-shadow: inset 0 0 0 1.5px var(--p-line); }
.card__link--alt:hover { background: var(--p-ink); color: #fff; filter: none; }
