/*
 * Aggiunte al tema (2026-11-12), caricate dopo theme.min.css.
 * Stanno qui finché la build SCSS non è rifatta: poi confluiscono in assets/scss.
 */

/* Open Sans servito dal sito (prima: Google Fonts caricato con webfont.js, anche prima del consenso). Licenza OFL-1.1, @fontsource/open-sans 5.0.28 */
@font-face {
	font-family: 'Open Sans';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/open-sans-latin-400.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Open Sans';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('../fonts/open-sans-latin-600.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Il tema usa anche il grassetto (700): con un solo peso 600 il browser lo simula da quello */
@font-face {
	font-family: 'Open Sans';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/open-sans-latin-600.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Il tema taglia lo sbordo orizzontale con overflow-x: hidden su html, body e .site-main, che blocca position: sticky.
   clip taglia allo stesso modo senza bloccarlo (browser senza clip: resta hidden, la sidebar semplicemente scorre). */
@supports (overflow-x: clip) {
	html, body, .site-main {
		overflow-x: clip;
	}
}

/* La sidebar dell'articolo (prima fissa con jQuery + scrolltofixed) è stata tolta dal modello il 2026-11-12: niente più regole sticky */

/* Footer (2026-11-13, prima stili scritti dentro template-parts/footer.php) */
/* Hover bianco solo nel footer (sfondo scuro): prima valeva per tutti i link del sito */
.site-footer a:hover {
	color: white !important;
}
/* «Gestisci i cookie» deve sembrare un link del footer: il tema dà ai button un colore scuro, invisibile sul fondo nero */
.footer-link__pulsante {
	background: none;
	border: 0;
	padding: 0;
	color: #ff5041;
	font: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	cursor: pointer;
}
.footer-link__pulsante:hover,
.footer-link__pulsante:focus-visible {
	color: white;
}

/* Pulsanti dell'intestazione (ricerca, apri e chiudi menu): il tema toglie il bordo al focus (outline: 0);
   lo rimettiamo solo per chi arriva con la tastiera (:focus-visible), il clic col mouse resta senza bordo */
#main-menu-search:focus-visible,
#main-menu-toggle:focus-visible,
a#main-menu-close:focus-visible {
	outline: 2px solid #ff5041;
	outline-offset: 2px;
}


/* Link nel testo di articoli e pagine (2026-11-13): rosso più scuro, stesso tono del sito.
   #ff5041 su bianco ha contrasto 3,2; #d33a2c arriva a 4,76 (minimo WCAG AA per il testo: 4,5). Pulsanti, menu e footer restano #ff5041;
   il breadcrumb è già nero. */
.post-content-cnt a,
.post-excerpt a {
	color: #d33a2c;
}
.post-content-cnt a:hover,
.post-content-cnt a:focus-visible {
	text-decoration: underline;
}

/* «Salta al contenuto» (2026-11-13): nascosto, compare in alto a sinistra al primo Tab */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 3000;
	padding: 10px 16px;
	background: #fff;
	color: #d33a2c;
	font-weight: 600;
}
.skip-link:focus {
	left: 10px;
	top: 10px;
	outline: 2px solid #d33a2c;
}
/* Con la barra di amministrazione (utenti collegati) il link andrebbe sotto la barra */
body.admin-bar .skip-link:focus {
	top: 42px;
}
@media screen and (max-width: 782px) {
	body.admin-bar .skip-link:focus {
		top: 56px;
	}
}

/* Categorie sopra i titoli (2026-11-13): ora sono link; restano del colore del testo, sopra la riga rossa del tema */
.gte a {
	color: inherit;
	position: relative;
	z-index: 1;
}
.gte a:hover,
.gte a:focus-visible {
	color: #d33a2c;
}

/* Titolo «Potrebbe interessarti» sopra i correlati (2026-11-13) */
.related-post__titolo {
	padding: 0 15px;
}

/* ===== Hover delle schede articolo: home, categorie, ricerca, 404, correlati (2026-11-13) =====
   Prima: il titolo passava da grigio scuro a blu scuro (regola generica a:hover), le immagini non reagivano.
   Ora, passando sulla scheda (o arrivandoci con la tastiera): l'immagine si solleva seguendo la sua ombra a sfalsamento,
   il titolo diventa rosso e sottolineato. */
.gpost .wp-post-image,
.home-featured .bb {
	transition: transform .2s ease, box-shadow .2s ease;
}
.gpost:hover .wp-post-image,
.gpost:focus-within .wp-post-image {
	transform: translate(-4px, -4px);
	box-shadow: 14px 14px #ededed;
}
.home-featured:hover .bb,
.home-featured:focus-within .bb {
	transform: translate(-4px, -4px);
	box-shadow: 14px 14px #fff;
}
.gpost .article__title a,
.gpost .entry-title a,
.home-featured a.h1 {
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	transition: color .2s ease, text-decoration-color .2s ease;
}
.gpost:hover .article__title a,
.gpost:hover .entry-title a,
.gpost .article__title a:focus-visible,
.gpost .entry-title a:focus-visible,
.home-featured:hover a.h1,
.home-featured a.h1:focus-visible {
	color: #d33a2c;
	text-decoration-color: currentColor;
}
/* Pulsante «Leggi»: prima al passaggio il testo diventava blu scuro sul rosso */
.btn:hover,
.btn:focus-visible {
	background: #333;
	color: #fff;
}

/* ===== Hover del menu (2026-11-13) ===== */
@media (min-width: 768px) {
	/* Voci principali: prima nessun cambiamento. Ora una linea rossa sotto la voce, che resta anche sulla sezione in cui si è */
	#main-menu .menu > li > a {
		position: relative;
	}
	#main-menu .menu > li > a::after {
		content: "";
		position: absolute;
		left: 15px;
		right: 15px;
		bottom: 0;
		height: 2px;
		background: #ff5041;
		transform: scaleX(0);
		transition: transform .2s ease;
	}
	#main-menu .menu > li:hover > a::after,
	#main-menu .menu > li > a:focus-visible::after,
	#main-menu .menu > li.current-menu-item > a::after,
	#main-menu .menu > li.current-menu-ancestor > a::after,
	#main-menu .menu > li.current-menu-parent > a::after,
	#main-menu .menu > li.current-post-ancestor > a::after {
		transform: scaleX(1);
	}
	/* Sottomenu: prima testo #ff5041 su bianco (contrasto 3,2); ora rosso scuro su fondo grigio chiaro */
	#main-menu .sub-menu li a:hover,
	#main-menu .sub-menu li a:focus-visible {
		color: #d33a2c !important;
		background: #f5f5f5;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gpost .wp-post-image,
	.home-featured .bb,
	.gpost .article__title a,
	.gpost .entry-title a,
	.home-featured a.h1,
	#main-menu .menu > li > a::after {
		transition: none;
	}
}
