/* ═════════════════════════════════════════════════════════════════════════
   Mappa-laboratorio — pagina pubblica output post-I3 Laboratorio Mappa-Caccia
   Accessibile via /mappa-laboratorio?id=N
   ═════════════════════════════════════════════════════════════════════════ */

.ml-page {
  padding-bottom: 4rem;
}

.ml-hero {
  background: var(--color-bg);
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.ml-hero h1 {
  font-size: 2.2rem;
  line-height: 1.1;
  margin: 0.3rem 0 0.75rem;
  color: var(--color-text);
}

.ml-lead {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--color-text);
  max-width: 680px;
  margin-bottom: 1.25rem;
}

.ml-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.ml-meta div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ml-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.ml-meta dd {
  font-size: 0.95rem;
  margin: 0;
  color: var(--color-text);
}

.ml-section {
  margin-bottom: 3rem;
}

.ml-muted {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 640px;
  margin-bottom: 1.25rem;
}

.ml-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.ml-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--color-bg);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Mappa Leaflet */
.ml-mappa-container {
  width: 100%;
  height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
  z-index: 0;
}

.ml-mappa-container:empty::before {
  content: 'Mappa non disponibile';
  display: block;
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
}

/* Popup Leaflet */
.ml-popup-titolo {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.ml-popup-squadra {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.ml-popup-thumb {
  width: 100%;
  max-width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  cursor: pointer;
}

/* Griglia foto */
.ml-foto-griglia {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

.ml-foto-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.ml-foto-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.ml-foto-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-bg);
  display: block;
}

.ml-foto-body {
  padding: 0.9rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ml-foto-tipo {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.ml-foto-titolo {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.ml-foto-didascalia {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  flex: 1;
  margin-bottom: 0.75rem;
}

.ml-foto-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 0.6rem;
  margin-top: auto;
}

.ml-foto-squadra-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
}

/* Confronti */
.ml-confronti-item {
  padding: 0.9rem 1rem;
  background: var(--color-bg);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 0.75rem;
}

.ml-confronti-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ml-confronti-istituzione {
  font-weight: 600;
  color: var(--color-text);
}

.ml-confronti-stato {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 50px;
  background: var(--color-bg-card);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* CTA */
.ml-cta {
  text-align: center;
  background: var(--color-bg);
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  margin-top: 3rem;
}

.ml-cta h2 {
  margin-bottom: 0.5rem;
}

.ml-cta p {
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 1.25rem;
  line-height: 1.5;
}

/* Modal foto full-size */
.ml-foto-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.ml-foto-modal.is-hidden {
  display: none;
}

.ml-foto-modal-inner {
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ml-foto-modal img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: #000;
  display: block;
  margin: 0 auto;
}

.ml-foto-modal-info {
  background: var(--color-bg-card);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  color: var(--color-text);
}

.ml-foto-modal-info h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.ml-foto-modal-info p {
  margin: 0 0 0.75rem;
  line-height: 1.55;
}

.ml-foto-modal-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ml-foto-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.ml-foto-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.is-hidden {
  display: none;
}

@media (max-width: 640px) {
  .ml-hero h1 {
    font-size: 1.7rem;
  }
  .ml-mappa-container {
    height: 320px;
  }
  .ml-foto-img {
    height: 180px;
  }
}
