/* ==========================================================================
   Roda Partner Map
   Linea grafica: verde bosco + oro, scheda arrotondata, mappa in grigi.
   ========================================================================== */

.rodapm {
	--rodapm-primary: #234d24;
	--rodapm-accent: #ebaa22;
	--rodapm-heading: #15261a;
	--rodapm-text: #858585;
	--rodapm-divider: #e2e2e2;
	--rodapm-card-text: #ffffff;
	--rodapm-card-radius: 40px;
	--rodapm-map-radius: 40px;
	--rodapm-map-height: 560px;
	--rodapm-list-max: 420px;
	--rodapm-button-radius: 6px;
	--rodapm-gap: 56px;
	--rodapm-ease: cubic-bezier(.2, .7, .2, 1);

	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	grid-template-areas:
		"intro card"
		"map   map";
	gap: var(--rodapm-gap);
	align-items: start;
	color: var(--rodapm-text);
	font-family: inherit;
}

.rodapm *,
.rodapm *::before,
.rodapm *::after { box-sizing: border-box; }

.rodapm--layout-side {
	grid-template-areas:
		"intro map"
		"card  map";
	grid-template-rows: auto 1fr;
}

.rodapm__intro { grid-area: intro; min-width: 0; padding-top: 1.5rem; }
.rodapm__card  { grid-area: card;  min-width: 0; }
.rodapm__map   { grid-area: map;   min-width: 0; }

/* ---------- Intestazione ---------- */

.rodapm__eyebrow {
	display: flex;
	align-items: center;
	gap: .65rem;
	margin: 0 0 .9rem;
	color: var(--rodapm-accent);
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.3;
}
.rodapm__eyebrow span:last-child {
	text-decoration: underline;
	text-underline-offset: .22em;
	text-decoration-thickness: 1px;
}
.rodapm__eyebrow-icon { display: inline-flex; width: 2.5rem; color: #5ba531; }
.rodapm__eyebrow-icon svg { width: 100%; height: auto; }

.rodapm__title {
	margin: 0 0 1.25rem;
	color: var(--rodapm-heading);
	font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.9rem);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -.035em;
}

.rodapm__description {
	margin: 0 0 2.2rem;
	max-width: 62ch;
	color: var(--rodapm-text);
	font-size: 1.125rem;
	line-height: 1.65;
}

.rodapm__list-title {
	margin: 0 0 1rem;
	color: var(--rodapm-heading);
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -.02em;
}

/* ---------- Ricerca ---------- */

.rodapm__search {
	position: relative;
	display: block;
	margin-bottom: .5rem;
}
.rodapm__search-icon {
	position: absolute;
	left: 1rem;
	top: 50%;
	width: 1.1rem;
	height: 1.1rem;
	transform: translateY(-50%);
	color: var(--rodapm-text);
	pointer-events: none;
}
.rodapm__search-icon svg { width: 100%; height: 100%; display: block; }
.rodapm .rodapm__search input {
	width: 100%;
	height: 3.25rem;
	margin: 0;
	padding: 0 1rem 0 2.8rem;
	border: 1px solid var(--rodapm-divider);
	border-radius: 8px;
	background: #fafafa;
	color: var(--rodapm-heading);
	font: inherit;
	font-size: 1rem;
	transition: border-color .2s, background-color .2s;
}
.rodapm .rodapm__search input:focus {
	outline: none;
	border-color: var(--rodapm-primary);
	background: #fff;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rodapm-primary) 18%, transparent);
}

/* ---------- Lista partner (stile righe "Contatti") ---------- */

.rodapm__list {
	list-style: none;
	margin: 0;
	padding: 0 .5rem 0 0;
	max-height: var(--rodapm-list-max);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--rodapm-divider) transparent;
}

.rodapm__item {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 0;
	padding: 1.35rem 0;
	border-bottom: 1px solid var(--rodapm-divider);
	cursor: pointer;
	outline: none;
}
.rodapm__item:last-child { border-bottom: 0; }
.rodapm__item[hidden] { display: none; }

.rodapm__item-icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 3.9rem;
	height: 3.9rem;
	border-radius: 50%;
	background: var(--rodapm-primary);
	color: var(--rodapm-accent);
	transition: background-color .25s var(--rodapm-ease), color .25s var(--rodapm-ease), transform .25s var(--rodapm-ease);
}
.rodapm__item-icon svg { width: 1.45rem; height: 1.45rem; }

.rodapm__item-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }

.rodapm__item-name {
	color: var(--rodapm-primary);
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -.01em;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: .2em;
	text-decoration-thickness: 1px;
	transition: text-decoration-color .2s;
}
.rodapm__item-address {
	color: var(--rodapm-text);
	font-size: 1rem;
	line-height: 1.45;
}

.rodapm__item:hover .rodapm__item-name { text-decoration-color: currentColor; }

.rodapm__item.is-active .rodapm__item-icon {
	background: var(--rodapm-accent);
	color: var(--rodapm-primary);
	transform: scale(1.04);
}
.rodapm__item.is-active .rodapm__item-name { text-decoration-color: currentColor; }
.rodapm__item.is-active .rodapm__item-address { color: var(--rodapm-accent); }

.rodapm__item:focus-visible .rodapm__item-icon {
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--rodapm-primary);
}

.rodapm__no-results,
.rodapm__empty { margin: 1rem 0 0; font-size: 1rem; }

/* ---------- Menu a tendina ---------- */

.rodapm__select-wrap { position: relative; }
.rodapm__select-icon {
	position: absolute;
	left: .45rem;
	top: 50%;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 2.7rem;
	height: 2.7rem;
	border-radius: 50%;
	background: var(--rodapm-primary);
	color: var(--rodapm-accent);
	pointer-events: none;
}
.rodapm__select-icon svg { width: 1.1rem; height: 1.1rem; }
.rodapm .rodapm__select {
	width: 100%;
	height: 3.6rem;
	margin: 0;
	padding: 0 3rem 0 3.9rem;
	border: 1px solid var(--rodapm-divider);
	border-radius: 999px;
	background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23234d24' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 1.1rem center / 1.4rem;
	color: var(--rodapm-heading);
	font: inherit;
	font-size: 1.05rem;
	font-weight: 500;
	appearance: none;
	cursor: pointer;
}
.rodapm .rodapm__select:focus {
	outline: none;
	border-color: var(--rodapm-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rodapm-primary) 18%, transparent);
}

/* ---------- Scheda verde ---------- */

.rodapm__card {
	position: relative;
	padding: clamp(2rem, 1.2rem + 2.4vw, 3.4rem) clamp(1.6rem, 1rem + 2.4vw, 3.4rem);
	border-radius: var(--rodapm-card-radius);
	background: var(--rodapm-card-bg, var(--rodapm-primary));
	color: var(--rodapm-card-text);
}

.rodapm__card-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }
.rodapm__card-logo {
	flex: 0 0 auto;
	width: 4.2rem;
	height: 4.2rem;
	border-radius: 50%;
	object-fit: cover;
	background: #fff;
}
.rodapm__card-logo[hidden] { display: none; }

.rodapm__card-label {
	margin: 0 0 .3rem;
	color: var(--rodapm-accent);
	font-size: 1rem;
	font-weight: 500;
}

.rodapm__card-title {
	margin: 0;
	color: var(--rodapm-card-text);
	font-size: clamp(1.9rem, 1.3rem + 1.8vw, 3.1rem);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -.04em;
}

.rodapm__card-address {
	margin: 0 0 2rem;
	color: color-mix(in srgb, var(--rodapm-card-text) 82%, transparent);
	font-size: 1.2rem;
	line-height: 1.6;
}

.rodapm__rows { margin: 0 0 2.2rem; padding: 0; }

.rodapm__row {
	display: flex;
	align-items: flex-start;
	gap: .95rem;
	padding: 1rem 0;
	border-top: 1px solid color-mix(in srgb, var(--rodapm-card-text) 16%, transparent);
}
.rodapm__row[hidden] { display: none; }

.rodapm__row-icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 50%;
	background: color-mix(in srgb, var(--rodapm-card-text) 10%, transparent);
	color: var(--rodapm-accent);
}
.rodapm__row-icon svg { width: 1.05rem; height: 1.05rem; }

.rodapm__rows dt {
	margin: 0 0 .15rem;
	color: var(--rodapm-card-text);
	font-size: 1rem;
	font-weight: 600;
}
.rodapm__rows dd {
	margin: 0;
	color: color-mix(in srgb, var(--rodapm-card-text) 82%, transparent);
	font-size: 1.05rem;
	line-height: 1.5;
}
.rodapm__rows dd a {
	color: var(--rodapm-accent);
	text-decoration: underline;
	text-underline-offset: .2em;
	text-decoration-thickness: 1px;
	word-break: break-word;
}
.rodapm__rows dd a:hover { color: var(--rodapm-card-text); }

.rodapm .rodapm__button {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	padding: .95rem 1.5rem;
	border-radius: var(--rodapm-button-radius);
	background: var(--rodapm-accent);
	color: var(--rodapm-primary);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: transform .2s var(--rodapm-ease), box-shadow .2s var(--rodapm-ease), background-color .2s;
}
.rodapm .rodapm__button svg { width: 1.15rem; height: 1.15rem; }
.rodapm .rodapm__button:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .45);
	color: var(--rodapm-primary);
}
.rodapm .rodapm__button:focus-visible { outline: 3px solid var(--rodapm-card-text); outline-offset: 3px; }
.rodapm .rodapm__button[hidden] { display: none; }

/* Aggiornamento scheda al cambio partner */
.rodapm__card.is-updating [data-f="name"],
.rodapm__card.is-updating .rodapm__card-address,
.rodapm__card.is-updating .rodapm__rows {
	opacity: 0;
	transform: translateY(6px);
}
.rodapm__card [data-f="name"],
.rodapm__card .rodapm__card-address,
.rodapm__card .rodapm__rows {
	transition: opacity .28s var(--rodapm-ease), transform .28s var(--rodapm-ease);
}

/* ---------- Mappa ---------- */

.rodapm__map {
	position: relative;
	height: var(--rodapm-map-height);
	border-radius: var(--rodapm-map-radius);
	overflow: hidden;
	background: #eceeec;
	isolation: isolate;
}
.rodapm--layout-side .rodapm__map { align-self: stretch; height: auto; min-height: var(--rodapm-map-height); }
.rodapm--layout-side .rodapm__iframe { position: absolute; inset: 0; }

.rodapm__iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	transition: opacity .35s var(--rodapm-ease);
}
.rodapm--grayscale .rodapm__iframe { filter: grayscale(1) contrast(1.02); }

.rodapm__map-loader {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
	opacity: 0;
	transition: opacity .25s;
}
.rodapm__map-loader::after {
	content: "";
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 50%;
	border: 3px solid color-mix(in srgb, var(--rodapm-primary) 20%, transparent);
	border-top-color: var(--rodapm-primary);
	animation: rodapm-spin .8s linear infinite;
}
.rodapm__map.is-loading .rodapm__iframe { opacity: .35; }
.rodapm__map.is-loading .rodapm__map-loader { opacity: 1; }

@keyframes rodapm-spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.rodapm,
	.rodapm--layout-side {
		grid-template-columns: minmax(0, 1fr);
		/* Su tablet e mobile la mappa sta subito dopo la lista, così resta a vista quando si sceglie un partner */
		grid-template-areas:
			"intro"
			"map"
			"card";
		grid-template-rows: none;
		--rodapm-gap: 36px;
	}
	.rodapm__intro { padding-top: 0; }
	.rodapm--layout-side .rodapm__map { height: var(--rodapm-map-height); align-self: auto; }
}

@media (max-width: 767px) {
	.rodapm {
		--rodapm-card-radius: 28px;
		--rodapm-map-radius: 28px;
		--rodapm-map-height: 380px;
		--rodapm-gap: 28px;
	}
	.rodapm__item { padding: 1rem 0; }
	.rodapm__item-icon { width: 3.2rem; height: 3.2rem; }
	.rodapm__item-name { font-size: 1.15rem; }
	.rodapm .rodapm__button { width: 100%; justify-content: center; }
	.rodapm__card { padding: 1.8rem 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
	.rodapm *,
	.rodapm *::before,
	.rodapm *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}

.rodapm .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
