/* Shortcode [salerno_luoghi_mappa] */

.salerno-luoghi-mappa {
	--salerno-luoghi-mappa-height: min(70vh, 560px);
	--salerno-luoghi-mappa-sidebar-width: min(340px, 38vw);
	width: 100%;
	margin: 1.5rem 0 2rem;
}

.salerno-luoghi-mappa__stage {
	display: flex;
	align-items: stretch;
	position: relative;
	width: 100%;
	height: var(--salerno-luoghi-mappa-height);
	min-height: 320px;
	border-radius: 12px;
	overflow: hidden;
	background: #1a1a1c;
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.salerno-luoghi-mappa__map-wrap {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
}

.salerno-luoghi-mappa__canvas {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	z-index: 1;
	background: #1a1a1c;
}

.salerno-luoghi-mappa__canvas.leaflet-container {
	font: inherit;
	touch-action: none;
	-webkit-tap-highlight-color: transparent;
}

.salerno-luoghi-mappa__map-wrap {
	touch-action: none;
	-webkit-overflow-scrolling: auto;
	overscroll-behavior: contain;
}

/* Evita bounce/“molla” del browser durante il pan della mappa */
.salerno-luoghi-mappa__canvas {
	overscroll-behavior: contain;
}

.salerno-luoghi-mappa .leaflet-control-zoom {
	border: none;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.salerno-luoghi-mappa .leaflet-control-zoom a {
	background: rgba(28, 28, 30, 0.95);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.18);
}

.salerno-luoghi-mappa .leaflet-control-zoom a:hover {
	background: rgba(48, 48, 52, 0.98);
	color: #fff;
}

.salerno-luoghi-mappa .leaflet-control-attribution {
	background: rgba(0, 0, 0, 0.55);
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.6875rem;
}

.salerno-luoghi-mappa .leaflet-control-attribution a {
	color: rgba(255, 255, 255, 0.85);
}

/* Marker a stella */
.salerno-luoghi-mappa__marker {
	background: transparent !important;
	border: none !important;
}

.salerno-luoghi-mappa__marker .salerno-luoghi-mappa__star {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: #f6d56c;
	cursor: pointer;
	transition: transform 0.15s ease, color 0.15s ease, filter 0.15s ease;
	filter: drop-shadow(0 0 6px rgba(246, 213, 108, 0.75)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
}

.salerno-luoghi-mappa__marker .salerno-luoghi-mappa__star svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

.salerno-luoghi-mappa__marker:hover .salerno-luoghi-mappa__star,
.leaflet-marker-icon.salerno-luoghi-mappa__marker.is-active .salerno-luoghi-mappa__star {
	transform: scale(1.2);
	color: #fff4c2;
	filter: drop-shadow(0 0 10px rgba(255, 244, 194, 0.95)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

/* Opera non installata — stella grigia */
.salerno-luoghi-mappa__marker.is-not-installed .salerno-luoghi-mappa__star {
	color: #9a9a9a;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}

.salerno-luoghi-mappa__marker.is-not-installed:hover .salerno-luoghi-mappa__star,
.leaflet-marker-icon.salerno-luoghi-mappa__marker.is-not-installed.is-active .salerno-luoghi-mappa__star {
	color: #c8c8c8;
	filter: drop-shadow(0 0 6px rgba(200, 200, 200, 0.45)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* Touch: niente scale/hover sulle stelle (evita jitter durante il pan) */
@media (hover: none), (pointer: coarse) {
	.salerno-luoghi-mappa__marker .salerno-luoghi-mappa__star {
		transition: none;
		/* Ripristino glow/ombra (senza animazioni) */
		filter: drop-shadow(0 0 6px rgba(246, 213, 108, 0.75)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65)) !important;
	}

	.salerno-luoghi-mappa__marker:hover .salerno-luoghi-mappa__star,
	.leaflet-marker-icon.salerno-luoghi-mappa__marker.is-active .salerno-luoghi-mappa__star {
		/* Evita scale su touch, ma mantieni la stessa ombra/glow */
		transform: none !important;
		filter: drop-shadow(0 0 6px rgba(246, 213, 108, 0.75)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65)) !important;
	}
}

/* Sidebar dettagli luogo */
.salerno-luoghi-mappa__sidebar {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 0 0 0;
	width: 0;
	overflow: hidden;
	background: rgba(14, 14, 16, 0.98);
	border-left: 0 solid rgba(255, 255, 255, 0.12);
	transition:
		width 0.28s ease,
		flex-basis 0.28s ease,
		border-width 0.28s ease;
	z-index: 5;
}

.salerno-luoghi-mappa__stage.is-sidebar-open .salerno-luoghi-mappa__sidebar {
	flex: 0 0 var(--salerno-luoghi-mappa-sidebar-width);
	width: var(--salerno-luoghi-mappa-sidebar-width);
	border-left-width: 1px;
	overflow-y: auto;
	overflow-x: hidden;
}

.salerno-luoghi-mappa__sidebar-close {
	position: absolute;
	top: 0.65rem;
	right: 0.65rem;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	transition: background 0.15s ease, border-color 0.15s ease;
}

.salerno-luoghi-mappa__sidebar-close:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.35);
}

.salerno-luoghi-mappa__sidebar-inner {
	position: relative;
	flex: 1 1 auto;
	min-height: 100%;
	z-index: 1;
}

.salerno-luoghi-mappa__sidebar-placeholder,
.salerno-luoghi-mappa__sidebar-content {
	position: absolute;
	inset: 0;
	overflow-x: hidden;
	overflow-y: auto;
	box-sizing: border-box;
}

.salerno-luoghi-mappa__sidebar-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5rem 1.25rem;
	text-align: center;
	z-index: 1;
}

.salerno-luoghi-mappa__sidebar-placeholder p {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.55);
}

.salerno-luoghi-mappa__sidebar-content {
	display: none;
	padding: 1rem 1rem 1.25rem;
	z-index: 2;
}

.salerno-luoghi-mappa__stage.is-sidebar-has-detail .salerno-luoghi-mappa__sidebar-placeholder {
	display: none !important;
}

.salerno-luoghi-mappa__stage.is-sidebar-has-detail .salerno-luoghi-mappa__sidebar-content {
	display: block !important;
	padding-top: 3.25rem;
	padding-right: 1rem;
}

.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__slide {
	width: 100%;
	margin: 0;
}

.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	text-decoration: none;
}

.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__thumb {
	aspect-ratio: 16 / 10;
}

.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__title {
	font-size: 1.05rem;
	padding: 0.85rem 1rem 0.35rem;
}

.salerno-luoghi-mappa__sidebar-detail--card .salerno-spettacoli__pills {
	padding: 0 1rem 0.75rem;
}

/* Card compatta opere nella sidebar */
.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__card {
	width: 100%;
	margin: 0;
}

.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__card-link {
	border-radius: 12px;
}

.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__chips {
	top: 0.5rem;
	left: 0.5rem;
	max-width: calc(100% - 3rem);
}

.salerno-luoghi-mappa__sidebar-media {
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 0.85rem;
}

.salerno-luoghi-mappa__sidebar-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.salerno-luoghi-mappa__sidebar-title {
	margin: 0 0 0.5rem;
	padding-right: 2rem;
	font-family: var(--salerno-font-heading, inherit);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
}

.salerno-luoghi-mappa__sidebar-address {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.8);
}

.salerno-luoghi-mappa__sidebar-address i {
	margin-right: 0.35rem;
	opacity: 0.85;
}

.salerno-luoghi-mappa__sidebar-actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.salerno-luoghi-mappa__sidebar-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.55rem 1rem;
	font-size: 0.875rem;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
	color: #fff;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 9999px;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.salerno-luoghi-mappa__sidebar-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.45);
	color: #fff;
}

.salerno-luoghi-mappa__sidebar-btn--primary {
	background: rgba(246, 213, 108, 0.2);
	border-color: rgba(246, 213, 108, 0.55);
	color: #fff4c2;
}

.salerno-luoghi-mappa__sidebar-btn--primary:hover {
	background: rgba(246, 213, 108, 0.35);
	border-color: rgba(246, 213, 108, 0.75);
}

.salerno-luoghi-mappa__caption {
	margin-top: 0.65rem;
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.75);
}

.salerno-luoghi-mappa__caption a {
	color: rgba(255, 255, 255, 0.9);
}

.salerno-luoghi-mappa__empty {
	margin: 1rem 0;
}

.salerno-luoghi-mappa__cards-store {
	display: none !important;
}

@media (max-width: 768px) {
	.salerno-luoghi-mappa {
		--salerno-luoghi-mappa-height: min(82vh, 620px);
		--salerno-luoghi-mappa-sidebar-width: min(100%, 320px);
	}

	.salerno-luoghi-mappa__stage {
		flex-direction: column;
		min-height: 400px;
	}

	.salerno-luoghi-mappa__map-wrap {
		flex: 1 1 auto;
		min-height: 340px;
		height: 100%;
	}

	/* Pannello dettaglio: striscia compatta in basso sopra la mappa */
	.salerno-luoghi-mappa__sidebar {
		position: absolute;
		right: 0;
		bottom: 0;
		top: auto;
		left: 0;
		height: 0;
		width: 100%;
		flex: none;
		border-left: 0;
		border-top: 0 solid rgba(255, 255, 255, 0.12);
		z-index: 10;
		transition: height 0.28s ease, border-top-width 0.28s ease;
	}

	.salerno-luoghi-mappa__stage.is-sidebar-open .salerno-luoghi-mappa__sidebar {
		height: auto;
		max-height: none;
		width: 100%;
		flex: none;
		border-top-width: 1px;
		overflow: visible;
	}

	.salerno-luoghi-mappa__sidebar-inner {
		min-height: 0;
		flex: 0 0 auto;
	}

	.salerno-luoghi-mappa__sidebar-placeholder,
	.salerno-luoghi-mappa__sidebar-content {
		position: relative;
		inset: auto;
		height: auto;
	}

	.salerno-luoghi-mappa__stage.is-sidebar-has-detail .salerno-luoghi-mappa__sidebar-content {
		padding: 2.35rem 0.75rem 0.65rem;
	}

	.salerno-luoghi-mappa__sidebar-close {
		top: 0.45rem;
		right: 0.45rem;
		width: 1.75rem;
		height: 1.75rem;
		font-size: 1.15rem;
	}

	/* Card orizzontale: thumb a sinistra, testo a destra */
	.salerno-luoghi-mappa__sidebar-detail--card {
		display: flex;
		flex-direction: column;
		gap: 0.5rem;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__card-link,
	.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__card {
		flex-direction: row;
		align-items: stretch;
		min-height: 5.5rem;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__media,
	.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__thumb {
		flex: 0 0 6.75rem;
		width: 6.75rem;
		min-width: 6.75rem;
		aspect-ratio: auto;
		height: auto;
		align-self: stretch;
		min-height: 5.5rem;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__thumb,
	.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__thumb {
		height: 100%;
		min-height: 5.5rem;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__img,
	.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__img {
		height: 100%;
		min-height: 5.5rem;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__body {
		flex: 1 1 auto;
		min-width: 0;
		justify-content: center;
		padding: 0.45rem 0.55rem 0.5rem 0.6rem;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__title {
		font-size: 0.8rem;
		-webkit-line-clamp: 2;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__address {
		font-size: 0.68rem;
		-webkit-line-clamp: 2;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__chips {
		top: 0.3rem;
		left: 0.3rem;
		max-width: calc(100% - 0.5rem);
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-opere-luci__chips .salerno-grandi-eventi__cat-pill {
		font-size: 0.58rem;
		padding: 0.1rem 0.35rem;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-correlati__title {
		display: flex;
		align-items: center;
		flex: 1 1 auto;
		min-width: 0;
		padding: 0.45rem 0.55rem 0.5rem 0.6rem;
		font-size: 0.8rem;
		-webkit-line-clamp: 3;
	}

	.salerno-luoghi-mappa__sidebar-detail--card .salerno-spettacoli__pills {
		display: none;
	}

	/* Fallback senza card in store */
	.salerno-luoghi-mappa__sidebar-detail:not(.salerno-luoghi-mappa__sidebar-detail--card) {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0.5rem 0.75rem;
		align-items: flex-start;
	}

	.salerno-luoghi-mappa__sidebar-detail:not(.salerno-luoghi-mappa__sidebar-detail--card) .salerno-luoghi-mappa__sidebar-media {
		flex: 0 0 6.75rem;
		width: 6.75rem;
		margin-bottom: 0;
	}

	.salerno-luoghi-mappa__sidebar-detail:not(.salerno-luoghi-mappa__sidebar-detail--card) .salerno-luoghi-mappa__sidebar-img {
		aspect-ratio: 1;
		height: 5.5rem;
		object-fit: cover;
	}

	.salerno-luoghi-mappa__sidebar-detail:not(.salerno-luoghi-mappa__sidebar-detail--card) .salerno-luoghi-mappa__sidebar-title,
	.salerno-luoghi-mappa__sidebar-detail:not(.salerno-luoghi-mappa__sidebar-detail--card) .salerno-luoghi-mappa__sidebar-address {
		flex: 1 1 0;
		min-width: 0;
		margin-bottom: 0;
	}

	.salerno-luoghi-mappa__sidebar-actions {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0.4rem;
		margin-top: 0;
		padding-top: 0;
		border-top: 0;
	}

	.salerno-luoghi-mappa__sidebar-btn {
		flex: 1 1 calc(50% - 0.25rem);
		min-width: 0;
		padding: 0.45rem 0.65rem;
		font-size: 0.75rem;
	}
}
