/*
 * Design system 2027 (spec 0028). Caricato solo sulle pagine con il template «FTMS design 2027»
 * (ftms-ds.php); ogni regola sta sotto body.ftms-ds, tranne i @font-face.
 * Fonti: DESIGN.md e docs/design/sistema.html (scala, ruoli, componenti), tavola Home2 in
 * docs/design/bozze/home-2.html (sezioni).
 * Regola della larghezza (AC-5): nessun limite in ch. Il testo prende la larghezza della colonna
 * della griglia in cui sta: contenitore 1200px, 12 colonne, 24px tra le colonne; su telefono una
 * colonna con 16px di margine.
 */

@font-face {
	font-family: 'EB Garamond';
	font-style: normal;
	font-weight: 400 500;
	font-display: swap;
	src: url('fonts/eb-garamond-latin.woff2') format('woff2');
}
@font-face {
	font-family: 'Manrope';
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url('fonts/manrope-latin.woff2') format('woff2');
}

/* Scala e ruoli. Chiaro e scuro sono scelte opposte sulla stessa scala. */
body.ftms-ds {
	--bianco: #FFFFFF;
	--latte: #F9F7F6;
	--nebbia: #EDE5E2;
	--bordo: #E1D7D2;
	--bruno: #513131;
	--fumo: #2F2F30;
	--ardesia: #272F36;
	--ardesia-scura: #22272B;
	--notte: #111416;
	/* Incarnato #EF9B82 in entrambi i modi (proprietario, 2026-11-25: provato #EE6338 a norma 3:1 e
	   scartato; per chi ne ha bisogno, piu' avanti opzioni di accessibilita'). */
	--incarnato: #EF9B82;

	--serif: 'EB Garamond', Garamond, Georgia, serif;
	--sans: 'Manrope', Helvetica, Arial, sans-serif;
	--esce: cubic-bezier(.16, 1, .3, 1);

	--ds-fondo: var(--bianco);
	--ds-pannello: var(--latte);
	--ds-riquadro: var(--bianco);
	--ds-linea: var(--bordo);
	--ds-linea-barra: var(--bordo);
	--ds-testo: var(--notte);
	--ds-testo-2: var(--fumo);
	--ds-muto: var(--bordo);
	--ds-accento: var(--incarnato);
	--ds-bottone: var(--notte);
	--ds-bottone-testo: var(--latte);
	--ds-bottone-hover: var(--fumo);
	--ds-campo: var(--fumo);
	--ds-icona: var(--ardesia);

	margin: 0;
	background: var(--ds-fondo);
	color: var(--ds-testo);
	font: 400 17px/1.6 var(--sans);
	-webkit-font-smoothing: antialiased;
}
html[data-theme="dark"] body.ftms-ds {
	--ds-fondo: var(--notte);
	--ds-pannello: var(--ardesia-scura);
	--ds-riquadro: var(--notte);
	--ds-linea: var(--fumo);
	--ds-linea-barra: rgba(225, 215, 210, .18);
	--ds-testo: var(--latte);
	--ds-testo-2: var(--nebbia);
	--ds-muto: var(--fumo);
	--ds-bottone: var(--latte);
	--ds-bottone-testo: var(--notte);
	--ds-bottone-hover: var(--ardesia);
	--ds-campo: var(--bordo);
	--ds-icona: var(--latte);
}
html[data-theme="dark"] {
	color-scheme: dark;
	background: #111416;
}

/* Base */
body.ftms-ds *,
body.ftms-ds *::before,
body.ftms-ds *::after { box-sizing: border-box; }
body.ftms-ds a { color: var(--ds-testo); }
body.ftms-ds :focus-visible {
	outline: 1px solid var(--incarnato);
	outline-offset: 3px;
}

body.ftms-ds .ds-salta {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 100;
	padding: 10px 16px;
	border-radius: 10px;
	background: var(--ds-bottone);
	color: var(--ds-bottone-testo);
	font-weight: 700;
}
body.ftms-ds .ds-salta:focus { top: 16px; }

/* Bottoni: mai colorati. Notte sul chiaro, Latte sullo scuro. */
body.ftms-ds .ds-btn,
body.ftms-ds .wp-block-button.ds-bottone .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid var(--ds-bottone);
	border-radius: 10px;
	background: var(--ds-bottone);
	color: var(--ds-bottone-testo);
	font: 700 14px/1 var(--sans);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .2s var(--esce), border-color .2s var(--esce), color .2s var(--esce);
}
body.ftms-ds .ds-btn::after,
body.ftms-ds .wp-block-button.ds-bottone .wp-block-button__link::after {
	content: '';
	flex: none;
	width: 7px;
	height: 12px;
	margin-left: 2px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 12'%3E%3Cpath d='M1 1l5 5-5 5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 12'%3E%3Cpath d='M1 1l5 5-5 5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.ftms-ds .ds-btn:hover,
body.ftms-ds .wp-block-button.ds-bottone .wp-block-button__link:hover {
	background: var(--ds-bottone-hover);
	border-color: var(--ds-bottone-hover);
	color: var(--latte);
}
body.ftms-ds .ds-scena .wp-block-button.ds-bottone .wp-block-button__link:hover,
body.ftms-ds .ds-pieno .wp-block-button.ds-bottone .wp-block-button__link:hover,
html[data-theme="dark"] body.ftms-ds .ds-btn:hover {
	background: var(--ardesia);
	border-color: var(--ardesia);
	color: var(--latte);
}

/* Header (AC-7): barra chiusa larga quanto l'hero, dello stesso colore della pagina. */
body.ftms-ds .ds-header {
	position: relative;
	z-index: 20;
	padding: 14px 14px 14px;
	background: var(--ds-fondo);
}
body.ftms-ds .ds-header__barra {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 10px 10px 22px;
	border: 1px solid var(--ds-linea-barra);
	border-radius: 16px;
	background: var(--ds-fondo);
}
body.ftms-ds .ds-header__marchio {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font: 800 20px/1 var(--sans);
	letter-spacing: .04em;
	color: var(--ds-testo);
	text-decoration: none;
}
body.ftms-ds .ds-header__nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}
body.ftms-ds .ds-header__nav a {
	font: 500 15px/1.4 var(--sans);
	color: var(--ds-testo-2);
	text-decoration: none;
}
body.ftms-ds .ds-header__nav a:hover,
body.ftms-ds .ds-header__nav a[aria-current] {
	color: var(--ds-testo);
	text-decoration: underline;
	text-decoration-color: var(--incarnato);
	text-underline-offset: 6px;
}
body.ftms-ds .ds-header__azioni {
	display: flex;
	align-items: center;
	gap: 6px;
}
body.ftms-ds .ds-header__tema,
body.ftms-ds .ds-header__account,
body.ftms-ds .ds-header__carrello,
body.ftms-ds .ds-header__menu,
body.ftms-ds .ds-scelta .header-ftms__lang-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-width: 40px;
	height: 40px;
	padding: 0 8px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--ds-testo);
	font: 600 13px/1 var(--sans);
	text-decoration: none;
	cursor: pointer;
}
body.ftms-ds .ds-header__tema:hover,
body.ftms-ds .ds-header__account:hover,
body.ftms-ds .ds-header__carrello:hover,
body.ftms-ds .ds-header__menu:hover,
body.ftms-ds .ds-scelta .header-ftms__lang-toggle:hover { background: var(--ds-pannello); }
body.ftms-ds .ds-header__carrello .ftms-cart-count {
	position: absolute;
	top: 4px;
	right: 2px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 8px;
	background: var(--ds-testo);
	color: var(--ds-fondo);
	font: 700 10px/16px var(--sans);
	text-align: center;
}
body.ftms-ds .ds-scelta {
	position: relative;
	display: block;
	margin: 0;
	padding: 0;
	background: none;
}
body.ftms-ds .ds-scelta .header-ftms__lang-list {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 30;
	display: none;
	flex-direction: column;
	min-width: 96px;
	padding: 6px;
	border: 1px solid var(--ds-linea);
	border-radius: 12px;
	background: var(--ds-fondo);
}
body.ftms-ds .ds-scelta.is-open .header-ftms__lang-list { display: flex; }
body.ftms-ds .ds-scelta .ftms-lang {
	margin: 0;
	padding: 8px 10px;
	border-radius: 8px;
	color: var(--ds-testo);
	font: 500 14px/1.2 var(--sans);
	text-decoration: none;
	opacity: 1;
}
body.ftms-ds .ds-scelta .ftms-lang:hover { background: var(--ds-pannello); }
body.ftms-ds .ds-scelta .ftms-lang-current { font-weight: 700; }
body.ftms-ds .ds-header__cta { margin-left: 6px; }
body.ftms-ds .ds-header__menu { display: none; flex-direction: column; gap: 5px; }
body.ftms-ds .ds-header__menu span {
	display: block;
	width: 18px;
	height: 1.5px;
	background: currentColor;
	transition: transform .3s var(--esce);
}
body.ftms-ds .ds-header.is-menu-open .ds-header__menu span:first-child { transform: translateY(3.25px) rotate(45deg); }
body.ftms-ds .ds-header.is-menu-open .ds-header__menu span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

@media (max-width: 1100px) {

	body.ftms-ds .ds-header__menu { display: inline-flex; }

	body.ftms-ds .ds-header__nav {
		position: absolute;
		top: calc(100% + 8px);
		left: 0;
		right: 0;
		display: none;
		padding: 8px 22px 16px;
		border: 1px solid var(--ds-linea-barra);
		border-radius: 16px;
		background: var(--ds-fondo);
	}

	body.ftms-ds .ds-header.is-menu-open .ds-header__nav { display: block; }

	body.ftms-ds .ds-header__nav ul { flex-direction: column; gap: 0; }

	body.ftms-ds .ds-header__nav a {
		display: block;
		padding: 12px 0;
		font-size: 17px;
		border-bottom: 1px solid var(--ds-linea);
	}

	body.ftms-ds .ds-header__nav li:last-child a { border-bottom: 0; }
}
@media (max-width: 640px) {

	body.ftms-ds .ds-header { padding: 10px 10px 10px; }

	body.ftms-ds .ds-header__barra { padding-left: 16px; gap: 4px; }

	body.ftms-ds .ds-header__cta { display: none; }

	body.ftms-ds .ds-header__azioni { gap: 0; }

	/* Proprietario, 2026-11-25: sul telefono solo il segno del logo, e la valuta dentro il menu. */
	body.ftms-ds .ds-header__nome { display: none; }

	body.ftms-ds .ds-header__azioni .header-ftms__cur { display: none; }

	body.ftms-ds .ds-header__nav .ds-header__valute {
		display: flex;
		gap: 8px;
		padding-top: 14px;
		border-top: 1px solid var(--ds-linea);
	}

	body.ftms-ds .ds-header__nav .ds-header__valute a {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 48px;
		padding: 8px 14px;
		border: 1px solid var(--ds-linea);
		border-radius: 10px;
		font-size: 17px;
		text-decoration: none;
	}

	body.ftms-ds .ds-header__nav .ds-header__valute a[aria-current] {
		border-color: var(--ds-testo);
		font-weight: 700;
	}
}
body.ftms-ds .ds-header__valute { display: none; }

/* Footer attuale ricolorato (AC-2): Notte, testo Latte, Garamond nei titoli. */
body.ftms-ds .footer-ftms {
	position: relative;
	z-index: 1;
	background: var(--notte);
	color: var(--latte);
	font-family: var(--sans);
	font-size: 15px;
}
body.ftms-ds .footer-ftms a { color: var(--latte); }
body.ftms-ds .footer-ftms a:hover { text-decoration-color: var(--incarnato); text-underline-offset: 4px; }
body.ftms-ds .footer-ftms__title { font-family: var(--sans); font-weight: 700; }
body.ftms-ds .footer-ftms__nl { border-bottom-color: var(--fumo); }
body.ftms-ds .footer-ftms__nl .ftms-nl__titolo { font-family: var(--serif); font-weight: 400; }
body.ftms-ds .footer-ftms input[type="email"] {
	border: 1px solid var(--bordo);
	border-radius: 10px;
	background: var(--notte);
	color: var(--latte);
	font-family: var(--sans);
}
body.ftms-ds .footer-ftms button[type="submit"] {
	border: 1px solid var(--latte);
	border-radius: 10px;
	background: var(--latte);
	color: var(--notte);
	font: 700 14px/1 var(--sans);
}
body.ftms-ds .footer-ftms button[type="submit"]:hover { background: var(--ardesia); border-color: var(--ardesia); color: var(--latte); }

/* Movimento ridotto: niente animazioni, tutto visibile (AC-9). */
@media (prefers-reduced-motion: reduce) {

	body.ftms-ds *,
	body.ftms-ds *::before,
	body.ftms-ds *::after { transition: none !important; animation: none !important; }
}

/* Logo (baffi e forbici, proprietario 2026-11-25): due maschere colorate dal CSS. Modo chiaro: parte
   scura Notte, parte rossa Incarnato; modo scuro: bianco e Incarnato. File in assets/logo/. */
body.ftms-ds .ds-logo {
	position: relative;
	display: inline-block;
	flex: none;
	width: 33px;
	height: 34px;
}
body.ftms-ds .ds-logo span {
	position: absolute;
	inset: 0;
	-webkit-mask: var(--ds-logo-maschera) center / contain no-repeat;
	mask: var(--ds-logo-maschera) center / contain no-repeat;
}
body.ftms-ds .ds-logo__scuro { --ds-logo-maschera: url('logo/logo-scuro.png'); background: var(--notte); }
body.ftms-ds .ds-logo__rosso { --ds-logo-maschera: url('logo/logo-rosso.png'); background: var(--incarnato); }
html[data-theme="dark"] body.ftms-ds .ds-logo__scuro { background: var(--bianco); }
@media (max-width: 420px) {
	body.ftms-ds .ds-header__marchio { gap: 6px; }
	body.ftms-ds .ds-logo { width: 25px; height: 26px; }
}
@media (max-width: 390px) {
	body.ftms-ds .ds-header__barra { padding-right: 6px; padding-left: 10px; gap: 2px; }
}
