/* --- Gallery Grid (gallery.html) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: start;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #f4f4f4;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: saturate(1.05) contrast(1.02);
}

.gallery-caption {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    display: none;
}

.gallery-section {
    padding: 4rem 0;
}

/* --- Lightbox --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 5px solid rgba(255, 255, 255, 0.1);
}

.lightbox-caption {
    margin-top: 20px;
    color: #fff;
    font-size: 1.2rem;
    font-family: var(--font-heading);
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 30px; right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2100;
}

.lightbox-close:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    outline: none;
}

.lightbox-next { right: 40px; border-radius: 3px 0 0 3px; }
.lightbox-prev { left: 40px; }

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: var(--accent-color);
}

@media (max-width: 768px) {
    .lightbox-content { max-width: 95%; }
    .lightbox-prev, .lightbox-next { padding: 8px; font-size: 18px; background: rgba(0,0,0,0.5); }
    .lightbox-close { top: 15px; right: 15px; font-size: 30px; }
    .lightbox-caption { font-size: 1rem; margin-top: 10px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .gallery-item img { height: 150px; }
}
