/* ==========================================================================
   THEME STYLES
   ========================================================================== */
:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --border-color: #ffffff;
    --switch-bg: #444444;
    --switch-active: #2196F3;
    --slider-color: #ffffff;
    --modal-bg: rgba(0, 0, 0, 0.85);
}

body.light-mode {
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #000000;
    --switch-bg: #ccc;
    --slider-color: #ffffff;
    --modal-bg: rgba(255, 255, 255, 0.85);
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px 0 40px 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

header {
    display: flex;
    justify-content: space-between; /* Pushes text left and switch right */
    align-items: center;
    width: 90%;          
    max-width: 1800px;   
    margin: 0 auto 30px auto;
}

/* Modern Monospace Typography Styling */
.header-title {
    font-family: 'Space Mono', 'Courier New', monospace; /* Modern geometric monospace */
    font-size: 15px; /* Small/normal standard scale */
    letter-spacing: 0.5px;
    font-weight: 400;
    color: var(--text-color);
    transition: color 0.3s ease;
}

/* ==========================================================================
   SWITCH STYLES
   ========================================================================== */
.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
    z-index: 10;
}
.theme-switch input { display: none; }
.slider {
    background-color: var(--switch-bg);
    bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0;
    transition: .4s;
}
.slider:before {
    background-color: var(--slider-color);
    bottom: 3px; content: ""; height: 18px; left: 4px; position: absolute;
    transition: .4s; width: 18px; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: var(--switch-active); }
input:checked + .slider:before { transform: translateX(24px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* ==========================================================================
   GRID STYLES
   ========================================================================== */
.foto-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 30px; 
    width: 90%;          
    max-width: 1800px;   
    margin: 0 auto;
}

.grid-item {
    background-color: rgba(128, 128, 128, 0.05); 
    padding: 15px;
    border: 1px solid var(--border-color); 
    display: flex;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    min-height: 250px; 
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    cursor: pointer;
}

.fade-in {
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.6s ease-in-out, filter 0.6s ease-in-out, transform 0.2s ease;
}

.fade-in.loaded {
    opacity: 1;
    filter: blur(0);
}

.grid-item img.loaded:hover {
    transform: scale(1.02);
}

.foto-groot { grid-row: span 2; }

/* ==========================================================================
   LIGHTBOX OVERLAY STYLES
   ========================================================================== */
.lightbox-modal {
    display: none; 
    position: fixed;
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    justify-content: space-between;
    align-items: center;
}

.lightbox-modal.active { display: flex; }

.lightbox-content-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 80%;
    height: 80%;
}

#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 3px solid var(--border-color); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background-color: var(--bg-color);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--text-color);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 35px;
    padding: 30px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
    z-index: 10000;
}

.close-btn:hover, .nav-btn:hover { opacity: 0.6; }

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-color);
    font-size: 14px;
    letter-spacing: 1.5px;
    font-weight: bold;
    background-color: rgba(0,0,0,0.4);
    padding: 6px 16px;
    border-radius: 20px;
}

body.light-mode .lightbox-counter {
    background-color: rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
    header {
        flex-direction: row; /* Keeps them side-by-side on mobile, but handles overflow if small */
        flex-wrap: wrap;
        gap: 15px;
    }
    .foto-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .foto-groot { grid-row: auto; }
    .nav-btn { padding: 10px; font-size: 25px; }
    .lightbox-content-wrapper { max-width: 70%; }
}

