/* static/css/main.css */
@import url("variables.e2e5228d5c45.css");

/* =========================================
 * 1. RESET & BASE
 * ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osk-font-smoothing: grayscale;
    scroll-padding-top: var(--sticky-offset);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    letter-spacing: 0.05em;
}

/* =========================================
 * 2. UTILITIES
 * ========================================= */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: var(--container-wide-max); margin: 0 auto; }

.skip-link {
    position: absolute; left: -9999px; z-index: 9999;
}
.skip-link:focus {
    left: 0; top: 0; background: var(--accent); color: white;
    padding: 0.5rem 1rem; border-radius: var(--radius);
}

/* =========================================
 * 3. TYPOGRAPHY & LINKS
 * ========================================= */
a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover {
    color: var(--accent-hover);
    text-decoration-thickness: 2px;
    text-decoration-color: var(--accent-hover);
}
a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-primary);
}
h1 { font-size: var(--fs-h1); letter-spacing: 0.02em; }
h2 { font-size: var(--fs-h2); letter-spacing: 0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

/* Code */
p code, li code, blockquote code {
    background: var(--bg-secondary);
    color: #93c5fd;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    border: 1px solid #475569;
    vertical-align: middle;
}

pre {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}
pre code { background: transparent; padding: 0; }

/* =========================================
 * 4. COMPONENTS
 * ========================================= */
/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: var(--header-height);
    transition: min-height 0.3s ease;
}
.header-center { display: flex; justify-content: center; }

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

.nav-brand {
    display: flex; align-items: center; gap: 0.75rem;
    text-decoration: none; color: inherit; font-weight: bold; font-size: 1.25rem;
}
.nav-brand img { max-width: 40px; height: auto; display: block; }

.nav-links {
    display: flex; gap: 2rem; list-style: none; align-items: center;
}
.nav-links a {
    color: var(--text-nav); font-size: 0.9375rem; text-decoration: none;
    border-bottom: 2px solid transparent; transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--accent); border-bottom-color: var(--accent);
}
.nav-links a.active { font-weight: 600; }

/* Breadcrumb */
.breadcrumb {
    position: sticky; top: calc(var(--header-height)); z-index: 90;
    background-color: var(--bg-primary); padding: 0.5rem 0; margin-bottom: 2rem;
    font-size: 0.875rem; color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb span[aria-current="page"] { color: var(--text-primary); font-weight: 500; }
.breadcrumb-separator { margin: 0 0.5rem; color: var(--border); }

/* Card & Content (New Utility Classes) */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.2rem 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.card-title { font-size: 1.25rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.card-title a { color: var(--text-secondary); text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-meta { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Content Area (Replaces markdown-content) */
.content { line-height: 1.7; color: var(--text-secondary); }
.content h1, .content h2, .content h3 { margin-top: 2rem; margin-bottom: 1rem; color: var(--text-primary); }
.content p { margin-bottom: 1.25rem; }
.content ul, .content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.content li { margin-bottom: 0.5rem; }
.content blockquote {
    border-left: 3px solid var(--accent); padding-left: 1rem; margin: 1rem 0;
    color: var(--text-muted); font-style: italic;
}

/* Actions (Replaces article-actions) */
.actions { display: flex; gap: 1rem; flex-wrap: wrap; margin: 2rem 0; }

/* Buttons */
.btn {
    display: inline-block; padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary); color: var(--text-secondary);
    text-decoration: none; border-radius: var(--radius);
    font-weight: 500; transition: all 0.2s ease; cursor: pointer;
    border: 1px solid transparent;
}
.btn:hover { color: var(--accent); border-color: var(--accent); }

.btn-outline {
    background: transparent; border: 1px solid var(--border); color: var(--text-primary);
}
.btn-outline:hover { color: var(--accent); border-color: var(--accent); }

/* Project Specifics */
.project-meta { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.5rem; }
.project-meta strong { color: var(--text-secondary); }

.project-featured-image {
    width: 100%; height: auto; border-radius: var(--radius);
    margin-bottom: 2rem; box-shadow: var(--shadow); display: block;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 2rem; }

.tag-badge {
    background-color: var(--bg-tertiary); color: var(--text-secondary);
    padding: 0.25rem 0.75rem; border-radius: 4px; font-size: 0.8rem;
    font-weight: 500; border: 1px solid var(--border);
}
.tag-badge:hover { background-color: var(--accent); color: white; border-color: var(--accent); }

/* Pagination */
.page-navigation {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); gap: 1rem;
}
.page-nav-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.625rem 1.25rem; background-color: transparent;
    border: 1px solid var(--border); color: var(--text-secondary);
    border-radius: var(--radius); text-decoration: none; font-weight: 500;
    transition: all 0.2s ease;
}
.page-nav-btn:hover {
    background-color: var(--bg-tertiary); color: var(--text-primary);
    border-color: var(--accent); transform: translateY(-1px);
}
.page-nav-btn.disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; }

.project-pages-section h2 { margin-bottom: 1rem; font-size: 1.5rem; }
.project-pages-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem;
}
.project-pages-list li {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-pages-list li:hover {
    transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent);
}
.project-pages-list a { color: var(--text-primary); text-decoration: none; font-weight: 500; display: block; }
.project-pages-list a:hover { color: var(--accent); }

/* =========================================
 * 5. TABLES
 * ========================================= */
.content table {
    width: auto; min-width: 300px; margin: 1rem 0;
    border-collapse: separate; border-spacing: 0; margin-bottom: 1.5rem;
    font-size: 0.95rem; background-color: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.content th, .content td {
    padding: 0.75rem 1rem; text-align: left;
    border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
    overflow-wrap: break-word;
}
.content th {
    background-color: var(--bg-tertiary); color: var(--text-primary);
    font-weight: 600; text-transform: uppercase; font-size: 0.85rem;
    letter-spacing: 0.05em; border-bottom: 2px solid var(--border);
}
.content tr:last-child td { border-bottom: none; }
.content tr:hover { background-color: rgba(96, 165, 250, 0.05); }
.content th:last-child, .content td:last-child { border-right: none; }

.homepage-intro .content table {
    margin-left: auto; /* Dwingt de tabel naar rechts */
    margin-right: 0;
}

/* =========================================
 * 6. FOOTER
 * ========================================= */
footer {
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem 0; margin-top: 1rem;
    text-align: center; font-size: 0.875rem; color: var(--text-secondary);
}
.footer-content {
    display: flex; flex-wrap: wrap; justify-content: space-between;
    align-items: center; gap: 1.5rem;
}
.copyright { color: var(--text-secondary); font-size: 0.875rem; text-align: right; line-height: 1.5; }
.copyright p { margin-bottom: 0; }
.copyright p:last-child { margin-top: 0.25rem; }
.license { font-size: 0.8rem; margin-top: 0.25rem; }
.license svg { width: 16px; height: 16px; fill: currentColor; vertical-align: middle; margin-right: 0.25rem; }
.copyright .license a { color: var(--text-primary); font-weight: 500; text-decoration: none; }
.copyright .license a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.contact-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.contact-item { display: flex; align-items: center; gap: 0.5rem; }
.contact-item a {
    color: var(--text-secondary); text-decoration: none; font-weight: 500;
    font-size: 0.875rem; transition: color 0.2s ease, transform 0.2s ease;
    display: inline-flex; align-items: center;
}
.contact-item a:hover { color: var(--accent); transform: translateY(-1px); }
.contact-item svg { width: 16px; height: 16px; fill: currentColor; vertical-align: middle; margin-right: 0.25rem; display: inline-block; }

.separator {
    position: relative; padding-left: 1rem; margin-left: 0.75rem;
}
.separator::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 1px; height: 1.2em; background-color: var(--border);
}

/* =========================================
 * 7. RESPONSIVE
 * ========================================= */
@media (max-width: 768px) {
    header { padding: 0.75rem 0; min-height: var(--header-height-mobile); border-radius: 0; }
    .nav { padding: 0 1rem; }
    .nav-brand { font-size: 1.1rem; }
    .nav-links { gap: 1rem; font-size: 0.85rem; }
    .breadcrumb { top: calc(var(--header-height-mobile) + 0rem); padding: 0.25rem 0; font-size: 0.8rem; white-space: nowrap; overflow-x: auto; }
    @media (max-width: 360px) { .breadcrumb-separator { display: none; } .breadcrumb { white-space: normal; } }
    .container { padding: 0 1rem; }
    h1 { font-size: 2rem; } h2 { font-size: 1.5rem; }
    .actions { flex-direction: column; gap: 0.75rem; }
    .page-navigation { flex-direction: column-reverse; align-items: stretch; }
    .page-nav-btn { width: 100%; justify-content: center; }
    .project-pages-list { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; text-align: center; gap: 1rem; }
    .contact-info { flex-direction: column; gap: 0.75rem; }
    .separator { display: none; }
    .contact-item { flex-direction: row; justify-content: center; }
    .copyright { text-align: center; }
    .content table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =========================================
 * 8. SYNTAX HIGHLIGHTING
 * ========================================= */
.codehilite {
    background: var(--bg-secondary) !important; border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important; padding: 1rem !important;
    margin-bottom: 1.5rem !important; overflow-x: auto !important; position: relative;
}
.codehilite pre { background: transparent !important; margin: 0 !important; padding: 0 !important; border: none !important; font-family: var(--font-mono) !important; font-size: 0.9em !important; line-height: 1.5 !important; }
.codehilite code { background: transparent !important; padding: 0 !important; font-family: var(--font-mono) !important; font-size: 0.9em !important; color: var(--text-primary) !important; }
.codehilite pre code { white-space: pre; word-wrap: normal; }

/* Syntax Colors */
.codehilite .c, .codehilite .c1, .codehilite .cm, .codehilite .cs, .codehilite .ch { color: #a0aec0 !important; font-style: italic; }
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sb, .codehilite .sc, .codehilite .sd, .codehilite .se, .codehilite .sh, .codehilite .si, .codehilite .sx, .codehilite .sr, .codehilite .ss { color: #9ae6b4 !important; }
.codehilite .k, .codehilite .kd, .codehilite .kn, .codehilite .kp, .codehilite .kr, .codehilite .kt { color: #f687b3 !important; font-weight: 600; }
.codehilite .nf, .codehilite .nn, .codehilite .nc, .codehilite .nd { color: #63b3ed !important; font-weight: 600; }
.codehilite .nv, .codehilite .vc, .codehilite .vg, .codehilite .vi, .codehilite .vm { color: #fbd38d !important; }
.codehilite .o, .codehilite .ow { color: #f6ad55 !important; font-weight: 600; }
.codehilite .m, .codehilite .mi, .codehilite .mf, .codehilite .mh, .codehilite .mo, .codehilite .il { color: #9f7aea !important; }
.codehilite .nb, .codehilite .bp { color: #68d391 !important; font-weight: 600; }
.codehilite .ne { color: #fc8181 !important; font-weight: 600; }
.codehilite .gh, .codehilite .gu { color: #b794f4 !important; font-weight: 600; }
.codehilite .gd { color: #fc8181 !important; background-color: rgba(252, 129, 129, 0.15) !important; }
.codehilite .gi { color: #68d391 !important; background-color: rgba(104, 211, 145, 0.15) !important; }

/* Homepage Page Grid */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.homepage-pages h2 {
    margin-bottom: 1.5rem;
}

/* Responsive aanpassing */
@media (max-width: 768px) {
    .page-grid { grid-template-columns: 1fr; }
    .actions .btn,
    .homepage-pages .btn {
        width: auto;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .actions .btn:last-child,
    .homepage-pages .btn:last-child {
        margin-bottom: 0;
    }

    /* 2. Tables: restore right border on mobile */
    .content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
        border: 1px solid var(--border);
    }

    .content th,
    .content td {
        border-right: 1px solid var(--border) !important;
        white-space: nowrap; /* prevents text wrapping that collapses column widths */
    }

    .content th:last-child,
    .content td:last-child {
        border-right: 1px solid var(--border) !important;
    }
}
