/* ============================================
   THE PAXTON RECORD — Design System
   Editorial / Investigative Journalism Aesthetic
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Source+Serif+4:wght@400;600&family=JetBrains+Mono:wght@400;600&display=swap');

/* --- Custom Properties --- */
:root {
    --ink: #1a1a1a;
    --paper: #f5f0e8;
    --cream: #ebe4d6;
    --red: #b91c1c;
    --red-dark: #7f1d1d;
    --gold: #c9a84c;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --border: #d1cbc0;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --max-width: 900px;
    --nav-height: 48px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    color: var(--ink);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--red);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--red-dark);
}

/* --- Animation --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeUp 0.6s ease both;
}

.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.2s; }
.fade-in:nth-child(4) { animation-delay: 0.3s; }
.fade-in:nth-child(5) { animation-delay: 0.4s; }
.fade-in:nth-child(6) { animation-delay: 0.5s; }

/* --- Top Bar --- */
.top-bar {
    background: var(--ink);
    color: var(--gray-400);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-align: center;
    padding: 0.5rem 1rem;
    letter-spacing: 0.05em;
}

/* --- Masthead --- */
.masthead {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    border-bottom: 4px double var(--ink);
}

.site-subtitle {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.site-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.site-title span {
    color: var(--red);
}

.masthead .page-descriptor {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}

/* --- Sticky Navigation --- */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: var(--nav-height);
    align-items: center;
    padding: 0 0.5rem;
}

nav::-webkit-scrollbar {
    display: none;
}

nav a {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--gray-700);
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

nav a:hover {
    color: var(--red);
    border-bottom-color: var(--red);
}

nav a.active {
    color: var(--red);
    border-bottom-color: var(--red);
    font-weight: 600;
}

/* --- Main Content --- */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.6rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 4px double var(--ink);
}

h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.05rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1.25rem;
    color: var(--gray-700);
}

blockquote {
    border-left: 4px solid var(--red);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--cream);
    font-style: italic;
    color: var(--gray-600);
}

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

ul, ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: var(--gray-700);
}

li {
    margin-bottom: 0.4rem;
}

/* --- Hero Section (Homepage) --- */
.hero {
    background: var(--ink);
    color: #fff;
    padding: 3rem 1.25rem;
    margin: -2rem -1.25rem 2.5rem;
    text-align: center;
}

.hero h1 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero .subtitle {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--gray-400);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.stat-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 1.25rem 1rem;
    border-radius: 2px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--red);
    line-height: 1;
    margin-bottom: 0.35rem;
    display: block;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gray-400);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.3;
}

/* --- Section Labels --- */
.section-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 0.5rem;
    display: block;
}

/* --- Cards Grid --- */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 1.5rem 0 2.5rem;
}

.card {
    background: #fff;
    border-left: 4px solid var(--red);
    padding: 1.5rem;
    border-radius: 0 2px 2px 0;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.card h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.card h3 a {
    color: var(--ink);
}

.card h3 a:hover {
    color: var(--red);
}

.card p {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.card .card-meta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Severity Badges --- */
.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    vertical-align: middle;
}

.badge-criminal {
    background: var(--red);
    color: #fff;
}

.badge-ethics {
    background: var(--gold);
    color: var(--ink);
}

.badge-political {
    background: var(--gray-400);
    color: #fff;
}

/* --- Source Tags --- */
.source-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gray-600);
    border: 1px solid var(--border);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    white-space: nowrap;
    display: inline-block;
    margin: 0.15rem 0.1rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}

a.source-tag:hover {
    border-color: var(--red);
    color: var(--red);
}

/* --- Timeline --- */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-year {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--red);
    margin: 2.5rem 0 1rem;
    position: relative;
}

.timeline-year:first-child {
    margin-top: 0;
}

.timeline-year::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--red);
    border: 2px solid var(--paper);
}

.timeline-item {
    position: relative;
    padding: 1rem 0 1.5rem;
    border-bottom: 1px dashed var(--border);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 1.35rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cream);
    border: 2px solid var(--border);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
    display: block;
}

.timeline-item h3 {
    font-size: 1rem;
    margin: 0.25rem 0 0.4rem;
}

.timeline-item p {
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
}

/* --- Recent Developments --- */
.dev-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.dev-item:last-child {
    border-bottom: none;
}

.dev-date {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}

.dev-item h3 {
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.dev-item p {
    font-size: 0.92rem;
    margin-bottom: 0;
}

/* --- Document Library --- */
.doc-category {
    margin: 2rem 0;
}

.doc-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.doc-item:last-child {
    border-bottom: none;
}

.doc-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.doc-meta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gray-600);
    margin-bottom: 0.35rem;
}

.doc-desc {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: 0;
}

/* --- Article / Long-form Content --- */
.article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.article-header h1 {
    margin-bottom: 0.5rem;
}

.article-header .article-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gray-600);
    letter-spacing: 0.03em;
}

.article-body p {
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-body h2 {
    margin-top: 2.5rem;
}

.article-body h3 {
    margin-top: 2rem;
}

.key-fact {
    background: var(--cream);
    border-left: 4px solid var(--red);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.key-fact .fact-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--red);
    margin-bottom: 0.35rem;
    display: block;
}

.big-number {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 3rem;
    color: var(--red);
    line-height: 1;
    display: block;
    margin: 0.5rem 0;
}

/* --- FAQ Section --- */
.faq-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--ink);
}

.faq-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--cream);
    border-left: 4px solid var(--red);
}

.faq-item h3 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--ink);
}

.faq-item p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- Related Pages / Internal Links --- */
.related-pages {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 4px double var(--ink);
}

.related-pages h2 {
    border-bottom: none;
    margin-top: 0;
    font-size: 1.2rem;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.related-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--gray-700);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.related-link:hover {
    border-color: var(--red);
    color: var(--red);
}

/* --- Footer --- */
footer {
    background: var(--ink);
    color: var(--gray-400);
    padding: 2.5rem 1.25rem;
    margin-top: 4rem;
    text-align: center;
}

footer .footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
}

.footer-nav a {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gray-400);
    letter-spacing: 0.03em;
}

.footer-nav a:hover {
    color: #fff;
}

.footer-disclaimer {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    line-height: 1.6;
    color: var(--gray-400);
    max-width: 700px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-copyright {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--gray-400);
    margin-top: 1rem;
}

/* --- Utility --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

.text-center { text-align: center; }

/* --- SEO Content Section --- */
.seo-content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 4px double var(--ink);
}

.seo-content h2 {
    border-bottom: none;
    margin-top: 0;
}

.seo-content p {
    font-size: 1rem;
}

/* --- Impeachment Articles List --- */
.articles-list {
    counter-reset: article-counter;
    list-style: none;
    padding-left: 0;
}

.articles-list li {
    counter-increment: article-counter;
    padding: 0.75rem 0 0.75rem 3rem;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.articles-list li::before {
    content: counter(article-counter);
    position: absolute;
    left: 0;
    top: 0.75rem;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--red);
    width: 2rem;
    text-align: center;
}

/* --- 404 Page --- */
.error-page {
    text-align: center;
    padding: 4rem 1.25rem;
}

.error-page .error-code {
    font-family: var(--font-display);
    font-size: 6rem;
    font-weight: 900;
    color: var(--red);
    line-height: 1;
    margin-bottom: 1rem;
}

/* --- About Page --- */
.about-section {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.about-section:last-of-type {
    border-bottom: none;
}

/* --- Responsive: Tablet+ --- */
@media (min-width: 640px) {
    .site-title {
        font-size: 3.5rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    main {
        padding: 3rem 2rem 5rem;
    }

    .hero {
        padding: 4rem 2rem;
        margin: -3rem -2rem 3rem;
    }
}

/* --- Responsive: Desktop --- */
@media (min-width: 1024px) {
    .site-title {
        font-size: 4rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    nav {
        justify-content: center;
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    main {
        padding: 3rem 1.25rem 5rem;
    }

    .hero {
        margin: -3rem calc(-50vw + var(--max-width) / 2) 3rem;
        padding: 4rem 2rem;
    }
}

/* --- Mobile Touch Targets & Accessibility Fixes --- */

/* Increase nav link touch targets to 44px minimum */
nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* Source tags: increase tap area */
.source-tag {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
}

/* Footer text: bump minimum readable size */
.footer-disclaimer,
.footer-copyright {
    font-size: 0.7rem;
}

/* Overflow protection for long content */
.article-body,
.timeline-item p,
main {
    overflow-wrap: break-word;
    word-break: break-word;
}

pre, code {
    overflow-x: auto;
    max-width: 100%;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* --- Small Screens (under 640px) --- */
@media (max-width: 639px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .big-number {
        font-size: 2.25rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Ensure badges are readable */
    .badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.65rem;
    }

    /* Tighter main padding on small phones */
    main {
        padding: 1.5rem 1rem 3rem;
    }

    .hero {
        padding: 2rem 1rem;
        margin: -1.5rem -1rem 2rem;
    }

    /* Blockquote tighter on mobile */
    blockquote {
        padding: 0.75rem 1rem;
    }

    /* Related links wrap better */
    .related-links {
        gap: 0.5rem;
    }

    .related-link {
        font-size: 0.7rem;
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* --- Very Small Screens (under 380px) --- */
@media (max-width: 379px) {
    .site-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
    }

    .stat-number {
        font-size: 2.25rem;
        margin-bottom: 0;
    }

    .stat-label {
        text-align: left;
    }

    nav a {
        padding: 0.5rem 0.6rem;
        font-size: 0.65rem;
    }
}

/* --- Print --- */
@media print {
    nav, .top-bar { display: none; }
    body { background: #fff; }
    main { max-width: 100%; }
    a { color: var(--ink); }
    .hero { background: #fff; color: var(--ink); }
    .hero h1 { color: var(--ink); }
    .stat-number { color: var(--ink); }
}
