/*
    courtinfo.convergenceresearch.com: Convergence's crimson (#990033), its hexagons and a gold accent, as in KeyMaster.
    Not available is red, partially available orange with dark text, available green; no amber or yellow. Each status
    also has its word and an icon, so nothing is told by colour alone. Changed recently is petrol, as KeyMaster marks
    time. The site's own stylesheet: no Bootstrap, nothing from elsewhere (section 10 of courtinfo-site-analysis.md).
*/

:root {
    --crimson: #990033;
    --crimson-dark: #7a0029;
    --crimson-tint: #f7e6eb;
    --gold: #d4a937;
    --ink: #1f2328;
    --muted: #5d636b;
    --line: #e3e5e9;
    --page: #f4f5f7;
    --x: #b42318; --x-bg: #fef3f2; --x-line: #fecdca;
    --p: #c2410c; --p-bg: #fff7ed; --p-line: #fed7aa; --p-fill: #fb923c; --p-ink: #431407;
    --a: #067647; --a-bg: #ecfdf3; --a-line: #abefc6;
    --r: #0a5266; --r-bg: #e3f3f7; --r-line: #b6dfe9;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--crimson); }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible { outline: 3px solid var(--crimson); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 74rem; margin: 0 auto; padding: 0 1.25rem; }

/* The icons: drawn once in the page's sprite, and coloured by the text around them. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { flex: none; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

header.top { background: #fff; border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; }
.logo { display: block; }
.logo img { display: block; height: 2.5rem; width: auto; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.95rem; border: 1px solid var(--crimson); border-radius: 999px; background: #fff; color: var(--crimson); font: 600 0.9rem/1 system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--crimson-tint); }

.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #5c001f, var(--crimson) 55%, #a3163f); color: #fff; }
.hero::before { content: ""; position: absolute; top: 0; right: -3rem; bottom: 0; width: 30rem; pointer-events: none; background: url("../img/hexagons.svg") no-repeat right center / contain; }
.hero .wrap { position: relative; padding: 2.2rem 1.25rem 4.6rem; }
.hero h1 { margin: 0 0 0.5rem; font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -0.01em; line-height: 1.15; }
.hero h1::after { content: ""; display: block; width: 3.5rem; height: 4px; margin-top: 0.55rem; border-radius: 2px; background: linear-gradient(90deg, var(--gold), #f0c75e); }
.hero p { margin: 0; max-width: 46rem; color: #f6e3e8; font-size: 1.06rem; }
.updated { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1rem; padding: 0.35rem 0.85rem; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 0.9rem; }
.updated .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #7ee2a8; box-shadow: 0 0 0 3px rgba(126, 226, 168, 0.25); }

.cards { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: -3.1rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.message { position: relative; z-index: 1; margin-top: -3.1rem; padding: 1.4rem 1.5rem; }
.cards + .message { margin-top: 0; }
.message h2 { margin: 0 0 0.4rem; }
.message p { margin: 0.3rem 0 0; }
.stat { display: flex; gap: 0.85rem; align-items: center; }
.stat .ic { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; }
.stat .ic .i { width: 1.35rem; height: 1.35rem; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.9rem; }
.ic.x { background: var(--x-bg); color: var(--x); }
.ic.p { background: var(--p-bg); color: var(--p); }
.ic.a { background: var(--a-bg); color: var(--a); }
.ic.n { background: var(--crimson-tint); color: var(--crimson); }

.notice { margin-top: 1.25rem; padding: 0.85rem 1.1rem; border-left: 4px solid var(--crimson); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.notice b { color: var(--crimson); }
.notice p { margin: 0.35rem 0 0; }

section.block { margin-top: 2.2rem; }
h2 { margin: 0 0 0.8rem; font-size: 1.3rem; }
h2 small { margin-left: 0.4rem; color: var(--muted); font-size: 0.9rem; font-weight: 500; }

.problems { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1rem; }
.problem { border-left: 5px solid var(--x); }
.problem.p { border-left-color: var(--p-fill); }
.problem .head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.problem h3 { margin: 0; font-size: 1.1rem; }
.problem .where { color: var(--muted); font-size: 0.9rem; }
.problem p { margin: 0.6rem 0 0.4rem; }
.problem .when { display: flex; align-items: center; gap: 0.35rem; color: var(--r); font-size: 0.85rem; font-weight: 600; }
.problem a { font-size: 0.9rem; font-weight: 600; }
.allclear { display: flex; gap: 0.75rem; align-items: center; color: var(--a); }
.allclear .i { width: 1.5rem; height: 1.5rem; }

.pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.6rem; border: 1px solid; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.pill .i { width: 0.9rem; height: 0.9rem; }
.pill.x { color: var(--x); background: var(--x-bg); border-color: var(--x-line); }
.pill.p { color: var(--p); background: var(--p-bg); border-color: var(--p-line); }
.pill.a { color: var(--a); background: var(--a-bg); border-color: var(--a-line); }
.pill.r { color: var(--r); background: var(--r-bg); border-color: var(--r-line); }

.mapcard { display: grid; grid-template-columns: minmax(0, 44rem) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.map { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.35rem; }
.tile { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 700 0.85rem/1 system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.tile:hover { border-color: var(--crimson); background: var(--crimson-tint); }
.tile.x { border-color: var(--x); background: var(--x); color: #fff; }
.tile.p { border-color: var(--p-fill); background: var(--p-fill); color: var(--p-ink); }
.tile.on { outline: 3px solid var(--ink); outline-offset: 2px; }
.tile .n { position: absolute; top: -0.45rem; right: -0.45rem; display: grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.25rem; border: 1px solid var(--x-line); border-radius: 999px; background: #fff; color: var(--x); font-size: 0.7rem; }
.r1 { grid-row: 1; } .r2 { grid-row: 2; } .r3 { grid-row: 3; } .r4 { grid-row: 4; }
.r5 { grid-row: 5; } .r6 { grid-row: 6; } .r7 { grid-row: 7; } .r8 { grid-row: 8; }
.c1 { grid-column: 1; } .c2 { grid-column: 2; } .c3 { grid-column: 3; } .c4 { grid-column: 4; }
.c5 { grid-column: 5; } .c6 { grid-column: 6; } .c7 { grid-column: 7; } .c8 { grid-column: 8; }
.c9 { grid-column: 9; } .c10 { grid-column: 10; } .c11 { grid-column: 11; } .c12 { grid-column: 12; }
.territories { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-top: 0.9rem; }
.territories .tile { width: 3.1rem; }
.territories .label { margin-right: 0.4rem; color: var(--muted); font-size: 0.85rem; }
.pick { display: none; }
.pick span { display: block; margin-bottom: 0.4rem; color: var(--muted); font-size: 0.85rem; }
.pick select { width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
.legend { display: grid; gap: 0.55rem; color: var(--muted); font-size: 0.92rem; }
.legend i { display: inline-block; width: 0.95rem; height: 0.95rem; margin-right: 0.5rem; border: 1px solid var(--line); border-radius: 4px; background: #fff; vertical-align: -2px; }
.legend i.x { border-color: var(--x); background: var(--x); }
.legend i.p { border-color: var(--p-fill); background: var(--p-fill); }
.legend p { margin: 0.4rem 0 0; }

.finder { position: sticky; top: 0; z-index: 5; margin-top: 2.2rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); background: rgba(244, 245, 247, 0.94); backdrop-filter: blur(6px); }
.finder .row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.search { flex: 1 1 18rem; display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--crimson); box-shadow: 0 0 0 4px rgba(153, 0, 51, 0.12); }
.search .i { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { padding: 0.45rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: 600 0.85rem/1 system-ui, sans-serif; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip.statechip { border-color: var(--crimson); background: var(--crimson); color: #fff; }
.found { margin-top: 0.5rem; color: var(--muted); font-size: 0.9rem; }

.states { display: grid; gap: 0.75rem; margin-top: 1rem; }
.finder[hidden] + .states { margin-top: 2.2rem; }
details.state { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); scroll-margin-top: 8rem; }
details.state > summary { display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1.1rem; list-style: none; cursor: pointer; }
details.state > summary::-webkit-details-marker { display: none; }
.chev { width: 1rem; height: 1rem; color: var(--muted); stroke-width: 2.2; transition: transform 0.15s; }
details[open] > summary .chev { transform: rotate(90deg); }
.sname { font-weight: 700; }
.scode { color: var(--muted); font-size: 0.85rem; }
.stot { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; align-items: center; margin-left: auto; }
.count { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

table.counties { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.counties thead th { padding: 0.5rem 1.1rem; border-top: 1px solid var(--line); background: #fafbfc; color: var(--muted); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; }
table.counties tbody th, table.counties td { padding: 0.6rem 1.1rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
table.counties .c { width: 22%; font-weight: 600; }
table.counties .s { width: 17%; }
table.counties .k { width: 13%; color: var(--muted); }
table.counties .note { color: #3b4047; }
.recent { display: block; margin-top: 0.15rem; color: var(--r); font-size: 0.78rem; font-weight: 600; }
mark { padding: 0 0.1em; border-radius: 3px; background: var(--crimson-tint); color: var(--crimson-dark); }

footer { margin-top: 3rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .chev { transition: none; }
}

@media (max-width: 900px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mapcard { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .logo img { height: 2rem; }
    .btn span { display: none; }
    .map, .territories, .legend { display: none; }
    .pick { display: block; }
    .stat b { font-size: 1.4rem; }
    .stot .count { display: none; }
    table.counties thead { display: none; }
    table.counties tr { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.75rem; padding: 0.75rem 1rem; border-top: 1px solid var(--line); }
    table.counties tbody th, table.counties td { width: auto !important; padding: 0; border: 0; }
    table.counties td.k { grid-column: 1 / -1; font-size: 0.85rem; }
    table.counties td.k::before { content: "Clerk searched: "; }
    table.counties td.note { grid-column: 1 / -1; }
    table.counties td.note:empty { display: none; }
}

@media print {
    .btn, .finder, .mapcard { display: none !important; }
    .hero { background: none; color: var(--ink); }
    .hero::before { display: none; }
    .hero p, .updated { color: var(--ink); }
    .cards { margin-top: 0; }
    details.state { break-inside: avoid; box-shadow: none; }
}
