/* Rimuovi sfondo grigio della mappa */
#leaflet-map-view-destinazioni-contenuto-attachment-1 {
  background: transparent !important;
  opacity: 0 !important;
}

#leaflet-map-view-destinazioni-contenuto-attachment-1 .leaflet-container {
  background: transparent !important;
}

#leaflet-map-view-destinazioni-contenuto-attachment-1 .leaflet-pane {
  background: transparent !important;
}

/* Mostra la mappa quando tutte le immagini dei marker sono caricate */
#leaflet-map-view-destinazioni-contenuto-attachment-1.markers-loaded {
  opacity: 1 !important;
}

/* Nascondi i marker di Leaflet fino a quando non vengono personalizzati */
#leaflet-map-view-destinazioni-contenuto-attachment-1 .leaflet-marker-icon {
  opacity: 0 !important;
}

/* Mostra i marker quando hanno la classe 'custom-icon-applied' */
#leaflet-map-view-destinazioni-contenuto-attachment-1 .leaflet-marker-icon.custom-icon-applied {
  opacity: 1 !important;
}

/* ==============================================
   Popup Ricchi per Località Turistiche
   Adapted from openlayers-nearby-markers.css
   ============================================== */

/* Assicura che il map container possa contenere popup posizionati assolutamente */
#leaflet-map-view-destinazioni-contenuto-attachment-1 {
  position: relative;
}

/* Popup container - positioned above marker */
.luoghi-localita-popup {
  position: absolute;
  background: white;
  padding: 12px 15px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  min-width: 180px;
  max-width: 280px;
  z-index: 1000;
  pointer-events: auto;
  display: none;
}

/* Arrow pointing down to marker */
.luoghi-localita-popup .popup-arrow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid white;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

/* Close button */
.luoghi-localita-popup .popup-closer {
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 18px;
  text-decoration: none;
  color: #999;
  z-index: 10;
  line-height: 1;
}

.luoghi-localita-popup .popup-closer:hover {
  color: #333;
}

/* Content container */
.luoghi-localita-popup .popup-content {
  padding: 0;
}

/* Layout: Image above, text below */
.luoghi-localita-popup .popup-content-wrapper {
  display: block;
}

/* Image section */
.luoghi-localita-popup .popup-image {
  margin-bottom: 15px;
}

.luoghi-localita-popup .popup-image img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  border-radius: 0;
}

/* Text section */
.luoghi-localita-popup .popup-text {
  padding: 0 5px;
}

/* Category label */
.luoghi-localita-popup .popup-category {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* Colored line under category */
.luoghi-localita-popup .popup-category::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #00a0d2 0%, #8bc53f 100%);
  margin-top: 8px;
}

/* Title */
.luoghi-localita-popup .popup-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.luoghi-localita-popup .popup-title a {
  color: #333;
  text-decoration: none;
}

.luoghi-localita-popup .popup-title a:hover {
  color: #0066cc;
  text-decoration: underline;
}

/* Loading state */
.luoghi-localita-popup .popup-loading {
  color: #666;
  font-style: italic;
  padding: 20px;
  text-align: center;
}

/* Error state */
.luoghi-localita-popup .popup-error {
  color: #c00;
  padding: 20px;
  text-align: center;
}
