/* Gallery specific styles */
.gallery {
    padding: 8rem 2rem 4rem;
    background-color: var(--background-color);
}

@keyframes slideIn {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes underlineSlide {
    0% {
        width: 0;
        opacity: 0;
    }
    100% {
        width: 100px;
        opacity: 1;
    }
}

.gallery h2 {
    text-align: center;
    margin: 2.5rem 0 4rem;
    font-size: 2.8rem;
    font-weight: 300;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1.5rem;
    animation: slideIn 0.8s ease-out forwards;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.gallery h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        var(--accent-color) 20%,
        var(--primary-color) 50%,
        var(--accent-color) 80%,
        transparent 100%
    );
    animation: underlineSlide 1s ease-out forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.gallery h2::before {
    content: '•';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-color);
    font-size: 1.2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed);
    background-color: var(--background-color);
    aspect-ratio: 4/3;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

/* Specific styling for centered images */
.gallery-item img[src*="med1.jpg"],
.gallery-item img[src*="med2.jpg"],
.gallery-item img[src*="med3.jpg"],
.gallery-item img[src*="med4.jpg"],
.gallery-item img[src*="med5.jpg"],
.gallery-item img[src*="kupinovo.jpg"],
.gallery-item img[src*="vinarija.jpg"],
.gallery-item img[src*="zagorac.jpg"],
.gallery-item img[src*="vino4.jpg"],
.gallery-item img[src*="todorovski.jpg"],
.gallery-item img[src*="bokun.jpg"] {
    object-position: center center;
    height: 100%;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

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

.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    color: var(--footer-text);
    text-align: center;
    text-shadow: 1px 1px 3px rgba(44, 24, 16, 0.6);
    background: linear-gradient(to top, rgba(139, 115, 85, 0.7), rgba(139, 115, 85, 0.4));
}

.gallery-item-info h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--card-bg);
}

.gallery-item-info p {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    color: var(--footer-text);
}

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

/* Logo link styling */
.logo a {
    text-decoration: none;
    color: inherit;
}

.logo a:hover {
    color: var(--accent-color);
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 1rem;
    transition: transform var(--transition-speed);
}

.lightbox-close:hover {
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery {
        padding: 6rem 1rem 3rem;
    }

    .gallery h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

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