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

/* ===== Variables ===== */
:root {
    --bg: #ffffff;
    --bg-alt: #f8f8f8;
    --bg-code: #f4f4f4;
    --text: #1a1a1a;
    --text-secondary: #444444;
    --text-muted: #666666;
    --accent: #1a1a1a;
    --border: #e0e0e0;
    --border-dark: #cccccc;
    --warning-bg: #fffbeb;
    --warning-border: #d4a012;
    --danger-bg: #fef2f2;
    --danger-border: #dc2626;
    --link: #0055aa;
    --link-hover: #003366;
}

/* ===== Typography ===== */
html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text);
}

h2 {
    font-size: 2.1rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.15rem;
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

strong {
    font-weight: 600;
    color: var(--text);
}

em {
    font-style: italic;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

/* ===== Layout ===== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.site-header .container-wide {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.site-title {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.site-title a {
    color: var(--text);
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.site-nav a {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.site-nav a:hover {
    color: var(--text);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 4px;
}

/* ===== Sections ===== */
.section {
    padding: 3.5rem 0;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 2rem;
}

.divider {
    max-width: 800px;
    margin: 0 auto;
}

.lead {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ===== Two Column Layout ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}

.col h4 {
    margin-top: 0;
}

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

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

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

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

.timeline-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.timeline-content h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    margin-bottom: 0;
}

/* ===== Entry ===== */
.entry {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.entry:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.entry h4 {
    margin-top: 0;
    font-size: 1.35rem;
}

.entry .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-style: italic;
}

.link-out {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.link-out a {
    color: var(--text-muted);
}

.link-out a:hover {
    color: var(--link);
}

/* ===== Controversial Entry ===== */
.entry-controversial {
    background: var(--danger-bg);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--danger-border);
    border-radius: 4px;
}

.entry-controversial h4 {
    color: #991b1b;
}

.entry-controversial .meta {
    color: #b91c1c;
}

/* ===== Boxes ===== */
.warning-box {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.warning-box p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #92400e;
}

/* ===== Symbol Grid ===== */
.symbol-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.symbol-item {
    padding: 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.symbol-item h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.symbol-item p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* ===== Table ===== */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

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

th {
    font-weight: 600;
    color: var(--text);
    background: var(--bg-alt);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    color: var(--text-secondary);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: var(--bg-alt);
}

/* ===== FAQ ===== */
.faq-list {
    margin: 1.5rem 0;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    padding: 1rem 0;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    color: var(--text);
    font-size: 1rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: '+ ';
    font-weight: 400;
    color: var(--text-muted);
}

.faq-item[open] summary::before {
    content: '− ';
}

.faq-item p {
    padding-bottom: 1rem;
    font-size: 0.95rem;
}

/* ===== Contact Form ===== */
.contact-form {
    max-width: 600px;
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--text);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input {
    width: auto;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
}

.btn-submit {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--bg);
    background: var(--text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-submit:hover {
    background: #333;
}

.form-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-success {
    padding: 1.5rem;
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 4px;
    margin: 2rem 0;
}

.form-success p {
    margin: 0;
    color: #065f46;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 2rem;
    background: var(--bg-alt);
}

.site-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-footer .copyright {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 0.8rem;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 900px) {
    .site-nav {
        gap: 0.4rem 1rem;
    }
    
    .site-nav a {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
        margin-top: 0.75rem;
    }
    
    .site-nav.active {
        display: flex;
    }
    
    .site-nav a {
        padding: 0.6rem 0;
        font-size: 0.9rem;
        border-bottom: 1px solid var(--border);
    }
    
    .site-nav a:last-child {
        border-bottom: none;
    }
    
    .section {
        padding: 2.5rem 0;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    .two-col {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .symbol-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-item {
        padding-left: 1rem;
    }
    
    .timeline-item::before {
        left: -1.5rem;
    }
    
    .entry-controversial {
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    th, td {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .site-header {
        position: static;
    }
    
    .site-nav, .nav-toggle {
        display: none;
    }
    
    .entry-controversial {
        border: 2px solid #000;
        background: #fff;
    }
    
    .contact-form {
        display: none;
    }
}
