/* ============================================================================
   Maa Koteshwari Seva Samiti Trust — Image Expansion Slider (gallery.html)
   Vanilla adaptation of the React ImageExpansionSlider component.
   ============================================================================ */

.image-slider {
    position: relative;
    background: linear-gradient(165deg, #1c0404 0%, #300808 55%, #1c0404 100%);
    border: 1px solid rgba(201, 162, 74, 0.4);
    border-radius: var(--r-xl);
    padding: 22px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    user-select: none;
}

.image-slider::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201, 162, 74, 0.16);
    border-radius: calc(var(--r-xl) - 8px);
    pointer-events: none;
}

/* ── Header: tabs + arrows ── */
.image-slider-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.image-slider-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.image-slider-tab {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.62);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
}

.image-slider-tab:hover {
    color: var(--gold-300);
}

.image-slider-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--maroon-600), var(--maroon-900));
    border-color: rgba(201, 162, 74, 0.5);
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6);
}

.image-slider-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-slider-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 162, 74, 0.35);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.image-slider-arrow:hover {
    background: rgba(201, 162, 74, 0.18);
    border-color: rgba(201, 162, 74, 0.6);
    color: #fff;
}

.image-slider-arrow:active {
    transform: scale(0.92);
}

/* ── Track ── */
.image-slider-track {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 14px;
    scrollbar-width: none;
}

.image-slider-track::-webkit-scrollbar {
    display: none;
}

.image-slider-slide {
    position: relative;
    flex: 0 0 100%;
    min-width: 0;
    height: clamp(220px, 30vw, 340px);
    scroll-snap-align: start;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    background: var(--maroon-950);
    transition: border-color 0.3s var(--ease);
}

.image-slider-slide:hover {
    border-color: rgba(201, 162, 74, 0.6);
}

.image-slider-slide img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.7s var(--ease);
}

.image-slider-slide:hover img {
    transform: scale(1.05);
}

/* ── Footer: dots + explore all ── */
.image-slider-foot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.image-slider-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.28);
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.image-slider-dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

.image-slider-dot.is-active {
    width: 30px;
    background: linear-gradient(90deg, var(--gold-400), var(--gold-300));
}

.image-slider-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.25s var(--ease);
}

.image-slider-more i {
    transition: transform 0.25s var(--ease);
}

.image-slider-more:hover {
    color: var(--gold-300);
}

.image-slider-more:hover i {
    transform: translateX(4px);
}

/* ── Fullscreen modal ── */
.image-slider-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 2, 2, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(6px);
}

.image-slider-modal[hidden] {
    display: none;
}

.image-slider-modal figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: min(92vw, 1000px);
    max-height: 100%;
}

.image-slider-modal img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: var(--r-md);
    border: 1px solid rgba(201, 162, 74, 0.4);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}

.image-slider-modal figcaption p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

.image-slider-modal-close {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 17px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    z-index: 2;
}

.image-slider-modal-close:hover {
    background: rgba(201, 162, 74, 0.25);
    border-color: rgba(201, 162, 74, 0.6);
}

.image-slider-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 18px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.image-slider-modal-nav:hover {
    background: rgba(201, 162, 74, 0.25);
    border-color: rgba(201, 162, 74, 0.6);
}

.image-slider-modal-nav:active {
    transform: translateY(-50%) scale(0.92);
}

.image-slider-modal-nav.prev {
    left: 22px;
}

.image-slider-modal-nav.next {
    right: 22px;
}

/* ── Responsive ── */
@media (min-width: 640px) {
    .image-slider-slide {
        flex-basis: calc(50% - 12px);
        height: clamp(240px, 26vw, 320px);
    }
}

@media (min-width: 1024px) {
    .image-slider-slide {
        flex-basis: calc(33.33% - 16px);
        height: clamp(260px, 22vw, 330px);
    }
}

@media (max-width: 480px) {
    .image-slider {
        padding: 16px;
    }

    .image-slider-modal-nav {
        width: 40px;
        height: 40px;
    }

    .image-slider-modal-nav.prev {
        left: 10px;
    }

    .image-slider-modal-nav.next {
        right: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .image-slider-slide img,
    .image-slider-arrow,
    .image-slider-more i {
        transition: none;
    }

    .image-slider-track {
        scroll-behavior: auto;
    }
}