.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}
.photo-item {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}
.photo-item:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}
.photo-item img {
    display: block;
    width: 100%;
    /* height: 200px; */
    object-fit: cover;
}
.empty-gallery {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 60px 20px;
    background: #fff;
    border: 2px dashed #ddd;
    border-radius: 8px;
}
.error-box {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* ----------- Lightbox ----------- */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease;
}
.lightbox.active {
    display: flex;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}
.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}
.lightbox-btn:active {
    transform: scale(0.95);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 28px;
    font-weight: bold;
}
.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    font-size: 32px;
}
.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}
.lightbox-prev:active,
.lightbox-next:active {
    transform: translateY(-50%) scale(0.95);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
}

.lightbox-loader {
    position: absolute;
    color: #fff;
    font-size: 16px;
}
@media (max-width: 650px) {
    .gallery {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .lightbox-prev, .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
}
@media (max-width: 400px) {
    .gallery {
        grid-template-columns: 1fr;
    }
}