/*
Theme Name: UFS Subalpina
Theme URI: https://filateliasubalpina.it/
Description: Tema child di Twenty Twenty-Five per l'Unione Filatelica Subalpina (Torino, 1913). Palette "carta antica", tipografia libraria (Vollkorn + Literata, font locali), header/footer UFS, stile blocco "Francobollo" e pattern di pagina pronti.
Author: Marco Plassio
Template: twentytwentyfive
Version: 1.7.1
Requires at least: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ufs-subalpina
*/

/* Grana della carta: rumore SVG leggerissimo sopra il colore di fondo. */
body {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	background-attachment: fixed;
}

/* Maiuscoletto per occhielli e sottotitoli: classe aggiuntiva "ufs-occhiello". */
.ufs-occhiello {
	font-family: var(--wp--preset--font-family--vollkorn);
	font-variant-caps: all-small-caps;
	letter-spacing: .14em;
	color: var(--wp--preset--color--accent-3);
}

/* Filetto doppio da frontespizio: classe aggiuntiva "ufs-filetto" su un Separatore. */
.wp-block-separator.ufs-filetto {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--oro);
	border-bottom: 1px solid var(--wp--preset--color--oro);
	height: 4px;
	background: none;
	opacity: 1;
	max-width: 8rem;
}

/* Capolettera: classe aggiuntiva "ufs-capolettera" su un Paragrafo. */
.ufs-capolettera::first-letter {
	float: left;
	font-family: var(--wp--preset--font-family--vollkorn);
	font-weight: 700;
	font-size: 3.6em;
	line-height: .85;
	padding: .06em .1em 0 0;
	color: var(--wp--preset--color--accent-3);
}

/* Header: bordo inferiore oro. */
header.wp-block-template-part > .ufs-header {
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--oro) 55%, transparent);
}

/* Sezioni scure (Stile 4 bordeaux, Stile 5 inchiostro): link e pulsanti leggibili. */
.is-style-section-4 a:where(:not(.wp-element-button)),
.is-style-section-5 a:where(:not(.wp-element-button)) {
	color: currentColor;
}
.is-style-section-4 a:where(:not(.wp-element-button)):hover,
.is-style-section-5 a:where(:not(.wp-element-button)):hover {
	color: var(--wp--preset--color--accent-1);
}
.is-style-section-4 .wp-element-button,
.is-style-section-5 .wp-element-button,
.is-style-section-4 .wp-block-button__link,
.is-style-section-5 .wp-block-button__link {
	background-color: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--accent-3);
}
.is-style-section-4 .wp-element-button:hover,
.is-style-section-5 .wp-element-button:hover,
.is-style-section-4 .wp-block-button__link:hover,
.is-style-section-5 .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--contrast);
}

/* Tabelle a righe alterne in tinta pergamena. */
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background-color: color-mix(in srgb, var(--wp--preset--color--accent-2) 70%, transparent);
}
.wp-block-table.is-style-stripes {
	border-bottom-color: var(--wp--preset--color--oro);
}

/* Vetrina de «Il Foglio»: didascalie sotto la copertina, non sovrapposte. */
.wp-block-gallery.has-nested-images.ufs-vetrina figure.wp-block-image:has(figcaption)::before {
	display: none;
}
.wp-block-gallery.has-nested-images.ufs-vetrina figure.wp-block-image figcaption {
	position: static;
	background: none;
	color: var(--wp--preset--color--contrast);
	text-shadow: none;
	max-height: none;
	overflow: visible;
	padding: .5em 0 0;
	font-family: var(--wp--preset--font-family--vollkorn);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	text-align: center;
}
.wp-block-gallery.has-nested-images.ufs-vetrina figure.wp-block-image img {
	box-shadow: 0 1px 3px color-mix(in srgb, var(--wp--preset--color--contrast) 25%, transparent);
}


/* Lettore PDF integrato negli articoli de «Il Foglio». */
.wp-block-file .ufs-pdf-embed {
	display: block;
	width: min(1000px, calc(100vw - 2.5rem));
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	height: min(85vh, 1100px);
	margin-top: var(--wp--preset--spacing--40);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--oro) 60%, transparent);
	background: var(--wp--preset--color--accent-5);
}
@media (max-width: 781px) {
	.wp-block-file .ufs-pdf-embed { display: none; }
}

/* Indice «Vai a» della pagina Il Foglio e scorrimento morbido alle ancore. */
html { scroll-behavior: smooth; }
:where(h2, h3)[id] { scroll-margin-top: 1.5rem; }
.ufs-foglio-indice {
	margin-block: var(--wp--preset--spacing--40);
	padding: .6em 1em;
	border-left: 3px solid var(--wp--preset--color--oro);
	background: color-mix(in srgb, var(--wp--preset--color--accent-5) 70%, transparent);
}
.ufs-foglio-indice .ufs-occhiello { margin-right: .4em; }
