.gallery-intro {
    margin-bottom: 20px;
    color: var(--color-ink-soft);
    line-height: 1.7;
    max-width: 70ch;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gallery-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-paper);
    border-radius: var(--radius-md);
    padding: 24px;
    min-height: 420px;
}

.gallery-main {
    max-width: 100%;
    display: flex;
    justify-content: center;
}

.gallery-main-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    cursor: zoom-in;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background-color: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 2;
}

.gallery-nav:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-50%) scale(1.05);
}

.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.gallery-expand {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.85);
    color: var(--color-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 2;
}

.gallery-expand:hover {
    background-color: #fff;
    color: var(--color-primary);
}

.gallery-meta {
    text-align: center;
}

.gallery-indicator {
    font-family: var(--font-nav);
    font-size: 0.85rem;
    color: var(--color-muted);
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scroll-behavior: smooth;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    opacity: 0.55;
    background: none;
    transition: all 0.25s ease;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumb:hover {
    opacity: 0.85;
}

.gallery-thumb.active {
    border-color: var(--color-primary);
    opacity: 1;
}

/* Fullscreen lightbox */
.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(15, 18, 17, 0.94);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox.open {
    display: flex;
}

.gallery-lightbox-image {
    max-width: 88vw;
    max-height: 88vh;
    border-radius: 4px;
}

.gallery-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease;
}

.gallery-lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.gallery-lightbox .gallery-prev { left: 24px; }
.gallery-lightbox .gallery-next { right: 24px; }

@media (max-width: 600px) {
    .gallery-stage {
        min-height: 260px;
        padding: 14px;
    }
    .gallery-nav {
        width: 36px;
        height: 36px;
    }
    .gallery-lightbox .gallery-prev { left: 10px; }
    .gallery-lightbox .gallery-next { right: 10px; }
}
