/* ═══════════════════════════════════════════════════
   CIU INSPECTOR — ACCESSIBILITY / VISUAL IMPAIRMENT TOOLS
   Appended via header.php — does NOT modify style.css
   ═══════════════════════════════════════════════════ */

/* ── ACCESSIBILITY TOOLBAR ──────────────────────────── */
#a11y-toolbar {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	background: var(--surface2);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0.25rem 0.5rem;
	flex-shrink: 0;
}

#a11y-toolbar .a11y-label {
	font-family: var(--font-head);
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	margin-right: 0.15rem;
	white-space: nowrap;
}

/* All toolbar buttons */
.a11y-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	cursor: pointer;
	font-family: var(--font-head);
	font-weight: 700;
	line-height: 1;
	padding: 0.3rem 0.5rem;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	font-size: 0.82rem;
	min-width: 30px;
	min-height: 30px;
	white-space: nowrap;
}

.a11y-btn:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.a11y-btn.active {
	background: var(--accent);
	border-color: var(--accent);
	color: #000;
}

/* Font size buttons */
#a11y-fs-down { font-size: 0.7rem; }
#a11y-fs-reset { font-size: 0.82rem; }
#a11y-fs-up   { font-size: 0.95rem; }

/* Divider between groups */
.a11y-divider {
	width: 1px;
	height: 20px;
	background: var(--border);
	flex-shrink: 0;
	margin: 0 0.1rem;
}

/* ── FONT SIZE STEPS ────────────────────────────────── */
/* Applied to <html> element so everything scales with em/rem */
html.a11y-fs-1 { font-size: 90%; }   /* smaller  */
html.a11y-fs-2 { font-size: 100%; }  /* default  */
html.a11y-fs-3 { font-size: 115%; }  /* large    */
html.a11y-fs-4 { font-size: 130%; }  /* x-large  */
html.a11y-fs-5 { font-size: 150%; }  /* xx-large */
html.a11y-fs-6 { font-size: 175%; }  /* huge     */
html.a11y-fs-7 { font-size: 200%; }  /* x-huge   */
html.a11y-fs-8 { font-size: 225%; }  /* xx-huge  */
html.a11y-fs-9 { font-size: 250%; }  /* max      */

/* ── HIGH CONTRAST: WHITE ON BLACK ─────────────────── */
html.a11y-hc-wb {
	--bg:       #000000;
	--surface:  #1c1c1c;
	--surface2: #2e2e2e;
	--border:   #ffffff;
	--text:     #ffffff;
	--muted:    #cccccc;
	--accent:   #ffff00;
	--accent2:  #ff9900;
	--danger:   #ff4444;
	--good:     #00ff88;
}

html.a11y-hc-wb body {
	background: #000 !important;
	color: #fff !important;
}

html.a11y-hc-wb a {
	color: #ffff00 !important;
	text-decoration: underline !important;
}

html.a11y-hc-wb input[type="text"],
html.a11y-hc-wb input[type="password"],
html.a11y-hc-wb input[type="email"],
html.a11y-hc-wb input[type="number"],
html.a11y-hc-wb input[type="tel"],
html.a11y-hc-wb select,
html.a11y-hc-wb textarea {
	background: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
}

html.a11y-hc-wb .insp-number,
html.a11y-hc-wb .insp-detail {
	color: #ffffff !important;
}

/* ── HIGH CONTRAST: YELLOW ON BLACK ────────────────── */
html.a11y-hc-yb {
	--bg:       #000000;
	--surface:  #1a1a00;
	--surface2: #2a2a00;
	--border:   #ffff00;
	--text:     #ffff00;
	--muted:    #cccc00;
	--accent:   #ffd700;
	--accent2:  #ff9900;
	--danger:   #ff6666;
	--good:     #00ff88;
}

html.a11y-hc-yb body {
	background: #000 !important;
	color: #ffff00 !important;
}

html.a11y-hc-yb a {
	color: #ffd700 !important;
	text-decoration: underline !important;
}

html.a11y-hc-yb input[type="text"],
html.a11y-hc-yb input[type="password"],
html.a11y-hc-yb input[type="email"],
html.a11y-hc-yb input[type="number"],
html.a11y-hc-yb input[type="tel"],
html.a11y-hc-yb select,
html.a11y-hc-yb textarea {
	background: #000 !important;
	color: #ffff00 !important;
	border-color: #ffff00 !important;
}

html.a11y-hc-yb .insp-number,
html.a11y-hc-yb .insp-detail {
	color: #ffff00 !important;
}

/* ── TEXT SPACING (Dyslexia-friendly) ───────────────── */
html.a11y-spacing body,
html.a11y-spacing p,
html.a11y-spacing li,
html.a11y-spacing label,
html.a11y-spacing td,
html.a11y-spacing th,
html.a11y-spacing input,
html.a11y-spacing select,
html.a11y-spacing textarea {
	line-height: 1.9 !important;
	letter-spacing: 0.04em !important;
	word-spacing: 0.16em !important;
}

html.a11y-spacing p,
html.a11y-spacing li {
	margin-bottom: 0.6em !important;
}

/* ── RESPONSIVE: COLLAPSE TOOLBAR ON SMALL SCREENS ─── */
@media (max-width: 600px) {
	#a11y-toolbar .a11y-label {
		display: none;
	}
	#a11y-toolbar {
		gap: 0.25rem;
		padding: 0.2rem 0.35rem;
	}
}

@media (max-width: 420px) {
	#a11y-toolbar {
		order: 10;
		width: 100%;
		justify-content: center;
		border-radius: 0;
		border-left: none;
		border-right: none;
		border-top: none;
	}
}

/* ── HIGH CONTRAST: CARD & SECTION VISIBILITY ──────────
   Cards use --surface/--surface2 variables (improved above
   vs original to give clear separation from --bg).
   These rules handle elements with hardcoded colours that
   the variable changes cannot reach.
   ──────────────────────────────────────────────────────── */

/* Thicker borders on every card/section variant */
html.a11y-hc-wb .card,
html.a11y-hc-wb .card-header,
html.a11y-hc-wb .insp-card,
html.a11y-hc-wb .insp-row,
html.a11y-hc-wb .section-card,
html.a11y-hc-wb .modal,
html.a11y-hc-wb #section {
	border-width: 2px !important;
}

html.a11y-hc-yb .card,
html.a11y-hc-yb .card-header,
html.a11y-hc-yb .insp-card,
html.a11y-hc-yb .insp-row,
html.a11y-hc-yb .section-card,
html.a11y-hc-yb .modal,
html.a11y-hc-yb #section {
	border-width: 2px !important;
}

/* .subsection-header — hardcoded purple #9470dc in prepurchase-report2.php */
html.a11y-hc-wb .subsection-header {
	background: #2e2e2e !important;
	color: #ffffff !important;
	border: 2px solid #ffffff !important;
}

html.a11y-hc-yb .subsection-header {
	background: #2a2a00 !important;
	color: #ffff00 !important;
	border: 2px solid #ffff00 !important;
}

/* .p2-insp-num — hardcoded rgba border & background */
html.a11y-hc-wb .p2-insp-num {
	background: #1c1c1c !important;
	border-color: #ffffff !important;
	color: #ffffff !important;
}

html.a11y-hc-yb .p2-insp-num {
	background: #1a1a00 !important;
	border-color: #ffff00 !important;
	color: #ffff00 !important;
}

/* Focus rings — replace rgba(accent, 0.12) with solid ring */
html.a11y-hc-wb input:focus,
html.a11y-hc-wb select:focus,
html.a11y-hc-wb textarea:focus {
	box-shadow: 0 0 0 3px #ffffff !important;
}

html.a11y-hc-yb input:focus,
html.a11y-hc-yb select:focus,
html.a11y-hc-yb textarea:focus {
	box-shadow: 0 0 0 3px #ffff00 !important;
}

/* .jim-alert — hardcoded dark-red background */
html.a11y-hc-wb .jim-alert {
	background: #2e2e2e !important;
	border-left-color: #ff4444 !important;
	color: #ff4444 !important;
}

html.a11y-hc-yb .jim-alert {
	background: #2a2a00 !important;
	border-left-color: #ff6666 !important;
	color: #ff6666 !important;
}

/* .insp-card hover */
html.a11y-hc-wb .insp-card:hover { border-color: #ffff00 !important; }
html.a11y-hc-yb .insp-card:hover { border-color: #ffd700 !important; }

/* ── HIGH CONTRAST: INSPECTION CARD BUTTON FIX ──────────
   .insp-open-btn is <button type="submit">, so it inherits
   background: var(--accent) = yellow from the global button
   rule in style.css, overriding its own transparent bg.
   Fix: dark card background, yellow text.
   ──────────────────────────────────────────────────────── */

html.a11y-hc-wb .insp-open-btn,
html.a11y-hc-wb .insp-open-btn:hover {
	background: #1c1c1c !important;
	color: #ffffff !important;
	border: none !important;
}

html.a11y-hc-yb .insp-open-btn,
html.a11y-hc-yb .insp-open-btn:hover {
	background: #1a1a00 !important;
	color: #ffff00 !important;
	border: none !important;
}

/* ── FONT SIZE: RESPONSIVE CARD COLUMNS ─────────────────
   As font size grows, widen the minimum card size so fewer
   cards fit per row, and collapse field-grid columns.
   ──────────────────────────────────────────────────────── */

/* fs-3: 115% */
html.a11y-fs-3 .insp-grid {
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* fs-4: 130% */
html.a11y-fs-4 .insp-grid {
	grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}
html.a11y-fs-4 .field-grid.cols-4 {
	grid-template-columns: repeat(3, 1fr);
}

/* fs-5: 150% */
html.a11y-fs-5 .insp-grid {
	grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
}
html.a11y-fs-5 .field-grid.cols-4,
html.a11y-fs-5 .field-grid.cols-3 {
	grid-template-columns: repeat(2, 1fr);
}

/* fs-6: 175% */
html.a11y-fs-6 .insp-grid {
	grid-template-columns: repeat(auto-fill, minmax(560px, 1fr));
}
html.a11y-fs-6 .field-grid.cols-4,
html.a11y-fs-6 .field-grid.cols-3,
html.a11y-fs-6 .field-grid.cols-2,
html.a11y-fs-6 .field-grid {
	grid-template-columns: repeat(2, 1fr);
}

/* fs-7+: 200% and above — single column everything */
html.a11y-fs-7 .insp-grid,
html.a11y-fs-8 .insp-grid,
html.a11y-fs-9 .insp-grid {
	grid-template-columns: 1fr;
}
html.a11y-fs-7 .field-grid.cols-4,
html.a11y-fs-7 .field-grid.cols-3,
html.a11y-fs-7 .field-grid.cols-2,
html.a11y-fs-7 .field-grid,
html.a11y-fs-8 .field-grid,
html.a11y-fs-9 .field-grid {
	grid-template-columns: 1fr;
}

/* ── HIGH CONTRAST: INSPECTION CARD TEXT FIX ────────────
   .insp-detail strong has color:#000 hardcoded in style.css
   with higher specificity than the .insp-detail override,
   making year/make/model and fee values invisible.
   Status badges have hardcoded coloured backgrounds that
   need normalising in hc modes.
   ──────────────────────────────────────────────────────── */

html.a11y-hc-wb .insp-detail strong,
html.a11y-hc-wb .insp-detail h3,
html.a11y-hc-wb .insp-detail h3 strong {
	color: #ffffff !important;
}

html.a11y-hc-yb .insp-detail strong,
html.a11y-hc-yb .insp-detail h3,
html.a11y-hc-yb .insp-detail h3 strong {
	color: #ffff00 !important;
}

/* Status badges — replace coloured backgrounds with neutral dark + border */
html.a11y-hc-wb .status-badge {
	background: #2e2e2e !important;
	color: #ffffff !important;
	border: 1px solid #ffffff !important;
}

html.a11y-hc-yb .status-badge {
	background: #2a2a00 !important;
	color: #ffff00 !important;
	border: 1px solid #ffff00 !important;
}

/* ── HIGH CONTRAST: ACTION LIST BUTTONS ─────────────────
   Global html.a11y-hc-wb a rule turns all links yellow, but
   action-list items are button-shaped (not inline text) so
   white reads better against their dark surface background.
   ──────────────────────────────────────────────────────── */

html.a11y-hc-wb .action-list li a,
html.a11y-hc-wb .action-list li button {
	color: #ffffff !important;
	border-color: #ffffff !important;
}

html.a11y-hc-wb .action-list li a:hover,
html.a11y-hc-wb .action-list li button:hover {
	color: #ffff00 !important;
	border-color: #ffff00 !important;
}

/* .action-approve — hardcoded rgba bg and #ff8888 text */
html.a11y-hc-wb .action-approve button {
	background: #2e2e2e !important;
	border: 2px solid #ff4444 !important;
	color: #ffffff !important;
}

html.a11y-hc-wb .action-approve button:hover {
	background: #ff4444 !important;
	color: #ffffff !important;
}