/**
 * components.css  site chrome (header/footer), buttons, logo theme-swap, cards.
 * Ported from components/SiteHeader.jsx + SiteFooter.jsx (inline styles → tokens).
 */

/* ---- Logo theme-swap (FOUC-safe, CSS-only) ---- */
.avt-logo {
	display: block;
	width: auto;
	max-width: none;
	height: auto;
}
.avt-logo--dark {
	display: var(--logo-dark-display);
}
.avt-logo--light {
	display: var(--logo-light-display);
}

/* Fixed white backdrop for brand marks (logos are authored for light surfaces). */
.avt-logo-plate {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	border: 1px solid rgba(18, 18, 21, 0.08);
}
.avt-logo-plate img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

/* =====================  HEADER  ===================== */
.avt-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--hdr-bar-bg);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--hdr-bar-border);
	transition:
		background 150ms ease,
		border-color 150ms ease,
		transform 220ms ease,
		opacity 180ms ease;
}
.avt-header.is-hidden {
	transform: translateY(-110%);
	opacity: 0;
	pointer-events: none;
}
.admin-bar .avt-header {
	top: 32px;
}
@media screen and (max-width: 782px) {
	.admin-bar .avt-header {
		top: 46px;
	}
}
.avt-header__inner {
	max-width: var(--maxw);
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	min-height: 66px;
	padding: 0 32px;
	gap: 12px;
}
.avt-header__logo {
	display: flex;
	align-items: center;
	gap: 11px;
	justify-self: start;
	min-height: 44px;
	min-width: 0;
}
.avt-header__mark {
	height: 26px !important;
	width: auto !important;
	max-width: none;
	flex: none;
}
.avt-header__wordmark .avt-logo {
	height: 18px !important;
	width: auto !important;
	max-width: none;
}

.avt-header__nav {
	display: flex;
	gap: 26px;
	font-size: 13.5px;
	justify-self: center;
}
.avt-header__nav a {
	color: var(--hdr-muted);
	transition: color 120ms ease;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}
.avt-header__nav a:hover {
	color: var(--hdr-active);
}
.avt-header__nav a.is-active {
	color: var(--hdr-active);
}
.avt-header__nav .avt-nav-external,
.avt-header__drawer-nav .avt-nav-external {
	flex: none;
	opacity: 0.72;
	transform: translateY(-0.5px);
}
.avt-header__nav a:hover .avt-nav-external,
.avt-header__drawer-nav a:hover .avt-nav-external {
	opacity: 1;
}

.avt-header__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	justify-self: end;
}

/* Language switcher */
.avt-lang-switcher {
	position: relative;
	display: inline-flex;
	align-items: center;
}
.avt-lang-switcher__trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 10px 0 12px;
	border-radius: var(--radius-pill);
	border: 1px solid var(--hdr-chip-border);
	background: var(--hdr-chip-bg);
	color: var(--hdr-chip-fg);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1;
	cursor: pointer;
	transition:
		border-color 120ms ease,
		background 120ms ease,
		color 120ms ease;
}
.avt-lang-switcher__trigger:hover,
.avt-lang-switcher.is-open .avt-lang-switcher__trigger {
	border-color: var(--hdr-active);
	color: var(--hdr-active);
}
.avt-lang-switcher__trigger:focus-visible {
	outline: 2px solid var(--hdr-focus);
	outline-offset: 2px;
}
.avt-lang-switcher__chevron {
	flex: none;
	opacity: 0.72;
	transition:
		transform 150ms ease,
		opacity 150ms ease;
}
.avt-lang-switcher.is-open .avt-lang-switcher__chevron {
	transform: rotate(180deg);
	opacity: 1;
}
.avt-lang-switcher__menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 60;
	min-width: 168px;
	margin: 0;
	padding: 4px;
	list-style: none;
	border-radius: 12px;
	border: 1px solid var(--hdr-bar-border);
	background: var(--hdr-panel-bg);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}
.avt-lang-switcher__menu[hidden] {
	display: none;
}
.avt-lang-switcher__item {
	margin: 0;
}
.avt-lang-switcher__option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 8px;
	color: var(--hdr-chip-fg);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition:
		background 120ms ease,
		color 120ms ease;
}
.avt-lang-switcher__option:hover,
.avt-lang-switcher__option.is-current {
	background: rgba(232, 84, 58, 0.14);
	color: var(--hdr-active);
}
.avt-lang-switcher__code {
	flex: none;
	min-width: 1.6em;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	opacity: 0.82;
}
.avt-lang-switcher__name {
	flex: 1;
	min-width: 0;
}
.avt-lang-switcher--drawer {
	display: flex;
	width: 100%;
	margin: 12px 0 4px;
	padding-top: 12px;
	border-top: 1px solid var(--hdr-bar-border);
}
.avt-lang-switcher--drawer .avt-lang-switcher__trigger {
	width: 100%;
	justify-content: space-between;
}
.avt-lang-switcher--drawer .avt-lang-switcher__menu {
	left: 0;
	right: 0;
	min-width: 0;
}

/* Theme toggle */
.avt-theme-toggle {
	background: var(--hdr-chip-bg);
	border: 1px solid var(--hdr-chip-border);
	border-radius: var(--radius-pill);
	color: var(--hdr-chip-fg);
	padding: 0;
	width: 36px;
	min-height: 36px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.avt-theme-toggle .avt-icon-moon {
	display: var(--logo-dark-display);
	transform: translateX(-0.5px);
}
.avt-theme-toggle .avt-icon-sun {
	display: var(--logo-light-display);
}

/* CTA pill */
.avt-header__cta {
	background: var(--hdr-cta-bg);
	color: var(--hdr-cta-fg);
	font-size: 13.5px;
	font-weight: 500;
	padding: 10px 18px;
	border-radius: var(--radius-pill);
	min-height: 40px;
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	transition: background 120ms ease;
}
.avt-header__cta:hover {
	background: var(--hdr-cta-bg-hover);
}

/* Hamburger */
.avt-header__menu-btn {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--hdr-chip-border);
	background: var(--hdr-chip-bg);
	color: var(--hdr-chip-fg);
	cursor: pointer;
	padding: 0;
}
.avt-header__menu-btn .avt-icon-close {
	display: none;
}
.avt-header__menu-btn[aria-expanded='true'] .avt-icon-burger {
	display: none;
}
.avt-header__menu-btn[aria-expanded='true'] .avt-icon-close {
	display: block;
}

/* Drawer */
.avt-header__drawer {
	border-top: 1px solid var(--hdr-bar-border);
	background: var(--hdr-panel-bg);
	padding: 12px 20px 20px;
}
.avt-header__drawer[hidden] {
	display: none;
}
.avt-header__drawer-nav {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-width: var(--maxw);
	margin: 0 auto;
}
.avt-header__drawer-nav a {
	color: var(--hdr-muted);
	font-size: 15px;
	font-weight: 500;
	padding: 12px 10px;
	min-height: 44px;
	display: flex;
	align-items: center;
	gap: 7px;
	border-radius: var(--radius-sm);
}
.avt-header__drawer-nav a.is-active {
	color: var(--hdr-active);
	font-weight: 600;
}
.avt-header__drawer-cta {
	margin-top: 10px;
	background: var(--hdr-cta-bg);
	color: var(--hdr-cta-fg) !important;
	font-size: 14.5px;
	font-weight: 600;
	padding: 14px 16px;
	min-height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
}

/* Chrome focus ring */
.avt-header a:focus-visible,
.avt-header button:focus-visible,
.avt-footer a:focus-visible {
	outline: 2px solid var(--hdr-focus);
	outline-offset: 3px;
}

@media (max-width: 920px) {
	.avt-header__nav {
		display: none;
	}
	.avt-header__cta {
		display: none;
	}
	.avt-header__menu-btn {
		display: inline-flex;
	}
	.avt-header__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		padding: 0 16px;
		gap: 8px;
		min-height: 56px;
	}
	.avt-header__actions {
		gap: 8px;
	}
	.avt-theme-toggle {
		width: 40px;
		min-height: 40px;
	}
	.avt-header__wordmark .avt-logo {
		height: 15px;
		max-width: 118px;
	}
}
@media (max-width: 380px) {
	.avt-header__wordmark {
		display: none;
	}
}
@media (min-width: 921px) {
	.avt-header__menu-btn {
		display: none;
	}
	.avt-header__drawer {
		display: none;
	}
}

/* =====================  FOOTER  ===================== */
.avt-footer {
	position: relative;
	overflow: hidden;
	overflow-x: clip;
	background: var(--ftr-bg);
	color: var(--ftr-fg);
	padding: 56px 32px 34px;
	border-top: 1px solid var(--ftr-border);
	transition:
		background 150ms ease,
		color 150ms ease,
		border-color 150ms ease;
	max-width: 100%;
}
.avt-footer__watermark {
	position: absolute;
	right: max(-20px, -2.5vw);
	bottom: 12px;
	width: min(920px, 76vw);
	pointer-events: none;
	user-select: none;
	z-index: 0;
}
.avt-footer__watermark .avt-footer__watermark-img {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	opacity: var(--ftr-watermark-opacity);
}
.avt-footer__inner {
	position: relative;
	z-index: 1;
	max-width: var(--maxw-narrow);
	margin: 0 auto;
}
.avt-footer__grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr;
	gap: 40px;
}
.avt-footer__brand-logo {
	display: flex;
	align-items: center;
	gap: 10px;
}
.avt-footer__brand-logo .avt-logo {
	width: auto !important;
	max-width: none !important;
	flex: none;
}
.avt-footer__brand-logo .avt-logo--type-mark {
	height: 24px !important;
}
.avt-footer__brand-logo .avt-logo--type-wordmark {
	height: 18px !important;
}
.avt-footer__blurb {
	margin: 16px 0 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--ftr-muted);
	max-width: 320px;
}
.avt-footer__tagline {
	margin: 14px 0 0;
	font-size: 13.5px;
	color: var(--ftr-tagline);
	font-weight: 500;
}
.avt-footer__label {
	font-family: var(--font-mono);
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ftr-label);
}
.avt-footer__links {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 14px;
	font-size: 13.5px;
}
.avt-footer__links a {
	color: var(--ftr-link);
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}
.avt-footer__links a:hover {
	color: var(--ftr-link-active);
}
.avt-footer__links a[aria-current='page'] {
	color: var(--ftr-link-active);
}
.avt-footer__socials {
	display: flex;
	gap: 8px;
	margin-top: 16px;
}
.avt-footer__socials a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--ftr-social-fg);
	border: 1px solid var(--ftr-social-border);
	border-radius: 8px;
	background: var(--ftr-social-bg);
}
.avt-footer__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 40px;
	padding-top: 22px;
	border-top: 1px solid var(--ftr-border);
	font-size: 12px;
	color: var(--ftr-label);
}
.avt-footer__disclaimer {
	font-family: var(--font-mono);
	letter-spacing: 0.04em;
}

@media (max-width: 900px) {
	.avt-footer__grid {
		grid-template-columns: 1fr 1fr;
		gap: 28px;
	}
	.avt-footer__watermark {
		width: min(680px, 92vw);
		right: -6vw;
		bottom: 8px;
	}
}
@media (max-width: 560px) {
	.avt-footer__grid {
		grid-template-columns: 1fr;
	}
	.avt-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	.avt-footer__watermark {
		width: min(520px, 110vw);
		right: -18vw;
		bottom: 6px;
	}
}

/* =====================  SHARED UI  ===================== */
.avt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: var(--radius-pill);
	padding: 13px 22px;
	font-size: 14.5px;
	font-weight: 500;
	min-height: 46px;
	cursor: pointer;
	border: 1px solid transparent;
	transition:
		background 120ms ease,
		border-color 120ms ease,
		color 120ms ease;
	text-align: center;
}
.avt-btn--primary {
	background: var(--accent);
	color: #fff;
}
.avt-btn--primary:hover {
	background: var(--accent-hover);
}
.avt-btn--ghost {
	background: transparent;
	border-color: currentColor;
}
.avt-btn--light {
	background: var(--fg);
	color: var(--surface);
}

.avt-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 6px 12px;
	border-radius: var(--radius-pill);
	border: 1px solid var(--border-dark);
}

.avt-card {
	border-radius: var(--radius-card);
	border: 1px solid var(--border);
	background: var(--card);
	padding: 24px;
}
