*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    /* Layered background: darker green at top, softer below, with highlights */
    background-color: #eaf6ef;
    /* fallback color */
    background-image:
        radial-gradient(1200px 400px at 8% 8%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(800px 300px at 85% 85%, rgba(255, 255, 255, 0.28), transparent),
        linear-gradient(180deg, #5f9a2f 0%, #79b93b 30%, #9cd66a 70%, #dff5d9 100%);
    background-blend-mode: overlay, overlay, normal;
    background-attachment: fixed;
    color: #21321a;
    line-height: 1.6;
}

:root {
    --accent: #2e7d32;
    --muted: #6b8a5a;
    --panel-bg: rgba(255, 255, 255, 0.95);
    --radius: 12px;
}

/* Grid layout */
.container {
    display: grid;
    grid-template-columns: 300px 550px 300px;
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Levý panel */
aside.left {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-logo {
    display: block;
    margin: 0 auto 12px;
    max-width: 160px
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0
}

.nav-list li {
    list-style: none
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent
}

.nav-list a:hover {
    background: linear-gradient(90deg, rgba(46, 125, 50, 0.06), rgba(46, 125, 50, 0.02));
    box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.04)
}

.nav-list a:focus-visible {
    outline: 3px solid rgba(46, 125, 50, 0.12);
    outline-offset: 2px
}

.nav-list a.active {
    background: linear-gradient(90deg, rgba(46, 125, 50, 0.12), rgba(46, 125, 50, 0.06));
    box-shadow: none
}

.search-box {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.search-box label {
    font-size: 0.9rem;
    color: var(--muted)
}

.search-box input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(16, 24, 32, 0.06)
}

.contact-info {
    font-size: 0.95rem;
    color: var(--muted)
}

/* Střední panel */
main {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

main h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #567125;
}

main h2 {
    color: #567125;
}

main p {
    margin-bottom: 15px;
    color: #567125;
}

.logo {
    max-width: 250px;
    /* zvětšené logo */
    display: block;
    margin: 0 auto 20px;
}

.hero {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hero-container {
    display: flex;
    gap: 20px;
    /* mezera mezi fotkami */
    justify-content: center;
    margin-bottom: 20px;
}

.hero-container .hero {
    width: 48%;
    /* aby se dvě fotky vešly vedle sebe */
    border-radius: 8px;
}

.cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 16px
}

.cats a {
    display: inline-block;
    padding: 8px 12px;
    background: var(--card);
    border: 1px solid #eee;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all .18s
}

.cats a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(11, 132, 165, .08);
    color: var(--accent)
}

.cats a.active {
    background: linear-gradient(90deg, var(--accent), #38b2c5);
    color: #fff;
    border-color: transparent
}

/* grid */
.grid {
    max-width: 1200px;
    margin: 18px auto;
    padding: 0 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px
}

/* Modern gallery grid and unified item styles (apply to .item and optional .gallery-item) */
.gallery-grid,
.grid {
    max-width: 1200px;
    margin: 12px auto;
    padding: 0 6px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px
}

.gallery-item,
.item {
    background: var(--panel-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, .04);
    transition: transform .26s ease, box-shadow .26s
}

.gallery-item:hover,
.item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(10, 10, 10, .08)
}

.gallery-item img,
.item img,
.thumb {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover
}

.gallery-caption,
.caption {
    padding: 10px 12px;
    font-size: .95rem;
    color: var(--muted);
    font-weight: 600
}

.item {
    background: var(--card);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, .03);
    transition: transform .22s ease, box-shadow .22s
}

.item:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 34px rgba(10, 10, 10, .08)
}

.thumb {
    display: block;
    width: 100%;
    height: 0;
    padding-bottom: 66.666%;
    background-size: cover;
    background-position: center
}

.caption {
    padding: 8px 10px;
    font-size: .9rem;
    color: var(--muted)
}

/* small helper row for filename */
.meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #888
}


/* lightbox (legacy .lb and new #lightbox selectors) */
.lb,
#lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .78);
    z-index: 9999;
    padding: 18px;
}

.lb.open,
#lightbox.open,
#lightbox[aria-hidden="false"] {
    display: flex
}

.lb .box,
#lightbox .box,
#lightbox .lightbox-content {
    max-width: 1100px;
    max-height: 86vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Constrain the displayed image so it never exceeds a reasonable static size */
.lb img,
#lightbox img,
#lightbox .lightbox-img {
    display: block;
    /* preserve the original aspect ratio while bounding by viewport */
    width: auto;
    height: auto;
    max-width: calc(100vw - 120px);
    /* keep some padding left/right for controls */
    max-height: calc(100vh - 160px);
    /* keep some padding top/bottom */
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

/* Controls: place inside the box near the image so they're always visible */
.lb .close,
.lb .prev,
.lb .next,
#lightbox .close,
#lightbox .prev,
#lightbox .next {
    /* high-contrast dark controls so they are visible over images */
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    position: absolute;
    z-index: 10010;
    /* above the image */
}

/* Layout the controls left/center/right when there is room; on small screens stack them */
.lb .prev,
#lightbox .prev {
    order: 0;
}

.lb .close,
#lightbox .close {
    order: 1;
}

.lb .next,
#lightbox .next {
    order: 2;
}

/* Position prev/next consistently to the left/right of the image so they are always visible */
.lb .prev,
#lightbox .prev {
    left: calc(50% - 48px);
    transform: translateY(-50%);
}

.lb .next,
#lightbox .next {
    left: calc(50% + 48px);
    transform: translateY(-50%);
}

.lb .close,
#lightbox .close {
    top: 12px;
    right: 12px;
    transform: none;
}

@media (max-width: 1000px) {

    /* for smaller screens keep buttons inside the viewport near the image edges */
    .lb .prev,
    #lightbox .prev {
        left: 12px;
        transform: translateY(0);
    }

    .lb .next,
    #lightbox .next {
        right: 12px;
        left: auto;
        transform: translateY(0);
    }
}

section.gallery {
    padding-bottom: 60px
}

/* subtle fade for content change when hash changes */
.grid {
    transition: opacity .3s ease, transform .3s ease
}

.grid.hidden {
    opacity: .06;
    transform: translateY(8px);
    pointer-events: none
}

/* Pravý panel */
aside.right {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

aside.right h2 {
    margin-bottom: 15px;
}

form {
    display: grid;
    gap: 15px;
}

label {
    display: flex;
    flex-direction: column;
    font-weight: bold;
}

input,
textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button {
    background: #567125;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    /* quick color transition for hover */
    transition: background-color 160ms ease-in-out, color 160ms ease-in-out;
}

button:hover {
    background: #6f8d36;
}

.confirmation {
    display: none;
    background: #e0ffe0;
    border: 1px solid #90ee90;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.footer-basic {
    padding: 40px 0;
    background-color: #ffffff;
    color: #4b4c4d;
}

.footer-basic ul {
    padding: 0;
    list-style: none;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-basic li {
    padding: 0 10px;
}

.footer-basic ul a {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
}

.footer-basic ul a:hover {
    opacity: 1;
}

.footer-basic .social {
    text-align: center;
    padding-bottom: 25px;
}

.footer-basic .social>a {
    font-size: 24px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    display: inline-block;
    text-align: center;
    border-radius: 50%;
    border: 1px solid #ccc;
    margin: 0 8px;
    color: inherit;
    opacity: 0.75;
}

.footer-basic .social>a:hover {
    opacity: 0.9;
}

.footer-basic .copyright {
    margin-top: 15px;
    text-align: center;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 0;
}

.footer-basic .footer-logo {
    text-align: center;
    margin-top: 10px;
}

.footer-basic .footer-logo img {
    height: 40px;
    display: inline-block;
    /* vycentruje logo */
}

/* Responsivita */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
    aside.left,
    aside.right,
    main {
        order: initial;
    }
    /* Zajistí, že galerie grid i cats nav se správně zalomí na mobilu */
    .gallery-grid,
    .grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 2px;
    }
    .cats {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 10px 0;
    }
    .cats a {
        width: 100%;
        text-align: center;
        font-size: 1rem;
        padding: 12px 0;
    }
    .item, .gallery-item {
        min-width: 0;
        max-width: 100%;
    }
    .thumb {
        height: 160px !important;
        padding-bottom: 0 !important;
    }
    #lightbox .box {
        max-width: 98vw;
        max-height: 90vh;
        padding: 0;
    }
    #lightbox img {
        max-width: 96vw;
        max-height: 70vh;
    }
}
/* --- MOBILNÍ MENU A ÚPRAVY ROZLOŽENÍ --- */

/* Výchozí stav: mobilní prvky jsou na desktopu skryté */
.mobile-header, .mobile-nav-overlay {
    display: none;
}

/* Responsivita pro mobily a tablety (pod 900px) */
@media(max-width: 900px) {
    
    /* 1. Změna rozložení stránky */
    .container {
        display: flex;
        flex-direction: column;
        margin-top: 60px; /* Místo pro fixní horní lištu */
    }

    /* PŘEHÁZENÍ POŘADÍ PRVKŮ (Order) */
    /* Hlavní obsah bude první */
    main {
        order: 1;
    }

    /* Pravý panel (Formulář) bude druhý */
    aside.right {
        order: 2;
    }

    /* Levý panel (Mapa a adresa) bude až nakonec */
    aside.left {
        order: 3;
        margin-top: 0;
    }

    /* 2. Skrytí duplicitní navigace a vyhledávání v levém panelu */
    /* Na mobilu nechceme navigaci dole, je v hamburger menu */
    aside.left nav, 
    aside.left .search-box, 
    aside.left .nav-logo {
        display: none;
    }

    /* Ujištění, že mapa a kontakt zůstanou viditelné */
    aside.left .contact-info, 
    aside.left iframe {
        display: block;
        width: 100%;
    }

    /* 3. Stylování horní lišty (Hamburger) */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: var(--accent); /* Zelená */
        padding: 15px 20px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        color: white;
    }

    .mobile-title {
        font-weight: 700;
        font-size: 1.1rem;
    }

    .hamburger {
        cursor: pointer;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .hamburger span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: white;
        border-radius: 3px;
    }

    /* 4. Stylování vyjížděcího menu */
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: -100%; /* Skryté vlevo mimo obrazovku */
        width: 280px; /* Šířka menu */
        height: 100vh;
        background-color: #fff;
        z-index: 1001;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        padding: 20px;
        overflow-y: auto;
    }

    .mobile-nav-overlay.active {
        left: 0; /* Vysunutí */
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 20px;
        font-size: 40px;
        cursor: pointer;
        color: var(--accent);
    }

    .mobile-nav-logo {
        max-width: 120px;
        display: block;
        margin: 40px auto 20px;
    }

    .mobile-nav-list {
        list-style: none;
        padding: 0;
        text-align: center;
    }

    .mobile-nav-list li {
        margin: 15px 0;
    }

    .mobile-nav-list a {
        text-decoration: none;
        color: #21321a;
        font-size: 1.2rem;
        font-weight: 600;
        display: block;
        padding: 10px;
        border-radius: 8px;
    }

    .mobile-nav-list a:hover, 
    .mobile-nav-list a.active {
        background-color: #eaf6ef;
        color: var(--accent);
    }
    
    /* Vypnutí gridu z původního CSS, aby fungoval Flexbox */
    .container {
        grid-template-columns: none;
    }
}