/* =========================================
   1. VARIABLES & CONFIGURATION
   ========================================= */
:root {
    /* --- Basiskleuren (Light Mode Defaults) --- */
    --main-color: var(--bs-danger); 
    --main-color-light: #ff9f8a;    
    
    /* Tekst & Achtergrond */
    --bg-body: #ffffff;             /* Nieuw: expliciete body kleur */
    --bg-light: #f8f9fa;            /* Secties / lichte blokken */
    --bg-card: #ffffff;             /* Cards */
    
    --text-body: #4a4a4a;          
    --text-muted: #7f8c8d;             
    --chill-color: #2c3e50;         /* Wordt gebruikt voor headers */
    
    /* Specifieke UI Elementen Variabelen (Zodat we ze makkelijk kunnen flippen) */
    --nav-bg: #2c3e50;              /* Navigatie & Footer achtergrond */
    --nav-text: rgba(255,255,255,0.85);
    --input-bg: #ffffff;            /* Input velden */
    --input-border: #ced4da;

    /* Borders & Lines */
    --border-color: #e9ecef;
    --border-radius: 8px;          
    --border-radius-pill: 8px;    

    /* Spacing & Layout */
    --wrapper-width: 1100px;        
    --gap-grid: 2rem;               

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    --transition-base: all 0.2s ease-in-out;
    
    /* Fonts */
    --font-family-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-heading: var(--font-family-base);
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
* { box-sizing: border-box; }

body {
    font-family: var(--font-family-base); 
    font-size: 16px;
    color: var(--text-body);
    line-height: 1.7;                
    margin: 0;
    background-color: var(--bg-body); /* Gebruik variabele! */
    transition: background-color 0.3s ease, color 0.3s ease; /* Soepele overgang bij togglen */
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-family-heading);
    color: var(--chill-color);
    margin-top: 0;
    line-height: 1.2;
}

h1 { font-size: 3rem; font-weight: 800; text-align: center; margin-bottom: 0.5em; letter-spacing: -0.02em; }
h2 { font-size: 2rem; font-weight: 700; margin: 2em 0 1em; }
h3 { font-size: 1.5rem; color: var(--main-color); font-weight: 600; margin: 1.5em 0 0.5em; }

a {
    color: var(--chill-color);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-base);
}

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

img, iframe {
    max-width: 100%;
    height: auto;
    margin: 1em auto;
    display: block;
    transition: filter 0.3s ease; /* Voor dark mode filter */
}

blockquote {
    background: var(--bg-light);
    border-left: 4px solid var(--main-color);
    margin: 2em 0;
    padding: 1.5em 2em;
    font-style: italic;
    color: var(--text-body);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* Layout Wrapper */
.wrapper {
    max-width: var(--wrapper-width);
    margin: 0 auto;
    padding: 0 1.5rem; 
}

main { padding-bottom: 80px; }

/* =========================================
   3. SHARED COMPONENTS (Card System)
   ========================================= */

.news-card,
.initiative-card,
.org-card,
.person-card,
.team-member,
.rss-item-card {
    background: var(--bg-card); /* Gebruik variabele */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    height: 100%; 
    text-decoration: none !important;
    color: inherit;
    position: relative;
}

.news-card:hover,
.initiative-card:hover,
.org-card:hover,
.person-card:hover,
.team-member:hover,
.rss-item-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
    color: inherit;
}

/* --- Buttons --- */
.main-item {
    display: inline-block;
    background-color: var(--main-color);
    color: #fff !important;
    padding: 0.8em 2em;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: var(--border-radius-pill);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: var(--transition-base);
    border: 2px solid var(--main-color);
}

.main-item:hover {
    background-color: var(--bg-card);
    color: var(--main-color) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.main-item.secondary {
    background-color: var(--chill-color);
    border-color: var(--chill-color);
}

.main-item.secondary:hover {
    background-color: transparent;
    color: var(--chill-color) !important;
}

.meta-btn, .quick-link-btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--border-radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-body); /* Aangepast naar var */
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
}

.meta-btn:hover, .quick-link-btn:hover {
    background: var(--main-color);
    border-color: var(--main-color);
    color: #fff !important;
}

/* =========================================
   4. SPECIFIC COMPONENT OVERRIDES
   ========================================= */

/* --- Navigation --- */
nav {
    background-color: var(--nav-bg); /* Variabele! */
    padding: 1em 0;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease;
}

nav .wrapper, nav > div { 
    max-width: var(--wrapper-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
}

nav a {
    color: var(--nav-text);
    font-size: 1.05em;
    padding: 0.5em 0.8em;
    border-radius: 4px;
    font-weight: 500;
}

nav a:hover, nav a.active {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
    text-decoration: none;
}

/* --- Footer --- */
footer {
    background-color: var(--nav-bg); /* Gebruik zelfde als Nav */
    color: #fff;
    padding: 4em 0;
    margin-top: auto;
}

footer a { color: #fff; opacity: 0.8; }
footer a:hover { opacity: 1; text-decoration: underline; }
.footer-box { display: flex; flex-wrap: wrap; gap: 3em; }

/* Footer Layout */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    padding-bottom: 2rem;
}
.footer-col { font-size: 0.95em; line-height: 1.6; }
.footer-heading {
    color: #fff;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.2em;
    opacity: 0.9;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5em;
    display: inline-block;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.8em; }
.footer-links a {
    display: inline-flex; align-items: center;
    color: rgba(255,255,255,0.85); text-decoration: none; transition: all 0.2s ease;
}
.footer-links a:hover { color: #fff; transform: translateX(5px); }
.footer-icon { width: 1.2em; height: 1.2em; margin-right: 0.6em; fill: currentColor; opacity: 0.8; }
.footer-links a:hover .footer-icon { opacity: 1; }
.icon-spacer { display: inline-block; width: 1.2em; margin-right: 0.3em; text-align: center; }
.license-text { font-size: 0.9em; color: rgba(255,255,255,0.7); }

/* --- Hero Banner --- */
.hero-banner {
    width: 100%;
    padding: 4em 1em; 
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-light) 100%); 
    display: flex; justify-content: center; align-items: center; margin-bottom: 3em;
}
.hero-logo-box {
    background: #fff;
    padding: 2em 3em; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.mission-statement {
    font-size: 1.5em; line-height: 1.5; text-align: center; color: var(--bs-danger); 
    font-weight: 300; max-width: 800px; margin: 2rem auto; 
}

/* --- Grids --- */
.initiatives-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap-grid); margin-top: 1.5em; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.5rem; padding: 0; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; list-style: none; padding: 0; }

/* --- Card Content Specifics --- */
.org-logo-box { width: 100%; height: 80px; display: flex; align-items: center; justify-content: center; margin-bottom: 1em; }
.org-logo-box img { filter: grayscale(100%); opacity: 0.7; transition: var(--transition-base); max-height: 60px; }
.org-card:hover .org-logo-box img { filter: grayscale(0%); opacity: 1; transform: scale(1.05); }
.org-title { text-align: center; font-weight: 700; font-size: 0.95em; color: var(--chill-color); }

.news-card h3 { margin-top: 0; font-size: 1.25em; line-height: 1.4; }
.news-card h3 a { color: var(--chill-color); }
.news-card:hover h3 a { color: var(--main-color); }
.news-card__meta { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 0.8em; font-weight: 600; }

.person-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5em; }
.person-name { font-weight: 700; font-size: 1.1em; color: var(--chill-color); }
.lid-badge { font-size: 0.7em; color: var(--text-muted); background: var(--bg-light); padding: 3px 6px; border-radius: 4px; }

/* --- Tags --- */
.tag-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8em; margin: 2em 0; }
a.tag {
    display: inline-flex; align-items: center; padding: 0.3em 0.8em;
    border-radius: var(--border-radius); 
    background-color: var(--bg-card); /* Variabele */
    border: 1px solid var(--border-color);
    border-bottom: 3px solid var(--border-color); 
    color: var(--text-body);
    font-size: 0.85em; font-weight: 600; transition: var(--transition-base);
}
a.tag:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); color: #000; }
/* Tag Kleuren */
.tag.makers { border-bottom-color: #e83e8c; }
.tag.open-access { border-bottom-color: #dc3545; }
.tag.open-source { border-bottom-color: #ffc107; }
.tag.open-design { border-bottom-color: #0dcaf0; }
.tag.open-glam { border-bottom-color: #198754; }
.tag.open-onderwijs { border-bottom-color: #20c997; }
.tag.open-onderzoek { border-bottom-color: #0d6efd; }
.tag.open-overheid { border-bottom-color: #6610f2; }
.tag.open-zorg { border-bottom-color: #fd7e14; }

/* --- Page Specifics --- */
.quick-links {
    display: flex; flex-wrap: wrap; gap: 0.8em; margin-bottom: 3em; padding: 1em 1.5em;
    background: var(--bg-card); border-radius: var(--border-radius); 
    border: 1px solid var(--border-color); align-items: center;
    box-shadow: var(--shadow-sm);
}
.quick-links-title { font-weight: 700; margin-right: 1em; color: var(--chill-color); font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.5px; }

.wikidata-badge {
    font-size: 0.8em; background: var(--bg-card); padding: 4px 10px; border-radius: 20px; 
    color: var(--text-muted); border: 1px solid var(--border-color); 
    display: inline-flex; align-items: center; gap: 6px;
}

.connection-box {
    background-color: var(--bg-light); 
    border: 1px solid transparent; 
    border-radius: var(--border-radius); 
    padding: 2em; margin: 2em 0;
}

.highlight-section {
    background-color: var(--bg-card); 
    padding: 2em; border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--main-color);
    margin-bottom: 4em; box-shadow: var(--shadow-sm);
}

/* --- Forms --- */
.newsletter-box {
    background-color: var(--bg-card); padding: 3em 2em; border-radius: 12px; 
    margin: 3em auto; max-width: 600px; text-align: center; 
    border: 1px solid var(--border-color); box-shadow: var(--shadow-md);
}

.newsletter-box input[type="text"], .newsletter-box input[type="email"] {
    width: 100%; padding: 12px 16px; 
    background-color: var(--input-bg); /* Variabele */
    border: 1px solid var(--input-border); 
    color: var(--text-body);
    border-radius: var(--border-radius); 
    margin-bottom: 1em; font-size: 1em;
}
.newsletter-box input[type="text"]:focus, .newsletter-box input[type="email"]:focus {
    outline: none; border-color: var(--main-color);
}

.newsletter-box input[type="submit"] {
    background-color: var(--main-color); color: #fff; border: none; padding: 12px 24px; 
    font-size: 1.1em; font-weight: 700; border-radius: var(--border-radius-pill); 
    cursor: pointer; width: 100%; transition: var(--transition-base);
}
.newsletter-box input[type="submit"]:hover { background-color: #c02871; }


/* =========================================
   5. UTILITIES
   ========================================= */
.mb-0 { margin-bottom: 0 !important; }
.mb-sm { margin-bottom: 1rem; }
.mb-md { margin-bottom: 2rem; }
.mb-lg { margin-bottom: 3rem; }
.mb-xl { margin-bottom: 4rem; }
.mt-0 { margin-top: 0 !important; }
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }

.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-left { text-align: left !important; }
.font-bold { font-weight: 700; }
.ml-auto { margin-left: auto; }
.mt-auto { margin-top: auto; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.tag-group { display: flex; gap: 0.6em; flex-wrap: wrap; }
.gap-sm { gap: 0.5em; }
.gap-md { gap: 1em; }

.container-narrow { max-width: 800px; margin-left: auto; margin-right: auto; }
.container-center { text-align: center; margin-left: auto; margin-right: auto; }
.source-box { text-align: center; max-width: 600px; margin: 0 auto; }

.content-body { font-size: 1.125em; line-height: 1.8; color: var(--text-body); }
.content-body p { margin-bottom: 1.5em; }

.page-meta-header {
    font-size: 1.1em; color: var(--text-muted); font-weight: 600; 
    display: block; margin-bottom: 0.5em; text-transform: uppercase; letter-spacing: 1px;
}

hr { border-top: 1px solid var(--border-color); margin: 3rem 0; opacity: 0.6; }
hr.large-gap { margin-top: 80px; margin-bottom: 60px; }

/* Mobile */
@media screen and (max-width: 768px) {
    h1 { font-size: 2.2em; }
    h2 { font-size: 1.8em; }
    .wrapper { padding: 0 1rem; }
    .hero-logo-box { padding: 1.5em; }
    .footer-box { flex-direction: column; gap: 2em; }
}


/* =========================================
   6. DARK MODE SUPPORT (Consolidated)
   ========================================= */

/* --- A. De regels voor de knop (body.dark-mode) --- */
body.dark-mode {
    --bg-body: #0a0a0a;          
    --bg-white: #121212;         
    --bg-light: #1e1e1e;         
    --bg-card: #1e1e1e;          
    
    --text-body: #e0e0e0;
    --text-muted: #a0a0a0;
    
    --chill-color: #dbe4eb;      /* Lichte kleur voor headers */
    --border-color: #2d2d2d;
    
    --nav-bg: #1a252f;           
    --nav-text: rgba(255,255,255,0.9);
    
    --input-bg: #2b2b2b;
    --input-border: #2d2d2d;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.8);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.6);
    --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.6);

    color-scheme: dark;
}

/* Specifieke element overrides voor .dark-mode */
body.dark-mode img, 
body.dark-mode iframe {
    filter: brightness(0.85) contrast(1.1);
}
body.dark-mode .hero-logo-box, 
body.dark-mode .org-logo-box {
    background-color: #fff;
    filter: none;
}

/* FIX: Secundaire knop (Outline stijl in Dark Mode) */
body.dark-mode .main-item.secondary {
    background-color: transparent;       /* Transparant */
    border-color: var(--chill-color);    /* Lichte rand */
    color: var(--chill-color) !important; /* Lichte tekst */
}
body.dark-mode .main-item.secondary:hover {
    background-color: var(--chill-color); /* Licht worden bij hover */
    color: var(--bg-body) !important;     /* Donkere tekst bij hover */
}


/* --- B. De regels voor systeemvoorkeur (Media Query) --- */
@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        --bg-body: #0a0a0a;
        --bg-white: #121212;
        --bg-light: #1e1e1e;
        --bg-card: #1e1e1e;
        
        --text-body: #e0e0e0;
        --text-muted: #a0a0a0;
        
        --chill-color: #dbe4eb;
        --border-color: #2d2d2d;
        
        --nav-bg: #1a252f;
        --nav-text: rgba(255,255,255,0.9);
        
        --input-bg: #2b2b2b;
        --input-border: #2d2d2d;
        
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.8);
        --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.6);
        --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.6);

        color-scheme: dark;
    }

    body:not(.light-mode) img, 
    body:not(.light-mode) iframe {
        filter: brightness(0.85) contrast(1.1);
    }
    body:not(.light-mode) .hero-logo-box, 
    body:not(.light-mode) .org-logo-box {
        background-color: #fff;
        filter: none;
    }

    /* FIX: Zelfde fix ook hier toepassen */
    body:not(.light-mode) .main-item.secondary {
        background-color: transparent;
        border-color: var(--chill-color);
        color: var(--chill-color) !important;
    }
    body:not(.light-mode) .main-item.secondary:hover {
        background-color: var(--chill-color);
        color: var(--bg-body) !important;
    }
}