/* Gallery Header */
.gallery-header {
    margin-top: var(--header-height);
    padding: 4rem 2rem 2rem;
    text-align: center;
    background: linear-gradient(
        135deg,
        var(--bg-subtle) 0%,
        var(--bg-light) 100%
    );
}

.gallery-header h1 {
    font-size: 4rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.section-header .underline {
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    margin: 1rem auto 2rem;
    border-radius: 2px;
}

.gallery-header p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    margin-top: 1.5rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-color);
}

/* Gallery Grid */
.gallery-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem 6rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.6s ease-out;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    cursor: pointer;
    aspect-ratio: 3/2;
    background: var(--bg-subtle);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: var(--transition);
    z-index: 2;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.view-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}

.gallery-item:hover .view-icon {
    transform: translate(-50%, -50%) scale(1);
}

.view-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--primary-color);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    animation: zoomIn 0.3s ease-out;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 50%;
}

.lightbox-close:hover {
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.4);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

.contact-section {
    background: var(--bg-subtle);
    max-width: 100%;
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 968px) {
    .gallery-header h1 {
        font-size: 2.8rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }

    .lightbox-nav {
        width: 50px;
        height: 50px;
    }

    .lightbox-prev {
        left: 1rem;
    }

    .lightbox-next {
        right: 1rem;
    }
}

@media (max-width: 640px) {
    .gallery-header {
        padding: 3rem 1rem 1.5rem;
    }

    .gallery-header h1 {
        font-size: 2.2rem;
    }

    .gallery-container {
        padding: 2rem 1rem 4rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
}

/* Fade-in animace pro Intersection Observer */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
