/* BVT Scuole — eredita caratteri e colori dal tema; personalizzabile con --bvt-sc-accent. */

.bvt-sc {
	--bvt-sc-accent: var(--wp--preset--color--sunset, var(--wp--preset--color--accent, var(--wp--preset--color--primary, #f26b1d)));
	--bvt-sc-deep: var(--wp--preset--color--ocean, #13506a);
	--bvt-sc-sand: var(--wp--preset--color--sand, #efe4cf);
	--bvt-sc-line: rgba(0, 0, 0, .12);
	--bvt-sc-line: color-mix(in srgb, currentColor 14%, transparent);
	--bvt-sc-soft: rgba(0, 0, 0, .04);
	--bvt-sc-soft: color-mix(in srgb, currentColor 5%, transparent);
	--bvt-sc-muted: color-mix(in srgb, currentColor 68%, transparent);
	--bvt-sc-radius: 10px;
	container-type: inline-size;
	font-size: 1rem;
}
.bvt-sc *, .bvt-sc *::before, .bvt-sc *::after { box-sizing: border-box; }
.bvt-sc [hidden] { display: none !important; }

/* ---------- pulsanti e campi ---------- */

.bvt-sc-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .45em;
	min-height: 2.75rem; padding: .55em 1.1em;
	font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none;
	color: #fff; background: var(--bvt-sc-accent);
	border: 2px solid var(--bvt-sc-accent); border-radius: 999px; cursor: pointer;
}
.bvt-sc-btn:hover { filter: brightness(.94); color: #fff; }
.bvt-sc-btn--ghost { color: inherit; background: transparent; border-color: var(--bvt-sc-line); }
.bvt-sc-btn--ghost:hover { border-color: var(--bvt-sc-accent); color: inherit; filter: none; }
.bvt-sc-btn--ghost.is-active { border-color: var(--bvt-sc-accent); background: color-mix(in srgb, var(--bvt-sc-accent) 12%, transparent); }
.bvt-sc-btn--small { min-height: 2.25rem; padding: .35em .9em; font-size: .9rem; }
.bvt-sc-btn[disabled] { opacity: .6; cursor: progress; }
.bvt-sc :focus-visible { outline: 3px solid var(--bvt-sc-accent); outline-offset: 2px; }

.bvt-sc input[type=text], .bvt-sc input[type=search], .bvt-sc input[type=email], .bvt-sc input[type=url], .bvt-sc input[type=tel],
.bvt-sc select, .bvt-sc textarea {
	width: 100%; min-height: 2.75rem; padding: .55em .8em;
	font: inherit; color: inherit; background: var(--bvt-sc-soft);
	border: 1px solid var(--bvt-sc-line); border-radius: 8px;
}
.bvt-sc select { appearance: auto; }
.bvt-sc select option { color: #1d1d1d; background: #fff; }
.bvt-sc input:focus, .bvt-sc select:focus, .bvt-sc textarea:focus { border-color: var(--bvt-sc-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--bvt-sc-accent) 25%, transparent); }

/* ---------- filtri ---------- */

.bvt-sc-filters {
	display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; align-items: end;
	margin: 0 0 1rem;
}
.bvt-sc-field { margin: 0; min-width: 0; }
.bvt-sc-field label { display: block; margin: 0 0 .3rem; font-size: .85rem; font-weight: 600; }
.bvt-sc-field--q { grid-column: 1 / -1; }
.bvt-sc-field--actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.bvt-sc-filters.is-live .bvt-sc-submit { display: none; }

@container (min-width: 760px) {
	.bvt-sc-filters { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; }
	.bvt-sc-field--q { grid-column: auto; }
}

.bvt-sc-regions {
	display: flex; gap: .4rem; margin: 0 0 1rem; padding: 0 0 .35rem;
	overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
@container (min-width: 760px) { .bvt-sc-regions { flex-wrap: wrap; overflow: visible; } }
.bvt-sc-chip {
	flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: .4em;
	padding: .35em .85em; font-size: .9rem; line-height: 1.3; white-space: nowrap;
	color: inherit; text-decoration: none; border: 1px solid var(--bvt-sc-line); border-radius: 999px;
}
.bvt-sc-chip span { font-size: .8em; color: var(--bvt-sc-muted); font-variant-numeric: tabular-nums; }
.bvt-sc-chip:hover { border-color: var(--bvt-sc-accent); color: inherit; }
.bvt-sc-chip.is-active { color: #fff; background: var(--bvt-sc-accent); border-color: var(--bvt-sc-accent); }
.bvt-sc-chip.is-active span { color: rgba(255, 255, 255, .85); }

.bvt-sc-summary { margin: 0 0 .9rem; font-size: 1.05rem; }
.bvt-sc-summary strong { font-size: 1.3em; font-variant-numeric: tabular-nums; }

/* ---------- mappa + elenco ---------- */

.bvt-sc-layout { display: grid; gap: 1.5rem; }
@container (min-width: 900px) {
	.bvt-sc-layout--split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
	.bvt-sc-layout--split .bvt-sc-mapwrap { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + 1rem); }
	.bvt-sc-layout--split .bvt-sc-map { height: min(var(--bvt-sc-h, 520px), calc(100vh - 2rem - var(--wp-admin--admin-bar--height, 0px))); }
}

.bvt-sc-map {
	position: relative; z-index: 0;
	height: min(var(--bvt-sc-h, 520px), 62vh); min-height: 260px;
	border-radius: var(--bvt-sc-radius); overflow: hidden;
	background: var(--bvt-sc-sand);
	color: #1d1d1d;
}
.bvt-sc-map__ph {
	position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: .25rem; padding: 1.5rem; text-align: center; font-size: .95rem;
	background:
		radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .55) 0, transparent 45%),
		repeating-linear-gradient(115deg, transparent 0 18px, rgba(0, 0, 0, .025) 18px 19px),
		var(--bvt-sc-sand);
}
.bvt-sc-map__ph p { margin: 0 0 .4rem; max-width: 32rem; }

/* Leaflet dentro il tema */
.bvt-sc .leaflet-container { font: inherit; font-size: .9rem; background: #dbe8ee; }
.bvt-sc .leaflet-container a { color: inherit; }
.bvt-sc .leaflet-control-attribution { font-size: .7rem; }
.bvt-sc .leaflet-bar a { color: #1d1d1d; }
.bvt-sc .leaflet-popup-content-wrapper { border-radius: 10px; }
.bvt-sc .leaflet-popup-content { margin: 12px 16px; line-height: 1.4; }

.bvt-sc-pin { background: none; border: 0; }
.bvt-sc-pin svg { display: block; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); transition: transform .15s ease; transform-origin: 50% 100%; }
.bvt-sc-pin__body { fill: var(--bvt-sc-accent); stroke: #fff; stroke-width: 1.5; }
.bvt-sc-pin__seam { fill: none; stroke: var(--bvt-sc-accent); stroke-width: 1.4; stroke-linecap: round; }
.bvt-sc-pin.is-active svg, .bvt-sc-pin:hover svg, .bvt-sc-pin:focus svg { transform: scale(1.2); }
.bvt-sc-pin.is-active .bvt-sc-pin__body { fill: var(--bvt-sc-deep); }
.bvt-sc-pin.is-active .bvt-sc-pin__seam { stroke: var(--bvt-sc-deep); }

.bvt-sc-cluster { background: none; border: 0; }
.bvt-sc-cluster span {
	display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
	font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; color: #fff;
	background: var(--bvt-sc-accent); border-radius: 50%;
	box-shadow: 0 0 0 5px color-mix(in srgb, var(--bvt-sc-accent) 30%, transparent), 0 2px 6px rgba(0, 0, 0, .25);
	border: 2px solid #fff;
}
.bvt-sc-me { fill: #1a73e8; fill-opacity: 1; stroke: #fff; }

.bvt-sc-pop { display: flex; flex-direction: column; gap: .15rem; }
.bvt-sc-pop strong { font-size: 1rem; line-height: 1.25; }
.bvt-sc-pop strong a { text-decoration: none; }
.bvt-sc-pop__addr { color: #555; font-size: .85rem; }
.bvt-sc-pop__links { display: flex; gap: .8rem; margin-top: .35rem; }
.bvt-sc-pop__links a { font-weight: 600; color: var(--bvt-sc-deep) !important; }

/* ---------- elenco ---------- */

.bvt-sc-group { margin: 0 0 1.75rem; }
.bvt-sc-group__title {
	display: flex; align-items: baseline; gap: .5rem;
	margin: 0 0 .25rem; padding: 0 0 .5rem;
	font-size: 1.2rem; line-height: 1.25; border-bottom: 2px solid var(--bvt-sc-accent);
}
.bvt-sc-group__title span { font-size: .8rem; font-weight: 600; color: var(--bvt-sc-muted); font-variant-numeric: tabular-nums; }

.bvt-sc-cards { display: grid; }
.bvt-sc-layout:not(.bvt-sc-layout--split) .bvt-sc-cards { column-gap: 2rem; }
@container (min-width: 760px) {
	.bvt-sc-layout:not(.bvt-sc-layout--split) .bvt-sc-cards { grid-template-columns: 1fr 1fr; }
}

.bvt-sc-card {
	position: relative; display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: .9rem;
	padding: .95rem .5rem .95rem .25rem; border-bottom: 1px solid var(--bvt-sc-line);
	transition: background-color .2s;
}
.bvt-sc-card.is-active { background: color-mix(in srgb, var(--bvt-sc-accent) 9%, transparent); box-shadow: inset 3px 0 0 var(--bvt-sc-accent); }
.bvt-sc-card__logo {
	width: 3rem; height: 3rem; border-radius: 50%; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	background: var(--bvt-sc-sand); color: #6b4d1d; font-weight: 700; font-size: .95rem; letter-spacing: .02em;
}
.bvt-sc-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.bvt-sc-card__body > * { margin: 0; }
.bvt-sc-card__name { font-size: 1.05rem; line-height: 1.3; margin: 0 0 .15rem; }
.bvt-sc-card__name a { color: inherit; text-decoration: none; }
.bvt-sc-card__name a:hover { color: var(--bvt-sc-accent); text-decoration: underline; }
.bvt-sc-card__place { font-size: .92rem; }
.bvt-sc-card__dist:not(:empty) { margin-left: .5rem; padding: .05em .5em; font-size: .8rem; font-weight: 700; border-radius: 999px; color: #fff; background: var(--bvt-sc-deep); white-space: nowrap; }
.bvt-sc-card__addr { font-size: .88rem; color: var(--bvt-sc-muted); }
.bvt-sc-card__links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .45rem !important; font-size: .88rem; }
.bvt-sc-link { font-weight: 600; text-decoration: none; color: var(--bvt-sc-accent); }
.bvt-sc-link:hover { text-decoration: underline; }
.bvt-sc-card__locate {
	align-self: start; width: 2.5rem; height: 2.5rem; padding: 0;
	display: flex; align-items: center; justify-content: center;
	color: var(--bvt-sc-accent); background: transparent; border: 1px solid var(--bvt-sc-line); border-radius: 50%; cursor: pointer;
}
.bvt-sc-card__locate:hover { background: var(--bvt-sc-accent); border-color: var(--bvt-sc-accent); color: #fff; }

.bvt-sc-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .45rem 0 0 !important; padding: 0; list-style: none; }
.bvt-sc-tags li { margin: 0; padding: .1em .6em; font-size: .78rem; border-radius: 999px; background: var(--bvt-sc-soft); border: 1px solid var(--bvt-sc-line); }

.bvt-sc-empty { padding: 2rem 1rem; text-align: center; border: 1px dashed var(--bvt-sc-line); border-radius: var(--bvt-sc-radius); }
.bvt-sc-empty p { margin: 0 0 .75rem; }

/* ---------- scheda della scuola ---------- */

.bvt-sc-scheda { display: grid; gap: 1.5rem; margin: 0 0 2rem; }
@container (min-width: 680px) { .bvt-sc-scheda { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.bvt-sc-scheda__logo img { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; }
.bvt-sc-scheda__place { margin: .5rem 0 .2rem; font-size: 1.05rem; font-weight: 600; }
.bvt-sc-scheda__place a { color: inherit; }
.bvt-sc-scheda__addr { margin: 0 0 .5rem; color: var(--bvt-sc-muted); }
.bvt-sc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.bvt-sc-actions .bvt-sc-btn:not(:last-child) { color: inherit; background: transparent; border-color: var(--bvt-sc-line); }
.bvt-sc-actions .bvt-sc-btn:not(:last-child):hover { border-color: var(--bvt-sc-accent); filter: none; }
.bvt-sc-scheda__map { --bvt-sc-h: 300px; }
.bvt-sc-near-list { margin: 2.5rem 0 1rem; }
.bvt-sc-near-list h2 { font-size: 1.25rem; margin: 0 0 .25rem; padding-bottom: .5rem; border-bottom: 2px solid var(--bvt-sc-accent); }
@container (min-width: 680px) { .bvt-sc-near-list .bvt-sc-cards { grid-template-columns: 1fr 1fr; column-gap: 2rem; } }
.bvt-sc-near-list .bvt-sc-card__locate { display: none; }
.bvt-sc-back { margin-top: 2rem; }

/* ---------- modulo «Segnala la tua scuola» ---------- */

.bvt-sc-form fieldset { margin: 0 0 1.25rem; padding: 0; border: 0; }
.bvt-sc-form legend { margin: 0 0 .6rem; padding: 0; font-size: 1.05rem; font-weight: 700; }
.bvt-sc-form p { margin: 0 0 .85rem; }
.bvt-sc-form label { display: block; margin: 0 0 .3rem; font-size: .9rem; font-weight: 600; }
.bvt-sc-form__grid { display: grid; gap: 0 1rem; }
@container (min-width: 620px) {
	.bvt-sc-form__grid { grid-template-columns: 1fr 1fr; }
	.bvt-sc-form__wide { grid-column: 1 / -1; }
}
.bvt-sc-form__checks > span { display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: 600; }
.bvt-sc-form__checks label, .bvt-sc-form__privacy label { display: inline-flex; align-items: center; gap: .4rem; margin: 0 1rem .4rem 0; font-weight: 400; }
.bvt-sc-form__privacy label { align-items: flex-start; font-size: .9rem; }
.bvt-sc-form__privacy input { margin-top: .25em; }
.bvt-sc-form input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--bvt-sc-accent); }
.bvt-sc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.bvt-sc-form-msg { margin: 0 0 1rem; padding: 1rem 1.25rem; border-radius: var(--bvt-sc-radius); border-left: 4px solid; }
.bvt-sc-form-msg p { margin: 0; }
.bvt-sc-form-msg--ok { border-color: #1a7f37; background: rgba(26, 127, 55, .08); }
.bvt-sc-form-msg--err { border-color: #b32d2e; background: rgba(179, 45, 46, .08); }

@media (prefers-reduced-motion: reduce) {
	.bvt-sc *, .bvt-sc .leaflet-zoom-anim .leaflet-zoom-animated { transition: none !important; animation: none !important; }
}

/* ---------- elenco delle regioni ---------- */

.bvt-sc-list__title { margin: 0 0 .5rem; padding: 0 0 .5rem; font-size: 1.2rem; line-height: 1.25; border-bottom: 2px solid var(--bvt-sc-accent); }
.bvt-sc-rl { list-style: none; margin: 0; padding: 0; display: grid; }
.bvt-sc-layout:not(.bvt-sc-layout--split) .bvt-sc-rl { column-gap: 2rem; }
@container (min-width: 760px) { .bvt-sc-layout:not(.bvt-sc-layout--split) .bvt-sc-rl { grid-template-columns: 1fr 1fr; } }
.bvt-sc-rl li { margin: 0; }
.bvt-sc-rl__item {
	display: grid; grid-template-columns: minmax(0, 1fr) auto 1.25rem; grid-template-areas: "name count arrow" "cities count arrow";
	align-items: center; column-gap: .9rem; padding: .8rem .35rem;
	color: inherit; text-decoration: none; border-bottom: 1px solid var(--bvt-sc-line);
	transition: background-color .15s;
}
.bvt-sc-rl__item:hover, .bvt-sc-rl__item:focus-visible { background: color-mix(in srgb, var(--bvt-sc-accent) 8%, transparent); color: inherit; }
.bvt-sc-rl__name { grid-area: name; font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.bvt-sc-rl__cities { grid-area: cities; font-size: .85rem; color: var(--bvt-sc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bvt-sc-rl__count { grid-area: count; font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.1; }
.bvt-sc-rl__count small { display: block; font-size: .7rem; font-weight: 600; color: var(--bvt-sc-muted); }
.bvt-sc-rl__arrow { grid-area: arrow; color: var(--bvt-sc-accent); transition: transform .15s; }
.bvt-sc-rl__item:hover .bvt-sc-rl__arrow { transform: translateX(3px); }

.bvt-sc-back-row { margin: 0 0 .75rem; }
.bvt-sc-backbtn {
	display: inline-flex; align-items: center; gap: .35em; padding: .4em .9em;
	font-weight: 600; font-size: .92rem; text-decoration: none; color: inherit;
	border: 1px solid var(--bvt-sc-line); border-radius: 999px;
}
.bvt-sc-backbtn:hover { border-color: var(--bvt-sc-accent); color: inherit; }
.bvt-sc-regions { display: none; }

