/* Critical CSS - Inline for performance */
:root {
    --color-primary: #1a365d;
    --color-secondary: #2c5282;
    --color-accent: #8b5a3c;
    --color-text: #2d3748;
    --color-text-light: #4a5568;
    --color-bg: #ffffff;
    --color-bg-alt: #f7fafc;
    --color-border: #e2e8f0;
    --font-serif: Charter, Georgia, Cambria, "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --max-width: 1200px;
    --article-width: 720px;
}

/* Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-serif);
    color: var(--color-text);
    background: var(--color-bg);
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.75;
}

a {
    color: var(--color-secondary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--color-primary);
}

blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    border-left: 4px solid var(--color-accent);
    background: var(--color-bg-alt);
    font-style: italic;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.article-container {
    max-width: var(--article-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav {
    padding: 1rem 0;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-sans);
    color: var(--color-primary);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    margin: 4px 0;
    transition: 0.3s;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--color-text);
    text-decoration: none;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: var(--color-primary);
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-light);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.amendment-text-card {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
}

.amendment-text-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.amendment-text {
    font-size: 1.25rem;
    line-height: 1.75;
    color: var(--color-primary);
    border-left: none;
    background: none;
    padding: 0;
    text-align: center;
}

.amendment-citation {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-top: 1rem;
}

/* Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-secondary);
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: white;
}

/* Section Grid */
.home-sections {
    padding: 4rem 0;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.section-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.section-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.section-card h3 {
    margin-bottom: 0.75rem;
}

.section-card h3 a {
    text-decoration: none;
    color: var(--color-primary);
}

.card-links {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.card-links li {
    padding: 0.25rem 0;
}

.card-links a {
    font-size: 0.95rem;
}

/* Recent Updates */
.recent-updates {
    background: var(--color-bg-alt);
    padding: 3rem 0;
}

.updates-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.updates-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.updates-list time {
    display: inline-block;
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-right: 1rem;
    min-width: 120px;
}

/* Methodology Note */
.methodology-note {
    padding: 3rem 0;
    text-align: center;
}

.methodology-note p {
    max-width: 720px;
    margin: 1rem auto;
}

/* Footer */
.site-footer {
    background: var(--color-primary);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: white;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    padding: 0.25rem 0;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

.contact-email {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.footer-note {
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.9;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 0.9rem;
}

.footer-bottom a {
    color: white;
}

/* Article Pages */
.article-header {
    padding: 2rem 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 2rem;
}

.article-title {
    margin-bottom: 0.5rem;
}

.article-meta {
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-family: var(--font-sans);
}

.article-content {
    font-size: 1.125rem;
}

.article-content h2,
.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Table of Contents */
.toc {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.toc h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc li {
    padding: 0.25rem 0;
}

.toc a {
    text-decoration: none;
}

/* Citations */
.citation {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-style: italic;
}

.citation-block {
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-accent);
    padding: 1rem;
    margin: 1rem 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-bg-alt);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 1rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .section-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .amendment-text {
        font-size: 1.1rem;
    }
}

/* Print Styles */
@media print {
    * {
        background: white !important;
        color: black !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .site-header,
    .site-footer,
    .nav-toggle,
    .cta-buttons {
        display: none !important;
    }

    .article-content {
        max-width: 100%;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    blockquote {
        border: 1px solid #000;
        page-break-inside: avoid;
    }

    a {
        text-decoration: none;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }

    .amendment-text-card {
        border: 2px solid black;
        page-break-inside: avoid;
    }
}

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

:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Loading optimization */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}