/* RFL – Anagrafiche · mappa: segnaposti, gruppi, scatole ed elenco */

.rfl-mappa-wrap { margin: 12px 0 20px; }
.rfl-mappa-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
@media (max-width: 900px) { .rfl-mappa-layout { grid-template-columns: 1fr; } .rfl-mappa-lista { max-height: 360px !important; } }

.rfl-mappa {
	width: 100%;
	min-height: 320px;
	border-radius: 14px;
	border: 1px solid #dcdcde;
	z-index: 0;
	background: #e8eef5;
}

.rfl-mappa-filtri { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 10px; font-size: 13px; }
.rfl-mappa-filtri label { display: flex; flex-direction: column; gap: 3px; font-weight: 600; }
.rfl-mappa-filtri select, .rfl-mappa-filtri input { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; }
.rfl-mappa-conta { color: #64748b; font-weight: 600; padding-bottom: 7px; }

/* Legenda: un pulsante per tipo, si accende e si spegne */
.rfl-mappa-legenda { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rfl-mappa-legenda:empty { display: none; }
.rfl-leg { --c: #2271b1; border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; opacity: 0.55; display: inline-flex; gap: 5px; align-items: center; }
.rfl-leg.attivo { opacity: 1; border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.rfl-leg b { background: var(--c); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; }

/* Segnaposto a goccia con il colore del tipo e l'icona dentro */
.rfl-pin-wrap { background: none; border: 0; }
.rfl-pin {
	--c: #2271b1;
	width: 32px; height: 32px;
	background: var(--c);
	border: 2px solid #fff;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
	display: flex; align-items: center; justify-content: center;
	transition: transform 0.15s;
}
.rfl-pin.grande { width: 40px; height: 40px; }
.rfl-pin span { transform: rotate(45deg); font-size: 15px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
.leaflet-marker-icon:hover .rfl-pin { transform: rotate(-45deg) scale(1.12); }

/* Gruppi di punti vicini */
.rfl-cluster { background: none; border: 0; }
.rfl-cluster-bolla {
	width: 42px; height: 42px; border-radius: 50%;
	background: #0b1f3a; color: #fff; font-weight: 800; font-size: 14px;
	display: grid; place-items: center;
	border: 3px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 0 6px rgba(11, 31, 58, 0.18), 0 4px 10px rgba(0, 0, 0, 0.3);
}
.rfl-cluster-bolla.media { width: 48px; height: 48px; font-size: 15px; background: #1d4ed8; }
.rfl-cluster-bolla.grande { width: 56px; height: 56px; font-size: 16px; background: #7c3aed; }

/* Scatola: fumetto sulla mappa ed elemento dell'elenco */
.rfl-popup .leaflet-popup-content-wrapper { border-radius: 14px; padding: 0; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25); }
/* Leaflet calcola una larghezza sua e la scrive nello stile: con width:auto
   la scatola si stringeva fino a spezzare le parole («Sì» diventava «S i»).
   Serve una larghezza minima, e il massimo lo tiene Leaflet. */
.rfl-popup .leaflet-popup-content { margin: 0; font-size: 13px; line-height: 1.45; width: auto !important; min-width: 300px; min-width: min( 300px, calc( 100vw - 96px ) ); max-width: 380px; box-sizing: border-box; }
.rfl-box { padding: 12px 14px; }
.rfl-box-img { display: block; width: calc(100% + 28px); margin: -12px -14px 10px; max-height: 150px; object-fit: cover; border-radius: 14px 14px 0 0; }
.rfl-box-testa { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.rfl-box-testa > div { min-width: 0; }
.rfl-box-ico { --c: #2271b1; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 17px; }
.rfl-box-titolo { display: block; font-size: 15px; line-height: 1.2; color: #0f172a; }
.rfl-box-tipo { display: block; color: #64748b; font-size: 12px; }
.rfl-box-tipo em { font-style: normal; color: #166534; }
.rfl-box-ind { color: #475569; font-size: 12.5px; margin-bottom: 6px; }
.rfl-box-dati { margin: 6px 0; display: grid; grid-template-columns: 1fr; gap: 3px; }
.rfl-box-dati div { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed #e2e8f0; padding: 3px 0; }
.rfl-box-dati dt { color: #64748b; font-size: 12px; margin: 0; flex: 1 1 auto; min-width: 0; }
/* «break-word» e non «anywhere»: una parola corta non va mai spezzata a metà. */
.rfl-box-dati dd { margin: 0; text-align: right; font-weight: 600; color: #0f172a; flex: 0 1 auto; max-width: 62%; overflow-wrap: break-word; hyphens: none; }
.rfl-box-coll { font-size: 12px; color: #475569; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.rfl-box-coll a { color: #2271b1; text-decoration: none; }
.rfl-box-azioni { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rfl-box-btn { border: 1px solid #cbd5e1; background: #fff; color: #0f172a; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.3; }
.rfl-box-btn:hover { border-color: #0b1f3a; }
.rfl-box-btn.primario { background: #0b1f3a; color: #fff; border-color: #0b1f3a; }
.rfl-box-btn.voce { border-color: #7c3aed; color: #7c3aed; }

/* Elenco laterale: gruppi per tipo, voci che si aprono */
.rfl-mappa-lista { overflow: auto; border: 1px solid #dcdcde; border-radius: 14px; background: #fff; padding: 6px; scrollbar-width: thin; }
.rfl-lista-vuota { color: #64748b; padding: 12px; margin: 0; }
.rfl-lista-gruppo { margin-bottom: 4px; }
.rfl-lista-gruppo > summary { cursor: pointer; padding: 8px 10px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 8px; border-radius: 10px; list-style: none; }
.rfl-lista-gruppo > summary::-webkit-details-marker { display: none; }
.rfl-lista-gruppo > summary .rfl-box-ico { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
.rfl-lista-gruppo > summary b { margin-left: auto; background: #e2e8f0; border-radius: 999px; padding: 0 8px; font-size: 11px; }
.rfl-lista-gruppo[open] > summary { background: #f1f5f9; }
.rfl-lista-voce { margin: 3px 0 3px 10px; border: 1px solid #e2e8f0; border-radius: 10px; }
.rfl-lista-voce > summary { cursor: pointer; padding: 7px 10px; list-style: none; display: flex; flex-direction: column; }
.rfl-lista-voce > summary::-webkit-details-marker { display: none; }
.rfl-lista-titolo { font-weight: 600; font-size: 13px; color: #0f172a; }
.rfl-lista-voce > summary small { color: #64748b; font-size: 11.5px; }
.rfl-lista-voce[open] { border-color: #0b1f3a; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); }
.rfl-lista-voce.attiva { border-color: #7c3aed; }
.rfl-lista-voce .rfl-box { border-top: 1px dashed #e2e8f0; }
.rfl-lista-voce .rfl-box-img { width: 100%; margin: 0 0 8px; border-radius: 8px; max-height: 120px; }
