/**
 * Site chrome: header bar, footer and the IT/EN/ES language switcher.
 *
 * Both live here because the switcher is part of the header and is loaded on
 * every page, exactly like the header itself. Colours use the theme's design
 * tokens with literal fallbacks, so the bar stays readable if the token
 * stylesheet is not present and in the dark theme.
 */

.site-header {
	background: var(--color-surface, #ffffff);
	color: var(--color-text, #1c1917);
	border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
	position: relative;
	z-index: 10;
}

.site-header__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--space-4, 16px) var(--space-6, 24px);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4, 16px);
}

.site-header .site-title {
	margin: 0;
	font-family: var(--font-heading, Georgia, "Times New Roman", serif);
	font-size: var(--text-xl, 1.35rem);
	font-weight: 700;
	letter-spacing: var(--letter-tight, -0.01em);
	line-height: 1.2;
}

.site-header .site-title a {
	color: inherit;
	text-decoration: none;
}

.site-header .site-title a:hover,
.site-header .site-title a:focus-visible {
	color: var(--color-primary-600, #b91c1c);
}

/* Navigation: one clean horizontal row, never a bulleted list. */
.site-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-6, 24px);
}

.site-nav__list a {
	color: inherit;
	text-decoration: none;
	font-size: var(--text-sm, 0.95rem);
	font-weight: 600;
	padding-bottom: 2px;
	border-bottom: 2px solid transparent;
	transition: color var(--duration-normal, 200ms) var(--ease-default, ease),
		border-color var(--duration-normal, 200ms) var(--ease-default, ease);
}

.site-nav__list a:hover,
.site-nav__list a:focus-visible {
	color: var(--color-primary-600, #b91c1c);
	border-bottom-color: var(--color-primary-600, #b91c1c);
}

.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a {
	border-bottom-color: currentColor;
}

/* Language switcher -------------------------------------------------------- */

.lang-switcher {
	display: flex;
	align-items: center;
	gap: var(--space-2, 8px);
}

.lang-switcher__label {
	font-size: var(--text-xs, 0.75rem);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.7;
}

.lang-switcher__list {
	list-style: none;
	margin: 0;
	padding: 2px;
	display: flex;
	align-items: center;
	gap: 2px;
	border: 1px solid var(--color-border, rgba(0, 0, 0, 0.15));
	border-radius: var(--radius-full, 999px);
}

.lang-switcher__link {
	display: inline-block;
	padding: 4px 12px;
	border-radius: var(--radius-full, 999px);
	font-size: var(--text-xs, 0.78rem);
	font-weight: 700;
	letter-spacing: 0.06em;
	color: inherit;
	text-decoration: none;
	transition: background-color var(--duration-normal, 200ms) var(--ease-default, ease),
		color var(--duration-normal, 200ms) var(--ease-default, ease);
}

.lang-switcher__link:hover,
.lang-switcher__link:focus-visible {
	background: var(--color-neutral-100, rgba(0, 0, 0, 0.07));
}

.lang-switcher__link.is-active {
	background: var(--color-primary-600, #b91c1c);
	color: var(--color-on-primary, #ffffff);
}

.site-header a:focus-visible {
	outline: 2px solid var(--color-primary-600, #b91c1c);
	outline-offset: 3px;
}

/* Screen-reader-only text, in case the theme stylesheet does not define it. */
.site-header .screen-reader-text,
.lang-switcher .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 640px) {
	.site-header__inner {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-3, 12px);
	}

	.site-nav__list {
		gap: var(--space-4, 16px);
	}
}

/* Site footer ------------------------------------------------------------- */

.site-footer {
	background: var(--color-surface-alt, #17120f);
	color: var(--color-on-dark, #f5f1ed);
	margin-top: var(--space-16, 64px);
}

.site-footer__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--space-12, 48px) var(--space-6, 24px) var(--space-6, 24px);
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-8, 32px);
	align-items: start;
}

.site-footer__brand {
	margin: 0 0 var(--space-2, 8px);
	font-family: var(--font-heading, Georgia, "Times New Roman", serif);
	font-size: var(--text-lg, 1.15rem);
	font-weight: 700;
}

.site-footer__text {
	margin: 0;
	font-size: var(--text-sm, 0.9rem);
	opacity: 0.8;
	max-width: 34ch;
}

.site-footer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-2, 8px);
}

.site-footer__list a {
	color: inherit;
	text-decoration: none;
	font-size: var(--text-sm, 0.9rem);
	transition: opacity var(--duration-normal, 200ms) var(--ease-default, ease);
}

.site-footer__list a:hover,
.site-footer__list a:focus-visible {
	opacity: 0.7;
	text-decoration: underline;
}

.site-footer .lang-switcher__list {
	border-color: rgba(255, 255, 255, 0.28);
}

.site-footer .lang-switcher__link:hover,
.site-footer .lang-switcher__link:focus-visible {
	background: rgba(255, 255, 255, 0.14);
}

.site-footer__legal {
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--space-4, 16px) var(--space-6, 24px) var(--space-8, 32px);
	font-size: var(--text-xs, 0.78rem);
	opacity: 0.65;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.site-footer a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

@media (max-width: 800px) {
	.site-footer__inner {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-nav__list a,
	.lang-switcher__link,
	.site-footer__list a {
		transition: none;
	}
}
