/* =========================================
   PROMĚNNÉ A ZÁKLAD
   ========================================= */
:root {
    --color-bg: #f3f7f4;
    --color-surface: #ffffff;
    --color-primary: #2d7a31;
    --color-primary-hover: #225e25;
    --color-text: #2a332a;
    --color-text-light: #5f7060;
    --color-border: #e2ebe3;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(45, 122, 49, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden; 
}

p, h1, h2, h3, td, th {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

h1, h2, h3 {
    line-height: 1.3; 
}

/* =========================================
   HLAVNÍ LAYOUT (GRID)
   ========================================= */
.layout-wrapper {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 300px;
    gap: 30px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: start; 
}

/* =========================================
   KOMPONENTY (KARTY)
   ========================================= */
.sidebar-left, .content-main, .sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.content-card, .form-card, .contact-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

/* =========================================
   LEVÝ PANEL
   ========================================= */
.nav-logo {
    display: block;
    max-width: 130px;
    margin: 0 auto 20px;
}

.nav-list {
    list-style: none;
    background: var(--color-surface);
    padding: 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.nav-list li { margin-bottom: 5px; }
.nav-list li:last-child { margin-bottom: 0; }

.nav-list a {
    display: block;
    padding: 12px 16px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}

.nav-list a:hover {
    background: #f0f7f1;
    color: var(--color-primary);
}

.nav-list a.active {
    background: var(--color-primary);
    color: #fff;
}

.search-box input {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-family: inherit;
    box-shadow: var(--shadow-sm);
    font-size: 16px; /* Zabrání přibližování na iPhonech */
}

.contact-card h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--color-primary); }
.contact-card p { font-size: 0.95rem; color: var(--color-text-light); margin-bottom: 10px; }
.contact-card a { color: var(--color-primary); text-decoration: none; font-weight: 600; }

.map-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.map-container iframe {
    width: 100%;
    display: block; 
}

/* =========================================
   FOTOGALERIE SPECIFICKÉ STYLY
   ========================================= */

/* Navigace pro kategorie / filtry */
.cats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.cats a {
    padding: 10px 18px;
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid var(--color-border);
}

.cats a:hover {
    background: #f0f7f1;
    color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.cats a.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* Nadpisy kategorií vykreslované z JS */
.gallery-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 30px 0 15px 0;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 5px;
}

/* JS generovaná Mřížka */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* JS generované Fotky (Karty) */
.item {
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.item .thumb {
    display: block;
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--color-border);
}

.item .caption {
    padding: 15px;
    font-size: 0.95rem;
    color: var(--color-text);
    font-weight: 600;
    text-align: center;
}

.item .meta {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- LIGHTBOX (Modální okno) --- */
.lb, #lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(20, 30, 22, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lb.open, #lightbox.open {
    display: flex;
}

.lb .box {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lb button {
    position: absolute;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px; height: 50px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10000;
    box-shadow: var(--shadow-sm);
}

.lb button:hover {
    background: var(--color-primary-hover);
    transform: scale(1.1);
}

.lb .close { top: -25px; right: -25px; }
.lb .prev { left: -70px; top: 50%; transform: translateY(-50%); }
.lb .next { right: -70px; top: 50%; transform: translateY(-50%); }


/* =========================================
   PRAVÝ PANEL (FORMULÁŘ)
   ========================================= */
.form-card h2 {
    color: var(--color-primary);
    margin-bottom: 5px;
}

.form-desc {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    background: #fbfcfb;
    transition: border-color 0.2s;
    font-size: 16px; 
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #fff;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: var(--color-primary-hover);
}

.confirmation {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #eaf2eb;
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
}

/* =========================================
   PATIČKA
   ========================================= */
.footer-modern {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 40px 20px;
    margin-top: 40px;
    width: 100%; 
    display: block;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #f0f7f1;
    color: var(--color-primary);
    font-size: 22px;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
}

.social-links a:hover {
    transform: translateY(-3px);
    background: var(--color-primary);
    color: #fff;
}

.copyright {
    margin: 20px 0;
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.partner-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.partner-title {
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.partner-item img {
    height: 35px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.partner-item a:hover img {
    opacity: 1;
}

/* =========================================
   RESPONZIVITA (MOBILY A TABLETY)
   ========================================= */
.mobile-header, .mobile-nav-overlay {
    display: none;
}

@media (max-width: 1200px) {
    .layout-wrapper {
        grid-template-columns: 260px minmax(0, 1fr);
    }
    .sidebar-right {
        grid-column: 1 / -1;
        width: 100%;
        max-width: none; 
    }
}

@media (max-width: 992px) {
    .layout-wrapper {
        display: flex; 
        flex-direction: column;
        align-items: stretch; 
        margin-top: 80px; 
        padding: 0 15px; 
        gap: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .content-main { order: 1; width: 100%; }  
    .sidebar-right { order: 2; width: 100%; }  
    .sidebar-left { order: 3; width: 100%; } 

    .desktop-nav { display: none; } 

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--color-surface);
        padding: 15px 20px;
        position: fixed;
        top: 0; left: 0; width: 100%;
        z-index: 1000;
        box-shadow: var(--shadow-sm);
        border-bottom: 1px solid var(--color-border);
    }

    .mobile-title {
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--color-primary);
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 5px;
    }

    .hamburger span {
        width: 25px; height: 3px;
        background: var(--color-text);
        border-radius: 2px;
        transition: all 0.3s;
    }

    .mobile-nav-overlay {
        display: block;
        position: fixed;
        top: 0; left: -100%;
        width: 280px; height: 100vh;
        background: var(--color-surface);
        z-index: 1001;
        transition: left 0.3s ease;
        padding: 20px;
        box-shadow: 2px 0 15px rgba(0,0,0,0.2);
    }

    .mobile-nav-overlay.active { left: 0; }

    .close-btn {
        position: absolute; top: 15px; right: 20px;
        font-size: 32px; cursor: pointer;
        color: var(--color-text);
        line-height: 1;
    }

    .mobile-nav-logo {
        max-width: 100px;
        margin: 30px auto;
        display: block;
    }

    .mobile-nav-list { list-style: none; }
    .mobile-nav-list a {
        display: block;
        padding: 15px;
        color: var(--color-text);
        text-decoration: none;
        font-weight: 600;
        border-bottom: 1px solid var(--color-border);
        transition: color 0.2s;
    }
    .mobile-nav-list a.active, .mobile-nav-list a:hover { 
        color: var(--color-primary); 
    }

    /* Optimalizace mezer a velikostí pro menší obrazovky */
    .content-card, .form-card, .contact-card {
        padding: 20px;
    }

    /* Bezpečnější Lightbox na mobilu */
    .lb .prev { left: 10px; width: 40px; height: 40px; font-size: 20px; }
    .lb .next { right: 10px; width: 40px; height: 40px; font-size: 20px; }
    .lb .close { top: -45px; right: 0; width: 40px; height: 40px; font-size: 20px; }
}

@media (max-width: 576px) {
    /* Zmenšení fotek v galerii pro malý mobil */
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .item .thumb {
        height: 140px;
    }
}