/* ==========================================================================
   Tema Alessandro Anello — stili
   ========================================================================== */

@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/montserrat-latin-800-normal.woff2") format("woff2"); }

:root {
	--blu-scuro: #003e87;   /* bordo superiore della foto */
	--blu: #005fa3;
	--blu-chiaro: #047ebd;  /* bordo inferiore della foto */
	--blu-notte: #002a5c;
	--testo: #1a2433;
	--grigio: #5b6577;
	--sfondo: #f4f7fb;
	--verde: #009246;
	--rosso: #ce2b37;
	--header-h: 72px;
	--font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.65;
	color: var(--testo);
	background: var(--sfondo);
}

img { max-width: 100%; height: auto; }

a { color: var(--blu); }
a:hover { color: var(--blu-scuro); }

:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }

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

.skip-link {
	position: absolute; left: 8px; top: -60px; z-index: 1000;
	background: #fff; color: var(--blu-scuro); padding: 10px 16px; font-weight: 600;
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 800px; }

/* --------------------------------------------------------------------------
   Testata
   -------------------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--blu-scuro);
	color: #fff;
}
.site-header::after { /* tricolore, come nella foto */
	content: "";
	display: block;
	height: 4px;
	background: linear-gradient(90deg, var(--verde) 0 33.33%, #fff 33.33% 66.66%, var(--rosso) 66.66% 100%);
}
.admin-bar .site-header { top: 32px; }

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: var(--header-h);
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 28px;
}

.brand {
	color: #fff;
	text-decoration: none;
	font-weight: 800;
	font-size: 21px;
	letter-spacing: .01em;
	white-space: nowrap;
}
.brand:hover { color: #fff; }

.nav { display: flex; align-items: center; gap: 28px; }

.nav__list {
	display: flex;
	gap: 26px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.nav__list a {
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: .08em;
	padding: 6px 0;
	border-bottom: 2px solid transparent;
}
.nav__list a:hover,
.nav__list .current-menu-item > a,
.nav__list .current_page_parent > a { border-bottom-color: #fff; }

.nav__warning { margin: 0; font-size: 12px; background: #b00020; padding: 4px 8px; }

.nav-toggle {
	display: none;
	background: transparent;
	border: 0;
	color: #fff;
	width: 48px; height: 48px;
	padding: 10px;
	cursor: pointer;
}
.nav-toggle svg { width: 28px; height: 28px; display: block; }
.nav-toggle__close { display: none; }

/* Home: testata trasparente sopra la foto, allineata a destra (zona blu della foto). */
.site-header--overlay {
	position: absolute;
	top: 0; left: 0; right: 0;
	background: transparent;
}
.site-header--overlay::after { display: none; }
.admin-bar .site-header--overlay { top: 32px; }
/* Il menu resta a destra del 42% della foto (zona blu, lontano dal viso).
   Larghezza della foto mostrata = il minore tra larghezza schermo e altezza × 1376/768. */
.site-header--overlay .site-header__inner {
	justify-content: flex-end;
	height: auto;
	min-height: 88px;
	padding-top: 14px;
	padding-bottom: 14px;
	padding-left: calc(min(100vw, 179.17vh) * .42);
	max-width: none;
}
.site-header--overlay .nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 12px; }
.site-header--overlay .brand {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);
}

/* --------------------------------------------------------------------------
   Pulsanti social
   -------------------------------------------------------------------------- */

.social { display: flex; flex-wrap: wrap; gap: 10px; }

.social-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: 999px;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	transition: transform .15s ease, box-shadow .15s ease;
}
.social-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0, 0, 0, .28); }
.social-btn svg { width: 18px; height: 18px; flex: none; }
.social-btn--whatsapp { background: #1fa855; }
.social-btn--facebook { background: #1877f2; }
.social-btn--instagram { background: linear-gradient(45deg, #f58529 0%, #dd2a7b 50%, #8134af 100%); }

.social--big .social-btn { padding: 15px 26px; font-size: 17px; }
.social--big .social-btn svg { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   Home — foto a tutto schermo
   La foto originale resta sempre intera: si ritagliano solo i prolungamenti
   (vedi inc/hero.php).
   -------------------------------------------------------------------------- */

.site-main { flex: 1 0 auto; }
.site-main--home { display: flex; flex-direction: column; }

.hero {
	position: relative;
	height: 100vh;
	height: 100svh;
	background: var(--blu-scuro);
	overflow: hidden;
}
.admin-bar .hero { height: calc(100vh - 32px); height: calc(100svh - 32px); }

.hero__picture { display: block; width: 100%; height: 100%; }
.hero__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 0 100%; /* in basso a sinistra */
}

.hero-social { display: none; }

.home-content { padding-top: 48px; padding-bottom: 48px; }

/* --------------------------------------------------------------------------
   Pagine interne
   -------------------------------------------------------------------------- */

.site-main:not(.site-main--home) { padding: 56px 0 72px; }

.page-header { margin-bottom: 32px; }
.page-title {
	margin: 0;
	font-weight: 800;
	font-size: clamp(30px, 4.2vw, 46px);
	line-height: 1.15;
	color: var(--blu-scuro);
}
.page-header::after {
	content: "";
	display: block;
	width: 72px;
	height: 4px;
	margin-top: 18px;
	background: linear-gradient(90deg, var(--verde) 0 33.33%, #d9dee6 33.33% 66.66%, var(--rosso) 66.66% 100%);
}
.entry-date, .card__date { display: block; color: var(--grigio); font-size: 14px; font-weight: 600; margin-bottom: 8px; }

.page-thumb { margin: 0 0 32px; }
.page-thumb img { width: 100%; border-radius: 10px; }

.entry-content > * { margin-top: 0; margin-bottom: 1.2em; }
.entry-content h2 { color: var(--blu-scuro); font-weight: 800; font-size: 24px; line-height: 1.25; margin-top: 1.6em; margin-bottom: .6em; }
.entry-content h3 { color: var(--blu-scuro); font-weight: 600; font-size: 20px; margin-top: 1.4em; }
.entry-content img { border-radius: 8px; }
.entry-content blockquote { margin-left: 0; padding-left: 20px; border-left: 4px solid var(--blu); color: var(--grigio); }

.wp-block-button__link {
	display: inline-block;
	background: var(--blu-scuro);
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	padding: 14px 26px;
	border-radius: 999px;
}
.wp-block-button__link:hover { color: #fff; background: var(--blu); }
.is-whatsapp .wp-block-button__link { background: #25d366; color: #fff; }
.is-whatsapp .wp-block-button__link:hover { background: #1ebe5b; }

.anello-email-list { list-style: none; padding: 0; }
.anello-email-list li { margin-bottom: 10px; font-size: 19px; font-weight: 600; }

.contact-social { margin-top: 40px; }

.back-link { margin-top: 40px; font-weight: 600; }

/* --------------------------------------------------------------------------
   Pagina Scrivimi — riquadro WhatsApp e modulo
   -------------------------------------------------------------------------- */

.anello-wa-card {
	background: #fff;
	border-radius: 12px;
	padding: 20px 22px;
	gap: 16px;
	align-items: center;
	box-shadow: 0 2px 14px rgba(0, 42, 92, .08);
}
.anello-wa-card p { margin: 0; color: var(--grigio); }
.anello-wa-card strong { color: var(--blu-scuro); font-size: 18px; }
.anello-wa-card .wp-block-buttons { margin: 0; }

.contact-form-wrap { scroll-margin-top: 100px; }
.contact-form {
	background: #fff;
	border-radius: 12px;
	padding: 24px 24px 18px;
	box-shadow: 0 2px 14px rgba(0, 42, 92, .08);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.contact-form .field { margin: 0 0 16px; }
.contact-form label { display: block; font-size: 14px; font-weight: 600; color: #3a4558; margin-bottom: 6px; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
	width: 100%;
	font: inherit;
	font-size: 16px; /* evita lo zoom automatico su iPhone */
	color: var(--testo);
	background: #fff;
	border: 1px solid #c9d3df;
	border-radius: 8px;
	padding: 11px 12px;
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--blu); outline: 3px solid rgba(0, 95, 163, .2); outline-offset: 0; }
.contact-form [aria-invalid="true"] { border-color: #b00020; }
.contact-form .check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; }
.contact-form .check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--blu-scuro); }
.contact-form .check label { font-weight: 400; font-size: 14.5px; margin: 0; }
.form-error { display: block; color: #b00020; font-size: 14px; font-weight: 600; margin: 4px 0 10px; }
.form-submit {
	font: inherit; font-weight: 600; font-size: 16px;
	background: var(--blu-scuro); color: #fff;
	border: 0; border-radius: 999px; padding: 14px 34px; cursor: pointer;
}
.form-submit:hover { background: var(--blu); }
.form-notice { border-radius: 10px; padding: 14px 18px; margin-bottom: 16px; font-weight: 600; }
.form-notice--ok { background: #e3f4e8; color: #14532d; border: 1px solid #a7d8b5; }
.form-notice--warn { background: #fdeaea; color: #8a1020; border: 1px solid #f2b8bf; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --------------------------------------------------------------------------
   Fascia "Scrivimi" nel piè di pagina (su tutte le pagine)
   -------------------------------------------------------------------------- */

.cta-band { background: var(--blu-scuro); color: #fff; padding: 40px 0; }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band__title { margin: 0 0 4px; font-size: 30px; font-weight: 800; line-height: 1.1; }
.cta-band__desc { margin: 0; font-size: 17px; color: rgba(255, 255, 255, .88); max-width: 620px; }
.cta-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 14px 28px; border-radius: 999px;
	font-weight: 600; font-size: 16px; line-height: 1; text-decoration: none;
	transition: transform .15s ease;
}
.cta-btn:hover { transform: translateY(-1px); }
.cta-btn svg { width: 20px; height: 20px; }
.cta-btn--primary { background: #fff; color: var(--blu-scuro); }
.cta-btn--primary:hover { color: var(--blu-scuro); }
.cta-btn--whatsapp { background: #1fa855; color: #fff; }
.cta-btn--whatsapp:hover { color: #fff; }
.site-footer { border-top: 4px solid transparent; border-image: linear-gradient(90deg, var(--verde) 0 33.33%, #fff 33.33% 66.66%, var(--rosso) 66.66% 100%) 1; }

/* --------------------------------------------------------------------------
   Notizie
   -------------------------------------------------------------------------- */

.news-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
	gap: 28px;
}
.card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 14px rgba(0, 42, 92, .08);
	transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: 0 6px 24px rgba(0, 42, 92, .16); transform: translateY(-2px); }
.card__link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card__link:hover { color: inherit; }
.card__img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card__body { padding: 20px 22px 24px; }
.card__title { margin: 0 0 10px; font-size: 20px; line-height: 1.3; font-weight: 800; color: var(--blu-scuro); }
.card__excerpt { margin: 0; color: var(--grigio); font-size: 15px; }

.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
	display: inline-block; min-width: 42px; padding: 9px 14px; text-align: center;
	background: #fff; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--blu-scuro);
	box-shadow: 0 1px 6px rgba(0, 42, 92, .08);
}
.pagination .page-numbers.current { background: var(--blu-scuro); color: #fff; }

.empty { color: var(--grigio); }

/* --------------------------------------------------------------------------
   Piè di pagina
   -------------------------------------------------------------------------- */

.site-footer { background: var(--blu-notte); color: #fff; padding: 36px 0; text-align: center; }
.site-footer__inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.site-footer__name { margin: 0; font-weight: 800; font-size: 19px; }
.site-footer__meta { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .75); }
.site-footer__meta a { color: #fff; }
.social--footer { justify-content: center; }

/* --------------------------------------------------------------------------
   Banner errori (solo amministratori)
   -------------------------------------------------------------------------- */

.anello-admin-banner {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 99999;
	max-height: 40vh; overflow: auto;
	background: #b00020; color: #fff;
	padding: 12px 20px; font: 14px/1.5 system-ui, sans-serif;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, .3);
}
.anello-admin-banner ul { margin: 6px 0; padding-left: 20px; }
.anello-admin-banner a { color: #fff; font-weight: 700; }

/* --------------------------------------------------------------------------
   Schermi grandi: testata della home più visibile
   -------------------------------------------------------------------------- */

@media (min-width: 1600px) {
	.site-header--overlay .site-header__inner { min-height: 104px; padding-right: 44px; }
	.site-header--overlay .nav__list a { font-size: 16px; }
	.site-header--overlay .social-btn { padding: 12px 20px; font-size: 16px; }
	.site-header--overlay .social-btn svg { width: 22px; height: 22px; }
}

/* --------------------------------------------------------------------------
   Schermi medi: testata più compatta
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
	.nav { gap: 18px; }
	.nav__list { gap: 18px; }
	.social--header .social-btn span { display: none; } /* restano le icone */
	.social--header .social-btn { padding: 9px; }
}

/* --------------------------------------------------------------------------
   Mobile e schermi verticali — stessa condizione usata dal <picture> della foto
   -------------------------------------------------------------------------- */

@media (max-width: 768px), (max-aspect-ratio: 1/1) {
	:root { --header-h: 62px; }
	body { font-size: 16px; }

	.site-header__inner { padding: 0 12px 0 20px; }
	.brand { font-size: 18px; }

	.nav-toggle { display: block; position: relative; z-index: 60; }

	.nav {
		display: none;
		position: fixed;
		inset: 0;
		z-index: 55;
		flex-direction: column;
		justify-content: center;
		gap: 36px;
		padding: 80px 24px 40px;
		background: var(--blu-scuro);
	}
	.nav-open .nav { display: flex; }
	.nav-open .nav-toggle__open { display: none; }
	.nav-open .nav-toggle__close { display: inline; }
	.nav-open { overflow: hidden; }

	.nav__list { flex-direction: column; align-items: center; gap: 22px; }
	.nav__list a { font-size: 20px; }

	.social--header { justify-content: center; }
	.social--header .social-btn span { display: inline; }
	.social--header .social-btn { padding: 13px 22px; font-size: 16px; }

	.site-header--overlay .site-header__inner { height: 56px; min-height: 0; padding: 0 4px 0 20px; }

	/* Foto intera, larga quanto lo schermo. */
	.hero, .admin-bar .hero { height: auto; }
	.hero__picture, .hero__img { height: auto; }
	.hero__img { object-fit: initial; }

	/* Pulsanti social subito sotto la foto, sullo stesso blu del bordo inferiore. */
	.hero-social {
		display: flex;
		flex: 1 0 auto;
		justify-content: center;
		align-items: flex-start;
		padding: 28px 20px 40px;
		background: linear-gradient(180deg, var(--blu-chiaro) 0%, var(--blu-scuro) 100%);
	}
	.hero-social .social { justify-content: center; }
	/* Pulsanti grandi in colonna, larghi e facili da toccare. */
	.social--big { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; margin: 0 auto; }
	.social--big .social-btn { justify-content: center; padding: 15px 20px; font-size: 17px; }
	.social--big .social-btn svg { width: 22px; height: 22px; }
	.contact-social .social--big { margin: 0; }

	.cta-band { padding: 32px 0; text-align: center; }
	.cta-band__inner { flex-direction: column; }
	.cta-band__actions { flex-direction: column; width: 100%; max-width: 320px; }
	.cta-btn { justify-content: center; }
	.contact-form { padding: 20px 16px 14px; }

	.site-main:not(.site-main--home) { padding: 36px 0 56px; }
	.container { padding: 0 20px; }
}

@media (max-width: 782px) {
	.admin-bar .site-header,
	.admin-bar .site-header--overlay { top: 46px; }
}
@media (max-width: 600px) {
	.admin-bar .site-header { top: 0; } /* sotto i 600px la barra admin non è fissa */
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
