/**
 * assets/css/header.css
 *
 * Styles for the site menu (header.php) — ONE component, TWO colour variants.
 *
 * UNIFICATION MODEL
 * -----------------
 * All layout, navigation, language switcher, CTA, toggle and responsive rules
 * are shared between "Menu LAT" and "Menu LAT blue". The ONLY thing that
 * differs is a small block of colour custom properties:
 *
 *   .site-header            → base layout + DEFAULT tokens ("Menu LAT", light)
 *   .site-header--blue      → overrides ONLY the colour tokens ("Menu LAT blue", navy)
 *
 * To retune either variant, change the token values — never the structural rules.
 *
 * COLOURS — confirm against Figma
 * -------------------------------
 * The "blue" surface here is the navy brand colour used by footer.php (#01162a)
 * with the muted blue accent (#7189bd), so the menu and footer share one palette.
 * >>> If "Menu LAT blue" in the Figma file uses a different blue, change the four
 *     tokens under .site-header--blue only — nothing else needs to move. <<<
 * Ideally map these to theme.json presets (var(--wp--preset--color--...)) so the
 * whole theme shares a single source of truth.
 *
 * SECURITY CLASS C — §2: structured, commented, no external requests
 * (no @import, no remote fonts/images).
 *
 * @package AICenterwp
 * @since   1.0.0
 */

/* ---------------------------------------------------------------------------
   Accessibility helpers (global — not variant-specific)
   --------------------------------------------------------------------------- */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100000;
	width: auto;
	height: auto;
	clip: auto;
	margin: 0;
	padding: 0.6rem 1rem;
	background: #01162a;
	color: #ffffff;
	border-radius: 4px;
	font-weight: 700;
	text-decoration: none;
}

/* ===========================================================================
   COLOUR TOKENS
   Default variant ("Menu LAT") declares the tokens on .site-header.
   Blue variant ("Menu LAT blue") overrides ONLY the tokens below.
   Everything after this block reads the tokens and is fully shared.
   =========================================================================== */
.site-header {
	/* Layout tokens (identical for both variants) */
	--aic-header-height: 72px;
	--aic-header-gap:    2rem;

	/* Colour tokens — DEFAULT ("Menu LAT", white text) */
	--aic-header-bg:     transparent;
	--aic-header-fg:     #ffffff;
	--aic-header-accent: #f06334;            /* coral — active menu item + hover */
	--aic-header-border: transparent;
	--aic-header-cta-bg: #01162a;
	--aic-header-cta-fg: #ffffff;
}

.site-header--blue {
	/* Colour tokens — "Menu LAT blue" (Figma node 108:85).
	   IMPORTANT: in the Figma file "blue" means blue LINK TEXT on a light
	   surface — NOT a navy background bar. Confirmed against Figma 2025:
	     links            #7189bd (muted blue)
	     active / hover   #fcab89 (peach)  — e.g. the "News" item, active language
	     surface          transparent (sits on the page background)
	     divider          none
	   To retune, change ONLY these tokens. */
	--aic-header-bg:     transparent;        /* sits on the page background */
	--aic-header-fg:     #7189bd;            /* muted blue link text */
	--aic-header-accent: #fcab89;            /* peach — active item + active language */
	--aic-header-border: transparent;        /* Figma shows no divider under the menu */
	--aic-header-cta-bg: #fcab89;            /* peach CTA to match the accent (if one is set) */
	--aic-header-cta-fg: #01162a;
}

/* ===========================================================================
   SHARED STRUCTURE (reads the tokens above — identical for both variants)
   =========================================================================== */

/* Header shell */
.site-header {
	background: var(--aic-header-bg);
	color: var(--aic-header-fg);
	border-bottom: 1px solid var(--aic-header-border);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--aic-header-gap);
	min-height: var(--aic-header-height);
}

/* Logo (SVG carries its own colours; aic_the_logo() returns the variant-
   appropriate file — light/reversed on the blue surface). */
.site-header__logo {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.site-header__logo img,
.site-header__logo svg {
	display: block;
	width: auto;
	height: 40px;
}

.site-header__logo a {
	display: inline-flex;
	align-items: center;
	color: var(--aic-header-cta-fg);
	font-weight: 700;
	text-decoration: none;
	fill: var(--aic-header-cta-fg);
}

/* Navigation (desktop) */
.site-header__nav {
	display: flex;
	align-items: center;
	gap: var(--aic-header-gap);
}

.site-header__menu {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header__menu a {
	color: var(--aic-header-fg);
	text-decoration: none;
	font-weight: 500;
	line-height: 1.2;
	padding: 0.25rem 0;
	border-bottom: 2px solid transparent;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.site-header__menu a:hover,
.site-header__menu a:focus-visible,
.site-header__menu .current-menu-item > a,
.site-header__menu .current_page_item > a {
	color: var(--aic-header-accent);          /* peach, matches Figma "News" */
}

.site-header__menu .current-menu-item > a,
.site-header__menu .current_page_item > a {
	font-weight: 700;                         /* active item is bold in Figma */
}

/* Language switcher (lv / en) */
.site-header__lang-list {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header__lang-list li {
	line-height: 1;
}

.site-header__lang-list a,
.site-header__lang-list span {
	display: inline-block;
	padding: 0.2rem 0.45rem;
	color: var(--aic-header-fg);
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	text-decoration: none;
	border-radius: 3px;
}

.site-header__lang-list .current-lang a,
.site-header__lang-list .current-lang span {
	color: var(--aic-header-accent);
}

.site-header__lang-list a:hover,
.site-header__lang-list a:focus-visible {
	color: var(--aic-header-accent);
}

/* CTA button (optional, editable) */
.site-header__cta {
	display: inline-flex;
	align-items: center;
	padding: 0.55rem 1.1rem;
	background: var(--aic-header-cta-bg);
	color: var(--aic-header-cta-fg);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	border-radius: 4px;
	transition: opacity 0.15s ease;
}

.site-header__cta:hover,
.site-header__cta:focus-visible {
	opacity: 0.88;
}

/* Mobile toggle (hidden on desktop; bar colour follows --aic-header-fg) */
.site-header__toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.site-header__toggle-bar {
	display: block;
	width: 24px;
	height: 2px;
	margin: 0 auto;
	background: var(--aic-header-fg);
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header.is-open .site-header__toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.site-header.is-open .site-header__toggle-bar:nth-child(2) {
	opacity: 0;
}
.site-header.is-open .site-header__toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Responsive — collapse nav into a panel below ~860px (shared by both variants) */
@media (max-width: 860px) {

	.site-header__toggle {
		display: flex;
		order: 3;
	}

	.site-header__nav {
		position: absolute;
		left: 0;
		right: 0;
		top: var(--aic-header-height);
		z-index: 999;
		flex-direction: column;
		align-items: flex-start;
		gap: 1.25rem;
		padding: 1.5rem var(--aic-header-gap);
		background: var(--aic-header-bg);
		border-bottom: 1px solid var(--aic-header-border);
		display: none; /* revealed when .is-open is set on the header */
	}

	.site-header.is-open .site-header__nav {
		display: flex;
	}

	.site-header__menu {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
		width: 100%;
	}

	.site-header__cta {
		width: 100%;
		justify-content: center;
	}
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.site-header__menu a,
	.site-header__cta,
	.site-header__toggle-bar {
		transition: none;
	}
}