/* --- ZÁKLADNÍ PROMĚNNÉ (Sjednoceno) --- */
:root {
    --page-bg: #ffffff;
    --text-color: #000000;
    --secondary-text: #555555;
    --border-color: #e0e0e0;
}

body.dark-mode {
    --page-bg: #0a0a0a;
    --text-color: #ffffff;
    --secondary-text: #aaaaaa;
    --border-color: #333333;
}

body {
    font-family: "Google Sans Flex", sans-serif;
    background: var(--page-bg);
    color: var(--text-color);
    margin: 0;
    overflow-x: hidden;
    transition: background 0.4s ease;
}

/* --- NAVIGACE & SWITCHER (Vložit z předchozích kroků) --- */
.top-nav { position: fixed; top: 30px; left: 50%; transform: translateX(-50%); z-index: 2100; display: flex; gap: 40px; }
.nav-link { color: var(--secondary-text); text-decoration: none; font-family: "Funnel Sans", sans-serif; font-size: 1.5vmin; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; transition: 0.6s; border-bottom: 2px solid transparent; }
.nav-link:hover { color: var(--text-color); border-bottom: 2px solid var(--text-color); }

.theme-switch-wrapper { position: fixed; bottom: 30px; left: 30px; z-index: 2200; background: rgba(128, 128, 128, 0.1); padding: 10px; border-radius: 50px; backdrop-filter: blur(5px); }
.theme-switch { display: inline-block; height: 20px; position: relative; width: 44px; }
.theme-switch input { display: none; }
.slider { background-color: #ccc; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .4s; border-radius: 34px; }
.slider:before { background-color: white; bottom: 3px; content: ""; height: 14px; left: 4px; position: absolute; transition: .4s; width: 14px; border-radius: 50%; }
input:checked + .slider { background-color: #444; }
input:checked + .slider:before { transform: translateX(22px); }

/* --- HLAVIČKA --- */
.main-header { padding: 120px 5% 40px; text-align: left; }
.page-title { font-size: clamp(3rem, 10vw, 8rem); font-weight: 800; letter-spacing: -3px; }

/* --- MŘÍŽKA 3x3 SEKCE --- */
.grid-slider-section {
    position: relative;
    width: 90vw;
    margin: 0 auto 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    aspect-ratio: 1 / 1; /* Udržuje mřížku čtvercovou */
    max-height: 85vh;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.grid-item {
    position: relative;
    overflow: hidden;
    background: #111;
    border-radius: 4px;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
    filter: grayscale(20%);
}

.grid-item:hover img {
    transform: scale(1.1);
    filter: grayscale(0%);
}

/* Šipky */
.grid-nav-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 3rem;
    cursor: pointer;
    padding: 20px;
    z-index: 10;
    transition: 0.3s;
    opacity: 0.5;
}

.grid-nav-btn:hover { opacity: 1; transform: scale(1.2); }

/* Tečky pod mřížkou */
.grid-pagination {
    position: absolute;
    bottom: -40px;
    display: flex;
    gap: 10px;
}

.page-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: 0.3s;
}

.page-indicator.active {
    background: var(--text-color);
    width: 24px;
    border-radius: 10px;
}

/* Responzivita */
@media (max-width: 900px) {
    .grid-3x3 {
        grid-template-columns: repeat(2, 1fr); /* 2x2 na tabletu */
        aspect-ratio: auto;
    }
    .grid-nav-btn { position: absolute; bottom: -80px; }
    .grid-nav-btn.prev { left: 20%; }
    .grid-nav-btn.next { right: 20%; }
}