/* Pagina mappa — layout full-height, filtri client-side (zero fetch extra) */

body.map-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

.map-page main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map-toolbar {
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.map-toolbar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.map-toolbar-intro {
  flex: none;
  width: 100%;
  text-align: center;
}

.map-toolbar-intro h1 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--blue-dark);
  margin: 0 0 0.15rem;
}

.map-toolbar-intro p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.map-dream-copy strong {
  color: var(--blue-dark);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 2 1 280px;
}

.map-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  flex: 1 1 120px;
}

.map-filters input {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}

.map-filters input:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--focus-ring);
}

.map-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.map-btn {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.map-btn:hover {
  border-color: var(--border-strong);
  color: var(--blue);
}

.map-btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.map-btn--primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--white);
}

.map-status {
  flex-shrink: 0;
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  text-align: center;
  background: rgba(0, 113, 194, 0.08);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.map-status--error {
  background: #fff3f3;
  color: #8b2020;
}

#map {
  flex: 1;
  min-height: 280px;
  width: 100%;
  height: 100%;
  background: #e8eef4;
  z-index: 0;
}

.map-stage {
  position: relative;
  flex: 1;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.map-popup-meta {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.map-popup-cta {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 600;
}

.leaflet-popup-content {
  margin: 12px 14px;
  line-height: 1.45;
}

/* Pin dimostrativi — anteprima «rete che cresce» */
.demo-pin-leaflet {
  background: transparent !important;
  border: none !important;
}

.demo-pin-burst {
  position: relative;
  width: 28px;
  height: 28px;
}

.demo-pin-burst::before,
.demo-pin-burst::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.demo-pin-burst::before {
  width: 12px;
  height: 12px;
  background: var(--yellow);
  border: 2px solid var(--blue-dark);
  animation: demo-pin-pop 0.45s ease-out;
}

.demo-pin-burst::after {
  width: 12px;
  height: 12px;
  border: 2px solid var(--yellow);
  animation: demo-pin-ring 0.7s ease-out forwards;
}

@keyframes demo-pin-pop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes demo-pin-ring {
  0% { width: 12px; height: 12px; opacity: 0.85; }
  100% { width: 36px; height: 36px; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-pin-burst::before,
  .demo-pin-burst::after {
    animation: none;
  }
}

.step-card--link {
  padding: 0;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.step-card--link:hover {
  border-color: var(--light-blue);
  box-shadow: 0 6px 24px rgba(0, 113, 194, 0.12);
}

.step-card-link {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.step-map-cta {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue);
}

.step-card-link:hover .step-map-cta {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .map-toolbar-intro h1 {
    font-size: 1.4rem;
  }
}
