/* RC88 · Mappa in stile carta antica
   Filtro seppia sulle tessere, cornice da carta geografica, rosa dei venti e
   cartiglio. Solo aspetto: i comandi della mappa restano quelli di prima. */

.map-panel.is-antique #resultsMap {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--arte-accent, #8a6a3d) 55%, transparent);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 6px color-mix(in srgb, var(--arte-paper, #f7f3ea) 92%, transparent),
    inset 0 0 0 7px color-mix(in srgb, var(--arte-accent, #8a6a3d) 40%, transparent),
    inset 0 0 60px color-mix(in srgb, #6b4d24 26%, transparent),
    var(--arte-shadow, 0 10px 30px rgba(52, 38, 22, .14));
}

.map-panel.is-antique #resultsMap .leaflet-tile-pane {
  filter: sepia(.52) saturate(.68) contrast(1.06) brightness(1.03) hue-rotate(-6deg);
}

/* Il riquadro della mappa è il riferimento di posizione degli arredi. */
.map-panel #resultsMap { position: relative; }

.map-panel.is-antique #resultsMap .leaflet-container,
.map-panel.is-antique #resultsMap .leaflet-control-attribution {
  background: var(--arte-paper, #f7f3ea);
  color: var(--arte-ink-soft, #5d5347);
  font-family: var(--arte-serif, Georgia, serif);
  font-size: 10px;
}

.map-panel.is-antique #resultsMap .leaflet-control-attribution a {
  color: var(--arte-accent, #8a6a3d);
}

.map-panel.is-antique .leaflet-control-zoom a {
  border-color: color-mix(in srgb, var(--arte-accent, #8a6a3d) 40%, transparent);
  background: var(--arte-paper, #f7f3ea);
  color: var(--arte-ink, #2c2620);
  font-family: var(--arte-serif, Georgia, serif);
}

/* ------------------------------------------------------ rosa dei venti */

.arte-compass {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: 12px;
  width: clamp(66px, 13vw, 92px);
  height: auto;
  opacity: .92;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(60, 42, 20, .28));
}

.arte-compass-ring {
  fill: none;
  stroke: var(--arte-accent, #8a6a3d);
  stroke-width: 1.6;
}

.arte-compass-ring.is-thin { stroke-width: .7; opacity: .7; }

.arte-compass-star {
  fill: color-mix(in srgb, var(--arte-paper, #f7f3ea) 88%, transparent);
  stroke: var(--arte-accent, #8a6a3d);
  stroke-width: .7;
}

.arte-compass-needle {
  fill: var(--arte-accent, #8a6a3d);
  opacity: .85;
}

.arte-compass-hub {
  fill: var(--arte-ink, #2c2620);
  stroke: var(--arte-paper, #f7f3ea);
  stroke-width: 1;
}

/* ------------------------------------------------------------ cartiglio */

.arte-cartouche {
  position: absolute;
  z-index: 500;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 14px;
  border: 1px solid color-mix(in srgb, var(--arte-accent, #8a6a3d) 45%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--arte-paper, #f7f3ea) 94%, transparent);
  color: var(--arte-ink, #2c2620);
  font-family: var(--arte-serif, Georgia, serif);
  font-size: .68rem;
  font-style: italic;
  letter-spacing: .06em;
  white-space: nowrap;
  pointer-events: none;
}

.arte-cartouche span {
  margin-right: 7px;
  color: var(--arte-accent, #8a6a3d);
  font-style: normal;
}

/* ------------------------------------------------ interruttore di stile */

.arte-map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid var(--line, #d8cfc0);
  border-radius: 999px;
  background: var(--chip-bg, #fff);
  color: var(--muted, #6b6152);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.arte-map-toggle:hover,
.arte-map-toggle:focus-visible {
  border-color: var(--arte-accent, #8a6a3d);
  color: var(--arte-ink, #2c2620);
}

.arte-map-toggle.is-active {
  border-color: var(--arte-accent, #8a6a3d);
  background: color-mix(in srgb, var(--arte-accent, #8a6a3d) 14%, #fff);
  color: var(--arte-ink, #2c2620);
}

.arte-map-toggle .arte-compass-mini {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: currentColor;
}

.map-panel.is-antique #resultsMap.is-empty .arte-compass,
.map-panel.is-antique #resultsMap.is-empty .arte-cartouche { display: none; }

@media (max-width: 560px) {
  .arte-map-toggle { margin-left: 0; flex: 1 1 100%; justify-content: center; }
  .arte-cartouche { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .arte-compass { transition: none; }
}
