.iacst-gallery {
    margin-top: 1rem;
}

.iacst-gallery-category {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.iacst-gallery-category-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    border: 0;
    background: #f8fafc;
    text-align: left;
    cursor: pointer;
}

.iacst-gallery-category-toggle:hover,
.iacst-gallery-category.is-open .iacst-gallery-category-toggle {
    background: #eef6fb;
}

.iacst-gallery-category-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: rgb(27, 130, 185);
}

.iacst-gallery-category-count {
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
}

.iacst-gallery-panel {
    padding: 0 1rem 1rem;
}

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

.iacst-gallery-item {
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: zoom-in;
    aspect-ratio: 4 / 3;
}

.iacst-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
}

.iacst-gallery-actions {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.iacst-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.iacst-gallery-lightbox[hidden] {
    display: none !important;
}

.iacst-gallery-lightbox-body {
    margin: 0;
    max-width: min(96vw, 1200px);
    max-height: 90vh;
    text-align: center;
}

.iacst-gallery-lightbox-body img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    border-radius: 0.5rem;
    background: #0f172a;
    cursor: default;
}

.iacst-gallery-lightbox-body figcaption {
    color: #e2e8f0;
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.iacst-gallery-lightbox-close,
.iacst-gallery-lightbox-prev,
.iacst-gallery-lightbox-next {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.iacst-gallery-lightbox-close {
    top: 1rem;
    right: 1rem;
}

.iacst-gallery-lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.iacst-gallery-lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

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

@media (max-width: 576px) {
    .iacst-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Gallery hub — event picker + slider */
.iacst-gallery-hub-intro {
    max-width: 46rem;
    line-height: 1.7;
}

.iacst-gallery-hub-picker .form-select {
    border-color: #cbd5e1;
}

.iacst-gallery-slider {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.85rem;
    overflow: hidden;
    background: #fff;
}

.iacst-gallery-slider-stage {
    position: relative;
    background: #0f172a;
    min-height: min(52vh, 420px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.iacst-gallery-slider-viewport {
    width: 100%;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.iacst-gallery-slider-track {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    transition: transform 0.35s ease;
    will-change: transform;
}

.iacst-gallery-slider-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1rem 3.75rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(52vh, 420px);
}

.iacst-gallery-slider-slide img,
.iacst-gallery-slider-slide-image {
    display: block;
    max-width: 100%;
    max-height: min(48vh, 380px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.35rem;
    background: #1e293b;
    cursor: zoom-in;
}

.iacst-gallery-slider-caption {
    color: #475569;
    font-size: 0.9rem;
    padding: 0.65rem 1rem 0;
    min-height: 1.5rem;
}

.iacst-gallery-slider-figure {
    display: none;
}

.iacst-gallery-slider-image {
    display: none;
}

.iacst-gallery-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.iacst-gallery-slider-nav:hover {
    background: rgba(255, 255, 255, 0.24);
}

.iacst-gallery-slider-prev { left: 0.75rem; }
.iacst-gallery-slider-next { right: 0.75rem; }

.iacst-gallery-slider-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-wrap: wrap;
}

.iacst-gallery-slider-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.iacst-gallery-hub-section-picker .form-select {
    border-color: #cbd5e1;
}

.iacst-gallery-section-hint {
    line-height: 1.5;
}

.iacst-gallery-lightbox-toolbar {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    z-index: 3;
}

.iacst-gallery-slider-counter {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.iacst-gallery-slider-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.75rem 1rem 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.iacst-gallery-slider-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 54px;
    border: 2px solid transparent;
    border-radius: 0.4rem;
    padding: 0;
    overflow: hidden;
    background: #e2e8f0;
    cursor: pointer;
    scroll-snap-align: center;
    opacity: 0.72;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.iacst-gallery-slider-thumb.is-active {
    border-color: rgb(27, 130, 185);
    opacity: 1;
}

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

.iacst-gallery-hub-video-frame {
    border-radius: 0.75rem;
    overflow: hidden;
    background: #000;
}

.iacst-gallery-hub .iacst-gallery-slider-slide img,
.iacst-gallery-hub .iacst-gallery-slider-thumb img {
    width: auto;
    max-width: 100%;
}

.iacst-gallery-hub-nav .form-select {
    max-width: 36rem;
}

@media (max-width: 576px) {
    .iacst-gallery-slider-slide {
        padding: 1rem 2.75rem;
        min-height: min(44vh, 320px);
    }

    .iacst-gallery-slider-slide img {
        max-height: min(40vh, 280px);
    }

    .iacst-gallery-slider-thumb {
        width: 64px;
        height: 48px;
    }
}
