/* Map container - hide markers outside bounds */
div[data-map="openlayers"] {
  overflow: hidden;
}

/* Nearby markers popup styles - tooltip style */
.nearby-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;
}

/* Arrow pointing down to marker */
.nearby-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));
}

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

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

.nearby-popup .popup-content {
  padding: 0;
}

/* Layout verticale: immagine grande sopra, testo sotto */
.nearby-popup .popup-content-wrapper {
  display: block;
}

.nearby-popup .popup-image {
  margin-bottom: 15px;
}

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

.nearby-popup .popup-text {
  padding: 0 5px;
}

.nearby-popup .popup-category {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* Linea colorata sotto la categoria */
.nearby-popup .popup-category::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #00a0d2 0%, #8bc53f 100%);
  margin-top: 8px;
}

.nearby-popup .popup-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

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

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

/* Legacy styles per retrocompatibilita */
.nearby-popup .popup-content .content {
  width: 200px;
}

/* Image field (legacy) */
.nearby-popup .field-name-field-immagine-top {
  margin-bottom: 8px;
}

.nearby-popup .field-name-field-immagine-top img {
  width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 3px;
}

/* Category field (legacy) */
.nearby-popup .field-name-field-tipologia-attrattore {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

/* Title field (legacy) */
.nearby-popup .field-name-title-field h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.nearby-popup .field-name-title-field h2 a {
  color: #333;
  text-decoration: none;
}

.nearby-popup .field-name-title-field h2 a:hover {
  color: #0066cc;
}

.nearby-popup .popup-loading {
  color: #666;
  font-style: italic;
  padding: 20px;
  text-align: center;
}

.nearby-popup .popup-error {
  color: #c00;
  padding: 20px;
  text-align: center;
}

/* Marker hover effect */
.nearby-marker-overlay:hover {
  transform: translate(-50%, -100%) scale(1.1);
  z-index: 200 !important;
}

/* ==============================================
   OpenLayers popup styles per mappa "Nelle vicinanze"
   Layout verticale: immagine grande sopra, testo sotto
   ============================================== */

/* Popup con layout verticale */
.ol-popup.popup {
  max-width: 320px;
  min-width: 280px;
}

/* Layout verticale (non flexbox) */
.ol-popup.popup .node--view-mode-teaser {
  display: block !important;
  padding: 0 !important;
}

/* Immagine grande sopra */
.ol-popup.popup .node--view-mode-teaser .image-wrapper {
  width: 100% !important;
  margin: 0 0 15px 0 !important;
}

.ol-popup.popup .node--view-mode-teaser .image-wrapper img {
  width: 100% !important;
  height: auto !important;
  max-height: 180px !important;
  object-fit: cover !important;
  border-radius: 0 !important;
}

/* Testo sotto */
.ol-popup.popup .node--view-mode-teaser .content-wrapper {
  padding: 0 15px 15px 15px !important;
}

.ol-popup.popup .node--view-mode-teaser .content-wrapper .content {
  padding: 0 !important;
  width: auto !important;
}

/* Categoria */
.ol-popup.popup .node--view-mode-teaser .field-name-field-tipologia-attrattore {
  font-size: 12px !important;
  color: #666 !important;
  text-transform: uppercase !important;
  margin-bottom: 8px !important;
  letter-spacing: 0.5px !important;
}

/* Linea colorata dopo categoria */
.ol-popup.popup .node--view-mode-teaser .field-name-field-tipologia-attrattore::after {
  content: '' !important;
  display: block !important;
  width: 40px !important;
  height: 3px !important;
  background: linear-gradient(90deg, #00a0d2 0%, #8bc53f 100%) !important;
  margin-top: 8px !important;
}

/* Titolo */
.ol-popup.popup .node--view-mode-teaser h2 {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

.ol-popup.popup .node--view-mode-teaser h2 a {
  color: #333 !important;
  text-decoration: none !important;
}

.ol-popup.popup .node--view-mode-teaser h2 a:hover {
  color: #0066cc !important;
  text-decoration: underline !important;
}
