/* Scintille map — Figma s25n interno: desktop 1:1461 (section 1366x1894), mobile 1:3276 (375x1895). */

.s25n-map {
	--pink: #fe298b;
	--navy: #222b76;
	--navy-dark: #12256a;
	--plum: #7e1f6e;

	position: relative;
	margin-block: 0;
	padding: 56px 0 62px;
	background:
		radial-gradient(circle at 100% 2%, rgba(254, 41, 139, 0.4) 0%, rgba(126, 31, 110, 0.5) 100%),
		var(--plum);
	color: #fff;
	/* Theme fonts: "din-ot" = DIN OT 400, "dinot" = DINOT 500/700 */
	font-family: var(--wp--preset--font-family--din-ot);
	font-weight: 400;
}

.s25n-map strong,
.s25n-map__title,
.s25n-map__cal-title,
.s25n-map__next-title,
.s25n-tip__city,
.s25n-tip__time,
.s25n-badge,
.s25n-cal__date,
.s25n-cal__more {
	font-family: var(--wp--preset--font-family--dinot);
	font-weight: 700;
}

.s25n-map p,
.s25n-map h2,
.s25n-map h3,
.s25n-map ol,
.s25n-map ul {
	margin: 0;
	padding: 0;
}

.s25n-map__inner {
	/* Theme grid: wide size container with body gutter */
	width: min(var(--wp--style--global--wide-size, 1160px), 100% - 2 * var(--wp--preset--spacing--theme-body-space));
	margin-inline: auto;
}

/* ---------- Top: intro / map / next event ---------- */

.s25n-map__top {
	display: grid;
	grid-template-areas: "intro" "map" "next";
}

.s25n-map__intro { grid-area: intro; }
.s25n-map__map   { grid-area: map; }
.s25n-map__next  { grid-area: next; }

.s25n-map__title,
.s25n-map__cal-title {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	color: #fff;
}

.s25n-map__title span,
.s25n-map__cal-title,
.s25n-map__eyebrow {
	color: var(--pink);
}

.s25n-map__text {
	margin-top: 30px !important;
	font-size: 18px;
	line-height: 1.4;
}

.s25n-map__text strong {
	font-weight: 700;
}

/* Map */
.s25n-map__map {
	position: relative;
	width: min(338px, 100%);
	margin: 38px auto 0;
	aspect-ratio: 698 / 832;
}

.s25n-map__italy {
	display: block;
	width: 100%;
	height: auto;
}

.s25n-map__pins {
	position: absolute;
	inset: 0;
	list-style: none;
}

/* Pins */
.s25n-pin {
	position: absolute;
	width: 0;
	height: 0;
	z-index: 1;
}

.s25n-pin.is-open,
.s25n-pin:hover,
.s25n-pin:focus-within {
	z-index: 3;
}

/* Pins: vector circles (always round at fractional sizes).
 * Figma: white core 5.42px, white halo 23.48px; next core 11.46px, pink halo 27.83px.
 * SVG viewBox is 1:1 with CSS px, centered on the pin coordinate. */
.s25n-pin__dot {
	position: absolute;
	top: -14px;
	left: -14px;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.s25n-pin__svg {
	position: absolute;
	top: -6px;
	left: -6px;
	width: 40px;
	height: 40px;
	overflow: visible;
	pointer-events: none;
	shape-rendering: geometricPrecision;
}

.s25n-pin__svg circle { stroke: none; }

.s25n-pin__halo { fill: rgba(255, 255, 255, 0.2); }
.s25n-pin__core { fill: #fff; }
.s25n-pin__ring { fill: rgba(255, 255, 255, 0.35); opacity: 0; }

.s25n-pin__halo--next { fill: #f5a3c7; }
.s25n-pin__ring--next { fill: rgba(245, 163, 199, 0.7); }

/* Next: the pulsing disc has a circle on its edge; it expands/fades with it.
 * Stroke stays 1px while the disc scales. Halo stays fixed at 27.83px. */
.s25n-pin__ring--next {
	stroke: #fe298b !important;
	stroke-width: 1px;
	vector-effect: non-scaling-stroke;
}
.s25n-pin__core--next { fill: var(--pink); }

/* Show the right set per status */
.s25n-pin:not(.is-next) .s25n-pin__halo--next,
.s25n-pin:not(.is-next) .s25n-pin__core--next,
.s25n-pin:not(.is-next) .s25n-pin__ring--next,
.s25n-pin.is-next .s25n-pin__ring:not(.s25n-pin__ring--next),
.s25n-pin.is-next .s25n-pin__halo:not(.s25n-pin__halo--next),
.s25n-pin.is-next .s25n-pin__core:not(.s25n-pin__core--next),
.s25n-pin.is-past .s25n-pin__halo,
.s25n-pin.is-past .s25n-pin__ring {
	display: none;
}

/* Pulse: expanding ring, halo/core sizes never change */
.s25n-pin.is-future .s25n-pin__ring,
.s25n-pin.is-next .s25n-pin__ring--next {
	transform-box: fill-box;
	transform-origin: center;
	animation: s25n-pulse 2s ease-out infinite;
}

@keyframes s25n-pulse {
	0%   { transform: scale(1);    opacity: 1; }
	70%  { transform: scale(1.75); opacity: 0; }
	100% { transform: scale(1.75); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.s25n-pin__ring {
		animation: none !important;
	}
}

/* Tooltip (Figma 1:1646: 193x130 white card, radius 18, tail) */
.s25n-tip {
	--shift: 0px;
	position: absolute;
	bottom: 22px;
	left: 0;
	box-sizing: border-box;
	width: 193px;
	padding: 19px 18px 18px;
	border-radius: 18px;
	background: #fff;
	color: var(--navy-dark);
	text-align: left;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translate(calc(-50% + var(--shift)), 6px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	box-shadow: 0 6px 24px rgba(0, 10, 43, 0.18);
}

.s25n-pin.is-next .s25n-tip {
	bottom: 26px;
}

/* Tail stays centered on the pin even when the card is shifted */
.s25n-tip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: calc(50% - var(--shift));
	width: 29px;
	height: 25px;
	margin-top: -10px;
	background: url("../../assets/img/scintille/tooltip-tail.svg") center / contain no-repeat;
	transform: translateX(-50%);
}

.s25n-pin.is-open .s25n-tip,
.s25n-pin:hover .s25n-tip,
.s25n-pin:focus-within .s25n-tip {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(calc(-50% + var(--shift)), 0);
}

/* Hovering another pin hides the default open one */
.s25n-map__pins:hover .s25n-pin.is-open:not(:hover) .s25n-tip {
	opacity: 0;
	visibility: hidden;
}


.s25n-tip__city {
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
}

.s25n-tip__when {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 10px 0 0 -5px !important;
}

.s25n-tip__time {
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
}

.s25n-tip__place {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px !important;
	font-size: 12px;
	line-height: 1.4;
	color: var(--navy);
}

.s25n-tip__place img {
	flex: none;
	width: 13px;
	height: auto;
}

/* Date badge (pill + leaf tail, Figma 1:1903) */
.s25n-badge {
	position: relative;
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	height: 32px;
	margin-right: 37px;
	padding: 0 0 0 17px;
	min-width: 110px;
	border-radius: 40px 0 0 40px;
	background: var(--pink);
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
	white-space: nowrap;
}

.s25n-badge::after {
	content: "";
	position: absolute;
	top: 0;
	left: 100%;
	width: 37px;
	height: 100%;
	margin-left: -0.5px;
	background: url("../../assets/img/scintille/badge-leaf.svg") left center / 100% 100% no-repeat;
}

.s25n-badge--sm {
	height: 22px;
	min-width: 61px;
	margin-right: 25px;
	padding-left: 13px;
	font-size: 12px;
}

.s25n-badge--sm::after {
	width: 25px;
}

/* Next event */
.s25n-map__next {
	margin-top: 46px;
}

.s25n-map__next-title {
	display: flex;
	flex-direction: column;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
}

.s25n-map__next-place {
	margin-top: 4px !important;
	font-size: 18px;
	line-height: 1.4;
}

.s25n-map__next-when {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-top: 20px !important;
	font-size: 18px;
	line-height: 1.3;
}

/* ---------- Calendar ---------- */

.s25n-map__cal-title {
	margin-top: 68px !important;
}

.s25n-cal {
	position: relative;
	display: grid;
	gap: 40px;
	margin-top: 27px !important;
	list-style: none;
}

.s25n-cal__item {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.s25n-cal__date {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.s25n-cal__row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 18px;
	line-height: 1.3;
}

.s25n-cal__row img {
	flex: none;
	width: 16px;
	height: auto;
	margin-top: 1px;
}

.s25n-cal__row--time {
	align-items: center;
}

.s25n-cal__row--time img {
	width: 24px;
	margin-top: 0;
}

/* Mobile: "City (PROV) - Venue." on one line, address below */
.s25n-cal__venue::before {
	content: " - ";
}

.s25n-cal__address {
	display: block;
}

/* Mobile: show first 4 items, fade the 4th, "Vedi tutte" */
.s25n-cal:not(.is-expanded) .s25n-cal__item:nth-child(n + 5) {
	display: none;
}

/* Fade via mask: blends with any section background */
.s25n-cal:not(.is-expanded) .s25n-cal__item:nth-child(4):not(:last-child) {
	-webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
	mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
}

.s25n-cal__more {
	display: inline-flex;
	margin-top: 40px;
	padding: 13px 24px;
	border: 0;
	border-radius: 12px;
	background: #fff;
	color: var(--navy);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
}

.s25n-cal__more[hidden] {
	display: none;
}

/* Touch devices: tooltip opens on tap, closes on tap outside (view.js) */
@media (hover: none) {
	.s25n-pin:hover:not(.is-open) .s25n-tip,
	.s25n-pin:focus-within:not(.is-open) .s25n-tip {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}

	.s25n-map__pins:hover .s25n-pin.is-open:not(:hover) .s25n-tip {
		opacity: 1;
		visibility: visible;
	}
}

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
	.s25n-map {
		padding: 54px 0 135px;
	}

	.s25n-map__top {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-rows: auto 1fr;
		grid-template-areas:
			"intro map"
			"next  map";
		column-gap: 60px;
	}

	.s25n-map__intro {
		max-width: 368px;
		padding-top: 49px;
	}

	.s25n-map__title,
	.s25n-map__cal-title {
		font-size: 30px;
		line-height: 1.21;
	}

	.s25n-map__title span {
		display: block;
	}

	.s25n-map__text {
		margin-top: 18px !important;
		line-height: 1.3;
	}

	.s25n-map__map {
		width: min(419px, 100%);
		margin: 0 0 0 23px;
	}

	.s25n-map__next {
		margin-top: 21px;
	}

	.s25n-map__eyebrow {
		font-size: 20px;
		line-height: 1.21;
	}

	.s25n-map__next-city {
		margin-top: 4px;
		font-size: 30px;
		line-height: 1.21;
	}

	.s25n-map__next-place {
		margin-top: 0 !important;
		line-height: 1.3;
	}

	.s25n-map__next-when {
		gap: 13px;
		margin-top: 22px !important;
	}

	.s25n-map__cal-title {
		margin-top: 85px !important;
	}

	/* Figma: 4 columns of 208px, 100px column gap, 60px row gap */
	.s25n-cal {
		grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
		column-gap: 100px;
		row-gap: 60px;
		margin-top: 44px !important;
	}

	.s25n-cal__item {
		gap: 20px;
	}

	.s25n-cal__date {
		font-size: 22px;
	}

	.s25n-cal__item > .s25n-cal__row:first-of-type {
		margin-bottom: -5px;
	}

	/* Align times across a row: items stretch to the row height, time sticks to the bottom */
	.s25n-cal__item > .s25n-cal__row--time {
		margin-top: auto;
	}

	.s25n-cal__city,
	.s25n-cal__venue {
		display: block;
	}

	.s25n-cal__venue::before {
		content: none;
	}

	.s25n-cal:not(.is-expanded) .s25n-cal__item:nth-child(n + 5) {
		display: flex;
	}

	.s25n-cal:not(.is-expanded) .s25n-cal__item:nth-child(4):not(:last-child) {
		-webkit-mask-image: none;
		mask-image: none;
	}

	.s25n-cal__more {
		display: none;
	}
}

@media (min-width: 1024px) {
	.s25n-map__top {
		column-gap: 0;
	}
}
