.gallery-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}

.gallery-header h2 {
    margin-bottom: 0.25rem;
}

.gallery-count {
    font-size: 0.82rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.photo-grid figure {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    border: 1px solid #e4e4e4;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.photo-grid figure:hover {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    border-color: #bbb;
}

.photo-grid figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.photo-grid figure:hover img {
    transform: scale(1.04);
    filter: brightness(0.72);
}

.photo-grid figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    color: #fff;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-grid figure:hover figcaption {
    opacity: 1;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.93);
    backdrop-filter: blur(6px);
    animation: lb-fadein 0.2s ease;
}

.lightbox.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes lb-fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-inner {
    display: flex;
    align-items: stretch;
    max-width: 1100px;
    width: 95vw;
    max-height: 90vh;
    background: #141414;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: lb-slidein 0.25s ease;
}

@keyframes lb-slidein {
    from {
        transform: scale(0.96) translateY(12px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.lightbox-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    overflow: hidden;
    min-height: 300px;
}

.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease;
}

.lightbox-meta {
    width: 260px;
    flex-shrink: 0;
    padding: 2rem 1.5rem;
    border-left: 1px solid #222;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    color: #ddd;
}

#lb-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    word-break: break-word;
}

.lb-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lb-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.lb-meta-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
}

.lb-meta-value {
    font-size: 0.85rem;
    color: #ccc;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.18);
}

.lightbox-close {
    top: 1.25rem;
    right: 1.25rem;
}

.lightbox-prev {
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
}

.lightbox-next {
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
}

.photo-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
    aspect-ratio: 4/3;
    border: 1px solid #e4e4e4;
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@media (max-width: 680px) {
    .lightbox-inner {
        flex-direction: column;
        max-height: 95vh;
    }

    .lightbox-meta {
        width: 100%;
        border-left: none;
        border-top: 1px solid #222;
        padding: 1rem;
        max-height: 200px;
    }

    .lb-meta-grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem 1.5rem;
    }
}