/* ==========================================================================
   Fondoo — Leaflet / OpenStreetMap styling (loaded only where a map exists)
   Sviluppo: Francesco Russo — https://francescorusso.work
   ========================================================================== */

.map-wrap {
	position: relative;
	border-radius: var(--radius-l, 32px);
	overflow: hidden;
	border: 1px solid var(--line, rgba(42, 36, 32, 0.12));
	box-shadow: var(--shadow, 0 18px 50px -20px rgba(42, 36, 32, 0.35));
	background: var(--cream-deep, #F3E6C4);
}

.fondoo-map {
	width: 100%;
	height: 100%;
	min-height: 440px;
	z-index: 1;
	background: var(--cream-deep, #F3E6C4);
	font-family: var(--font-body, system-ui, sans-serif);
}

.where-grid__map .fondoo-map { min-height: 480px; }

/* Soften OSM tiles toward the warm palette */
.fondoo-map .leaflet-tile-pane { filter: sepia(0.18) saturate(0.9) contrast(0.98); }

/* Brand marker (divIcon) */
.fondoo-pin {
	position: relative;
	width: 44px;
	height: 44px;
	border-radius: 50% 50% 50% 4px;
	background: var(--yellow, #F0C020);
	border: 3px solid var(--dark, #2A2420);
	transform: rotate(-45deg);
	box-shadow: 0 8px 18px -6px rgba(42, 36, 32, 0.6);
	display: grid;
	place-items: center;
	transition: transform 0.25s ease;
}
.fondoo-pin::after {
	content: '';
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--dark, #2A2420);
}
.leaflet-marker-icon:hover .fondoo-pin,
.leaflet-marker-icon:focus-visible .fondoo-pin { transform: rotate(-45deg) scale(1.12); }
.leaflet-marker-icon:focus-visible { outline: 3px solid var(--dark, #2A2420); outline-offset: 4px; border-radius: 50%; }

/* Popup */
.fondoo-map .leaflet-popup-content-wrapper {
	background: var(--paper, #FFFBF0);
	color: var(--dark, #2A2420);
	border-radius: 18px;
	box-shadow: 0 18px 40px -16px rgba(42, 36, 32, 0.55);
	padding: 4px;
}
.fondoo-map .leaflet-popup-tip { background: var(--paper, #FFFBF0); }
.fondoo-map .leaflet-popup-content { margin: 14px 16px; line-height: 1.45; }
.fondoo-popup__title { display: block; font-family: var(--font-display, Georgia, serif); font-size: 1.25rem; font-weight: 500; margin-bottom: 2px; }
.fondoo-popup__addr { display: block; font-size: 0.92rem; color: var(--text-muted, rgba(42, 36, 32, 0.74)); margin-bottom: 10px; }
.fondoo-popup__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fondoo-popup__actions a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--dark, #2A2420);
	color: var(--cream, #FBF4E2) !important;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
}
.fondoo-popup__actions a:hover { background: var(--ember, #B5451B); }
.fondoo-popup__actions a.is-ghost { background: transparent; border: 1.5px solid rgba(42, 36, 32, 0.35); color: var(--dark, #2A2420) !important; }
.fondoo-popup__actions a.is-ghost:hover { background: var(--yellow, #F0C020); border-color: var(--yellow, #F0C020); }

/* Controls */
.fondoo-map .leaflet-control-zoom a {
	width: 40px;
	height: 40px;
	line-height: 40px;
	color: var(--dark, #2A2420);
	background: var(--paper, #FFFBF0);
}
.fondoo-map .leaflet-control-zoom { border: 0; box-shadow: 0 6px 16px -6px rgba(42, 36, 32, 0.5); border-radius: 14px; overflow: hidden; }
.fondoo-map .leaflet-control-zoom a:hover { background: var(--yellow, #F0C020); }
.fondoo-map .leaflet-control-attribution { background: rgba(255, 251, 240, 0.85); font-size: 11px; }
.fondoo-map .leaflet-control-attribution a { color: var(--dark, #2A2420); }

/* "Click to enable scroll zoom" hint */
.map-hint {
	position: absolute;
	left: 50%;
	bottom: 18px;
	z-index: 500;
	transform: translate(-50%, 10px);
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--dark, #2A2420);
	color: var(--cream, #FBF4E2);
	font-size: 0.85rem;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
	white-space: nowrap;
}
.map-hint.is-visible { opacity: 1; transform: translate(-50%, 0); }

.map-fallback { list-style: none; margin: 0; padding: 20px; display: grid; gap: 8px; }
.map-fallback a { font-weight: 600; }

@media (max-width: 700px) {
	.fondoo-map, .where-grid__map .fondoo-map { min-height: 380px; }
	.map-hint { white-space: normal; text-align: center; max-width: 86%; }
}

@media print { .map-wrap { display: none; } }
