/* =============================================================================
   Cold Case Audit — Public stylesheet
   Investigative-journalism register: serif headlines, sans body, restrained
   palette, generous whitespace. Light + dark themes via [data-theme].
   ========================================================================== */

:root[data-theme="light"] {
    --bg:        #f6f3ec;
    --bg-elev:   #ffffff;
    --ink:       #181818;
    --ink-soft:  #4a4a4a;
    --muted:     #7a7568;
    --line:      #d8d2c2;
    --accent:    #7a1f1f;
    --accent-ink:#5e1717;
}

:root[data-theme="dark"] {
    --bg:        #15181c;
    --bg-elev:   #1c2026;
    --ink:       #ece8df;
    --ink-soft:  #cfcabb;
    --muted:     #8c8678;
    --line:      #2b3038;
    --accent:    #c46868;
    --accent-ink:#ddaaaa;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Iowa", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: "Iowan Old Style", "Iowa", Georgia, "Times New Roman", serif;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.18;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--accent); }

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

/* ---- Masthead ----------------------------------------------------------- */

.masthead {
    border-bottom: 1px solid var(--line);
    background: var(--bg-elev);
}
.masthead-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 18px 24px;
}
.brand {
    font-family: "Iowan Old Style", Georgia, serif;
    font-weight: 600;
    font-size: 20px;
    color: var(--accent);
    border-bottom: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.brand-rule { color: var(--line); margin: 0 8px; }
.brand-name { color: var(--ink); }
.primary-nav {
    margin-left: auto;
    display: flex;
    gap: 22px;
}
.primary-nav a {
    color: var(--ink-soft);
    text-transform: uppercase;
    font-size: 12.5px;
    letter-spacing: 1.5px;
    font-weight: 600;
    border-bottom: 0;
}
.primary-nav a:hover { color: var(--accent); }

.theme-toggle {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
[data-theme="light"] .theme-toggle-dark,
[data-theme="dark"]  .theme-toggle-light { display: none; }

/* ---- Main + hero -------------------------------------------------------- */

.main { padding: 56px 24px 96px; }

.hero { max-width: 780px; margin: 0 auto 64px; }
.kicker {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 14px;
}
.hero-title {
    font-size: 44px;
    margin: 0 0 18px;
    font-weight: 600;
}
.hero-lede {
    font-size: 19px;
    color: var(--ink-soft);
    margin: 0 0 28px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 11px 22px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    cursor: pointer;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* ---- Sections + lists --------------------------------------------------- */

.section-header {
    display: flex; align-items: baseline; justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    margin-bottom: 24px;
}
.section-header h2 { font-size: 22px; margin: 0; }
.section-more {
    font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
    border-bottom: 0; color: var(--ink-soft);
}

.recent { max-width: 780px; margin: 0 auto; }
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.article-list-item a { color: var(--ink); border-bottom: 0; }
.article-list-item h3 { font-size: 23px; margin: 0 0 6px; }
.article-list-item .subtitle { color: var(--ink-soft); margin: 0 0 8px; }
.article-list-item .byline {
    color: var(--muted); font-size: 13px;
    text-transform: uppercase; letter-spacing: 1.2px;
    margin: 0;
}
.dot { padding: 0 6px; }

.empty-state {
    color: var(--muted);
    font-style: italic;
    padding: 24px 0;
}

/* ---- Error page --------------------------------------------------------- */

.error-page { max-width: 560px; margin: 80px auto; text-align: center; }
.error-page h1 { font-size: 36px; margin: 6px 0 16px; }

/* ---- Footer ------------------------------------------------------------- */

.footer {
    border-top: 1px solid var(--line);
    margin-top: 80px;
    padding: 32px 0;
    background: var(--bg-elev);
}
.footer-inner { max-width: 780px; }
.footer-mission { color: var(--ink-soft); margin: 0 0 12px; }
.footer-meta {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}
.footer-meta a { color: var(--ink-soft); border-bottom: 0; }
.footer-meta a:hover { color: var(--accent); }

/* ---- Forms -------------------------------------------------------------- */

.form-page { max-width: 760px; margin: 0 auto; }
.form-page-narrow { max-width: 560px; }
.form-header { margin-bottom: 32px; }
.form-header h1 { font-size: 34px; margin: 6px 0 12px; }
.form-header .lede { color: var(--ink-soft); margin: 0; font-size: 17px; }

.form { margin-top: 8px; }
.form fieldset {
    border: 0;
    border-top: 1px solid var(--line);
    padding: 24px 0 8px;
    margin: 0;
}
.form fieldset legend {
    font-family: "Iowan Old Style", Georgia, serif;
    font-size: 18px;
    color: var(--accent);
    padding: 0 12px 0 0;
    margin-bottom: 4px;
}

.form label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 18px 0 6px;
}
.form label .req { color: var(--accent); }

.form input[type="text"],
.form input[type="email"],
.form input[type="url"],
.form input[type="number"],
.form textarea,
.form select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-elev);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 3px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
}
.form textarea { resize: vertical; min-height: 110px; }
.form input:focus,
.form textarea:focus,
.form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(122,31,31,0.14);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.form-row label { margin-top: 0; }

.form-hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.form-actions { margin-top: 32px; }

/* Honeypot — visually and assistive-tech hidden, kept in form flow for bots */
.honeypot {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.anti-spam {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 16px 20px !important;
    margin-top: 32px !important;
}
.anti-spam legend {
    background: var(--bg);
    padding: 0 10px !important;
    font-size: 15px !important;
}

/* Public-side flash messages */
.flash {
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 15px;
}
.flash-notice {
    background: rgba(31,111,58,0.10);
    border: 1px solid rgba(31,111,58,0.30);
    color: #1f6f3a;
}
.flash-error {
    background: rgba(122,31,31,0.08);
    border: 1px solid rgba(122,31,31,0.30);
    color: var(--accent-ink);
}
.flash ul { margin: 8px 0 0; padding-left: 20px; }

/* ---- Draft preview banner ---------------------------------------------- */

.draft-banner {
    background: #fff4d6;
    border: 1px solid #e6c992;
    color: #6d4a00;
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 28px;
    font-size: 14px;
    text-align: center;
}

/* ---- Home: card eyebrow ------------------------------------------------ */

.state-eyebrow {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 4px;
}
.article-list-item .excerpt {
    color: var(--ink-soft);
    margin: 0 0 8px;
    font-size: 16px;
}

/* ---- Archive listings -------------------------------------------------- */

.archive {
    max-width: 780px;
    margin: 0 auto;
}
.archive-header { margin-bottom: 36px; }
.archive-header h1 {
    font-size: 40px;
    margin: 6px 0 14px;
}
.archive-lede {
    color: var(--ink-soft);
    font-size: 18px;
    margin: 0;
}

.archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.archive-item {
    border-top: 1px solid var(--line);
    padding: 26px 0;
}
.archive-item:last-child { border-bottom: 1px solid var(--line); }
.archive-item a {
    display: block;
    color: var(--ink);
    border-bottom: 0;
}
.archive-item a:hover h2 { color: var(--accent); }
.archive-item h2 {
    font-size: 26px;
    margin: 4px 0 6px;
    line-height: 1.22;
}
.archive-item .subtitle {
    color: var(--ink-soft);
    margin: 0 0 10px;
    font-size: 17px;
}
.archive-item .excerpt {
    color: var(--ink-soft);
    margin: 0 0 12px;
}
.archive-item .byline {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 12px;
    margin: 0;
}
.archive-meta {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11px;
    margin: 0 0 6px;
}

.archive-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0;
}

/* ---- Reading layout (case article, methodology, update) --------------- */

.case-article,
.methodology-article,
.update-article {
    max-width: 720px;
    margin: 0 auto;
}

.article-header { margin-bottom: 36px; }
.article-header h1 {
    font-size: 44px;
    line-height: 1.15;
    margin: 6px 0 14px;
    letter-spacing: -0.012em;
}
.article-header .dek {
    color: var(--ink-soft);
    font-size: 20px;
    line-height: 1.45;
    margin: 0 0 16px;
}
.article-header .byline {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
}
.article-header .byline a { color: var(--ink-soft); border-bottom: 0; }

/* ---- Case snapshot box ------------------------------------------------ */

.case-snapshot {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 3px;
    padding: 22px 26px;
    margin: 0 0 36px;
}
.case-snapshot header h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin: 0 0 12px;
}
.case-snapshot dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 18px;
    margin: 0;
    font-size: 15px;
}
.case-snapshot dt {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    align-self: baseline;
    padding-top: 2px;
}
.case-snapshot dd {
    margin: 0;
    color: var(--ink);
}

/* ---- Prose (rendered Markdown) ---------------------------------------- */

.prose {
    font-family: "Iowan Old Style", "Iowa", Georgia, "Times New Roman", serif;
    font-size: 19px;
    line-height: 1.7;
    color: var(--ink);
}
.prose p { margin: 0 0 1.1em; }
.prose h2 {
    font-size: 28px;
    margin: 1.6em 0 0.5em;
    letter-spacing: -0.005em;
}
.prose h3 {
    font-size: 22px;
    margin: 1.4em 0 0.4em;
}
.prose h4 {
    font-size: 18px;
    margin: 1.3em 0 0.3em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.prose a {
    color: var(--accent);
    border-bottom: 1px solid rgba(122,31,31,0.35);
}
.prose a:hover { border-bottom-color: var(--accent); }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.1em 1.2em; padding: 0; }
.prose li { margin: 0 0 0.4em; }
.prose blockquote {
    border-left: 3px solid var(--accent);
    margin: 1.2em 0;
    padding: 0.2em 0 0.2em 1.2em;
    color: var(--ink-soft);
    font-style: italic;
}
.prose hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2em auto;
    width: 60%;
}
.prose code {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 1px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
}
.prose pre {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 14px 16px;
    overflow: auto;
    font-size: 14px;
    line-height: 1.55;
}
.prose pre code {
    background: transparent;
    border: 0;
    padding: 0;
    font-size: inherit;
}

/* ---- Inline images + float/wrap classes ----------------------------- */

.prose img {
    max-width: 100%;
    height: auto;
    /* Treat images as block by default so a bare <img> sits on its own line. */
    display: block;
    margin: 1.2em auto;
}

.prose img.img-small   { width: 240px; max-width: 50%; }
.prose img.img-medium  { width: 420px; max-width: 70%; }
.prose img.img-large   { width: 100%; }

/* WordPress-style wrap: simple float + small margin. No per-paragraph
   clearfix so text flows across paragraphs. Sections that should break
   the wrap clear the float explicitly below. */
.prose img.img-left {
    float: left;
    display: inline;
    margin: 0.2em 16px 8px 0;
}
.prose img.img-right {
    float: right;
    display: inline;
    margin: 0.2em 0 8px 16px;
}
.prose img.img-center {
    display: block;
    margin: 1.4em auto;
    float: none;
}

/* Break wrap below the image for these block elements so a new section
   doesn't get pulled into the gutter. */
.prose h2,
.prose h3,
.prose h4,
.prose blockquote,
.prose hr,
.prose ol,
.prose ul { clear: both; }

/* On phones, floats fight the narrow column. Drop floats back to block
   so a small/medium image alongside text doesn't trample the content. */
@media (max-width: 640px) {
    .prose img.img-left,
    .prose img.img-right {
        float: none;
        display: block;
        margin: 1.2em auto;
        max-width: 100%;
    }
    .prose img.img-small  { width: auto; max-width: 70%; }
    .prose img.img-medium { width: auto; max-width: 90%; }
}

/* Markdown callout (> [!note] …) */
.prose .callout {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 3px;
    padding: 14px 18px;
    margin: 1.4em 0;
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-soft);
}
.prose .callout-warning { border-left-color: #b07a00; }
.prose .callout-info    { border-left-color: #1f4d7a; }

/* ---- YouTube video frame --------------------------------------------- */

.article-video { margin: 36px 0; }
.video-frame {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
}
.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---- Agency contact, updates, contact prompt ------------------------- */

.article-agency,
.article-contact-prompt,
.article-updates {
    margin: 40px 0;
    padding: 26px 28px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 4px;
}
.article-agency header h2,
.article-contact-prompt header h2,
.article-updates header h2 {
    font-size: 19px;
    margin: 0 0 12px;
}
.article-agency p,
.article-contact-prompt p {
    margin: 0 0 12px;
    color: var(--ink-soft);
}
.article-agency .kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 18px;
    margin: 12px 0 0;
}
.article-agency .kv dt {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding-top: 2px;
}
.article-agency .kv dd { margin: 0; }

.article-updates ul { list-style: none; padding: 0; margin: 0; }
.article-updates li {
    border-top: 1px dashed var(--line);
    padding: 14px 0;
}
.article-updates li:first-child { border-top: 0; }
.article-updates li a { color: var(--ink); border-bottom: 0; }
.article-updates li time {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.3px;
    font-size: 11.5px;
    display: block;
    margin-bottom: 2px;
}
.article-updates .excerpt { color: var(--ink-soft); margin: 4px 0 0; }

/* ---- Related cases ---------------------------------------------------- */

.related-cases {
    margin: 48px 0 0;
    border-top: 1px solid var(--line);
    padding-top: 28px;
}
.related-cases h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--muted);
    margin: 0 0 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
}
.related-cases ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.related-cases li a {
    display: block;
    color: var(--ink);
    border-bottom: 0;
}
.related-cases h3 {
    font-size: 18px;
    margin: 4px 0 4px;
    line-height: 1.25;
}
.related-cases p {
    color: var(--ink-soft);
    margin: 0;
    font-size: 14px;
}
.related-state {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 10.5px;
}

.article-footer {
    margin: 40px 0 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.3px;
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 760px) {
    .hero-title { font-size: 32px; }
    .hero-lede  { font-size: 17px; }
    .masthead-inner { flex-wrap: wrap; gap: 14px; }
    .primary-nav { order: 3; width: 100%; gap: 14px; flex-wrap: wrap; }
    .theme-toggle { order: 2; }
    .form input,
    .form textarea { font-size: 16px; }  /* keeps iOS from zooming */

    .article-header h1 { font-size: 32px; }
    .article-header .dek { font-size: 17px; }
    .prose { font-size: 17.5px; }
    .prose h2 { font-size: 23px; }
    .archive-header h1 { font-size: 30px; }
    .archive-item h2 { font-size: 22px; }
    .case-snapshot { padding: 18px 20px; }
    .case-snapshot dl { font-size: 14px; }
    .article-agency,
    .article-contact-prompt,
    .article-updates { padding: 20px 18px; }
}
