/* ==========================================================================
   Olive — accessibility layer (WCAG 2.1 Level AA)
   100% Custom implementation: font scaling, high contrast, underline links.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Font scaling — 5 steps applied on root (87.5% → 137.5%)
   -------------------------------------------------------------------------- */
html[data-font-scale="0"] { font-size: 87.5% !important; }
html[data-font-scale="2"] { font-size: 112.5% !important; }
html[data-font-scale="3"] { font-size: 125% !important; }
html[data-font-scale="4"] { font-size: 137.5% !important; }

/* --------------------------------------------------------------------------
   2. Underline Links
   -------------------------------------------------------------------------- */
html[data-underline-links="true"] a {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 3px !important;
}

/* --------------------------------------------------------------------------
   3. High contrast mode (WCAG 2.1 AAA contrast ratio)
   -------------------------------------------------------------------------- */
html[data-contrast="high"] {
	--bg: #000000;
	--bg-tinted: #0a0a0a;
	--surface: #111111;
	--text: #ffffff;
	--text-muted: #f3f4f6;
	--border: #ffffff;
	--border-strong: #ffffff;

	--primary: #ffe600;
	--primary-strong: #ffe600;
	--accent: #00e5ff;

	--olive-950: #000000;
	--olive-900: #000000;
	--olive-800: #101010;
	--olive-700: #1a1a1a;
	--olive-300: #ffffff;
	--terracotta-500: #ffe600;
	--terracotta-600: #ffe600;
	--cream: #000000;
	--sand: #0a0a0a;
	--ink: #ffffff;
	--ink-muted: #f3f4f6;

	color-scheme: dark;
}

html[data-contrast="high"] body {
	background-color: #000000 !important;
	color: #ffffff !important;
}

html[data-contrast="high"] a {
	color: #ffe600 !important;
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
}

html[data-contrast="high"] a:hover,
html[data-contrast="high"] a:focus {
	color: #00e5ff !important;
	background: #111111 !important;
}

html[data-contrast="high"] :focus-visible {
	outline: 3px solid #00e5ff !important;
	outline-offset: 3px !important;
}

html[data-contrast="high"] .site-header,
html[data-contrast="high"] .site-footer,
html[data-contrast="high"] .card,
html[data-contrast="high"] .post-card,
html[data-contrast="high"] .tech-card,
html[data-contrast="high"] .partner-card,
html[data-contrast="high"] .deliverable-row,
html[data-contrast="high"] .banner-funding,
html[data-contrast="high"] .nav-panel,
html[data-contrast="high"] .nav-toggle {
	background-color: #000000 !important;
	border: 2px solid #ffffff !important;
	color: #ffffff !important;
}

html[data-contrast="high"] .btn,
html[data-contrast="high"] .button,
html[data-contrast="high"] .footer-a11y-badge .badge-a11y,
html[data-contrast="high"] input[type="submit"] {
	background: #000000 !important;
	color: #ffe600 !important;
	border: 2px solid #ffe600 !important;
}

html[data-contrast="high"] .footer-a11y-badge .a11y-badge-icon {
	color: #ffe600 !important;
}

html[data-contrast="high"] .btn:hover,
html[data-contrast="high"] .button:hover,
html[data-contrast="high"] .footer-a11y-badge a.badge-a11y:hover,
html[data-contrast="high"] input[type="submit"]:hover {
	background: #ffe600 !important;
	color: #000000 !important;
}

html[data-contrast="high"] .footer-a11y-badge a.badge-a11y:hover .a11y-badge-icon {
	color: #000000 !important;
}

html[data-contrast="high"] input,
html[data-contrast="high"] textarea,
html[data-contrast="high"] select {
	background: #000000 !important;
	color: #ffffff !important;
	border: 2px solid #ffffff !important;
}

html[data-contrast="high"] .skip-link {
	background: #ffe600 !important;
	color: #000000 !important;
	font-weight: bold !important;
	border: 3px solid #000000 !important;
}

/* --------------------------------------------------------------------------
   4. Toolbar Styling — Floating & Prominent
   -------------------------------------------------------------------------- */
.a11y-bar {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 9999;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: #ffffff;
	border: 2px solid #2c3424;
	border-radius: 40px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	transition: all 0.2s ease;
}

.a11y-bar-title {
	display: flex;
	align-items: center;
	margin-right: 4px;
}

.a11y-badge {
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	padding: 2px 6px;
	background: #5c6f4e;
	color: #ffffff;
	border-radius: 12px;
	text-transform: uppercase;
}

.a11y-group {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border-left: 1px solid #d1d5db;
	padding-left: 6px;
}

.a11y-group:first-child {
	border-left: none;
	padding-left: 0;
}

.a11y-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 2px 8px;
	font-size: 0.9rem;
	font-weight: 700;
	color: #2c3424;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-radius: 16px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.a11y-btn:hover,
.a11y-btn:focus-visible {
	background: #5c6f4e;
	color: #ffffff;
	border-color: #5c6f4e;
}

.a11y-btn[aria-pressed="true"] {
	background: #2c3424;
	color: #ffffff;
	border-color: #2c3424;
}

.a11y-btn-txt {
	font-size: 0.8rem;
	margin-left: 4px;
}

html[data-contrast="high"] .a11y-bar {
	background: #000000 !important;
	border: 2px solid #ffffff !important;
	box-shadow: 0 0 12px #ffe600 !important;
}

html[data-contrast="high"] .a11y-badge {
	background: #ffe600 !important;
	color: #000000 !important;
}

html[data-contrast="high"] .a11y-btn {
	background: #000000 !important;
	color: #ffffff !important;
	border: 1px solid #ffffff !important;
}

html[data-contrast="high"] .a11y-btn:hover,
html[data-contrast="high"] .a11y-btn[aria-pressed="true"] {
	background: #ffe600 !important;
	color: #000000 !important;
	border-color: #ffe600 !important;
}

@media (max-width: 640px) {
	.a11y-bar {
		left: 8px;
		bottom: 8px;
		padding: 4px 8px;
		gap: 4px;
	}
	.a11y-btn-txt {
		display: none;
	}
}
