/*
Theme Name: FitCrosswalk
Theme URI: https://fitcrosswalk.com/
Description: Lightweight technical-reference theme for FitCrosswalk. Data and routes live in the FitCrosswalk Core plugin.
Version: 0.2.0
Requires at least: 6.4
Requires PHP: 8.1
Author: FitCrosswalk
License: GPL-2.0-or-later
Text Domain: fitcrosswalk
*/

/* ---------- Tokens ---------- */
:root {
	--fcw-ink: #14213d;        /* navy/charcoal text */
	--fcw-ink-2: #3d4a63;
	--fcw-muted: #5b6577;
	--fcw-bg: #ffffff;
	--fcw-bg-2: #f3f5f8;       /* light grey sections */
	--fcw-line: #d9dee7;
	--fcw-accent: #0b4f9c;     /* dark blue */
	--fcw-accent-ink: #ffffff;
	--fcw-ok: #136f3a;  --fcw-ok-bg: #e6f4ea;
	--fcw-cond: #7a4b00; --fcw-cond-bg: #fff4dc;
	--fcw-no: #9b1c1c;  --fcw-no-bg: #fde8e8;
	--fcw-unk: #3d4a63; --fcw-unk-bg: #eef1f6;
	--fcw-focus: #ffbf47;
	--fcw-radius: 8px;
	--fcw-space-1: .25rem; --fcw-space-2: .5rem; --fcw-space-3: .75rem; --fcw-space-4: 1rem; --fcw-space-6: 1.5rem; --fcw-space-8: 2rem;
	--fcw-measure: 70ch;
	--fcw-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--fcw-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1.0625rem/1.6 var(--fcw-font); color: var(--fcw-ink); background: var(--fcw-bg); }
img { max-width: 100%; height: auto; }
a { color: var(--fcw-accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--fcw-focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; color: var(--fcw-ink); }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.1rem); margin: 0 0 var(--fcw-space-2); }
h2 { font-size: 1.25rem; margin: var(--fcw-space-8) 0 var(--fcw-space-3); }
h3 { font-size: 1.05rem; margin: var(--fcw-space-6) 0 var(--fcw-space-2); }
p, ul, ol, dl { margin: 0 0 var(--fcw-space-4); }
.fcw-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fcw-skip { position: absolute; left: -999px; top: 0; background: var(--fcw-ink); color: #fff; padding: var(--fcw-space-3) var(--fcw-space-4); z-index: 10; }
.fcw-skip:focus { left: var(--fcw-space-2); }

/* ---------- Layout ---------- */
.fcw-wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--fcw-space-4); }
.fcw-page { max-width: 72rem; margin: 0 auto; padding: var(--fcw-space-4) var(--fcw-space-4) var(--fcw-space-8); }
.fcw-page > section, .fcw-page > header, .fcw-page p, .fcw-page ul { max-width: var(--fcw-measure); }

/* ---------- Header / footer ---------- */
.fcw-header { border-bottom: 1px solid var(--fcw-line); background: var(--fcw-bg); }
.fcw-header__row { display: flex; align-items: center; justify-content: space-between; gap: var(--fcw-space-4); min-height: 56px; }
.fcw-logo { font-weight: 700; font-size: 1.1rem; color: var(--fcw-ink); text-decoration: none; letter-spacing: -.01em; }
.fcw-logo span { color: var(--fcw-accent); }
.fcw-nav ul { display: flex; gap: var(--fcw-space-4); list-style: none; margin: 0; padding: 0; }
.fcw-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--fcw-space-2); text-decoration: none; font-weight: 600; }
.fcw-footer { margin-top: var(--fcw-space-8); background: var(--fcw-bg-2); border-top: 1px solid var(--fcw-line); padding: var(--fcw-space-6) 0; color: var(--fcw-muted); font-size: .95rem; }
.fcw-footer p { max-width: var(--fcw-measure); }

/* ---------- Components ---------- */
.fcw-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--fcw-space-1) var(--fcw-space-2); list-style: none; margin: 0 0 var(--fcw-space-4); padding: 0; font-size: .9rem; color: var(--fcw-muted); }
.fcw-crumbs li + li::before { content: "/"; margin-right: var(--fcw-space-2); color: var(--fcw-line); }
.fcw-kicker { margin: 0 0 var(--fcw-space-1); color: var(--fcw-muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.fcw-lead { font-size: 1.15rem; }
.fcw-answer { background: var(--fcw-bg-2); border: 1px solid var(--fcw-line); border-radius: var(--fcw-radius); padding: var(--fcw-space-4); max-width: var(--fcw-measure); }
.fcw-answer > :last-child { margin-bottom: 0; }
.fcw-limits { padding-left: 1.2rem; }
.fcw-note, .fcw-muted { color: var(--fcw-muted); font-size: .95rem; }

.fcw-search { margin: var(--fcw-space-4) 0 var(--fcw-space-6); max-width: 40rem; }
.fcw-search label { display: block; font-weight: 600; margin-bottom: var(--fcw-space-2); }
.fcw-search__row { display: flex; gap: var(--fcw-space-2); }
.fcw-search input { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 var(--fcw-space-3); font: inherit; font-family: var(--fcw-mono); border: 2px solid var(--fcw-ink-2); border-radius: var(--fcw-radius); background: #fff; color: var(--fcw-ink); }
.fcw-search button { min-height: 48px; min-width: 44px; padding: 0 var(--fcw-space-4); font: inherit; font-weight: 700; color: var(--fcw-accent-ink); background: var(--fcw-accent); border: 0; border-radius: var(--fcw-radius); cursor: pointer; }

.fcw-badge { display: inline-flex; align-items: center; gap: .35em; padding: .15em .55em; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; border: 1px solid currentColor; }
.fcw-badge--ok { color: var(--fcw-ok); background: var(--fcw-ok-bg); }
.fcw-badge--cond { color: var(--fcw-cond); background: var(--fcw-cond-bg); }
.fcw-badge--no { color: var(--fcw-no); background: var(--fcw-no-bg); }
.fcw-badge--unk { color: var(--fcw-unk); background: var(--fcw-unk-bg); }

.fcw-cards { list-style: none; padding: 0; display: grid; gap: var(--fcw-space-3); max-width: var(--fcw-measure); }
.fcw-card { border: 1px solid var(--fcw-line); border-radius: var(--fcw-radius); padding: var(--fcw-space-4); }
.fcw-card__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--fcw-space-2); margin-bottom: var(--fcw-space-3); }
.fcw-card__title { font-family: var(--fcw-mono); font-weight: 700; font-size: 1.1rem; }
.fcw-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fcw-space-2) var(--fcw-space-4); margin-bottom: var(--fcw-space-3); }
.fcw-specs dt { font-size: .8rem; color: var(--fcw-muted); text-transform: uppercase; letter-spacing: .04em; }
.fcw-specs dd { margin: 0; font-weight: 600; }
.fcw-specs--inline { margin-top: var(--fcw-space-4); }
.fcw-evidence { margin: 0; font-size: .95rem; color: var(--fcw-ink-2); }
.fcw-cond { margin: var(--fcw-space-2) 0 0; }
.fcw-cite { font-size: .8em; vertical-align: super; margin-left: .15em; text-decoration: none; }
.fcw-open { padding-left: 1.2rem; }
.fcw-open li { margin-bottom: var(--fcw-space-2); }

.fcw-table-wrap { max-width: var(--fcw-measure); }
.fcw-table { width: 100%; border-collapse: collapse; }
.fcw-table th, .fcw-table td { text-align: left; padding: var(--fcw-space-3); border-bottom: 1px solid var(--fcw-line); vertical-align: top; }
.fcw-table thead th { font-size: .85rem; color: var(--fcw-muted); text-transform: uppercase; letter-spacing: .04em; }

.fcw-grid { display: grid; gap: var(--fcw-space-6); }
.fcw-list { list-style: none; padding: 0; columns: 1; }
.fcw-list a { display: inline-flex; min-height: 44px; align-items: center; }
.fcw-help, .fcw-sources { border-top: 1px solid var(--fcw-line); margin-top: var(--fcw-space-8); }
.fcw-sources ol { padding-left: 1.4rem; font-size: .95rem; }
.fcw-sources li { margin-bottom: var(--fcw-space-2); overflow-wrap: anywhere; }

/* Home */
.fcw-hero { padding: var(--fcw-space-6) 0 var(--fcw-space-2); }
.fcw-hero p { color: var(--fcw-ink-2); }
.fcw-tiles { display: grid; gap: var(--fcw-space-3); list-style: none; padding: 0; max-width: 72rem !important; }
.fcw-tile { border: 1px solid var(--fcw-line); border-radius: var(--fcw-radius); padding: var(--fcw-space-4); background: var(--fcw-bg); }
.fcw-tile h3 { margin-top: 0; }
.fcw-steps { padding-left: 1.2rem; }

/* ---------- Mobile table → labelled rows ---------- */
@media (max-width: 599px) {
	.fcw-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.fcw-table, .fcw-table tbody, .fcw-table tr, .fcw-table th, .fcw-table td { display: block; width: 100%; }
	.fcw-table tr { border: 1px solid var(--fcw-line); border-radius: var(--fcw-radius); margin-bottom: var(--fcw-space-3); padding: var(--fcw-space-2) 0; }
	.fcw-table th, .fcw-table td { border: 0; padding: var(--fcw-space-1) var(--fcw-space-3); }
	.fcw-table td::before { content: attr(data-label) ": "; font-size: .8rem; color: var(--fcw-muted); text-transform: uppercase; letter-spacing: .04em; }
	.fcw-search__row { flex-direction: row; }
}

@media (min-width: 768px) {
	.fcw-page { padding-top: var(--fcw-space-6); }
	.fcw-grid { grid-template-columns: 1fr 1fr; }
	.fcw-list { columns: 2; }
	.fcw-tiles { grid-template-columns: repeat(3, 1fr); }
	.fcw-cards { grid-template-columns: 1fr 1fr; max-width: 72rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

.fcw-footer__links { display: flex; flex-wrap: wrap; gap: var(--fcw-space-2) var(--fcw-space-4); list-style: none; padding: 0; margin: 0 0 var(--fcw-space-4); }
.fcw-footer__links a { display: inline-flex; align-items: center; min-height: 44px; }
.fcw-page article { max-width: var(--fcw-measure); }
