/* =========================================================
   The FOIA Library — styles
   A simple, accessible, readable design.
   ========================================================= */

:root {
  /* Delaware state colors — Colonial Blue + Buff (as on the state flag) */
  --bg: #fbf7eb;             /* subtle buff cream */
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --muted: #6b6b6b;
  --line: #e6ddc4;           /* warm buff-tinted border */
  --primary: #00539B;        /* Delaware Colonial Blue */
  --primary-dark: #003D73;   /* darker shade for hover/emphasis */
  --primary-soft: #d8e4f3;   /* pale blue background tint */
  --buff: #F4D77A;           /* Delaware Buff */
  --buff-soft: #FAEEC9;      /* pale buff for callout backgrounds */
  --accent: #00539B;         /* same as primary for a clean two-color palette */
  --accent-soft: #FAEEC9;    /* buff-soft, used for notice/info callouts */
  --focus: #00539B;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --container: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--primary-dark); }

h1, h2, h3 {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 1.2;
  color: var(--ink);
  margin-top: 0;
}

h1 { font-size: 2.25rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

p { margin: 0 0 1rem; }

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.hidden { display: none !important; }

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

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}
.logo-mark {
  /* Mirrors the Delaware state flag: Colonial Blue background, Buff text */
  display: inline-block;
  background: var(--primary);
  color: var(--buff);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 3px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.logo-text {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.site-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--primary-dark); }
.site-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--bg) 100%),
    var(--surface);
}
.hero h1 {
  font-size: 2.5rem;
  max-width: 22ch;
  margin-bottom: 0.75rem;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover { background: var(--primary-soft); color: var(--primary); }

/* ---------- Library section ---------- */
.library { padding: 40px 0 64px; }

.library-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.library-header h2 { margin: 0; }

.search-bar { margin-bottom: 24px; }

#search {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
#search:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}

.search-hint { margin-top: 10px; font-size: 0.9rem; }

.chip {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  border: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-right: 4px;
  font-family: inherit;
}
.chip:hover { background: #c9d8ed; }

/* ---------- Results / cards ---------- */
.results {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .results { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-agency {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
}
.card h3 { margin: 4px 0 6px; font-size: 1.15rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }

.card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.card-desc { color: var(--ink-soft); font-size: 0.95rem; }

.card-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  background: var(--buff-soft);
  color: var(--ink-soft);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #ead9a2;
}

.card-actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.card-actions a {
  font-size: 0.9rem;
  font-weight: 600;
}

.badge-pending {
  display: inline-block;
  background: var(--buff-soft);
  color: #6b4f00;
  border: 1px solid #ead9a2;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 3px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- Static pages (about, submit) ---------- */
.page {
  background: var(--surface);
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
.page .container { max-width: 740px; }
.page h1 { margin-bottom: 1rem; }
.page p, .page li { color: var(--ink-soft); }
.page h2 { margin-top: 2rem; }

.form-grid {
  display: grid;
  gap: 16px;
  background: var(--surface);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 16px;
}
.form-grid label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--ink);
}
.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: inherit;
  color: var(--ink);
}
.form-grid textarea { min-height: 120px; resize: vertical; }
.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.form-help {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.notice {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: 4px;
  margin: 1rem 0;
  color: var(--ink-soft);
}

/* Submit-page specific styles */
hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.5rem 0;
}

.steps-overview {
  background: var(--primary-soft);
  border: 1px solid #c5d6ea;
  border-radius: var(--radius);
  padding: 16px 20px 16px 44px;
  margin: 1.5rem 0;
  font-size: 1.05rem;
  color: var(--ink);
}
.steps-overview li {
  padding: 4px 0;
}

.meta-template {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 20px 20px;
  margin: 1rem 0 1.5rem;
}
.meta-template h4 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95re