/**
 * base.css — reset, tipografia di base, anello di focus, movimento ridotto.
 * Usa solo i token di tokens.css.
 */

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

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

body {
	margin: 0;
	background: var(--et-crema);
	color: var(--et-inchiostro);
	font-family: var(--et-font-testo);
	font-size: var(--et-testo-corpo);
	/* Come la bozza: l'interlinea si dichiara dove serve (paragrafi, 1.5-1.7), altrove e "normal". */
	line-height: normal;
	-webkit-font-smoothing: antialiased;
}

/* Sotto i 760 px: margini e sezioni piu stretti (docs/DESIGN.md, sezione 5). */
@media (max-width: 759px) {
	:root {
		--et-gutter: 16px;
		--et-sezione-v: 48px;
		--et-pulsante: 12px;
	}
}

/* [hidden] non nasconde chi ha un display proprio: qui si forza. */
[hidden] {
	display: none !important;
}

img,
svg {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

h1,
h2,
h3,
h4 {
	margin: 0;
	font-family: var(--et-font-titoli);
	font-weight: 700;
	font-style: normal;
	line-height: 1.15;
}

p {
	margin: 0 0 1em;
}

a {
	color: inherit;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---------------------------------------------------------------------------
 * Anello di focus.
 * Su fondo scuro: oro #C5A15A (8,08:1 su #0B0B0B, 8,62:1 su #000, 7,49:1 su #161514).
 * Su crema: bordeaux #5A0F1A (12,08:1 su #F5EFE3, 10,96:1 su #EDE4D3, 13,61:1 su #FFFDF8).
 * Entrambi superano il 3:1 richiesto agli indicatori di focus (WCAG 2.4.11 / 1.4.11).
 * ------------------------------------------------------------------------- */
:root {
	--et-anello: var(--et-bordeaux);
}

.et-topbar,
.et-header,
.et-panel,
.et-footer,
.et-age-gate,
.et-su-scuro {
	--et-anello: var(--et-oro);
}

:focus {
	outline: none;
}

:focus-visible {
	outline: 2px solid var(--et-anello);
	outline-offset: 2px;
}

/* Il contenitore principale riceve il focus dal link di salto: niente anello sul riquadro. */
.et-main:focus {
	outline: none;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	border: 0;
	clip-path: inset(50%);
}

.screen-reader-text:focus {
	position: fixed;
	z-index: 1000;
	top: 8px;
	left: 8px;
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 18px;
	clip-path: none;
	background: var(--et-nero-pieno);
	color: var(--et-crema);
	outline: 2px solid var(--et-oro);
	outline-offset: 2px;
}

/* Pulsanti (bozza: 13 px 700 maiuscolo 0.12em; 12 px sotto i 760). */
.et-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--et-pulsante-h);
	padding: 0 26px;
	border: 0;
	border-radius: var(--et-raggio);
	font-family: var(--et-font-testo);
	font-size: var(--et-pulsante);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
}

.et-btn--oro {
	background: var(--et-oro);
	color: var(--et-nero);
}

.et-btn--oro:hover {
	background: var(--et-oro-chiaro);
}

.et-btn--nero {
	background: var(--et-nero);
	color: var(--et-crema);
}

.et-btn--filo-scuro {
	background: transparent;
	border: 1px solid var(--et-bordo-campo-scuro);
	color: var(--et-crema);
}

/* Struttura comune delle pagine generiche. */
.et-container {
	width: 100%;
	max-width: calc(var(--et-contenitore) + 2 * var(--et-gutter));
	margin: 0 auto;
	padding: var(--et-sezione-v) var(--et-gutter);
}

.et-entry__title,
.et-page-header__title {
	margin-bottom: 24px;
	font-size: var(--et-h1-pagina);
}

.et-entry__content {
	max-width: 720px;
	font-size: var(--et-testo-lettura);
	line-height: 1.7;
}

.et-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 40px 20px;
}

.et-card__title {
	font-size: var(--et-h3-scheda);
}

.et-empty {
	color: var(--et-testo-2-chiaro);
}

/* Movimento ridotto: si azzerano animazioni, transizioni E i loro ritardi. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-delay: 0s !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
		scroll-behavior: auto !important;
	}
}

/* Parole lunghe (tedesco, portoghese): sillabazione con lang corretto, senza toccare le dimensioni della bozza. */
:lang(de) :is(h1, h2, h3, h4, p, li, dd, .et-card__name),
:lang(pt) :is(h1, h2, h3, h4, p, li, dd, .et-card__name) {
	hyphens: auto;
	overflow-wrap: break-word;
}
