/* Fotovoltaico365 – stili dei componenti. I colori arrivano da theme.json (--wp--preset--color--*). */

:root {
	--f365-navy: var(--wp--preset--color--navy, #18345B);
	--f365-navy-profondo: var(--wp--preset--color--navy-profondo, #0F2440);
	--f365-verde: var(--wp--preset--color--verde, #3A6E4A);
	--f365-ambra: var(--wp--preset--color--ambra, #E9A23B);
	--f365-bordo: var(--wp--preset--color--bordo, #E1E7EE);
	--f365-ardesia: var(--wp--preset--color--ardesia, #4A5D72);
	--f365-nebbia: var(--wp--preset--color--nebbia, #C5D2E0);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:where(a, button, input, select, summary):focus-visible {
	outline: 2px solid var(--f365-ambra);
	outline-offset: 3px;
}

/* ---------- Intestazione ---------- */
.f365-barra { font-size: 0.875rem; }
.f365-barra a { color: #fff; text-decoration: none; }
.f365-barra a:hover { color: var(--f365-ambra); }

.f365-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid var(--f365-bordo);
}
.admin-bar .f365-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .f365-header { top: 0; position: relative; } }

.f365-header .f365-logo img { height: 48px; width: auto; display: block; }
@media (max-width: 600px) { .f365-header .f365-logo img { height: 38px; } }
.f365-header .wp-block-navigation a:hover { color: var(--f365-verde); }

/* ---------- Testi di servizio ---------- */
.is-style-occhiello {
	font-weight: 600;
	font-size: 0.9375rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--f365-verde);
	margin-bottom: 0.5rem !important;
}
.has-navy-background-color .is-style-occhiello,
.has-navy-profondo-background-color .is-style-occhiello { color: var(--f365-ambra); }

.is-style-etichetta {
	display: inline-block;
	align-self: flex-start;
	font-size: 0.8125rem;
	font-weight: 700;
	padding: 0.3rem 0.8rem;
	border-radius: 999px;
	line-height: 1.4;
}

.f365-pillola-hero {
	display: inline-block;
	background: rgba(255, 255, 255, 0.1);
	color: var(--f365-ambra);
	font-size: 0.875rem;
	font-weight: 600;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
}

/* ---------- Pulsanti ---------- */
.wp-block-button.is-style-contorno-verde .wp-block-button__link {
	background: transparent;
	color: #fff;
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--verde-chiaro, #7DBF8A);
}
.wp-block-button.is-style-contorno-verde .wp-block-button__link:hover { background: rgba(125, 191, 138, 0.15); }
.wp-block-button.is-style-navy .wp-block-button__link { background: var(--f365-navy); color: #fff; }
.wp-block-button.is-style-navy .wp-block-button__link:hover { background: var(--f365-navy-profondo); }
.wp-block-button__link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Schede ---------- */
.is-style-scheda {
	background: #fff;
	border: 1px solid var(--f365-bordo);
	border-radius: 22px;
	overflow: hidden;
}
.f365-formula { display: flex; flex-direction: column; height: 100%; }
.f365-formula > .wp-block-group:last-child { flex-grow: 1; display: flex; flex-direction: column; }
.f365-formula .wp-block-image { margin: 0; }
.f365-formula .wp-block-image img { width: 100%; height: 220px; object-fit: cover; display: block; }
.f365-formula .f365-formula__link { margin-top: auto; font-weight: 700; }

.f365-passo__numero {
	font-family: var(--wp--preset--font-family--titoli);
	font-weight: 800;
	font-size: 2.75rem;
	line-height: 1;
	color: var(--f365-ambra);
	margin: 0;
}

.is-style-arrotondata img { border-radius: 22px; }

/* ---------- Hero ---------- */
.f365-hero__foto { position: relative; }
.f365-hero__foto img { border-radius: 28px; width: 100%; aspect-ratio: 4 / 3.2; object-fit: cover; display: block; }
.f365-hero__badge {
	position: absolute;
	left: -20px;
	bottom: 28px;
	background: #fff;
	color: var(--f365-navy);
	border-radius: 18px;
	padding: 0.9rem 1.2rem;
	box-shadow: var(--wp--preset--shadow--morbida);
	font-size: 0.875rem;
	line-height: 1.35;
	max-width: 260px;
}
@media (max-width: 781px) { .f365-hero__badge { left: 12px; bottom: 12px; } }
.f365-numeri strong {
	display: block;
	font-family: var(--wp--preset--font-family--titoli);
	font-size: 1.375rem;
	color: #fff;
}

/* ---------- Province ---------- */
.f365-province { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.f365-province li {
	background: var(--wp--preset--color--cielo, #F4F7FA);
	border: 1px solid var(--f365-bordo);
	padding: 0.45rem 0.9rem;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
}

.f365-galleria { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.f365-galleria .wp-block-image { margin: 0; }
.f365-galleria .wp-block-image img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 22px; width: 100%; }
.f365-galleria .wp-block-image figcaption { margin-top: 0.4rem; }
.f365-contatore {
	aspect-ratio: 1 / 1;
	border-radius: 22px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}
.f365-contatore .f365-contatore__cifra {
	font-family: var(--wp--preset--font-family--titoli);
	font-weight: 800;
	font-size: clamp(2.25rem, 5vw, 3.25rem);
	line-height: 1;
	color: var(--f365-ambra);
	margin: 0;
}

/* ---------- Recensioni ---------- */
.f365-stelle { color: var(--wp--preset--color--ambra-scuro, #8A5A00); letter-spacing: 2px; }
.f365-recensione blockquote, .f365-recensione .wp-block-quote { margin: 0; padding: 0; }
.f365-recensione cite { font-style: normal; font-weight: 700; font-size: 0.9375rem; }

/* ---------- FAQ ---------- */
.wp-block-details summary { font-weight: 700; cursor: pointer; list-style: none; position: relative; padding-right: 2rem; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "";
	position: absolute;
	right: 0.25rem;
	top: 0.45em;
	width: 0.6rem;
	height: 0.6rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}
.wp-block-details[open] summary::after { transform: rotate(-135deg); top: 0.7em; }
.wp-block-details > :not(summary) { color: var(--f365-ardesia); margin-top: 0.75rem; }
@media (prefers-reduced-motion: reduce) { .wp-block-details summary::after { transition: none; } }

/* ---------- Simulatore ---------- */
.f365-sim__tipi { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.75rem; }
.f365-sim__tipi button {
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	padding: 0.6rem 1.1rem;
	min-height: 44px;
	border-radius: 999px;
	cursor: pointer;
	border: 2px solid rgba(255, 255, 255, 0.3);
	background: transparent;
	color: #fff;
}
.f365-sim__tipi button[aria-pressed="true"] { border-color: var(--f365-ambra); background: var(--f365-ambra); color: var(--f365-navy-profondo); }
.f365-sim__etichetta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 600; margin-bottom: 0.6rem; }
.f365-sim__etichetta output { font-family: var(--wp--preset--font-family--titoli); font-size: 1.375rem; color: var(--f365-ambra); }
.f365-sim input[type="range"] { width: 100%; accent-color: var(--f365-ambra); height: 32px; }
.f365-sim__risultati { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.75rem; }
@media (max-width: 480px) { .f365-sim__risultati { grid-template-columns: minmax(0, 1fr); } }
.f365-sim__box { border-radius: 18px; padding: 1.3rem; background: rgba(255, 255, 255, 0.07); }
.f365-sim__box span { font-size: 0.875rem; color: var(--f365-nebbia); }
.f365-sim__box strong { display: block; font-family: var(--wp--preset--font-family--titoli); font-size: 2rem; font-weight: 800; color: #fff; line-height: 1.2; }
.f365-sim__box--chiaro { background: #fff; }
.f365-sim__box--chiaro span { color: var(--f365-ardesia); }
.f365-sim__box--chiaro strong { color: var(--f365-verde); }
.f365-sim__nota { font-size: 0.8125rem; color: var(--f365-nebbia); margin-top: 0.9rem; }

/* ---------- Modulo ---------- */
.f365-modulo { display: flex; flex-direction: column; gap: 0.9rem; }
.f365-modulo__campo { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.875rem; font-weight: 600; }
.f365-modulo input[type="text"],
.f365-modulo input[type="tel"],
.f365-modulo select {
	font: inherit;
	font-size: 1rem;
	font-weight: 400;
	padding: 0.8rem 0.9rem;
	border: 1px solid #B9C6D3;
	border-radius: 12px;
	background: #fff;
	color: var(--f365-navy);
	min-height: 48px;
	box-sizing: border-box;
	width: 100%;
}
.f365-modulo input:focus, .f365-modulo select:focus { border-color: var(--f365-navy); }
.f365-modulo__consenso { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.8125rem; color: var(--f365-ardesia); }
.f365-modulo__consenso input { margin-top: 0.2rem; width: 18px; height: 18px; flex: none; }
.f365-modulo__invia { width: 100%; border: 0; cursor: pointer; min-height: 52px; }
.f365-modulo__whatsapp { text-align: center; font-weight: 600; font-size: 0.9375rem; color: var(--f365-verde); }
.f365-modulo__trappola { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.f365-modulo__esito { border-radius: 12px; padding: 0.9rem 1rem; margin-bottom: 1rem; font-size: 0.9375rem; }
.f365-modulo__esito--ok { background: var(--wp--preset--color--verde-tenue, #E8F1EA); color: #23492F; }
.f365-modulo__esito--errore { background: #FBE7E5; color: #8A1F14; }

/* ---------- Footer ---------- */
.f365-footer a { color: var(--f365-nebbia); text-decoration: none; }
.f365-footer a:hover { color: #fff; text-decoration: underline; }
.f365-footer .f365-logo img { height: 44px; width: auto; }
.f365-footer .wp-block-social-links .wp-social-link { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* ---------- Articoli ---------- */
.f365-card-articolo .wp-block-post-featured-image img { border-radius: 18px; aspect-ratio: 5 / 4; object-fit: cover; }
.f365-card-articolo .wp-block-post-title a:hover { color: var(--f365-verde); }
.wp-block-query-pagination a { text-decoration: none; font-weight: 600; }
.f365-footer ul { list-style: none; padding-left: 0; }
.f365-footer ul li + li { margin-top: 0.35rem; }

/* ---------- Pagine interne ---------- */
.f365-card h3::before {
	content: "";
	display: block;
	width: 28px;
	height: 4px;
	border-radius: 2px;
	background: var(--f365-ambra);
	margin-bottom: 0.9rem;
}
.f365-card h3 { margin-top: 0; }
.f365-card p:last-child { margin-bottom: 0; }

.f365-check { list-style: none; padding-left: 0; }
.f365-check li { position: relative; padding-left: 2rem; }
.f365-check li + li { margin-top: 0.6rem; }
.f365-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.35em;
	width: 1.15rem;
	height: 1.15rem;
	border-radius: 50%;
	background: var(--wp--preset--color--verde-tenue, #E8F1EA);
	box-shadow: inset 0 0 0 2px var(--f365-verde);
}
.f365-check li::after {
	content: "";
	position: absolute;
	left: 0.4rem;
	top: 0.55em;
	width: 0.35rem;
	height: 0.6rem;
	border-right: 2px solid var(--f365-verde);
	border-bottom: 2px solid var(--f365-verde);
	transform: rotate(45deg);
}

.f365-impianto .wp-block-image { margin: 0; }
.f365-impianto .wp-block-image img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; display: block; }
.f365-impianto h3 { font-size: 1.125rem; margin: 0; }
.f365-impianto .f365-luogo { color: var(--f365-verde); font-weight: 700; font-size: 0.875rem; margin: 0; }

.f365-hero-pagina .wp-block-image img { border-radius: 24px; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.f365-briciole { font-size: 0.875rem; color: var(--f365-nebbia); }
.f365-briciole a { color: var(--f365-nebbia); text-decoration: none; }
.f365-briciole a:hover { color: #fff; text-decoration: underline; }

.f365-marchi { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; padding: 0; }
.f365-marchi li { border: 1px solid var(--f365-bordo); border-radius: 12px; padding: 0.6rem 1.1rem; font-weight: 700; background: #fff; }

/* ---------- Intestazione su mobile ---------- */
.f365-header .f365-logo { flex-shrink: 0; }
.f365-header .wp-block-button__link { white-space: nowrap; }
@media (max-width: 781px) {
	.f365-barra { display: none !important; }
}
@media (max-width: 600px) {
	.f365-header .wp-block-buttons { display: none; }
	.f365-header .f365-logo img { height: 40px; }
}

/* ---------- Pulsante WhatsApp flottante (mobile e tablet) ---------- */
.f365-wa {
	position: fixed;
	right: calc(16px + env(safe-area-inset-right, 0px));
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 9999;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #25D366;
	color: #fff;
	display: none;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 22px rgba(15, 36, 64, 0.28);
	transition: transform 0.15s ease;
}
.f365-wa:hover, .f365-wa:focus-visible { color: #fff; transform: scale(1.06); }
.f365-wa:focus-visible { outline: 3px solid var(--f365-ambra); outline-offset: 3px; }
@media (max-width: 1024px) { .f365-wa { display: flex; } }
@media (prefers-reduced-motion: reduce) { .f365-wa { transition: none; } }
