.gallery-header {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4) 70%, rgba(245, 245, 245, 0.8) 100%),
                url('../images/menu.jpg') center/cover;
    background-attachment: fixed;
    color: white;
    text-align: center;
    padding: clamp(3rem, 10vh, 6rem) 0 clamp(4rem, 12vh, 8rem) 0;
    margin-top: 60px;
    position: relative;
    margin-bottom: -50px;
    z-index: 1;
}

/* Mobile background fix for gallery header */
@media (max-width: 768px) {
    .gallery-header {
        background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4) 70%, rgba(245, 245, 245, 0.8) 100%),
                    url('../images/menu.jpg') center/cover !important;
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
        min-height: 250px !important;
        z-index: 5 !important; /* Higher than content but lower than nav */
    }
}

.gallery-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #f5f5f5);
    z-index: 0;
}

.gallery-header .container {
    position: relative;
    z-index: 2;
}

.gallery-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.gallery-header p {
    font-size: clamp(1rem, 3vw, 1.4rem);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Obsah galerie */
.gallery-content {
    padding: clamp(2rem, 3vw, 3rem) 0 clamp(3rem, 5vw, 5rem) 0;
    position: relative;
    z-index: 2;
    background: #f5f5f5;
    border-radius: 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
    max-height: none;
    overflow-y: visible;
}

.container {
    width: min(95%, 1200px);
    margin-inline: auto;
    padding: clamp(0.5rem, 1.5vw, 1.5rem);
}

/* Filtry galerie */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-btn {
    padding: 10px 18px;
    border: none;
    background-color: white;
    color: #333;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid #eee;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-btn:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.filter-btn.active {
    background-color: var(--primary-color, #ff7700);
    color: white;
    border-color: var(--primary-color, #ff7700);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(255, 119, 0, 0.3);
}

/* Mřížka galerie */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4/3;
    background-color: #eee;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-info {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-info h3 {
    margin: 0 0 5px;
    font-size: 1.2rem;
}

.gallery-item-info p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Kategorie obrázků v galerii */
.gallery-item-category-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 12px;
    z-index: 1;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-category-tag {
    background-color: var(--primary-color, #ff7700);
}

/* Přidání indikátoru filtru */
.gallery-filter-indicator {
    text-align: center;
    margin-bottom: 20px;
    font-size: 16px;
    color: #777;
}

.gallery-filter-indicator strong {
    color: var(--primary-color, #ff7700);
    font-weight: 600;
}

/* Žádné fotografie */
.no-gallery {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    color: #666;
    font-size: 1.1rem;
}

.no-gallery i {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: block;
}

/* Responzivní design */
@media (max-width: 768px) {
    .gallery-header {
        padding: 4rem 0 2rem;
    }

    .gallery-header h1 {
        font-size: 2.2rem;
    }

    .gallery-header p {
        font-size: 1.1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        aspect-ratio: 3/2;
    }
}

/* Animace pro filtry */
.gallery-item {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Styl pro Lightbox */
.lb-data .lb-caption {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.lb-data .lb-details {
    margin-top: 10px;
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
    opacity: 0.5;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
    opacity: 1;
}

.lb-data .lb-close {
    opacity: 0.8;
    font-size: 2em;
    padding: 10px;
}

.lb-nav a {
    opacity: 0.5;
}

/* Mobile hint text */
.lb-container:after {
    content: "Klepněte mimo obrázek pro zavření";
    display: block;
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 5px;
    font-size: 14px;
}

@media (min-width: 769px) {
    .lb-container:after {
        display: none;
    }
}

/* Přidejte na konec souboru */

/* Skrytí prvků pomocí třídy hidden */
.gallery-item.hidden {
    display: none !important;
}

/* Vylepšení zavíracího tlačítka v lightboxu */
.lb-closeContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: auto !important;
    height: auto !important;
    z-index: 100;
}

.lb-close {
    width: 50px !important;
    height: 50px !important;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 0 0 10px 0;
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 12px;
    opacity: 0.8 !important;
    transition: all 0.2s ease;
}

.lb-close:hover {
    opacity: 1 !important;
    background-color: rgba(255, 119, 0, 0.8);
}

/* Vytvoření křížku pomocí pseudo-elementů */
.lb-close:before, .lb-close:after {
    content: '';
    position: absolute;
    width: 30px;
    height: 4px;
    background-color: white;
    border-radius: 2px;
}

.lb-close:before {
    transform: rotate(45deg);
}

.lb-close:after {
    transform: rotate(-45deg);
}

/* Přidání textové nápovědy pro mobilní zařízení */
@media (max-width: 768px) {
    .lb-container {
        position: relative;
    }
    
    .lb-container:after {
        content: "Pro zavření klepněte na křížek";
        display: block;
        position: absolute;
        bottom: 20px;
        left: 0;
        width: 100%;
        text-align: center;
        color: white;
        background-color: rgba(0, 0, 0, 0.6);
        padding: 8px 0;
        font-size: 14px;
        z-index: 10;
    }
    
    /* Zvětšení zavíracího tlačítka na mobilech */
    .lb-close {
        width: 60px !important;
        height: 60px !important;
    }
}

/* Zvýraznění navigace v lightboxu */
.lb-nav a.lb-prev,
.lb-nav a.lb-next {
    opacity: 0.6;
    background-color: rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
    opacity: 1;
    background-color: rgba(255, 119, 0, 0.5);
}

.lb-nav a.lb-prev {
    border-radius: 0 5px 5px 0;
}

.lb-nav a.lb-next {
    border-radius: 5px 0 0 5px;
}

/* Vlastní zavírací tlačítko pro lightbox */
.custom-close-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 36px;
    line-height: 1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.custom-close-btn:hover {
    background-color: rgba(255, 119, 0, 0.9);
    transform: scale(1.1);
}

/* Mobilní úpravy */
@media (max-width: 768px) {
    .custom-close-btn {
        width: 60px;
        height: 60px;
        font-size: 46px;
        top: 15px;
        left: 15px;
    }
    
    /* Instrukce pro zavření */
    .lb-container:after {
        content: "Pro zavření klepněte na křížek";
        display: block;
        position: absolute;
        bottom: 20px;
        left: 0;
        width: 100%;
        text-align: center;
        color: white;
        background-color: rgba(0, 0, 0, 0.6);
        padding: 10px 0;
        font-size: 16px;
        z-index: 9999;
    }
}

/* Oprava pro původní zavírací tlačítko, které můžeme ponechat jako zálohu */
.lb-close {
    opacity: 1 !important;
    filter: alpha(opacity=100) !important;
}

/* Vylepšení pro lightbox - přidejte na konec souboru */

/* Stylování lightbox containeru, aby nebyl fullscreen */
.lb-outerContainer {
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    padding: 10px !important;
    margin: 0 auto !important;
    max-width: 90% !important;
}

.lb-container {
    padding: 10px !important;
    position: relative !important;
}

/* Úprava velikosti obrázku, aby nebyl ve fullscreenu */
.lb-image {
    max-width: 90vw !important;
    max-height: 80vh !important;
    border-radius: 4px !important;
    border: none !important;
}

/* Výrazný zavírací křížek */
.custom-close-btn {
    position: absolute !important;
    top: -20px !important;
    left: -20px !important;
    width: 40px !important;
    height: 40px !important;
    background-color: #e74c3c !important;
    color: white !important;
    font-size: 24px !important;
    line-height: 1 !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) !important;
    transition: all 0.2s ease !important;
    opacity: 1 !important;
}

.custom-close-btn:hover {
    background-color: #c0392b !important;
    transform: scale(1.1) !important;
}

/* Zlepšení navigačních šipek */
.lb-nav a.lb-prev,
.lb-nav a.lb-next {
    opacity: 0.7 !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
    transition: all 0.3s ease !important;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
    opacity: 1 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Instrukce pro mobilní zařízení */
.mobile-instruction {
    text-align: center !important;
    font-size: 14px !important;
    padding: 8px 0 !important;
    color: #555 !important;
    background-color: #f9f9f9 !important;
    margin-bottom: 10px !important;
    border-radius: 4px !important;
}

@media (min-width: 769px) {
    .mobile-instruction {
        display: none !important;
    }
}

/* Vylepšení pro popisek */
.lb-data .lb-details {
    width: 100% !important;
    text-align: center !important;
    padding: 10px 0 !important;
}

.lb-data .lb-caption {
    font-size: 16px !important;
    font-weight: bold !important;
    color: #333 !important;
}

/* Nastavení pozadí pro overlay */
.lb-overlay {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

/* Další mobilní úpravy */
@media (max-width: 768px) {
    .lb-outerContainer {
        padding: 5px !important;
    }
    
    .custom-close-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 30px !important;
        top: -15px !important;
        left: -15px !important;
    }
    
    .lb-nav a.lb-prev,
    .lb-nav a.lb-next {
        opacity: 0.9 !important;
    }
}