/* Mappa "Dove siamo" (shortcode [way_world_map]). Tutto è sotto .way-map. */
.way-map {
	--wm-ink: #242322;
	--wm-muted: #77726d;
	--wm-line: rgba(36, 35, 34, .12);
	--wm-pink: #df3581;
	--wm-grad: linear-gradient(120deg, #1fb3d1, #f3d43b 50%, #d13f98);
	position: relative;
	width: 100%;
	color: var(--wm-ink);
	font-family: Montserrat, system-ui, sans-serif;
}
.way-map *, .way-map *::before, .way-map *::after { box-sizing: border-box; }
.way-map button { all: unset; box-sizing: border-box; cursor: pointer; font-family: inherit; }
.way-map button:focus-visible { outline: 2px solid var(--wm-ink); outline-offset: 2px; }

/* Senza JS resta un elenco leggibile; con la mappa pronta lo teniamo per screen reader e motori. */
.way-map.is-ready .way-map__data {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.wm-stage {
	position: relative;
	aspect-ratio: 16 / 10;
	max-height: 86svh;
	width: 100%;
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
}
@media (max-width: 720px) { .wm-stage { aspect-ratio: 4 / 5; } }
.wm-stage > svg {
	position: absolute; inset: 0; width: 100%; height: 100%; display: block;
	/* sfuma i bordi, così il mondo "continua" oltre la cornice */
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(transparent, #000 6%, #000 94%, transparent);
	-webkit-mask-composite: source-in;
	mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(transparent, #000 6%, #000 94%, transparent);
	mask-composite: intersect;
}

/* geometria */
.way-map svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.way-map .wm-o { stroke: #d3cec8; stroke-width: .9; }
.way-map svg.is-world .wm-o { stroke: #c9c4be; stroke-width: .7; }
.way-map .wm-v { display: none; }
.way-map .wm-countries .on .wm-v { display: inline; }
.way-map .wm-countries .on .wm-o { display: none; }
.way-map .wm-countries .wm-mesh path { stroke-width: .6; opacity: .85; }
.way-map .wm-countries .wm-coast path { stroke-width: 1.1; }
.way-map .wm-it .wm-mesh path { stroke-width: 1.3; }
.way-map .wm-it .wm-coast path { stroke-width: 2.4; }
.way-map svg.is-world .wm-it .wm-mesh path { stroke-width: .6; }
.way-map svg.is-world .wm-it .wm-coast path { stroke-width: 1; }
.way-map .wm-routes path {
	stroke: url(#wm-g); stroke-width: 1.6; stroke-dasharray: 2 6; opacity: .75;
	animation: wm-flow 1.6s linear infinite; transition: opacity .2s, stroke-width .2s;
}
.way-map .wm-routes path.is-on { opacity: 1; stroke-width: 2.4; }
@keyframes wm-flow { to { stroke-dashoffset: -8; } }
.way-map .wm-italy-hit { pointer-events: none; }
.way-map svg.is-world .wm-italy-hit { pointer-events: all; cursor: zoom-in; }

/* punti */
.wm-pins { position: absolute; inset: 0; pointer-events: none; }
.way-map .wm-pin { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: auto; }
.way-map .wm-pin::after { content: ""; position: absolute; left: 0; top: 0; width: 34px; height: 34px; transform: translate(-50%, -50%); border-radius: 50%; }
.way-map .wm-pin i {
	position: absolute; left: 0; top: 0; width: var(--d, 12px); height: var(--d, 12px); transform: translate(-50%, -50%);
	border-radius: 50%; background: var(--wm-grad); box-shadow: 0 0 0 2px #fff, 0 2px 8px -2px rgba(0, 0, 0, .35);
	transition: transform .2s; display: grid; place-items: center;
	font-style: normal; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; font-variant-numeric: tabular-nums;
}
.way-map .wm-pin.is-exp i { background: radial-gradient(circle at 35% 30%, #ff7fb5, #df3581); }
.way-map .wm-pin.is-group i { background: var(--wm-ink); }
.way-map .wm-pin:hover i, .way-map .wm-pin.on-sel i { transform: translate(-50%, -50%) scale(1.3); }
.way-map .wm-pin span {
	position: absolute; left: calc(var(--d, 12px) / 2 + 5px); top: 0; transform: translateY(-50%);
	font-size: 11.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none;
	text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.way-map .wm-pin:hover span, .way-map .wm-pin.has-label span, .way-map .wm-pin.on-sel span { opacity: 1; }

/* etichette dei paesi sul bordo */
.way-map .wm-chip {
	position: absolute; left: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 6px;
	border: 1px solid var(--wm-line); background: #fff; border-radius: 999px; padding: 6px 11px 6px 12px;
	font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; color: var(--wm-ink);
	box-shadow: 0 8px 22px -14px rgba(0, 0, 0, .4); transition: border-color .2s, opacity .3s;
}
.way-map .wm-chip:hover, .way-map .wm-chip.on-sel { border-color: var(--wm-ink); }
.way-map .wm-chip small { color: var(--wm-muted); font-weight: 500; font-size: 11.5px; }
.way-map .wm-chip i { font-style: normal; display: inline-block; color: var(--wm-muted); transform: rotate(var(--a)); }
.way-map .wm-chip.is-hidden { opacity: 0; pointer-events: none; }
@media (max-width: 720px) { .way-map .wm-chip { font-size: 11.5px; padding: 5px 9px; } .way-map .wm-chip small { display: none; } }

/* scelta vista */
.way-map .wm-ctl {
	position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; display: flex; gap: 4px;
	background: #fff; border: 1px solid var(--wm-line); border-radius: 999px; padding: 3px; box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .35);
}
.way-map .wm-ctl button { border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--wm-muted); white-space: nowrap; }
.way-map .wm-ctl button[aria-pressed="true"] { background: var(--wm-ink); color: #fff; }

.way-map .wm-credit { position: absolute; right: 8px; bottom: 6px; z-index: 2; font-size: 10px; color: var(--wm-muted); text-decoration: none; opacity: .8; }
.way-map:not(.is-ready) .wm-credit { position: static; }

/* scheda */
.way-map .wm-card {
	position: absolute; z-index: 5; width: 330px; max-height: min(75%, 460px); background: #fff; border-radius: 16px;
	box-shadow: 0 20px 50px -20px rgba(36, 35, 34, .45), 0 0 0 1px var(--wm-line);
	display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(6px); pointer-events: none;
	transition: opacity .2s, transform .2s; text-align: left;
}
.way-map .wm-card.open { opacity: 1; transform: none; pointer-events: auto; }
.way-map .wm-card__head { padding: 14px 44px 10px 16px; border-top: 3px solid transparent; border-image: var(--wm-grad) 1; }
.way-map .wm-card small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--wm-muted); }
.way-map .wm-card h3 { margin: 2px 0 0; padding: 0; font-family: Akshar, Montserrat, sans-serif; font-weight: 600; font-size: 24px; line-height: 1.05; color: var(--wm-ink); text-transform: none; letter-spacing: 0; }
.way-map .wm-x { position: absolute; right: 8px; top: 10px; width: 30px; height: 30px; display: grid; place-items: center; font-size: 20px; color: var(--wm-muted); }
.way-map .wm-card ul { list-style: none; margin: 0; padding: 4px 8px 10px; overflow: auto; overscroll-behavior: contain; }
.way-map .wm-card li { margin: 0; padding: 0; }
.way-map .wm-card li[data-kind] { position: relative; display: grid; grid-template-columns: 52px 1fr; column-gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; }
.way-map .wm-card li[data-kind]:hover { background: #f5f4f3; }
.way-map .wm-card li[data-kind] > a { display: contents; color: var(--wm-ink); text-decoration: none; }
.way-map .wm-card li[data-kind] img { grid-row: 1 / span 2; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #f1f0ee; }
.way-map .wm-card .wm-t { grid-column: 2; align-self: end; font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.way-map .wm-card .wm-t::after { content: ""; position: absolute; inset: 0; border-radius: 10px; } /* tutta la riga è il link */
.way-map .wm-card .wm-m { grid-column: 2; align-self: start; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--wm-muted); }
.way-map .wm-card li[data-kind]:not(:has(img)) { grid-template-columns: 1fr; }
.way-map .wm-card li[data-kind]:not(:has(img)) .wm-t, .way-map .wm-card li[data-kind]:not(:has(img)) .wm-m { grid-column: 1; }
.way-map .wm-book { color: var(--wm-pink); font-weight: 700; }
.way-map .wm-live { color: #118a5d; font-weight: 600; }
.way-map .wm-card .wm-sub { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--wm-muted); padding: 8px 8px 2px; }
@media (max-width: 720px) {
	.way-map .wm-card { left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; max-height: 64%; }
}
@media (prefers-reduced-motion: reduce) {
	.way-map .wm-routes path { animation: none; }
	.way-map * { transition: none !important; }
}
