/* ============================================================
   Standalone report pages (/reports/*) — derived from
   static/css/style.css: same design tokens, font, buttons and
   table look, scoped to the report page/chrome classes.

   Only the standalone pages link this file. The dashboard's
   Report tab renders the same markup with the app's own rules
   (.report-tab in style.css) instead.
   ============================================================ */

/* ===== FONTS (same files as the app, absolute paths) ===== */

@font-face {
    font-family: "Public Sans";
    src: url("/css/publicsans-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Public Sans";
    src: url("/css/publicsans-latin-ext.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ===== TOKENS (subset of style.css :root) ===== */

:root {
    --clr-bg: #f1f3f7;
    --clr-surface: #ffffff;
    --clr-border: #c3cbda;
    --clr-text: #2a3042;
    --clr-text-muted: #5c6b88;
    --clr-text-inverse: #ffffff;
    --clr-accent: #1b3a85;
    --clr-accent-hover: #122a64;
    --clr-accent-light: #e8edf6;
    --clr-highlight: #d4952e;
    --clr-highlight-light: #fff3e0;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    --text-sm: 0.85rem;
    --text-base: 1rem;
    --text-lg: 1.25rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.75rem;

    --leading-normal: 1.45;
    --leading-loose: 1.6;

    --radius: 4px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --transition: 150ms ease;
}

/* ===== BASE ===== */

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

body.report-page {
    font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--clr-text);
    background: var(--clr-bg);
}

/* ===== PAGE CHROME ===== */

.report-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
}

.report-brand {
    font-weight: 800;
    font-size: var(--text-lg);
    color: var(--clr-accent);
    text-decoration: none;
}

.report-brand-tld {
    color: var(--clr-highlight);
}

.report-nav {
    display: flex;
    gap: var(--space-5);
}

.report-nav a {
    color: var(--clr-text-muted);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);
}

.report-nav a:hover {
    color: var(--clr-accent);
}

.report-main {
    max-width: 52rem;
    margin: 0 auto;
    padding: var(--space-6) var(--space-5) var(--space-8);
}

/* CTA above the fold of the report body (funnel entry point) */
.report-cta {
    margin: 0 0 var(--space-6);
    text-align: center;
}

/* mirror of style.css .btn-accent */
.btn-accent {
    display: inline-block;
    font-weight: 600;
    padding: var(--space-2) var(--space-4);
    border: 2px solid var(--clr-accent);
    border-radius: var(--radius);
    background: var(--clr-accent);
    color: var(--clr-text-inverse);
    text-decoration: none;
    transition: all var(--transition);
}

.btn-accent:hover {
    background: var(--clr-accent-hover);
    border-color: var(--clr-accent-hover);
}

/* ===== REPORT BODY (also lifted verbatim into the dashboard tab) ===== */

.report-body {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
    overflow-wrap: break-word;
    word-break: break-word;
}

.report-body h1 {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--clr-accent);
    margin: 0 0 var(--space-4);
    line-height: 1.2;
}

.report-body h2 {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--clr-accent);
    margin: var(--space-8) 0 var(--space-3);
}

.report-body h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    margin: var(--space-5) 0 var(--space-2);
}

.report-body p,
.report-body li {
    line-height: var(--leading-loose);
}

.report-body p {
    margin: 0 0 0.6em;
}

.report-body ul,
.report-body ol {
    padding-left: 1.3em;
    margin: 0.3em 0 0.8em;
}

.report-body li {
    padding: 0.15rem 0;
}

.report-body a {
    color: var(--clr-accent);
}

.report-body hr {
    border: none;
    border-top: 1px solid var(--clr-border);
    margin: var(--space-6) 0;
}

.report-body blockquote {
    border-left: 4px solid var(--clr-highlight);
    background: var(--clr-highlight-light);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-3) 0 var(--space-4);
}

.report-body blockquote p:last-child {
    margin-bottom: 0;
}

.report-body code {
    font-size: 0.85em;
}

.report-body table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-3) 0 var(--space-5);
    font-size: var(--text-sm);
}

.report-body th,
.report-body td {
    padding: var(--space-1) var(--space-2);
    border-bottom: 1px solid var(--clr-border);
    text-align: left;
}

.report-body thead th {
    border-bottom: 2px solid var(--clr-accent);
    color: var(--clr-accent);
}

.report-body tbody tr:nth-child(even) {
    background: #fafbfd; /* style.css's --clr-surface-alt */
}

.report-body tbody tr:hover {
    background: var(--clr-accent-light);
}

.report-body .report-meta {
    color: var(--clr-text-muted);
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--clr-border);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-5);
}

.report-body .report-footer {
    border-top: 1px solid var(--clr-border);
    margin-top: var(--space-6);
    padding-top: var(--space-3);
    color: var(--clr-text-muted);
    font-size: var(--text-sm);
}

/* ===== CATALOG (/reports/) ===== */

.catalog-chapter h2 {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--clr-accent);
    margin: var(--space-6) 0 var(--space-2);
}

.report-list {
    list-style: none;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: var(--space-3) var(--space-5);
}

.report-list li {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-2) 0;
}

.report-list li + li {
    border-top: 1px solid var(--clr-border);
}

.report-list a {
    color: var(--clr-accent);
    font-weight: 600;
    text-decoration: none;
}

.report-list a:hover {
    text-decoration: underline;
}

.report-list time {
    color: var(--clr-text-muted);
    font-size: var(--text-sm);
    white-space: nowrap;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 640px) {
    .report-main {
        padding: var(--space-4) var(--space-3);
    }
    .report-body {
        padding: var(--space-4);
    }
    .report-body h1 {
        font-size: var(--text-2xl);
    }
}

/* ===== PRINT (also what the PDF render uses) ===== */

@media print {
    body.report-page {
        background: #ffffff;
    }
    .report-topbar,
    .report-cta {
        display: none;
    }
    .report-main {
        max-width: none;
        padding: 0;
    }
    .report-body {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .report-body a {
        color: var(--clr-text);
        text-decoration: none;
    }
}
