/* SIL Website Styles - Clean, minimal, professional */

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

body {
    background: #fafafa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: #333;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    background: white;
    padding: 60px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-top: 20px;
    margin-bottom: 40px;
}

/* Navigation */
.nav-bar {
    background: #111;
    padding: 16px 0;
    text-align: center;
}

.nav-bar a {
    color: #fff;
    text-decoration: none;
    margin: 0 20px;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-bar a:hover,
.nav-bar a.active {
    color: #4CAF50;
}

/* Headers */
.page-header {
    margin-bottom: 56px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e5e5e5;
}

h1 {
    font-size: 36px;
    font-weight: 600;
    color: #111;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    color: #111;
    margin: 40px 0 20px 0;
    letter-spacing: -0.01em;
    padding-bottom: 12px;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, #999 0%, #ccc 100%);
    border-radius: 2px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin: 32px 0 12px 0;
}

h3 a {
    color: #111;
    text-decoration: none;
    border-bottom: 2px solid #e5e5e5;
    transition: border-color 0.2s;
}

h3 a:hover {
    border-bottom-color: #999;
}

.subtitle {
    font-size: 13px;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.date {
    font-size: 14px;
    color: #999;
    margin-top: 8px;
}

.intro {
    font-size: 17px;
    color: #444;
    margin-top: 24px;
    line-height: 1.8;
}

/* Content */
p {
    margin-bottom: 16px;
    font-size: 16px;
    color: #333;
}

ul, ol {
    margin: 16px 0 20px 0;
    padding-left: 24px;
}

li {
    margin-bottom: 8px;
    font-size: 16px;
    color: #444;
}

/* Layer Sections */
.layer-section {
    margin: 60px 0;
}

.layer-section:first-of-type {
    margin-top: 0;
}

.layer-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #111;
}

.layer-number {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.layer-header h2 {
    margin: 0;
    padding: 0;
}

.layer-header h2::after {
    display: none;
}

.layer-projects {
    display: grid;
    gap: 32px;
}

/* Projects */
.project {
    padding: 24px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
}

.project:hover {
    border-color: #ccc;
    background: #fff;
}

.meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    font-weight: 500;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

/* Maturity status badges */
.meta-badge.production {
    background: #e8f5e9;
    color: #2e7d32;
}

.meta-badge.research {
    background: #e3f2fd;
    color: #1565c0;
}

.meta-badge.alpha {
    background: #fff3e0;
    color: #e65100;
}

.meta-badge.specification {
    background: #f3e5f5;
    color: #6a1b9a;
}

.meta-badge.planned {
    background: #f5f5f5;
    color: #757575;
}

.meta-badge.private {
    background: #ffebee;
    color: #c62828;
}

.meta-badge.pypi {
    background: #e1f5fe;
    color: #01579b;
}

/* Maturity note */
.maturity-note {
    display: block;
    font-size: 14px;
    font-style: italic;
    color: #666;
    margin-bottom: 12px;
}

.links {
    margin-top: 16px;
}

.links a {
    display: inline-block;
    margin-right: 16px;
    color: #0066cc;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.links a:hover {
    border-bottom-color: #0066cc;
}

/* Code blocks */
pre {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0 24px 0;
    font-size: 14px;
    line-height: 1.5;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
}

code {
    background: #f0f0f0;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    color: #24292e;
}

/* Mermaid diagrams */
.mermaid {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 24px;
    margin: 24px 0;
    text-align: center;
}

/* Architecture diagram */
.architecture {
    background: #f8f8f8;
    padding: 16px 24px 20px 24px;
    border-radius: 4px;
    margin: 32px 0 64px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre;
}

.architecture-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 12px 24px;
    background: #111;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    margin-right: 16px;
    transition: background 0.2s;
}

.button:hover {
    background: #333;
}

.button.secondary {
    background: #f0f0f0;
    color: #333;
}

.button.secondary:hover {
    background: #e0e0e0;
}

.cta {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

/* Layout with Sidebar */
.layout {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    gap: 0;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #f8f8f8;
    padding: 40px 32px;
    min-height: calc(100vh - 200px);
    border-right: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.sidebar h3 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 20px 0;
}

.sidebar h3.sidebar-section-header {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e0e0e0;
}

/* Sidebar standalone links */
.sidebar-links {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar .sidebar-links a {
    display: block;
    padding: 12px 14px;
    color: #555 !important;
    text-decoration: none !important;
    font-size: 15px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.sidebar .sidebar-links a:hover {
    background: #e8e8e8;
    color: #111 !important;
}

.sidebar .sidebar-links a.active {
    background: #111;
    color: #fff !important;
    font-weight: 500;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-nav a {
    display: block;
    padding: 12px 14px;
    color: #444;
    text-decoration: none;
    font-size: 15px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 6px;
}

.sidebar-nav a:hover {
    background: #e8e8e8;
    color: #111;
}

.sidebar-nav a.active {
    background: #111;
    color: #fff;
    font-weight: 500;
}

/* Main content */
main.with-sidebar {
    flex: 1;
}

main.full-width {
    width: 100%;
}

main.with-sidebar .container {
    margin-top: 40px;
    margin-left: 40px;
    margin-right: 40px;
    box-shadow: none;
    border-radius: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

/* Tiered Document Organization */
.tier-section {
    margin-bottom: 60px;
}

.tier-header {
    margin-bottom: 30px;
}

.tier-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.tier-description {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Tier 1: Founding Documents - Large prominent cards */
.tier-1-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 20px;
}

.tier-1-card {
    background: #fff;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 24px;
    position: relative;
    transition: all 0.2s ease;
}

.tier-1-card:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
    transform: translateY(-2px);
}

.tier-1-card .doc-number {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.tier-1-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    padding-right: 50px;
}

.tier-1-card h3 a {
    color: #1a1a1a;
    text-decoration: none;
}

.tier-1-card h3 a:hover {
    color: #28a745;
}

.tier-1-card .doc-description {
    color: #444;
    margin-bottom: 12px;
    line-height: 1.5;
}

.tier-1-card .doc-meta {
    color: #888;
    font-size: 14px;
    margin: 0;
}

/* Tier 2: Architecture - Medium cards */
.tier-2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.tier-2-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    transition: all 0.2s ease;
}

.tier-2-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #0066cc;
}

.tier-2-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.tier-2-card h3 a {
    color: #1a1a1a;
    text-decoration: none;
}

.tier-2-card h3 a:hover {
    color: #0066cc;
}

.tier-2-card .doc-description {
    color: #555;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.tier-2-card .doc-meta {
    color: #888;
    font-size: 13px;
    margin: 0;
}

/* Tier 3: Research - Compact grouped list */
.tier-3-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.research-group {
    background: #fafafa;
    border-left: 3px solid #666;
    padding: 20px 24px;
    border-radius: 4px;
}

.research-group-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 16px;
    font-weight: 600;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.doc-item h4 {
    font-size: 16px;
    margin-bottom: 6px;
    font-weight: 500;
}

.doc-item h4 a {
    color: #1a1a1a;
    text-decoration: none;
}

.doc-item h4 a:hover {
    color: #0066cc;
    text-decoration: underline;
}

.doc-item .doc-description {
    color: #666;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.doc-item .doc-meta {
    color: #999;
    font-size: 12px;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding: 24px;
    }

    .container {
        padding: 40px 30px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
        box-shadow: none;
    }

    h1 {
        font-size: 24px;
    }

    .architecture {
        font-size: 12px;
        padding: 16px;
    }

    .nav-bar a {
        margin: 0 10px;
        font-size: 14px;
    }
}
