/* 16th Judicial Circuit of Missouri - Stoa prototype
   Accessibility-first: AA contrast, visible focus, semantic landmarks.
   System fonts only, no external requests. */

:root {
  --navy-900: #0f2740;
  --navy-800: #16314f;
  --navy-700: #1d4068;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #5b6b7f;
  --slate-200: #d8e0e8;
  --slate-100: #eef2f6;
  --slate-50:  #f6f9fc;
  --paper: #ffffff;
  --ink: #14202e;
  --brass: #8a6212;       /* AA on white for text */
  --brass-soft: #b8860b;
  --link: #1a4f8a;        /* AA on white */
  --link-hover: #0f2740;
  --accent: #1d4ed8;      /* AA on white */
  --focus: #9a3412;       /* amber-brown focus ring, AA */
  --good: #1d6f42;
  --line: #cbd6e1;
  --shadow-sm: 0 1px 2px rgba(15,39,64,.08);
  --shadow-md: 0 6px 20px rgba(15,39,64,.12);
  --radius: 10px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", "Iowan Old Style", serif;
  color: var(--navy-900);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1rem; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

img { max-width: 100%; height: auto; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

/* ---- Skip link ---- */
.skip {
  position: absolute;
  left: 8px; top: -60px;
  background: var(--navy-900);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  font-weight: 600;
  transition: top .12s ease;
}
.skip:focus { top: 0; color: #fff; }

/* ---- Top utility bar ---- */
.util {
  background: var(--navy-900);
  color: #dbe6f1;
  font-size: .86rem;
}
.util .wrap { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: center; justify-content: space-between; padding-top: .45rem; padding-bottom: .45rem; }
.util a { color: #fff; text-decoration: none; }
.util a:hover { text-decoration: underline; }
.util ul { list-style: none; display: flex; gap: 1.2rem; margin: 0; padding: 0; flex-wrap: wrap; }

/* ---- Masthead ---- */
.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead .wrap { display: flex; align-items: center; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--navy-900); }
.brand:hover { color: var(--navy-900); }
.seal {
  flex: 0 0 auto;
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #1d4068 0 58%, #0f2740 59% 100%);
  border: 2.5px solid var(--brass-soft);
  display: grid; place-items: center;
  color: #f3e6c4;
  box-shadow: var(--shadow-sm);
}
.seal svg { width: 34px; height: 34px; }
.brand-text strong { display: block; font-family: Georgia, serif; font-size: 1.18rem; line-height: 1.1; color: var(--navy-900); }
.brand-text span { display: block; font-size: .82rem; color: var(--slate-600); margin-top: .15rem; }

.masthead-spacer { flex: 1 1 auto; }

/* header search (compact) */
.hsearch { display: flex; gap: .4rem; align-items: center; }
.hsearch input {
  width: clamp(140px, 22vw, 240px);
  padding: .55rem .7rem; font-size: .95rem;
  border: 2px solid var(--line); border-radius: 8px; background: var(--slate-50);
}
.hsearch button {
  padding: .55rem .9rem; font-size: .92rem; font-weight: 600;
  color: #fff; background: var(--navy-800); border: 0; border-radius: 8px; cursor: pointer;
}
.hsearch button:hover { background: var(--navy-900); }

/* ---- Primary nav ---- */
.primary { background: var(--navy-800); }
.primary .wrap { display: flex; align-items: center; gap: .5rem; }
.nav-toggle {
  display: none;
  margin: .5rem 0; padding: .55rem .9rem;
  background: transparent; color: #fff; border: 2px solid #4a6488; border-radius: 8px;
  font-weight: 600; font-size: .95rem; cursor: pointer;
  align-items: center; gap: .5rem;
}
#primary-menu ul { list-style: none; display: flex; flex-wrap: wrap; gap: .15rem; margin: 0; padding: 0; }
#primary-menu a {
  display: block; color: #eaf1f8; text-decoration: none; font-weight: 600; font-size: .98rem;
  padding: .95rem .85rem; border-bottom: 3px solid transparent;
}
#primary-menu a:hover { color: #fff; background: var(--navy-700); border-bottom-color: var(--brass-soft); }
#primary-menu a[aria-current="page"] { color: #fff; border-bottom-color: var(--brass-soft); background: var(--navy-700); }

/* ---- Hero ---- */
.hero { background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%); color: #eef4fb; }
.hero .wrap { padding: clamp(2.4rem, 6vw, 4.2rem) clamp(1rem,4vw,2.5rem); }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.1rem); margin: 0 0 .7rem; max-width: 20ch; }
.hero p.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: #cfdcec; max-width: 56ch; margin: 0 0 1.6rem; }

.herosearch { display: flex; gap: .5rem; max-width: 600px; }
.herosearch input {
  flex: 1; padding: .95rem 1.1rem; font-size: 1.05rem;
  border: 2px solid transparent; border-radius: 10px; background: #fff; color: var(--ink);
}
.herosearch button {
  padding: .95rem 1.5rem; font-size: 1.05rem; font-weight: 700;
  color: #fff; background: var(--accent); border: 0; border-radius: 10px; cursor: pointer;
}
.herosearch button:hover { background: #1843b8; }
.hero .hint { margin: .9rem 0 0; font-size: .95rem; color: #b9cae0; }
.hero .hint a { color: #fff; }

/* ---- Section / layout helpers ---- */
section { padding: clamp(2rem, 5vw, 3.2rem) 0; }
section.alt { background: var(--slate-50); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 1.4rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .35rem; }
.section-head p { color: var(--slate-600); margin: 0; max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--brass); margin: 0 0 .4rem; font-family: system-ui, sans-serif; }

/* ---- Task cards ---- */
.tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); color: var(--ink); }
.card .ico { font-size: 1.7rem; line-height: 1; }
.card strong { font-family: Georgia, serif; font-size: 1.15rem; color: var(--navy-900); }
.card span { color: var(--slate-600); font-size: .96rem; }

/* ---- Generic grid ---- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.panel h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
.panel ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.panel li { margin: .3rem 0; }

/* stat band */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.25rem; text-align: center; }
.stat .num { font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 2.8rem); color: var(--navy-900); font-weight: 700; line-height: 1; }
.stat .lab { color: var(--slate-600); font-size: .98rem; margin-top: .35rem; }

/* ---- Breadcrumb ---- */
.crumb { font-size: .9rem; color: var(--slate-600); padding: .9rem 0; }
.crumb a { color: var(--link); }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.crumb li::after { content: "›"; margin-left: .4rem; color: var(--slate-500); }
.crumb li:last-child::after { content: ""; }

/* page header for interior pages */
.pagehead { background: var(--slate-100); border-bottom: 1px solid var(--line); }
.pagehead .wrap { padding: clamp(1.4rem,4vw,2.4rem) clamp(1rem,4vw,2.5rem); }
.pagehead h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .2rem 0 .4rem; }
.pagehead p { color: var(--slate-600); margin: 0; max-width: 60ch; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: .8rem 1.3rem; font-weight: 700; font-size: 1rem;
  background: var(--accent); color: #fff; border: 2px solid var(--accent); border-radius: 9px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #1843b8; border-color: #1843b8; color: #fff; }
.btn.ghost { background: transparent; color: var(--navy-800); border-color: var(--navy-800); }
.btn.ghost:hover { background: var(--navy-800); color: #fff; }

/* ---- Tables ---- */
table.data { width: 100%; border-collapse: collapse; font-size: .98rem; }
table.data caption { text-align: left; color: var(--slate-600); font-size: .92rem; margin-bottom: .5rem; }
table.data th, table.data td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { background: var(--navy-800); color: #fff; font-weight: 600; }
table.data tbody tr:nth-child(even) { background: var(--slate-50); }

/* ---- Notices ---- */
.notice {
  border-left: 5px solid var(--brass-soft); background: #fbf6e9;
  padding: 1rem 1.2rem; border-radius: 0 8px 8px 0; margin: 1.2rem 0;
}
.notice.info { border-left-color: var(--accent); background: #eef4ff; }
.notice strong { color: var(--navy-900); }

/* reviewer note (Stoa annotation) */
.reviewer-note {
  border: 2px dashed var(--brass-soft); background: #fcf8ee;
  padding: 1rem 1.2rem; border-radius: 10px; margin: 1.4rem 0; font-size: .95rem;
}
.reviewer-note .tag {
  display: inline-block; background: var(--brass); color: #fff; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; padding: .2rem .55rem; border-radius: 5px; margin-bottom: .5rem;
}

/* ---- Search demo ---- */
.searchbox { display: flex; gap: .5rem; max-width: 640px; margin-bottom: .4rem; }
.searchbox input {
  flex: 1; padding: .9rem 1.05rem; font-size: 1.05rem;
  border: 2px solid var(--line); border-radius: 10px; background: #fff;
}
.searchbox button { padding: .9rem 1.3rem; font-weight: 700; color: #fff; background: var(--accent); border: 0; border-radius: 10px; cursor: pointer; }
.searchbox button:hover { background: #1843b8; }
.search-meta { color: var(--slate-600); font-size: .95rem; margin: .6rem 0 1.2rem; }
.facets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.facet {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  padding: .45rem .9rem; border-radius: 999px; border: 2px solid var(--line);
  background: #fff; color: var(--slate-700);
}
.facet[aria-pressed="true"] { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.result {
  border: 1px solid var(--line); border-radius: 10px; padding: 1.05rem 1.2rem; background: #fff; box-shadow: var(--shadow-sm);
}
.result h3 { margin: 0 0 .25rem; font-size: 1.12rem; }
.result h3 a { text-decoration: none; }
.result h3 a:hover { text-decoration: underline; }
.result .kind {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #fff; background: var(--slate-600); padding: .15rem .5rem; border-radius: 5px; margin-bottom: .45rem;
}
.result .kind.form { background: #1d6f42; }
.result .kind.service { background: var(--accent); }
.result .kind.department { background: var(--navy-700); }
.result .kind.page { background: #7a5a12; }
.result p { margin: 0; color: var(--slate-700); font-size: .98rem; }
.result mark { background: #fde68a; color: inherit; padding: 0 .1em; border-radius: 2px; }
.empty { padding: 1.5rem; border: 2px dashed var(--line); border-radius: 10px; color: var(--slate-600); text-align: center; }

/* ---- Definition / contact lists ---- */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; }
dl.kv dt { font-weight: 700; color: var(--navy-900); }
dl.kv dd { margin: 0; color: var(--slate-700); }

/* ---- Footer ---- */
.site-footer { background: var(--navy-900); color: #cdd9e6; margin-top: 1rem; }
.site-footer .wrap { padding: clamp(2rem,5vw,3rem) clamp(1rem,4vw,2.5rem); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1.6rem; }
.site-footer h2 { color: #fff; font-size: 1.05rem; margin: 0 0 .7rem; }
.site-footer a { color: #dfe9f4; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .35rem 0; }
.proto-banner {
  background: var(--brass); color: #fff; text-align: center;
  font-size: .92rem; padding: .6rem 1rem; font-weight: 600;
}
.proto-banner a { color: #fff; text-decoration: underline; }
.foot-legal { border-top: 1px solid rgba(255,255,255,.15); margin-top: 1.8rem; padding-top: 1.2rem; font-size: .88rem; color: #9fb2c6; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Responsive nav ---- */
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  #primary-menu {
    display: none; width: 100%;
  }
  #primary-menu.open { display: block; }
  #primary-menu ul { flex-direction: column; gap: 0; padding-bottom: .5rem; }
  #primary-menu a { padding: .85rem .6rem; border-bottom: 1px solid #2c456a; border-left: 3px solid transparent; }
  #primary-menu a:hover, #primary-menu a[aria-current="page"] { border-bottom-color: #2c456a; border-left-color: var(--brass-soft); }
  .primary .wrap { flex-wrap: wrap; }
  .hsearch { display: none; }
}

@media (max-width: 560px) {
  .herosearch { flex-direction: column; }
  .herosearch button { width: 100%; }
  .searchbox { flex-direction: column; }
  dl.kv { grid-template-columns: 1fr; gap: .1rem 0; }
  dl.kv dd { margin-bottom: .6rem; }
}
