:root {
  --bg: #f4f1e8;
  --ink: #101924;
  --muted: #47566a;
  --line: #d3d8df;
  --surface: #ffffff;
  --surface-alt: #fdf9ee;
  --accent: #0f5d67;
  --accent-2: #c76d2b;
  --ok: #1f7a4e;
  --warn: #9a5728;
  --shadow: 0 10px 30px rgba(16, 25, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(199, 109, 43, 0.12), transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(15, 93, 103, 0.14), transparent 35%),
    var(--bg);
}

.skip-link {
  position: absolute;
  left: 10px;
  top: -40px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
}

.skip-link:focus {
  top: 8px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1200px, 94vw);
  margin: 0 auto;
}

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

.site-header {
  border-bottom: 1px solid #c9d2db;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 6px 18px rgba(16, 25, 36, 0.05);
}

.header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-family: "Oswald", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.4px;
  color: var(--ink);
}

.brand-copy {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-size: 1.12rem;
}

.brand-subtitle {
  margin-top: 3px;
  font-family: "Source Sans 3", sans-serif;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.25px;
}

.main-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 11px;
  color: #1c2f44;
}

.main-nav a:hover {
  text-decoration: none;
  border-color: #bfd3dc;
  background: #f0f7f8;
}

.header-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-search input[type="search"] {
  min-width: 200px;
  width: 220px;
  padding: 9px 11px;
  border-radius: 999px;
}

.header-search button {
  border: 1px solid #c3dddd;
  background: #ebf4f4;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.header-search button:hover {
  border-color: var(--accent);
}

.hero {
  padding: 42px 0 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 24px;
}

.hero-single {
  max-width: 980px;
}

.subhero {
  padding: 34px 0 10px;
}

.page-intro {
  margin: 10px 0 0;
  max-width: 82ch;
  color: #20354d;
  font-size: 1.08rem;
  line-height: 1.74;
}

.breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumbs a {
  color: #274565;
  font-weight: 600;
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 0.8rem;
  margin: 0 0 8px;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: "Oswald", sans-serif;
  letter-spacing: 0.2px;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 12px;
}

h2 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  margin: 0 0 10px;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 78ch;
}

.search-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 18px;
}

input[type="search"] {
  min-width: 260px;
  width: min(480px, 100%);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #bdc6d1;
  font: inherit;
  background: #fff;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(140deg, var(--accent), #17527b);
}

.btn-secondary {
  color: var(--accent);
  background: #ebf4f4;
  border: 1px solid #c3dddd;
}

.stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.stats div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 120px;
  box-shadow: var(--shadow);
}

.stats strong {
  display: block;
  font-size: 1.35rem;
}

.stats span {
  color: var(--muted);
}

.featured,
.quick-links,
.jail-meta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.featured ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.featured li + li {
  margin-top: 8px;
}

.featured a {
  display: flex;
  justify-content: space-between;
  background: var(--surface-alt);
  border: 1px solid #ebdfca;
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink);
}

.content-grid,
.jail-layout {
  display: grid;
  grid-template-columns: 1.24fr 0.76fr;
  gap: 18px;
  margin: 22px auto;
}

.home-seo {
  margin: 6px auto 18px;
}

.home-seo.prose {
  width: min(1200px, 94vw);
  max-width: none;
  padding: 32px clamp(26px, 5vw, 88px);
}

.home-seo p + p {
  margin-top: 10px;
}

.home-seo-bottom {
  margin: 8px auto 14px;
}

.home-seo-bottom h3 {
  margin-top: 14px;
}

.home-seo-bottom > * {
  margin-left: 0;
  margin-right: 0;
}

.home-seo.prose > * {
  max-width: none;
}

.home-seo-preview {
  margin: 0;
}

.home-seo-full.is-collapsed {
  display: none;
}

.home-seo-toggle {
  display: block;
  margin: 14px auto 0;
}

.seo-article,
.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.seo-article p,
.prose p {
  color: #2a3648;
}

.prose {
  padding: 28px clamp(18px, 3vw, 34px);
  max-width: 980px;
  margin: 12px auto 8px;
}

.prose h2 {
  font-family: "Source Sans 3", sans-serif;
  font-size: clamp(1.22rem, 2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.32;
  margin: 24px 0 10px;
  color: #15263b;
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose h2:not(:first-of-type) {
  border-top: 1px solid #dce3eb;
  padding-top: 14px;
}

.prose h3 {
  font-family: "Source Sans 3", sans-serif;
  font-size: clamp(1.02rem, 1.55vw, 1.16rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.36;
  margin: 14px 0 6px;
  color: #1a2f48;
}

.prose p,
.prose li {
  font-size: 1.08rem;
  line-height: 1.78;
  color: #20354d;
}

.prose p + p {
  margin-top: 12px;
}

.prose ul,
.prose ol {
  margin: 10px 0 18px 24px;
  padding: 0;
}

.prose li + li {
  margin-top: 8px;
}

.prose > * {
  max-width: 78ch;
}

.prose a {
  font-weight: 600;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.summary-head-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-updated {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-pill-active {
  background: #ebf8ef;
  color: var(--ok);
  border: 1px solid #8ac7a7;
}

.status-pill-inactive {
  background: #fff6ee;
  color: var(--warn);
  border: 1px solid #e6c0a1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
  padding: 10px 12px;
}

.summary-item-wide {
  grid-column: span 2;
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 700;
}

.summary-value {
  display: block;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
}

.seo-article dl {
  margin: 0;
}

.seo-article dt {
  font-weight: 700;
  margin-top: 10px;
}

.seo-article dd {
  margin: 0;
  color: #2d3f53;
  overflow-wrap: anywhere;
}

.contact-card .contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contact-card .contact-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
  padding: 10px 12px;
}

.contact-card .contact-item-wide {
  grid-column: span 2;
}

.quick-links a {
  display: block;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.quick-links a:last-child {
  border-bottom: none;
}

.sidebar-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.is-hidden {
  display: none !important;
}

.list-section {
  margin: 18px auto 30px;
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.home-search-section {
  margin-top: 8px;
}

#home-search-empty {
  margin: 0 0 10px;
}

.jail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.jail-card,
.state-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #bec9d8;
  padding: 4px 10px;
  font-size: 0.84rem;
}

.badge-ok {
  color: var(--ok);
  border-color: #8ac7a7;
  background: #ebf8ef;
}

.badge-warn {
  color: var(--warn);
  border-color: #e6c0a1;
  background: #fff6ee;
}

.muted {
  color: var(--muted);
}

.state-grid {
  margin: 20px auto 30px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.county-index {
  margin: 20px auto 30px;
}

.county-alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.county-alpha-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid #bdc6d1;
  border-radius: 999px;
  background: #fff;
  color: #1f344c;
  font-weight: 700;
  text-decoration: none;
}

.county-alpha-nav a:hover {
  border-color: var(--accent);
}

.county-sections {
  display: grid;
  gap: 12px;
}

.county-letter-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.county-link-list {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 20px;
}

.county-link-list li {
  break-inside: avoid;
  margin: 0 0 8px;
}

.county-link-list a {
  color: #1f344c;
  font-weight: 600;
}

.source-link {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.jail-meta dl {
  margin: 0;
}

.jail-meta h2 + dl {
  margin-bottom: 16px;
}

.jail-meta h2:not(:first-child) {
  margin-top: 20px;
}

.jail-meta dt {
  font-weight: 700;
  margin-top: 8px;
}

.jail-meta dd {
  margin: 0;
  color: #2d3f53;
}

.jail-meta p {
  margin: 8px 0;
  color: #2d3f53;
}

.jail-meta ul {
  margin: 8px 0 12px 18px;
  padding: 0;
}

.roster-section {
  margin: 18px auto 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.roster-alert {
  margin-top: 10px;
  border: 1px solid #f1c9a8;
  background: #fff5ec;
  border-radius: 10px;
  padding: 10px 12px;
  color: #6d3d1f;
  line-height: 1.5;
}

.roster-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.roster-tools {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

#roster-count {
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: top;
}

th {
  color: #1f344c;
  background: #f7fafb;
}

.roster-pagination {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

#roster-page-meta {
  margin: 10px 0 0;
  text-align: center;
}

.roster-pagination.is-hidden {
  display: none;
}

.page-list {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.page-btn {
  border: 1px solid #bdc6d1;
  background: #fff;
  color: #1f344c;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.page-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.site-footer {
  margin-top: 44px;
  border-top: 1px solid #c9d2db;
  background: rgba(255, 255, 255, 0.96);
}

.footer-grid {
  padding: 24px 0 14px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 18px;
}

.footer-grid a {
  display: block;
  margin: 7px 0;
}

.footer-brand p {
  max-width: 50ch;
}

.footer-bottom {
  border-top: 1px solid #dbe2e8;
  padding: 10px 0 16px;
  text-align: center;
}

@media (max-width: 1080px) {
  .jail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .state-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .header-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    align-items: flex-start;
  }

  .header-tools {
    justify-content: flex-start;
    width: 100%;
  }

  .main-nav,
  .header-search {
    flex-wrap: wrap;
  }

  .header-search input[type="search"] {
    width: min(360px, 100%);
  }

  .hero-grid,
  .content-grid,
  .jail-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-head-right {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .jail-list,
  .state-grid {
    grid-template-columns: 1fr;
  }

  .county-link-list {
    columns: 1;
  }

  .roster-pagination {
    justify-content: center;
  }

  .summary-grid,
  .contact-card .contact-grid {
    grid-template-columns: 1fr;
  }

  .summary-item-wide,
  .contact-card .contact-item-wide {
    grid-column: auto;
  }

  .footer-bottom {
    text-align: center;
  }
}
