:root{
  --ink: #16233B;
  --ink-700: #263652;
  --slate: #4A5568;
  --slate-light: #6B7280;
  --paper: #F1F0E8;
  --paper-raised: #FBFAF5;
  --hairline: #D8D5C8;
  --hairline-strong: #C3BFAE;
  --brass: #A9843C;
  --brass-dark: #7C5F2B;
  --docket-red: #A13B2D;
  --docket-red-dark: #7C2D22;
  --ledger-green: #2F5E45;
  --ledger-green-dark: #1F4531;
  --county-blue: #2C5170;
  --county-blue-dark: #1E3A52;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 10px;
  --shadow-card: 0 1px 2px rgba(22,35,59,0.06), 0 1px 0 rgba(22,35,59,0.03);
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a{ color: var(--county-blue-dark); }
a:hover{ color: var(--ink); }

.wrap{
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

/* ---------- header: logo + ad slot ---------- */

.site-header{
  background: var(--paper-raised);
  border-bottom: 1px solid var(--hairline);
}

.header-grid{
  display: grid;
  grid-template-columns: 1fr 2fr; /* left third logo, right two-thirds ad */
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
}

/* Logo cell: img is width:100%/height:auto, so its own rendered height
   sets the row height. No padding here on purpose. */
.logo-slot{
  position: relative;
  width: 100%;
}
.logo-link{ display: block; width: 100%; line-height: 0; }
.logo-img{ display: block; width: 100%; height: auto; }

/* Ad cell: absolutely-positioned image so it can never contribute its own
   intrinsic size to the grid row — only the logo cell does that. The ad
   is then stretched/letterboxed to exactly fill whatever height the logo
   established. */
.ad-slot{
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 60px;
  overflow: hidden;
  text-decoration: none;
  border-left: 1px solid var(--hairline);
}
.ad-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Fallback placeholders: hidden by default, shown via onerror when the
   image fails to load, so the header never silently collapses. */
.media-fallback-box{
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  margin: 10px;
  border: 2px dashed var(--hairline-strong);
  border-radius: 6px;
  color: var(--slate-light);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px;
  background: repeating-linear-gradient(
    45deg, rgba(22,35,59,0.03), rgba(22,35,59,0.03) 8px, transparent 8px, transparent 16px
  );
}
.logo-slot.media-fallback .media-fallback-box,
.ad-slot.media-fallback .media-fallback-box,
.footer-ad-slot.media-fallback .media-fallback-box{ display: flex; }
.ad-slot.media-fallback{ min-height: 90px; }

/* ---------- secondary nav (moved out of the header row) ---------- */

.secondary-nav{
  background: var(--ink);
  border-bottom: 3px solid var(--brass);
}
.secondary-nav-inner{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 28px;
  padding: 12px 24px;
  flex-wrap: wrap;
}
.secondary-nav a{
  color: #D9D6C8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.secondary-nav a:hover{ color: #fff; }

@media (max-width: 560px){
  .header-grid{ grid-template-columns: 1fr 1.4fr; }
  .media-fallback-box{ font-size: 10px; }
}


/* ---------- hero ---------- */

.hero{
  background: var(--ink);
  color: #F1EFE6;
  padding: 56px 0 72px;
  position: relative;
}
.hero::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass) 20%, var(--brass) 80%, transparent);
}
.eyebrow{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 14px;
}
.hero h1{
  color: #FBFAF5;
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 1.12;
  max-width: 15ch;
  margin-bottom: 18px;
}
.hero-sub{
  color: #C7C4B6;
  max-width: 56ch;
  font-size: 17px;
  margin: 0 0 36px;
}

.search-panel{
  background: var(--paper-raised);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.28);
  max-width: 780px;
}
.search-row{
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  padding: 4px 14px;
}
.search-icon{ opacity: 0.45; flex-shrink: 0; color: var(--ink); }
#search-input{
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 0;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--ink);
  background: transparent;
}
#search-input::placeholder{ color: #9C9A8E; }

.level-tabs{
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.level-tab{
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: #fff;
  color: var(--slate);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.level-tab:hover{ border-color: var(--brass); }
.level-tab.is-active{
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.hero-stats{
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #A6A395;
}

/* ---------- results ---------- */

.results-section{ padding: 48px 0 8px; }
.results-header{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.results-header h2{ margin: 0; font-size: 22px; }
.state-select-wrap{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--slate);
}
#state-jump{
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--hairline-strong);
  background: #fff;
  color: var(--ink);
}

.results-list{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.court-card{
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.stamp{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1.5px solid currentColor;
  transform: rotate(-3deg);
  white-space: nowrap;
}
.stamp-federal{ color: var(--docket-red); background: rgba(161,59,45,0.07); }
.stamp-state{ color: var(--ledger-green-dark); background: rgba(47,94,69,0.08); }
.stamp-county{ color: var(--county-blue-dark); background: rgba(44,81,112,0.08); }
.stamp-city{ color: var(--brass-dark); background: rgba(169,132,60,0.1); }

.verified-dot{
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ledger-green);
  margin-right: 6px;
  vertical-align: middle;
}

.court-name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}

.breadcrumb{
  font-size: 12.5px;
  color: var(--slate-light);
  font-family: var(--font-mono);
}
.breadcrumb .sep{ color: var(--hairline-strong); margin: 0 4px; }

.court-note{
  font-size: 13.5px;
  color: var(--slate);
  margin: 0;
  flex: 1;
}

.card-actions{
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.card-actions a{
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--hairline-strong);
  color: var(--ink);
  background: #fff;
}
.card-actions a.primary{
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.card-actions a:hover{ border-color: var(--brass); }
.card-actions a.primary:hover{ background: var(--ink-700); }

.verify-line{
  font-size: 11.5px;
  color: var(--slate-light);
  display: flex;
  align-items: center;
}

.empty-state{
  text-align: center;
  color: var(--slate);
  padding: 48px 12px;
  font-size: 15px;
}

/* ---------- circuit browse ---------- */

.browse-section{
  background: var(--paper-raised);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 56px 0;
}
.section-sub{ color: var(--slate); margin: 0 0 28px; max-width: 60ch; }

.circuit-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.circuit-tile{
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--ink);
  transition: border-color 0.15s, transform 0.1s;
}
.circuit-tile:hover{ border-color: var(--brass); transform: translateY(-1px); }
.circuit-name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
}
.circuit-states{
  font-size: 12px;
  color: var(--slate-light);
  line-height: 1.4;
}

/* ---------- about ---------- */

.about-section{ padding: 56px 0; }
.about-grid{
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-grid p{ color: var(--slate); }
.about-stamp-card{
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 22px;
}
.stamp-card-label{
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-light);
  margin: 0 0 14px;
}
.stamp-legend{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.stamp-card-note{
  font-size: 13px;
  color: var(--slate);
  display: flex;
  align-items: center;
  margin: 0;
}

/* ---------- footer ---------- */

.site-footer{
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 28px 0 36px;
}
.footer-inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.footer-links{
  display: flex;
  gap: 24px;
}
.footer-links a{
  color: #C7C4B6;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-links a:hover{ color: #fff; }

/* Footer ad slot: reserves a stable 728x90 leaderboard-shaped box, centered
   in the footer, so nothing shifts on load and the injected iframe has
   room to render at full size. */
.footer-ad-slot{
  position: relative;
  display: block;
  width: 728px;
  max-width: 100%;
  height: 90px;
  margin: 0 auto;
  overflow: visible;
  border-radius: 6px;
}
.footer-ad-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.footer-ad-slot .media-fallback-box{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-color: rgba(255,255,255,0.25);
  color: #9C9A8E;
  background: repeating-linear-gradient(
    45deg, rgba(255,255,255,0.03), rgba(255,255,255,0.03) 8px, transparent 8px, transparent 16px
  );
}

/* ---------- disclosure page ---------- */

.disclosure-section{ padding: 48px 0 64px; }
.disclosure-inner{ max-width: 640px; }
.disclosure-inner h1{
  font-size: clamp(28px, 4vw, 36px);
  margin-bottom: 20px;
}
.disclosure-inner p{
  color: var(--slate);
  margin: 0 0 16px;
}
.disclosure-inner a{ color: var(--county-blue-dark); }

/* ---------- responsive ---------- ---------- */

@media (max-width: 760px){
  .secondary-nav-inner{ justify-content: center; gap: 18px; }
  .about-grid{ grid-template-columns: 1fr; }
  .results-header{ align-items: flex-start; }
}

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