/* PermitTrace — civic-authority design system
   Palette: deep navy + warm amber + cream paper background.
   Type: Fraunces (serif slab display) for headings, Inter for UI/body. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700;9..144,900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #0b1d33;
  --ink-soft: #2d3e55;
  --muted: #5d6d80;
  --muted-2: #8694a5;
  --line: #e5e2d6;
  --line-2: #d8d4c4;
  --paper: #faf6ec;
  --paper-2: #f3ecd9;
  --surface: #ffffff;
  --navy: #0a2540;
  --navy-2: #14365e;
  --navy-deep: #061629;
  --amber: #c98a1f;
  --amber-2: #e0a64a;
  --amber-soft: #f6e2b6;
  --good: #2f8a52;
  --shadow-sm: 0 1px 2px rgba(10,37,64,.06);
  --shadow: 0 1px 2px rgba(10,37,64,.05), 0 14px 28px -12px rgba(10,37,64,.12);
  --shadow-lg: 0 4px 8px rgba(10,37,64,.06), 0 30px 60px -20px rgba(10,37,64,.18);
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--paper);
  background-image: linear-gradient(180deg, #faf6ec 0%, #f7f1e2 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', 'Source Serif Pro', Georgia, serif;
  font-variation-settings: 'opsz' 96;
  color: var(--navy);
  letter-spacing: -0.015em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 4vw, 2.85rem); line-height: 1.08; margin: 0 0 .5em; font-weight: 900; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.2; margin: 1.8em 0 .5em; }
h3 { font-size: 1.18rem; line-height: 1.3; margin: 1.4em 0 .35em; color: var(--navy-2); }
h4 { font-size: .95rem; margin: 1.2em 0 .3em; color: var(--navy-2); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 1em; color: var(--ink-soft); max-width: 72ch; }
a { color: var(--navy-2); text-decoration: underline; text-decoration-color: rgba(20,54,94,.28); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--amber); text-decoration-color: var(--amber-2); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Top accent strip */
.topstrip { height: 4px; background: linear-gradient(90deg, var(--amber) 0%, var(--amber-2) 50%, var(--navy) 100%); }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.header-inner { display: flex; align-items: center; gap: 24px; padding: 16px 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background:
    radial-gradient(circle at 30% 30%, var(--amber-2) 0%, transparent 40%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 4px 12px rgba(10,37,64,.18);
  flex-shrink: 0;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 8px 9px;
  background:
    linear-gradient(180deg, transparent 0 35%, var(--amber) 35% 38%, transparent 38% 60%, var(--amber) 60% 63%, transparent 63%);
  opacity: .85;
}
.brand-name { font-family: 'Fraunces', serif; font-weight: 900; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--navy); }
.brand-tag { display: block; font-family: 'Inter', sans-serif; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); font-weight: 600; margin-top: -3px; }
.primary-nav { display: flex; gap: 4px; margin-left: 18px; }
.primary-nav a { font-size: .92rem; text-decoration: none; color: var(--ink-soft); font-weight: 500; padding: 8px 12px; border-radius: 6px; }
.primary-nav a:hover { color: var(--navy); background: var(--paper-2); }
.header-search { margin-left: auto; display: flex; gap: 0; align-items: stretch; }
.header-search input { padding: 9px 14px; border: 1.5px solid var(--line-2); border-right: 0; border-radius: 8px 0 0 8px; font-size: .92rem; min-width: 240px; background: #fff; font-family: inherit; }
.header-search input:focus { outline: 0; border-color: var(--navy); }
.header-search button { padding: 9px 16px; background: var(--navy); color: #fff; border: 1.5px solid var(--navy); border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 600; font-family: inherit; font-size: .92rem; }
.header-search button:hover { background: var(--navy-2); border-color: var(--navy-2); }

.site-main { padding: 28px 24px 60px; }

/* Hero */
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0; overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
  position: relative;
}
.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-2) 100%);
  z-index: 1;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch; }
.hero-copy { padding: 56px 56px 48px; }
.hero-copy h1 { font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.05; }
.hero-copy h1 em { font-style: italic; font-weight: 500; color: var(--amber); }
.hero-copy .lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 38ch; }
.hero-img { background-size: cover; background-position: center; min-height: 380px; position: relative; }
.hero-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,37,64,.08) 0%, transparent 30%); pointer-events: none; }
.hero-search { display: flex; gap: 0; margin-top: 22px; max-width: 460px; box-shadow: 0 6px 20px -8px rgba(10,37,64,.18); border-radius: 10px; overflow: hidden; }
.hero-search input { flex: 1; padding: 14px 18px; border: 1.5px solid var(--navy); border-right: 0; border-radius: 10px 0 0 10px; font-size: 1rem; background: #fff; font-family: inherit; min-width: 0; }
.hero-search input:focus { outline: 0; }
.hero-search button { padding: 14px 22px; background: var(--navy); color: #fff; border: 1.5px solid var(--navy); border-radius: 0 10px 10px 0; cursor: pointer; font-weight: 700; font-family: inherit; font-size: .95rem; letter-spacing: .01em; }
.hero-search button:hover { background: var(--amber); border-color: var(--amber); }
.hero-foot { margin-top: 16px; font-size: .9rem; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.hero-foot a { color: var(--navy-2); font-weight: 500; }

.btn { display: inline-block; padding: 12px 22px; background: var(--navy); color: #fff; border-radius: 10px; text-decoration: none; font-weight: 600; border: 1.5px solid var(--navy); cursor: pointer; font-family: inherit; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--amber); border-color: var(--amber); color: #fff; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--navy); }
.btn.secondary:hover { background: var(--navy); color: #fff; }
.btn.amber { background: var(--amber); border-color: var(--amber); }
.btn.amber:hover { background: var(--navy); border-color: var(--navy); }

/* Stat cards */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0 28px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; text-align: left; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--amber); }
.stat-num { font-family: 'Fraunces', serif; font-size: 1.85rem; font-weight: 900; color: var(--navy); display: block; line-height: 1; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; display: block; font-weight: 600; }

/* Sections */
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 32px; margin: 22px 0; box-shadow: var(--shadow-sm); }
.section h2:first-child, .section h3:first-child { margin-top: 0; }
.section.tinted { background: linear-gradient(180deg, #fffdf5 0%, #fff 100%); }
.section-eyebrow { font-family: 'Inter', sans-serif; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--amber); font-weight: 700; margin: 0 0 6px; }

/* Sidebar layout */
.layout-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
.sidebar { display: flex; flex-direction: column; gap: 18px; position: relative; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.card h3 { margin-top: 0; font-size: 1.05rem; }
.card.featured { border-color: var(--amber); border-top: 3px solid var(--amber); }

/* Editorial recommendation block (sidebar) */
.recommend { background: linear-gradient(180deg, #fffaf0 0%, #fff 100%); border: 1px solid var(--line-2); border-top: 3px solid var(--amber); border-radius: var(--radius); padding: 22px; }
.recommend h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--navy); }
.recommend .recommend-eyebrow { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--amber); font-weight: 700; margin-bottom: 12px; display: block; }
.recommend ol { list-style: none; padding: 0; margin: 12px 0 0; counter-reset: rec; }
.recommend li { counter-increment: rec; padding: 12px 0 12px 32px; border-top: 1px solid var(--line); position: relative; line-height: 1.4; }
.recommend li:first-child { border-top: 0; padding-top: 4px; }
.recommend li::before {
  content: counter(rec); position: absolute; left: 0; top: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper-2); color: var(--navy); font-family: 'Fraunces', serif;
  font-weight: 700; font-size: .82rem; display: flex; align-items: center; justify-content: center;
}
.recommend li:first-child::before { top: 4px; }
.recommend li a { color: var(--navy); font-weight: 600; text-decoration: none; font-size: .94rem; display: block; }
.recommend li a:hover { color: var(--amber); }
.recommend li .blurb { font-size: .8rem; color: var(--muted); margin-top: 2px; display: block; }

/* Footer recommendation strip */
.footer-recommend { background: var(--paper-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 28px 0; }
.footer-recommend .container { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.footer-recommend h3 { font-size: 1.1rem; margin: 0 0 4px; color: var(--navy); }
.footer-recommend p.eyebrow { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--amber); font-weight: 700; margin: 0 0 6px; }
.footer-recommend p.intro { font-size: .85rem; color: var(--muted); margin: 0; }
.footer-recommend ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 22px; }
.footer-recommend li a { color: var(--navy); font-weight: 500; font-size: .9rem; text-decoration: none; padding: 4px 0; display: block; border-bottom: 1px dashed transparent; }
.footer-recommend li a:hover { color: var(--amber); border-bottom-color: var(--amber-2); }

/* AdSense slot styling */
.adslot { background: var(--paper-2); border: 1px dashed var(--line-2); color: var(--muted); padding: 22px; text-align: center; font-size: .78rem; border-radius: var(--radius); font-family: 'Inter', sans-serif; letter-spacing: .12em; text-transform: uppercase; }

/* State + county lists */
.col-list { columns: 4; column-gap: 28px; }
.col-list a { display: block; padding: 5px 0; text-decoration: none; color: var(--ink-soft); font-size: .94rem; }
.col-list a:hover { color: var(--amber); }

.county-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.county-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--navy); display: block; transition: border-color .15s, transform .15s, box-shadow .15s; }
.county-card:hover { border-color: var(--amber); transform: translateY(-1px); text-decoration: none; box-shadow: var(--shadow); color: var(--navy); }
.county-card .county-name { font-weight: 600; font-size: 1.02rem; font-family: 'Fraunces', serif; letter-spacing: -.01em; }
.county-card .county-seat { color: var(--muted); font-size: .82rem; margin-top: 3px; }

.office-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 18px 0; }
.office-tile { background: linear-gradient(180deg, #fff 0%, #fffdf5 100%); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; text-decoration: none; color: var(--navy); display: block; transition: border-color .15s, transform .15s; position: relative; }
.office-tile::before { content: ''; position: absolute; top: 0; left: 22px; width: 28px; height: 3px; background: var(--amber); border-radius: 0 0 3px 3px; }
.office-tile:hover { border-color: var(--amber); text-decoration: none; transform: translateY(-1px); color: var(--navy); }
.office-tile h3 { margin: 8px 0 6px; font-size: 1.08rem; color: var(--navy); }
.office-tile .tagline { color: var(--muted); font-size: .88rem; margin: 0; line-height: 1.45; }

.contact-block { background: linear-gradient(90deg, #fffaf0 0%, #fff 60%); border-left: 3px solid var(--amber); padding: 16px 22px; border-radius: 0 var(--radius) var(--radius) 0; margin: 14px 0; }
.contact-block .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.contact-block .value { font-weight: 600; color: var(--navy); font-size: 1rem; margin-top: 4px; line-height: 1.5; }

.kv-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 18px; margin: 12px 0; }
.kv-grid dt { font-weight: 600; color: var(--navy-2); font-size: .85rem; }
.kv-grid dd { margin: 0; color: var(--ink-soft); font-size: .92rem; }

table.permit-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 14px 0; }
table.permit-table th, table.permit-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.permit-table th { background: var(--paper-2); color: var(--navy); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
table.permit-table tbody tr:hover { background: #fffaf0; }
table.permit-table td.amount { font-family: 'Fraunces', serif; font-weight: 600; color: var(--navy); white-space: nowrap; }

.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--amber); }
.breadcrumbs .sep { color: var(--muted-2); margin: 0 6px; }
.breadcrumbs span[aria-current] { color: var(--navy); font-weight: 600; }

.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--amber-soft); color: var(--navy); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-family: 'Inter', sans-serif; }
.pill.navy { background: var(--navy); color: #fff; }
.pill.outline { background: transparent; border: 1px solid var(--amber); color: var(--amber); }

ul.checks { list-style: none; padding: 0; }
ul.checks li { padding: 8px 0 8px 30px; position: relative; color: var(--ink-soft); border-bottom: 1px dotted var(--line); }
ul.checks li:last-child { border-bottom: 0; }
ul.checks li::before {
  content: '✓'; color: #fff; background: var(--good); width: 20px; height: 20px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  position: absolute; left: 0; top: 8px; font-size: .72rem; font-weight: 700;
}

.tip-box { background: #fff8e3; border: 1px solid #f3dca0; border-left: 4px solid var(--amber); border-radius: var(--radius); padding: 16px 20px; margin: 16px 0; font-size: .94rem; color: var(--navy-2); }
.tip-box strong { color: var(--navy); }

/* Footer */
.site-footer { background: var(--navy-deep); color: #b9c7da; margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding: 48px 24px 32px; }
.site-footer h4 { color: #fff; font-family: 'Inter', sans-serif; font-size: .82rem; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 7px 0; }
.site-footer a { color: #b9c7da; text-decoration: none; font-size: .92rem; }
.site-footer a:hover { color: var(--amber-2); }
.site-footer .brand-name { color: #fff; font-size: 1.35rem; }
.site-footer .brand-tag { color: var(--amber-2); }
.site-footer p { color: #8da4be; font-size: .9rem; max-width: 32ch; }
.footer-bottom { padding: 18px 24px 32px; border-top: 1px solid #14365e; text-align: center; }
.footer-bottom small { color: #6b809b; font-size: .82rem; }

/* Long prose */
.long-prose { white-space: pre-line; color: var(--ink-soft); font-size: 1rem; line-height: 1.7; }
.long-prose ul { padding-left: 22px; }

/* Search results */
.result-list { list-style: none; padding: 0; }
.result-list li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.result-list li a { font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 700; color: var(--navy); text-decoration: none; }
.result-list li a:hover { color: var(--amber); }
.result-list .meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }

/* Featured states block on homepage */
.featured-states { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 18px 0; }
.featured-state { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--navy); display: block; position: relative; overflow: hidden; transition: border-color .15s, transform .15s; }
.featured-state::after { content: '→'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--amber); font-size: 1.1rem; opacity: 0; transition: opacity .15s, transform .15s; }
.featured-state:hover { border-color: var(--amber); transform: translateY(-1px); color: var(--navy); }
.featured-state:hover::after { opacity: 1; transform: translate(4px, -50%); }
.featured-state .fs-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.05rem; }
.featured-state .fs-meta { color: var(--muted); font-size: .8rem; margin-top: 3px; }

@media (max-width: 980px) {
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-recommend .container { grid-template-columns: 1fr; gap: 18px; }
  .footer-recommend ul { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 36px 28px 32px; }
  .hero-img { min-height: 200px; }
  .col-list { columns: 2; }
  .header-inner { flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .header-search { order: 3; width: 100%; margin-left: 0; }
  .header-search input { min-width: 0; flex: 1; }
  .primary-nav { margin-left: 0; flex-wrap: wrap; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; padding: 36px 24px 24px; }
  .footer-recommend ul { grid-template-columns: 1fr; }
  .section { padding: 22px 20px; }
  .kv-grid { grid-template-columns: 110px 1fr; }
}
