/* ScattoViaggiando — mappa dei viaggi (pagina /mappa, teaser home, widget storia, admin luoghi) */

/* ---------- elementi comuni ---------- */
.svmap-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.svmap-kicker { margin: 0 0 .35rem; font: 600 .72rem/1.2 var(--f-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--c-red); }
.svmap-btn {
  display: inline-flex; align-items: center; gap: .5em; padding: .72em 1.25em; border-radius: 999px;
  background: var(--c-red); color: #fff; font: 600 .95rem/1 var(--f-sans); text-decoration: none; border: 0; cursor: pointer;
  box-shadow: 0 6px 18px -8px rgb(215 20 26 / .7); transition: background .2s var(--ease), transform .2s var(--ease);
}
.svmap-btn:hover { background: var(--c-red-dark); color: #fff; transform: translateY(-1px); }
.svmap-btn:focus-visible, .svmap :focus-visible, .svmap-story :focus-visible, .svmap-teaser :focus-visible { outline: 3px solid var(--c-orange); outline-offset: 2px; }
.svmap-link { color: var(--c-red-dark); font-weight: 600; text-decoration: none; }
.svmap-link:hover { text-decoration: underline; }

/* Leaflet: tipografia e controlli in tono col sito */
.svmap .leaflet-container, .svmap-mini.leaflet-container, .svmap-admin-map.leaflet-container { font-family: var(--f-sans); background: #e8e2d6; }
.leaflet-container .leaflet-control-attribution { background: rgb(250 246 240 / .82); color: var(--c-muted); font-size: 10px; border-radius: 6px 0 0 0; backdrop-filter: blur(4px); }
.leaflet-container .leaflet-control-attribution a { color: var(--c-ink-2); }
.svmap .leaflet-bar, .svmap-mini .leaflet-bar, .svmap-admin-map .leaflet-bar { border: 0; box-shadow: var(--shadow-s); border-radius: 12px; overflow: hidden; }
.svmap .leaflet-bar a, .svmap-mini .leaflet-bar a, .svmap-admin-map .leaflet-bar a { width: 36px; height: 36px; line-height: 36px; color: var(--c-ink); background: var(--c-paper); border-color: var(--c-line); font: 500 20px/36px var(--f-sans); }
.svmap .leaflet-bar a:hover { background: #fff; color: var(--c-red); }

/* tessere più calde e morbide, in tono con la carta crema del sito */
.svmap .leaflet-tile-pane, .svmap-mini .leaflet-tile-pane, .svmap-admin-map .leaflet-tile-pane { filter: saturate(.72) sepia(.14) contrast(.94) brightness(1.04); }

/* ---------- marker ---------- */
.svm-marker { background: none; border: 0; }
.svm-marker:focus-visible { outline: none; }
.svm-marker:focus-visible .svm-pin, .svm-marker:focus-visible .svm-dot, .svm-marker:focus-visible .svm-cluster { box-shadow: 0 0 0 4px var(--c-orange), var(--shadow); }
.svm-pin {
  position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50%;
  background: var(--trip, var(--c-red)); padding: 3px; box-shadow: 0 6px 14px -4px rgb(22 20 18 / .5);
  transition: transform .25s var(--ease); transform-origin: 50% 115%;
}
.svm-pin::after { /* punta del segnaposto */
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; margin-left: -7px;
  background: var(--trip, var(--c-red)); transform: rotate(45deg); border-radius: 0 0 3px 0; z-index: -1;
}
.svm-marker .svm-pin img { display: block; width: 100%; height: 100%; max-width: none; aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 2px solid #fff; background: var(--c-paper-2); }
.svm-marker:hover .svm-pin, .svm-marker.is-active .svm-pin { transform: scale(1.18); }
.svm-marker.is-active .svm-pin, .svm-marker.is-active .svm-pin::after { background: var(--c-ink); }

.svm-dot {
  position: absolute; inset: 3px; border-radius: 50%; background: var(--c-paper); border: 3px solid var(--trip, var(--c-sea));
  box-shadow: 0 2px 6px rgb(22 20 18 / .35); transition: transform .2s var(--ease);
}
.svm-dot--story { background: var(--trip, var(--c-red)); border-color: #fff; }
.svm-dot b { display: grid; place-items: center; height: 100%; color: #fff; font: 700 11px/1 var(--f-sans); }
.svm-marker:hover .svm-dot, .svm-marker.is-active .svm-dot { transform: scale(1.3); }
.svm-marker.is-active .svm-dot { background: var(--c-ink); border-color: #fff; }

.svm-cluster {
  position: absolute; inset: 4px; border-radius: 50%; background: var(--c-paper-2); border: 3px solid var(--trip, #fff); overflow: hidden;
  box-shadow: 5px -4px 0 -1px #fff, 5px -4px 0 1px rgb(22 20 18 / .12), 10px -8px 0 -2px #fff, 10px -8px 0 0 rgb(22 20 18 / .1), 0 8px 18px -6px rgb(22 20 18 / .55);
  transition: transform .2s var(--ease);
}
.svm-marker .svm-cluster img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.svm-cluster--plain { background: var(--c-sea); }
.svm-cluster__count {
  position: absolute; top: -4px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; background: var(--c-red); color: #fff; border: 2px solid #fff;
  font: 700 12px/1 var(--f-sans); box-shadow: 0 2px 6px rgb(22 20 18 / .35);
}
.svm-cluster__label {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, 4px); white-space: nowrap;
  padding: .22em .65em; border-radius: 999px; background: rgb(22 20 18 / .84); color: #fff; font: 600 11px/1.3 var(--f-sans);
  pointer-events: none;
}
.svm-marker--cluster:hover .svm-cluster { transform: scale(1.08); }

@keyframes svm-pop { 0% { opacity: 0; transform: translateY(-14px) scale(.4); } 60% { opacity: 1; } }
/* Leaflet posiziona il contenitore con transform: animo solo il contenuto */
.svm-marker.is-new > * { animation: svm-pop .6s var(--ease) both; animation-delay: inherit; }

/* rotta */
/* colore e spessore arrivano dalle opzioni di Leaflet (colore del viaggio) */
.svm-route { fill: none; stroke-linecap: round; stroke-dasharray: 2 7; animation: svm-dash 1.6s linear infinite; }
.svm-route-shadow { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; transition: stroke-opacity .3s; }
.svm-route { transition: stroke-opacity .3s; }
@keyframes svm-dash { to { stroke-dashoffset: -18; } }
.svm-route--draw { stroke-dasharray: 2 7; }

.svm-tip { font: 600 12px/1.2 var(--f-sans); color: var(--c-ink); border: 0; border-radius: 8px; box-shadow: var(--shadow-s); }

/* =================================================================
   Pagina /mappa
   ================================================================= */
.page-map main { padding: 0; }
.svmap {
  position: relative; isolation: isolate; overflow: hidden;
  height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); min-height: 520px;
  background: #e8e2d6; color: var(--c-ink); font-family: var(--f-sans);
}
.svmap-canvas { position: absolute; inset: 0; z-index: 0; }
.svmap .leaflet-bottom.leaflet-right { bottom: 88px; }
.svmap .leaflet-bottom.leaflet-right .leaflet-control-zoom { margin: 0 16px 12px 0; }
.svmap.is-intro .svm-route { animation: svm-dash 1.6s linear infinite, svm-fade 1.6s var(--ease) both; }
@keyframes svm-fade { from { stroke-opacity: 0; } }

/* pannello */
.svmap-panel {
  position: absolute; z-index: 600; display: flex; flex-direction: column;
  background: rgb(250 246 240 / .94); backdrop-filter: blur(10px) saturate(1.1);
  box-shadow: var(--shadow-l); color: var(--c-ink);
}
.svmap-panel__handle { display: none; }
.svmap-panel__head { padding: 1.25rem 1.25rem .9rem; border-bottom: 1px solid var(--c-line); }
.svmap-panel__title { margin: 0 0 .9rem; font: 800 1.5rem/1.12 var(--f-serif); letter-spacing: -.01em; }
.svmap-panel__title em { font-style: italic; color: var(--c-red); }
.svmap-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0; }
.svmap-stats div { display: flex; flex-direction: column-reverse; padding: .55rem .7rem; border-radius: 12px; background: #fff; box-shadow: var(--shadow-s); }
.svmap-stats dt { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }
.svmap-stats dd { margin: 0; font: 900 1.4rem/1.1 var(--f-serif); font-variant-numeric: tabular-nums; color: var(--c-ink); }
.svmap-panel__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.svmap-tabs { display: flex; gap: .25rem; margin: .8rem 1.25rem .3rem; padding: .25rem; background: var(--c-paper-2); border-radius: 999px; }
.svmap-tabs[hidden] { display: none; }
.svmap-tabs button {
  flex: 1; padding: .45rem .5rem; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 600 .82rem/1 var(--f-sans); color: var(--c-ink-2);
}
.svmap-tabs button[aria-selected="true"] { background: #fff; color: var(--c-red-dark); box-shadow: var(--shadow-s); }
.svmap-list { flex: 1; overflow-y: auto; padding: .3rem .75rem 1rem; overscroll-behavior: contain; scrollbar-width: thin; }
.svmap-group__title {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: baseline;
  margin: 0; padding: .7rem .5rem .35rem; background: linear-gradient(rgb(250 246 240) 70%, rgb(250 246 240 / 0));
  font: 800 1.02rem/1.15 var(--f-serif); color: var(--c-ink);
}
.svmap-group__title span { font: 600 .72rem/1 var(--f-sans); color: var(--c-muted); }
.svmap-group ul { list-style: none; margin: 0; padding: 0; }
.svmap-item {
  display: flex; align-items: center; gap: .75rem; width: 100%; padding: .45rem .5rem; border: 0; border-radius: 12px;
  background: none; text-align: left; color: inherit; text-decoration: none; cursor: pointer; font: inherit;
  transition: background .15s, opacity .3s;
}
.svmap-item:hover { background: #fff; }
.svmap-item.is-active { background: #fff; box-shadow: inset 3px 0 0 var(--c-red), var(--shadow-s); }
.svmap-item.is-future { opacity: .38; }
.svmap-item__img { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--c-paper-2); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--c-line); }
.svmap-item__img--none { display: grid; place-items: center; }
.svmap-item__img--none::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--c-sea); }
.svmap-item__text { display: flex; flex-direction: column; min-width: 0; }
.svmap-item__text strong { font-weight: 600; font-size: .95rem; line-height: 1.25; }
.svmap-item__text small { font-size: .78rem; color: var(--c-muted); }
.svmap-item__text em { font-style: normal; color: var(--c-sea); }

/* timeline */
.svmap-timeline {
  position: absolute; z-index: 650; display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.1rem .7rem .7rem; border-radius: 999px;
  background: rgb(22 20 18 / .86); color: #fff; backdrop-filter: blur(8px); box-shadow: var(--shadow);
}
.svmap-timeline[hidden] { display: none; }
.svmap-play {
  flex: none; display: inline-flex; align-items: center; gap: .55rem; padding: .55rem 1rem .55rem .65rem;
  border: 0; border-radius: 999px; background: var(--c-red); color: #fff; cursor: pointer;
  font: 600 .9rem/1 var(--f-sans); transition: background .2s;
}
.svmap-play:hover { background: #ef2027; }
.svmap-play svg { width: 22px; height: 22px; fill: currentColor; padding: 3px; border-radius: 50%; background: rgb(255 255 255 / .2); }
.svmap-play__icon-pause, .svmap-play[aria-pressed="true"] .svmap-play__icon-play { display: none; }
.svmap-play[aria-pressed="true"] .svmap-play__icon-pause { display: block; }
.svmap-track { position: relative; flex: 1; min-width: 0; padding-bottom: 1rem; }
.svmap-range {
  --p: 1; display: block; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.svmap-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--c-red) calc(var(--p) * 100%), rgb(255 255 255 / .25) calc(var(--p) * 100%));
}
.svmap-range::-moz-range-track { height: 4px; border-radius: 4px; background: rgb(255 255 255 / .25); }
.svmap-range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--c-red); }
.svmap-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: #fff; border: 4px solid var(--c-red); box-shadow: 0 2px 6px rgb(0 0 0 / .4);
}
.svmap-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 4px solid var(--c-red); }
.svmap-range:focus-visible { outline: none; }
.svmap-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--c-orange); }
.svmap-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--c-orange); }
.svmap-years { position: absolute; left: 9px; right: 9px; bottom: 0; height: 1rem; pointer-events: none; }
.svmap-years span {
  position: absolute; left: calc(var(--x, 0) * 100%); transform: translateX(-2px);
  font: 600 .68rem/1 var(--f-sans); letter-spacing: .04em; color: rgb(255 255 255 / .7);
  padding-left: 6px; border-left: 1px solid rgb(255 255 255 / .35);
}
.svmap-now { flex: none; width: 13.5rem; font: 500 .85rem/1.25 var(--f-sans); color: rgb(255 255 255 / .92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* scheda luogo */
.svmap-card {
  position: absolute; z-index: 700; overflow: hidden; background: #fff; border-radius: var(--radius-l);
  box-shadow: var(--shadow-l); color: var(--c-ink); animation: svm-card-in .35s var(--ease) both;
}
.svmap-card[hidden] { display: none; }
.svmap-card:focus { outline: none; }
@keyframes svm-card-in { from { transform: translateY(14px) scale(.98); } }
.svmap-card__media { margin: 0; aspect-ratio: 4 / 3; background: var(--c-paper-2); }
.svmap-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.svmap-card__media--none { aspect-ratio: 16 / 5; background: radial-gradient(circle at 30% 120%, rgb(31 95 116 / .35), transparent 60%), repeating-linear-gradient(135deg, var(--c-paper) 0 12px, var(--c-paper-2) 12px 24px); }
.svmap-card__body { padding: 1.1rem 1.3rem 1rem; }
.svmap-card__meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .35rem; font: 600 .72rem/1 var(--f-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--c-red); }
.svmap-card__meta span + span::before { content: "·"; margin-right: .4rem; color: var(--c-muted); }
.svmap-card__title { margin: 0 0 .45rem; font: 800 1.6rem/1.1 var(--f-serif); letter-spacing: -.01em; }
.svmap-card__note { margin: 0 0 1rem; font-size: .95rem; line-height: 1.5; color: var(--c-ink-2); }
.svmap-card__story { margin: .55rem 0 0; font-size: .78rem; color: var(--c-muted); }
.svmap-card__soon { margin: 0; padding: .6rem .8rem; border-radius: 10px; background: var(--c-paper); font-size: .85rem; color: var(--c-ink-2); }
.svmap-card__nav { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--c-line); font-size: .78rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.svmap-card__nav button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--c-line); background: var(--c-paper);
  font: 600 1rem/1 var(--f-sans); color: var(--c-ink); cursor: pointer;
}
.svmap-card__nav button:hover:not(:disabled) { border-color: var(--c-red); color: var(--c-red); }
.svmap-card__nav button:disabled { opacity: .35; cursor: default; }
.svmap-card__close {
  position: absolute; top: .7rem; right: .7rem; z-index: 1; display: grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .92); cursor: pointer; box-shadow: var(--shadow-s);
}
.svmap-card__close svg { width: 18px; height: 18px; stroke: var(--c-ink); stroke-width: 2.2; stroke-linecap: round; fill: none; }

/* senza JS: solo elenco */
.svmap:not(.is-ready) .svmap-panel { position: relative; inset: auto; width: auto; max-width: 40rem; margin: 2rem auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.svmap:not(.is-ready) { height: auto; }

/* ---- desktop ---- */
@media (min-width: 900px) {
  .svmap-panel { top: 16px; left: 16px; bottom: 16px; width: 22rem; border-radius: var(--radius-l); overflow: hidden; }
  .svmap-timeline { left: calc(22rem + 32px); right: 16px; bottom: 16px; }
  .svmap-card { top: 16px; right: 16px; width: 22rem; max-height: calc(100% - 120px); overflow-y: auto; }
}
@media (min-width: 900px) and (max-width: 1180px) {
  .svmap-now { width: 9rem; }
}

/* ---- mobile: bottom sheet ---- */
@media (max-width: 899.98px) {
  .svmap { min-height: 460px; }
  .svmap .leaflet-bottom.leaflet-right { bottom: 132px; }
  .svmap .leaflet-bottom.leaflet-right .leaflet-control-zoom { display: none; }
  .svmap-panel {
    left: 0; right: 0; bottom: 0; max-height: 78%; border-radius: 22px 22px 0 0;
    transform: translateY(calc(100% - 56px)); transition: transform .35s var(--ease);
  }
  .svmap-panel.is-open { transform: none; z-index: 800; }
  .svmap-panel__handle {
    display: flex; flex-direction: column; align-items: center; gap: .35rem; flex: none; width: 100%; height: 56px;
    padding: .5rem 1rem; border: 0; background: none; cursor: pointer; font: 600 .88rem/1.2 var(--f-sans); color: var(--c-ink);
  }
  .svmap-panel__grip { width: 42px; height: 5px; border-radius: 5px; background: var(--c-line); }
  .svmap-panel__head { padding: .2rem 1rem .8rem; }
  .svmap-panel__head .svmap-kicker { display: none; }
  .svmap-panel__title { font-size: 1.3rem; margin-bottom: .7rem; }
  .svmap-panel:not(.is-ready *) .svmap-list { padding-bottom: 1.5rem; }
  .svmap-timeline { left: 8px; right: 8px; bottom: 64px; gap: .6rem; padding: .45rem .8rem .45rem .45rem; }
  .svmap-play { padding: .5rem; }
  .svmap-play__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .svmap-now { display: none; }
  .svmap-card {
    left: 8px; right: 8px; bottom: 130px; display: grid; grid-template-columns: 112px 1fr; border-radius: 20px; max-height: 60%;
  }
  .svmap-card[hidden] { display: none; }
  .svmap-card__media { aspect-ratio: auto; height: 100%; min-height: 150px; }
  .svmap-card__media--none { min-height: 0; }
  .svmap-card__body { padding: .8rem .9rem .7rem; min-width: 0; }
  .svmap-card__title { font-size: 1.3rem; padding-right: 1.8rem; }
  .svmap-card__note { font-size: .84rem; margin-bottom: .7rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .svmap-card .svmap-btn { padding: .6em 1em; font-size: .85rem; }
  .svmap-card__story { display: none; }
  .svmap-card__nav { margin-top: .6rem; padding-top: .5rem; }
  .svmap-card__nav button { width: 30px; height: 30px; }
  .svmap-card__close { top: .45rem; right: .45rem; width: 30px; height: 30px; }
  .svmap.has-card .svmap-panel:not(.is-open) { transform: translateY(100%); }
  .svmap.has-card .svmap-timeline { bottom: 8px; }
  .svmap.has-card .svmap-card { bottom: 72px; }
}

/* =================================================================
   Teaser home
   ================================================================= */
.svmap-teaser { font-family: var(--f-sans); color: var(--c-ink); }
.svmap-teaser__inner {
  display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
  max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--gutter);
}
.svmap-teaser__title { margin: 0 0 .8rem; font: 800 clamp(2rem, 4.5vw, 3.1rem)/1.06 var(--f-serif); letter-spacing: -.01em; }
.svmap-teaser__title em { font-style: italic; color: var(--c-red); }
.svmap-teaser__lead { margin: 0 0 1.4rem; max-width: 34rem; font-size: 1.05rem; line-height: 1.6; color: var(--c-ink-2); }
.svmap-teaser__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1.6rem; max-width: 30rem; }
.svmap-teaser__stats div { display: flex; flex-direction: column-reverse; padding: .7rem .4rem .6rem; border-top: 3px solid var(--c-red); background: #fff; border-radius: 0 0 12px 12px; box-shadow: var(--shadow-s); text-align: center; }
.svmap-teaser__stats dt { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); }
.svmap-teaser__stats dd { margin: 0; font: 900 clamp(1.4rem, 3vw, 1.9rem)/1.1 var(--f-serif); font-variant-numeric: tabular-nums; }
.svmap-teaser__map { position: relative; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-l); background: #e8e2d6; transform: rotate(-.6deg); }
.svmap-teaser__overlay { position: absolute; inset: 0 0 18px; z-index: 450; }
.svmap-teaser__badge {
  position: absolute; z-index: 460; top: 1rem; left: 1rem; padding: .4rem .8rem; border-radius: 999px;
  background: rgb(250 246 240 / .94); font: 400 1.25rem/1 var(--f-hand); color: var(--c-red-dark); box-shadow: var(--shadow-s);
  transform: rotate(-3deg);
}
.svmap-mini { width: 100%; background: #e8e2d6; }
.svmap-mini--teaser { aspect-ratio: 16 / 10; min-height: 260px; }
.svmap-mini.is-error { display: none; }
@media (min-width: 860px) {
  .svmap-teaser__inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.svmap-mini--teaser .svm-route--draw { animation: svm-dash 1.6s linear infinite, svm-fade 2s var(--ease) both; }

/* =================================================================
   Widget nella pagina storia
   ================================================================= */
.svmap-story {
  display: grid; gap: 1rem 1.5rem; margin: clamp(2rem, 5vw, 3.5rem) 0; padding: clamp(1rem, 3vw, 1.6rem);
  background: var(--c-paper-2); border-radius: var(--radius-l); font-family: var(--f-sans); color: var(--c-ink);
}
.svmap-story__title { margin: 0; font: 800 1.55rem/1.12 var(--f-serif); letter-spacing: -.01em; }
.svmap-story .svmap-mini--story { aspect-ratio: 16 / 9; min-height: 240px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-s); }
.svmap-story__list { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.svmap-story__list a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border-radius: 999px;
  background: #fff; color: var(--c-ink); font-size: .88rem; font-weight: 500; text-decoration: none; box-shadow: var(--shadow-s);
}
.svmap-story__list a:hover { color: var(--c-red-dark); }
.svmap-story__pin { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--c-red); color: #fff; font: 700 10px/1 var(--f-sans); }
.svmap-story__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0; font-size: .88rem; color: var(--c-muted); }
@media (min-width: 860px) {
  .svmap-story { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); grid-template-areas: "head map" "list map" "foot map"; align-content: start; }
  .svmap-story__head { grid-area: head; align-self: end; }
  .svmap-story .svmap-mini--story { grid-area: map; height: 100%; aspect-ratio: auto; min-height: 300px; }
  .svmap-story__list { grid-area: list; align-self: start; }
  .svmap-story__foot { grid-area: foot; align-self: end; flex-direction: column; }
}

/* =================================================================
   Admin: /admin/luoghi e pannello nella modifica storia
   ================================================================= */
.svmap-admin { display: grid; gap: 1rem; font-family: var(--f-sans); }
.svmap-admin-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem; }
.svmap-admin-head h1 { margin: 0; font: 800 2rem/1.1 var(--f-serif); }
.svmap-admin-hint { margin: 0; color: var(--c-muted); font-size: .9rem; }
.svmap-admin-h { margin: 0 0 .5rem; font: 800 1.1rem/1.15 var(--f-serif); }
.svmap-admin-grid { display: grid; gap: 1rem; }
@media (min-width: 1000px) { .svmap-admin-grid { grid-template-columns: minmax(0, 1fr) 24rem; align-items: start; } }
.svmap-admin-map { position: relative; height: min(72vh, 720px); min-height: 380px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-s); background: #e8e2d6; }
.svmap-panel-admin .svmap-admin-map { height: 340px; min-height: 0; }
.svmap-admin-map.is-picking { cursor: crosshair; }
.svmap-admin-map.is-picking .leaflet-container, .svmap-admin-map.is-picking.leaflet-container { cursor: crosshair; }
.svmap-admin-banner {
  position: absolute; z-index: 800; top: .75rem; left: 50%; transform: translateX(-50%); padding: .5rem .9rem; border-radius: 999px;
  background: var(--c-ink); color: #fff; font-size: .85rem; box-shadow: var(--shadow); white-space: nowrap; pointer-events: none;
}
.svmap-admin-banner[hidden] { display: none; }
.svmap-admin-side { display: grid; gap: 1rem; }
.svmap-admin-box { padding: 1rem; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); }
.svmap-admin-search { position: relative; display: flex; gap: .5rem; }
.svmap-admin-search input { flex: 1; min-width: 0; }
.svmap-admin input[type="text"], .svmap-admin input[type="search"], .svmap-admin input[type="date"], .svmap-admin input[type="number"],
.svmap-admin select, .svmap-admin textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--c-line); border-radius: 10px; background: #fff;
  font: 400 .92rem/1.3 var(--f-sans); color: var(--c-ink);
}
.svmap-admin textarea { min-height: 4.5rem; resize: vertical; }
.svmap-admin input:focus-visible, .svmap-admin select:focus-visible, .svmap-admin textarea:focus-visible, .svmap-admin button:focus-visible { outline: 3px solid var(--c-orange); outline-offset: 1px; }
.svmap-admin label { display: grid; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--c-ink-2); }
.svmap-admin-form { display: grid; gap: .7rem; }
.svmap-admin-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.svmap-admin-form .coords { font-size: .8rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.svmap-admin-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.svm-btn {
  display: inline-flex; align-items: center; gap: .35rem; padding: .55rem .95rem; border-radius: 999px; border: 1px solid var(--c-line);
  background: var(--c-paper); color: var(--c-ink); font: 600 .85rem/1 var(--f-sans); cursor: pointer; text-decoration: none;
}
.svm-btn:hover { border-color: var(--c-ink-2); }
.svm-btn--red { background: var(--c-red); border-color: var(--c-red); color: #fff; }
.svm-btn--red:hover { background: var(--c-red-dark); }
.svm-btn--danger { color: var(--c-red-dark); background: #fff; }
.svm-btn--danger:hover { border-color: var(--c-red); }
.svm-btn[disabled] { opacity: .5; cursor: progress; }
.svmap-admin-results { list-style: none; margin: .4rem 0 0; padding: 0; border: 1px solid var(--c-line); border-radius: 10px; overflow: hidden; background: #fff; }
.svmap-admin-results:empty { display: none; }
.svmap-admin-results button { display: block; width: 100%; padding: .55rem .7rem; border: 0; border-bottom: 1px solid var(--c-line); background: none; text-align: left; cursor: pointer; font: inherit; font-size: .85rem; }
.svmap-admin-results li:last-child button { border-bottom: 0; }
.svmap-admin-results button:hover, .svmap-admin-results button:focus-visible { background: var(--c-paper); }
.svmap-admin-results small { display: block; color: var(--c-muted); font-size: .75rem; }
.svmap-admin-msg { margin: .4rem 0 0; font-size: .85rem; color: var(--c-muted); }
.svmap-admin-msg.is-error { color: var(--c-red-dark); }
.svmap-admin-list { list-style: none; margin: 0; padding: 0; max-height: 26rem; overflow: auto; }
.svmap-panel-admin .svmap-admin-list { max-height: none; }
.svmap-admin-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem .3rem; border-bottom: 1px solid var(--c-line); }
.svmap-admin-list li:last-child { border-bottom: 0; }
.svmap-admin-list li.is-active { background: var(--c-paper); }
.svmap-admin-list img, .svmap-admin-list .noimg { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--c-paper-2); }
.svmap-admin-list .txt { flex: 1; min-width: 0; }
.svmap-admin-list .txt button { padding: 0; border: 0; background: none; font: 600 .9rem/1.25 var(--f-sans); color: var(--c-ink); cursor: pointer; text-align: left; }
.svmap-admin-list .txt button:hover { color: var(--c-red-dark); text-decoration: underline; }
.svmap-admin-list small { display: block; font-size: .75rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svmap-admin-filter { display: flex; gap: .5rem; margin-bottom: .6rem; }
.svmap-admin-photos { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 9.5rem; overflow: auto; padding: .1rem; }
.svmap-admin-photos button { width: 52px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--c-paper-2); cursor: pointer; }
.svmap-admin-photos button[aria-pressed="true"] { border-color: var(--c-red); box-shadow: 0 0 0 2px #fff inset; }
.svmap-admin-photos button.none { font-size: .66rem; line-height: 1.1; color: var(--c-ink-2); }
.svmap-admin-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.svmap-panel-admin { display: grid; gap: .8rem; }
@media (min-width: 900px) { .svmap-panel-admin .svmap-panel-admin__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1rem; align-items: start; } }
.svmap-panel-admin__grid > * + * { margin-top: 0; }
@media (max-width: 899.98px) { .svmap-panel-admin__grid { display: grid; gap: .8rem; } }

/* admin: dettagli */
.svmap-admin-mapwrap { position: relative; }
.svmap-admin-hint--below { margin-top: .5rem; font-size: .8rem; }
.svmap-admin-label { display: block; margin-bottom: .3rem; font-size: .8rem; font-weight: 600; color: var(--c-ink-2); }
.svm-btn--ghost { background: #fff; }
.svmap-admin-list em { font-style: normal; color: var(--c-sea); }

.svm-marker--draft .svm-dot { background: var(--c-orange); border-color: #fff; transform: scale(1.15); box-shadow: 0 0 0 5px rgb(242 162 27 / .35), 0 2px 6px rgb(22 20 18 / .35); }
.svmap-admin-grid, .svmap-panel-admin__grid, .svmap-admin-side { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .svmap-admin-grid { grid-template-columns: minmax(0, 1fr) 24rem; } }
@media (min-width: 900px) { .svmap-panel-admin .svmap-panel-admin__grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.svmap-admin-photos button.none { width: auto; padding: 0 .55rem; }
@media (max-width: 699.98px) {
  .svmap-admin-map { height: min(58vh, 420px); min-height: 300px; }
  .svmap-admin-banner { white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 5.5rem); left: auto; right: .75rem; transform: none; font-size: .8rem; }
}

/* ---------- viaggi ---------- */
.svm-marker.is-dim { opacity: .38; filter: grayscale(.5); }
.svm-marker.is-dim:hover, .svm-marker.is-dim:focus-visible { opacity: .9; filter: none; }
.svmap-km { margin: .55rem 0 0; font-size: .8rem; color: var(--c-muted); }
.svmap-km span[data-stat] { font-weight: 700; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.svmap-km__hint { display: none; }
.svmap-tabs button { padding-inline: .3rem; }
.svmap-showall {
  display: block; margin: .3rem .25rem .5rem; padding: .45rem .8rem; border: 1px solid var(--c-line); border-radius: 999px;
  background: #fff; font: 600 .82rem/1 var(--f-sans); color: var(--c-ink-2); cursor: pointer;
}
.svmap-showall:hover { border-color: var(--c-ink-2); }
.svmap-tripcard {
  position: relative; margin: .5rem .1rem .6rem; padding: .55rem .6rem .6rem .8rem; border-radius: 16px; background: #fff;
  box-shadow: var(--shadow-s); border-left: 5px solid var(--trip, var(--c-red)); transition: opacity .3s, box-shadow .2s;
}
.svmap-tripcard.is-active { box-shadow: 0 0 0 2px var(--trip, var(--c-red)), var(--shadow); }
.svmap.has-focus .svmap-tripcard:not(.is-active) { opacity: .55; }
.svmap-tripcard.is-future { opacity: .35; }
.svmap-tripcard__main {
  display: flex; align-items: center; gap: .75rem; width: 100%; padding: 0; border: 0; background: none;
  text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.svmap-tripcard__img { flex: none; width: 52px; height: 52px; border-radius: 14px; object-fit: cover; background: var(--c-paper-2); }
.svmap-tripcard__img--none { background: radial-gradient(circle, var(--trip, var(--c-red)) 0 7px, transparent 8px), var(--c-paper-2); }
.svmap-tripcard__text { display: flex; flex-direction: column; min-width: 0; }
.svmap-tripcard__text strong { font: 800 1.02rem/1.15 var(--f-serif); color: var(--c-ink); }
.svmap-tripcard__main:hover strong { color: var(--c-red-dark); }
.svmap-tripcard__text small { font-size: .78rem; color: var(--c-muted); line-height: 1.35; }
.svmap-tripcard__countries { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svmap-tripcard__stops { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 0; padding: 0; list-style: none; counter-reset: tappa; }
.svmap-chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .55rem .22rem .3rem; border: 1px solid var(--c-line); border-radius: 999px;
  background: var(--c-paper); font: 600 .74rem/1.2 var(--f-sans); color: var(--c-ink-2); cursor: pointer;
}
.svmap-chip::before {
  counter-increment: tappa; content: counter(tappa); display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--trip, var(--c-red)); color: #fff; font-size: .62rem;
}
.svmap-chip:hover, .svmap-chip.is-active { border-color: var(--trip, var(--c-red)); color: var(--c-ink); background: #fff; }
.svmap-item .svmap-item__img { box-shadow: 0 0 0 2px var(--trip, var(--c-line)); }
.svmap-card__trip { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 .7rem; font-size: .82rem; color: var(--c-muted); }
.svmap-card__swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--trip, var(--c-red)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--trip, var(--c-red)) 25%, transparent); }
.svmap-card__triplink { padding: 0; border: 0; background: none; font: 700 .82rem/1.3 var(--f-sans); color: var(--c-ink); cursor: pointer; text-decoration: underline; text-decoration-color: var(--trip, var(--c-red)); text-decoration-thickness: 2px; text-underline-offset: 3px; }
@media (max-width: 899.98px) {
  .svmap-km { display: none; }
  .svmap-card__trip { margin-bottom: .45rem; font-size: .76rem; }
}

/* admin: viaggi */
.svmap-admin-trips summary { cursor: pointer; list-style: none; }
.svmap-admin-trips summary::-webkit-details-marker { display: none; }
.svmap-admin-trips summary .svmap-admin-h::after { content: " ▾"; color: var(--c-muted); font-size: .8em; }
.svmap-admin-trips[open] summary .svmap-admin-h::after { content: " ▴"; }
.svmap-admin-trips .svmap-admin-hint { margin-bottom: .6rem; font-size: .8rem; }
.svmap-admin-triplist { list-style: none; margin: 0 0 .7rem; padding: 0; max-height: 18rem; overflow: auto; }
.svmap-admin-triplist li { display: flex; align-items: center; gap: .6rem; padding: .4rem .2rem; border-bottom: 1px solid var(--c-line); }
.svmap-admin-triplist li:last-child { border-bottom: 0; }
.svmap-admin-triplist li.empty { color: var(--c-muted); font-size: .85rem; }
.svmap-admin-triplist .sw, .svmap-admin-list .sw { flex: none; display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--trip, var(--c-muted)); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--c-line); }
.svmap-admin-list .sw { width: 9px; height: 9px; margin-right: .35rem; vertical-align: 1px; }
.svmap-admin-triplist .txt { flex: 1; min-width: 0; }
.svmap-admin-triplist .txt button { padding: 0; border: 0; background: none; font: 700 .9rem/1.25 var(--f-sans); color: var(--c-ink); cursor: pointer; text-align: left; }
.svmap-admin-triplist .txt button:hover { color: var(--c-red-dark); text-decoration: underline; }
.svmap-admin-triplist small { display: block; font-size: .75rem; color: var(--c-muted); }
.svmap-admin-tripform { display: grid; gap: .7rem; margin-bottom: .8rem; padding: .8rem; border-radius: 12px; background: var(--c-paper); }
.svmap-admin-tripform[hidden] { display: none; }
.svmap-admin-swatches { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .45rem; }
.svmap-admin-swatches button { width: 30px; height: 30px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--c-line); cursor: pointer; }
.svmap-admin-swatches button.auto { width: auto; padding: 0 .6rem; border-radius: 999px; background: #fff; font: 600 .75rem/1 var(--f-sans); color: var(--c-ink-2); }
.svmap-admin-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--c-ink); }
.svmap-admin .svmap-admin-inline { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.svmap-admin-inline input[type="color"] { width: 36px; height: 28px; padding: 0; border: 1px solid var(--c-line); border-radius: 6px; background: none; }
.svmap-admin-list small.trip { color: var(--c-ink-2); }

/* ---------- movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  .svm-route, .svmap.is-intro .svm-route, .svmap-mini--teaser .svm-route--draw { animation: none; }
  .svm-marker.is-new > *, .svmap-card { animation: none; }
  .svmap-panel, .svm-pin, .svm-dot, .svm-cluster, .svmap-btn { transition: none; }
}
