/*
 * Caratteri di ToBePolo (D122, 30/9/2026; titoli cambiati il 1/10/2026).
 *
 * Schibsted Grotesk per testi, bottoni e campi; Figtree per titoli e prezzi
 * (1/10, decisione del CEO: la «f» di Bricolage Grotesque non piaceva).
 * Manrope esce dal sito. Oxanium resta solo nel logotipo.
 *
 * I file stanno da noi (fonts/), mai Google a runtime: privacy e una
 * connessione in meno. Sono WOFF2 variabili ritagliati da quelli ufficiali
 * (github.com/google/fonts, licenza OFL, testo in fonts/OFL-*.txt):
 *  - latino (italiano, inglese, francese, tedesco, € « » ’ e frecce), sempre;
 *  - latino esteso a parte (ł, ő, ş… nei nomi stranieri): il browser lo
 *    scarica solo se la pagina ha una di quelle lettere (unicode-range).
 * Schibsted v2 (30/9): le cifre tabellari (tabular-nums, «tnum») cambiano solo le
 * cifre. Nel file ufficiale la funzione allargava anche . , : ; # % alla larghezza di una
 * cifra, e dove la gestione usa tabular-nums sembrava uno spazio prima («00 :15»).
 * Schibsted: pesi 400-800. Figtree: pesi 600-800 (l'asse ufficiale va da 300 a
 * 900, qui ristretto ai pesi dei titoli: 19 kB il latino, contro i 34 kB di
 * Bricolage). Le sue cifre tabellari cambiano solo 0-9 (niente trappola «00 :15»).
 * Precaricati solo i due file latini (inc/caratteri/caratteri.php).
 *
 * I nomi vecchi. Circa 200 regole del tema e dei plugin chiedono ancora
 * «Manrope» o «DM Sans», spesso con !important, e molte stanno in file di
 * altri lavori. Invece di riscriverle tutte, quei due nomi qui sotto portano ai
 * file di Schibsted: stesso risultato, nessun file Manrope o DM Sans scaricato.
 * Quando un file viene toccato per altro, il nome va cambiato in var(--tbp-font).
 *
 * I gettoni (--tbp-font, --tbp-font-titoli, scala) stanno in tbp-tokens.css,
 * che dichiara anche il livello «tbp-caratteri»: le sue regole !important
 * vincono su quelle senza livello e sul livello tbp-appearance.
 */

/* ── 1. I due caratteri ─────────────────────────────────────────────── */
@font-face { font-family: "Schibsted Grotesk"; src: url("../fonts/schibsted-grotesk-v1-latin-ext.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; src: url("../fonts/schibsted-grotesk-v2-latin.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; 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+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-v1-latin-ext.woff2") format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-v1-latin.woff2") format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; 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+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── 2. Riserve tarate ──────────────────────────────────────────────────
 * Mentre i file arrivano (font-display: swap) il testo compare in Arial, ma
 * ingrandito e con ascendenti e discendenti di Schibsted e Figtree: le righe
 * occupano gia' lo stesso spazio e la pagina non salta. Valori misurati con
 * fontTools su una frase del sito (larghezza media, metriche hhea). */
@font-face { font-family: "TBP Riserva"; src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Roboto"); font-weight: 400 800; size-adjust: 104.3%; ascent-override: 93.6%; descent-override: 24.7%; line-gap-override: 0%; }
@font-face { font-family: "TBP Riserva Titoli"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Roboto Bold"); font-weight: 600 800; size-adjust: 98.5%; ascent-override: 96.4%; descent-override: 25.4%; line-gap-override: 0%; }

/* ── 3. «Manrope» e «DM Sans» portano a Schibsted ───────────────────────
 * Le loro vecchie @font-face sono uscite (tobepolo-italia-rebrand.css,
 * functions.php via inc/caratteri, Kirki): queste sono le sole con quei nomi.
 * Una lettera che Schibsted non ha passa al carattere dopo nella pila. */
@font-face { font-family: "Manrope"; src: url("../fonts/schibsted-grotesk-v1-latin-ext.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; src: url("../fonts/schibsted-grotesk-v2-latin.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; src: url("../fonts/schibsted-grotesk-v1-latin-ext.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; src: url("../fonts/schibsted-grotesk-v2-latin.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── 4. Base ─────────────────────────────────────────────────────────── */
html,
body,
button,
input,
select,
textarea,
optgroup {
	font-family: var(--tbp-font);
}

/* ── 5. Livello tbp-caratteri: vince sulle vecchie pile con !important ──── */
@layer tbp-caratteri {
	/* 5a. Titoli e prezzi: Figtree. Gli occhielli (maiuscoletto piccolo:
	   piede, menu della gestione, «Territori ed enti pubblici») restano in Schibsted. */
	html body :is(h1, h2, h3, h4, .heading-font, .entry-title, .page-title, .section-title, .product-title, .tbp-exp-card__title, .tbp-auth-toolbar__title, .tbp-filter-section__title, .tbp-quando__titolo, .wcfm-page-heading-text),
	html body :is(.tbp-exp-card__price, .tbp-exp-price, .tbp-book-strip__price, .tbp-wishlist-card__prezzo, .tbp-colombo-chat__card-price, .tbp-pf-scelta__prezzo, .tbp-order-summary__amount, .tbp-swipe-pay__amount, .order-total .amount),
	html body :is(.tbp-exp-card__price, .tbp-exp-price, .tbp-book-strip__price, .tbp-wishlist-card__prezzo, .tbp-colombo-chat__card-price, .tbp-pf-scelta__prezzo, .tbp-order-summary__amount, .tbp-swipe-pay__amount, .order-total .amount) :is(.amount, .woocommerce-Price-amount, bdi, .woocommerce-Price-currencySymbol) {
		font-family: var(--tbp-font-titoli) !important;
	}

	/* 5b. Le poche pile «di sistema» rimaste (barra in basso, note dei filtri, mappa). */
	html body :is(.tbp-app-bar__label, .tbp-filter-section__lead, .leaflet-container) {
		font-family: var(--tbp-font) !important;
	}

	/* 5c. Scala: le misure fuori scala riportate sul gradino piu' vicino
	   (12 nota · 14 secondario · 16 testo · 20 sezione · 26 pagina) e niente
	   sotto i 12 px. Solo dove e' sicuro: parti comuni (barra in basso, piede,
	   Colombo) e pagine pubbliche; la gestione (body.tbp-wcfm-ui) la stanno
	   rifacendo i kit gestione-*, qui cambia solo il carattere. Numeri della
	   mappa, «+» «−» e «×» sono segni, non testo: restano. */

	/* Parti comuni */
	html body :is(.tbp-app-bar__label, .tbp-colombo-chat__launcher-name, .tbp-mega-footer__title, .tbp-mega-footer__etichetta, .tbp-mega-footer__righe span) {
		font-size: var(--tbp-testo-nota) !important;
	}
	html body :is(.tbp-mega-footer__righe a, .tbp-mega-footer__grazie) {
		font-size: var(--tbp-testo-piccolo) !important;
	}

	/* Pagine pubbliche: note */
	html body:not(.tbp-wcfm-ui) :is(.leaflet-control-attribution, .leaflet-control-attribution a, .leaflet-control-attribution span, .tbp-map-legend__nota, .tbp-map-legend__testo, .tbp-home-map__lede, .tbp-home-map__frase, .tbp-home-map__frase-pezzo, .tbp-exp-card__tag, .tbp-card-rating__count, .tbp-social-btn__soon, .tbp-account-claim, .tbp-rev__chip) {
		font-size: var(--tbp-testo-nota) !important;
	}
	/* a 12 px la nota della legenda va su due righe: che siano pari, senza una parola sola sotto */
	html body:not(.tbp-wcfm-ui) :is(.tbp-map-legend__nota, .tbp-home-map__lede) {
		text-wrap: balance;
	}
	/* secondario */
	html body:not(.tbp-wcfm-ui) :is(.tbp-home-map__azione, .tbp-partner-nastro__voce > span:not(.tbp-territories__logo-slot), .tbp-filter-section__lead, .tbp-condividi__apri, .woocommerce-LostPassword, .tbp-auth-link, .tbp-registrati__invito, .tbp-social-legal, .tbp-guided-view-toggle, .tbp-rev__occhiello) {
		font-size: var(--tbp-testo-piccolo) !important;
	}
	/* testo */
	html body:not(.tbp-wcfm-ui) :is(.tbp-quando__titolo, .tbp-registrati__cta, .tbp-rev__sotto, .tbp-rev__testo, .tbp-rev__poi, .tbp-rev__nota, .tbp-rev__nome, .tbp-rev__bottone) {
		font-size: var(--tbp-testo) !important;
	}
	html body:not(.tbp-wcfm-ui) :is(.woocommerce-form-login .woocommerce-button, .tbp-auth-step .woocommerce-button) {
		font-size: var(--tbp-testo) !important;
	}
	/* titolo di sezione */
	html body:not(.tbp-wcfm-ui) :is(.single-esperienze h2, .tbp-correlate__titolo, .tbp-doc-cards__title, .tbp-core-cerca h2:not(.tbp-filter-section__title)) {
		font-size: var(--tbp-titolo-sezione) !important;
		line-height: var(--tbp-interlinea-titoli) !important;
	}
	/* titolo di pagina (il prezzo grande della scheda conta come un titolo) */
	html body:not(.tbp-wcfm-ui) :is(.tbp-exp-hero .tbp-exp-card__price, .tbp-auth-step__title, .tbp-page-hero__title) {
		font-size: var(--tbp-titolo-pagina) !important;
		line-height: var(--tbp-interlinea-titoli) !important;
	}
	/* Al telefono le schede (e la testata della scheda, che ne ha la forma):
	   titolo 20, prezzo 16, autore e luogo 12. Al computer le schede hanno misure loro. */
	@media (max-width: 849px) {
		html body:not(.tbp-wcfm-ui) .tbp-exp-card__title {
			font-size: var(--tbp-titolo-sezione) !important;
			letter-spacing: -.02em !important; /* titoli delle schede un filo stretti: con Figtree (circa 5% piu' stretto di Bricolage) le righe restano le stesse o calano, mai di piu' (prove/misure.json) */
		}
		html body:not(.tbp-wcfm-ui) .tbp-exp-card:not(.tbp-exp-card--scheda) .tbp-exp-card__price {
			font-size: var(--tbp-testo) !important;
		}
		html body:not(.tbp-wcfm-ui) :is(.tbp-exp-card__maker-name, .tbp-exp-card__place-bit) {
			font-size: var(--tbp-testo-nota) !important;
		}
	}
}
