/* ═══════════════════════════════════════════════
   CROCKETT² — Civic Intelligence Stylesheet
   ═══════════════════════════════════════════════ */

:root {
    --ink: #0C1B2A;
    --paper: #F8F5EE;
    --rule: #D3D1C7;
    --accent: #D85A30;
    --civic: #534AB7;
    --teal: #1D9E75;
    --signal: #D4537E;
    --map-bg: #0C1B2A;
    --map-data: #185FA5;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { background: var(--paper); color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; flex-direction: column; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── NAV ────────────────────────────── */
.site-nav { border-bottom: 1px solid rgba(12,27,42,.15); background: var(--paper); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 72rem; margin: 0 auto; padding: 0 1rem; height: 2.75rem; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -.01em; }
.nav-brand sup { font-size: .55em; position: relative; top: -.65em; }
.nav-links { display: flex; gap: 1.5rem; font-size: .8rem; letter-spacing: .03em; }
.nav-links a { color: rgba(12,27,42,.6); transition: color .15s; }
.nav-links a:hover, .nav-links a.nav-active { color: var(--accent); }

/* ── FOOTER ─────────────────────────── */
.site-footer { margin-top: auto; padding: 2rem 1rem; border-top: 1px solid rgba(12,27,42,.1); text-align: center; font-size: .65rem; color: rgba(12,27,42,.3); letter-spacing: .1em; }
.site-footer a { color: var(--accent); }

/* ── LAYOUT ─────────────────────────── */
.container { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1rem; }
.container-sm { max-width: 48rem; margin: 0 auto; padding: 2.5rem 1rem; }
.container-lg { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

/* ── TYPOGRAPHY ─────────────────────── */
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.dateline { font-family: var(--font-mono); font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; color: rgba(12,27,42,.35); }
.section-label { font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; color: rgba(12,27,42,.3); }
.filed-label { font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }

h1.masthead { font-family: var(--font-display); font-size: 4.5rem; text-align: center; line-height: .85; letter-spacing: -.02em; margin-top: 1.25rem; }
h1.masthead sup { font-size: .35em; position: relative; top: -2rem; }
h1.page-title { font-family: var(--font-display); font-size: 2.5rem; margin-top: .5rem; letter-spacing: -.01em; }
h2.section-title { font-family: var(--font-display); font-size: 1.5rem; }
h3.card-title { font-family: var(--font-display); font-size: 1.15rem; }
.subtitle { font-family: var(--font-display); font-style: italic; color: rgba(12,27,42,.65); font-size: 1.1rem; text-align: center; margin-top: .75rem; }

/* ── NEWSPRINT RULE ─────────────────── */
.newsprint-rule { border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); padding: .25rem 0; text-align: center; margin: 1.5rem 0; }

/* ── STATS STRIP ────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0; }
.stat-block { text-align: center; }
.stat-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 500; }
.stat-label { font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; color: rgba(12,27,42,.35); margin-top: .25rem; }

/* ── CARDS ───────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.card { border: 1px solid rgba(12,27,42,.12); padding: 1.25rem; transition: border-color .15s; display: block; }
.card:hover { border-color: var(--accent); }
.card:hover .card-title { color: var(--accent); }
.card-desc { font-size: .85rem; color: rgba(12,27,42,.5); margin-top: .5rem; line-height: 1.5; }

/* ── BADGES ──────────────────────────── */
.badge { display: inline-block; font-size: .55rem; letter-spacing: .1em; text-transform: uppercase; padding: .15rem .5rem; }
.badge-sponsor { background: var(--accent); color: var(--paper); }
.badge-verified { background: var(--ink); color: var(--paper); }

/* ── FORMS ───────────────────────────── */
input[type="text"], input[type="email"], input[type="search"], select {
    border: 1px solid rgba(12,27,42,.15); background: transparent; padding: .5rem .75rem;
    font-family: var(--font-body); font-size: .85rem; outline: none; transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--accent); }
.btn { display: inline-block; border: 1px solid var(--ink); padding: .5rem 1rem; font-size: .85rem;
    font-family: var(--font-body); cursor: pointer; background: transparent; transition: all .15s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-accent { border-color: var(--accent); color: var(--accent); }
.btn-accent:hover { background: var(--accent); color: var(--paper); }
.btn-solid { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.btn-solid:hover { background: #b54a28; }
.btn-full { width: 100%; text-align: center; }

/* ── FILTER PILLS ────────────────────── */
.filter-pills { display: flex; gap: .35rem; flex-wrap: wrap; margin: 1rem 0; }
.pill { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; padding: .3rem .65rem;
    border: 1px solid rgba(12,27,42,.12); cursor: pointer; transition: all .15s; background: transparent; font-family: var(--font-body); }
.pill:hover { border-color: rgba(12,27,42,.3); }
.pill.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── REGISTRY ────────────────────────── */
.registry-item { border: 1px solid rgba(12,27,42,.12); padding: 1rem; transition: border-color .15s; display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.registry-item:hover { border-color: var(--accent); }
.registry-item:hover .card-title { color: var(--accent); }
.registry-meta { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(12,27,42,.3); margin-top: .25rem; }
.registry-addr { font-size: .8rem; color: rgba(12,27,42,.4); margin-top: .5rem; }

/* ── DETAIL ──────────────────────────── */
.detail-dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: .75rem; font-size: .9rem; }
.detail-dt { font-size: .6rem; letter-spacing: .15em; text-transform: uppercase; color: rgba(12,27,42,.3); padding-top: .15rem; }
.detail-dd a { color: var(--accent); }
.back-link { font-size: .8rem; color: var(--accent); margin-bottom: 1rem; display: inline-block; }
.back-link:hover { text-decoration: underline; }

/* ── PULSE ────────────────────────────── */
.pulse-item { border-left: 2px solid rgba(12,27,42,.1); padding: .5rem 0 .5rem 1rem; }
.pulse-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.kind-badge { font-size: .55rem; letter-spacing: .08em; text-transform: uppercase; padding: .15rem .5rem; }
.kind-teal { background: rgba(29,158,117,.1); color: #0f6e56; }
.kind-civic { background: rgba(83,74,183,.1); color: #3c3489; }
.kind-blue { background: rgba(24,95,165,.1); color: #185fa5; }
.kind-accent { background: rgba(216,90,48,.1); color: #993c1d; }
.kind-signal { background: rgba(212,83,126,.1); color: #993556; }
.pulse-time { font-family: var(--font-mono); font-size: .6rem; color: rgba(12,27,42,.2); }
.pulse-headline { font-weight: 500; font-size: .9rem; }
.pulse-body { font-size: .8rem; color: rgba(12,27,42,.5); margin-top: .2rem; }
.pulse-loc { font-family: var(--font-mono); font-size: .6rem; color: rgba(12,27,42,.15); margin-top: .2rem; }

/* ── SIGNALS ─────────────────────────── */
.signal-item { border-bottom: 1px solid rgba(12,27,42,.08); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.signal-title { font-family: var(--font-display); font-size: 1.5rem; margin-top: .35rem; transition: color .15s; }
.signal-title:hover { color: var(--accent); }
.signal-dek { font-family: var(--font-display); font-style: italic; color: rgba(12,27,42,.55); margin-top: .5rem; line-height: 1.5; }
.signal-date { font-family: var(--font-mono); font-size: .6rem; color: rgba(12,27,42,.2); margin-top: .5rem; }
.signal-body { font-size: .95rem; line-height: 1.7; color: rgba(12,27,42,.75); }
.signal-body p { margin-bottom: 1rem; }

/* ── RECORD ──────────────────────────── */
.doc-item { border-bottom: 1px solid rgba(12,27,42,.08); padding-bottom: 1.25rem; margin-bottom: 1.25rem; }
.doc-meta { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(12,27,42,.25); display: flex; gap: .5rem; }
.doc-title { font-family: var(--font-display); font-size: 1.2rem; margin-top: .35rem; }
.doc-summary { border-left: 2px solid rgba(216,90,48,.3); padding-left: .75rem; margin-top: .5rem; }
.doc-summary-label { font-size: .6rem; letter-spacing: .15em; text-transform: uppercase; color: rgba(216,90,48,.5); margin-bottom: .25rem; }
.doc-summary-text { font-size: .85rem; color: rgba(12,27,42,.6); line-height: 1.5; }
.doc-tags { display: flex; gap: .25rem; margin-top: .5rem; flex-wrap: wrap; }
.doc-tag { font-size: .55rem; background: rgba(12,27,42,.06); padding: .15rem .4rem; letter-spacing: .05em; }

/* ── CTA / FOUNDING ──────────────────── */
.cta-box { border: 1px solid rgba(12,27,42,.12); padding: 2rem; text-align: center; margin-top: 2.5rem; }
.cta-founding { border-color: rgba(216,90,48,.3); max-width: 28rem; margin: 1rem auto 0; padding: 1.5rem; }

/* ── MAP ─────────────────────────────── */
.map-layout { display: flex; height: calc(100vh - 2.75rem); }
.map-sidebar { width: 12rem; background: var(--paper); border-right: 1px solid rgba(12,27,42,.12); padding: .75rem; overflow-y: auto; flex-shrink: 0; }
.map-viewport { flex: 1; position: relative; background: var(--map-bg); }
.map-inspector { width: 17rem; background: var(--paper); border-left: 1px solid rgba(12,27,42,.12); padding: 1rem; overflow-y: auto; flex-shrink: 0; }
.map-topbar { display: flex; align-items: center; justify-content: space-between; padding: .4rem 1rem; background: var(--map-bg); border-bottom: 1px solid rgba(255,255,255,.08); }
.map-topbar-brand { font-family: var(--font-display); color: #fff; font-size: .85rem; }
.map-topbar-brand span { color: rgba(255,255,255,.35); font-family: var(--font-mono); font-size: .7rem; margin-left: .5rem; }
.map-coords { font-family: var(--font-mono); font-size: .65rem; color: rgba(255,255,255,.35); display: flex; gap: 1rem; }
.map-overlay { position: absolute; z-index: 10; font-family: var(--font-mono); font-size: .65rem; }
.map-legend { top: .75rem; left: .75rem; background: rgba(12,27,42,.9); border: 1px solid rgba(255,255,255,.08); padding: .5rem .75rem; color: rgba(255,255,255,.35); }
.map-stats { bottom: .75rem; left: .75rem; background: rgba(12,27,42,.9); border: 1px solid rgba(255,255,255,.08); padding: .35rem .75rem; color: rgba(255,255,255,.35); }
.layer-check { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; font-size: .75rem; cursor: pointer; }
.layer-dot { width: .6rem; height: .6rem; display: inline-block; }

.inspector-field { margin-bottom: .75rem; }
.inspector-label { font-size: .6rem; letter-spacing: .15em; text-transform: uppercase; color: rgba(12,27,42,.25); display: block; margin-bottom: .1rem; }
.inspector-value { font-family: var(--font-mono); font-size: .85rem; }

/* ── RESPONSIVE ──────────────────────── */
@media (max-width: 768px) {
    .card-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    h1.masthead { font-size: 3rem; }
    h1.masthead sup { top: -1.2rem; }
    .map-layout { flex-direction: column; }
    .map-sidebar, .map-inspector { width: 100%; height: auto; max-height: 40vh; }
    .detail-dl { grid-template-columns: 1fr; }
    .nav-links { gap: .75rem; font-size: .7rem; }
}

/* ── MAPLIBRE POPUP OVERRIDE ─────────── */
.maplibregl-popup-content {
    background: var(--paper) !important; border: 1px solid var(--ink) !important;
    border-radius: 0 !important; font-family: var(--font-body) !important;
    padding: .75rem 1rem !important; box-shadow: 3px 3px 0 rgba(12,27,42,.12) !important;
}
.maplibregl-popup-close-button { font-size: 1rem; color: rgba(12,27,42,.4); }
