/* =================================================================
   RISI Gallery Grid Widget Stylesheet
   ================================================================ */

.risi-gallery {
    background: #0d0d0d;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    padding: 100px 60px;
    position: relative;
}

/* ─── Header ─────────────────────────────────────────────── */
.risi-gallery__header-wrap {
    max-width: 1320px;
    margin: 0 auto 60px;
    width: 100%;
}
.risi-gallery__kicker {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: #c9a84c;
    margin-bottom: 12px;
}
.risi-gallery__page-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 700;
    line-height: 1.05;
    color: #f5f0eb;
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}
.risi-gallery__subtitle {
    font-size: 14px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    line-height: 1.6;
}

/* ─── Container & Centered Slider ─────────────────────────── */
.risi-gallery__container {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 0 40px;
}
.risi-gallery__slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
}
.risi-gallery__track-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 20px 0;
}
.risi-gallery__track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.risi-gallery__item {
    flex: 0 0 50%;
    position: relative;
    padding-bottom: 35% !important;
    height: 0 !important;
    overflow: hidden;
    cursor: pointer;
    background: #111111;
    margin: 0 15px;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
    opacity: 0.35;
    transform: scale(0.88);
}
.risi-gallery__item.is-active {
    opacity: 1;
    transform: scale(1.0);
    z-index: 5;
}

.risi-gallery__image-wrap {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
.risi-gallery__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Slider Arrow Buttons */
.risi-gallery__slider-arrow {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10;
    flex-shrink: 0;
    margin: 0 15px;
}
.risi-gallery__slider-arrow:hover {
    background: #c9a84c;
    color: #0d0d0d;
    border-color: #c9a84c;
    transform: scale(1.05);
}

/* Light hover effect on the image itself */
.risi-gallery__item:hover .risi-gallery__image {
    transform: scale(1.04);
}

/* ─── Lightbox Overlay ───────────────────────────────────── */
.risi-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.risi-gallery-lightbox.is-active {
    opacity: 1;
    pointer-events: auto;
}

.risi-gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92) !important;
    backdrop-filter: blur(8px);
    z-index: 1;
}

.risi-gallery-lightbox__content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.risi-gallery-lightbox__figure {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.risi-gallery-lightbox__img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border: 8px solid #000000;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.risi-gallery-lightbox__caption {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #c9a84c;
    margin-top: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* Close & Arrow buttons */
.risi-gallery-lightbox__close {
    position: fixed;
    top: 24px;
    right: 28px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    z-index: 100001;
}
.risi-gallery-lightbox__close:hover {
    color: #c9a84c;
}

.risi-gallery-lightbox__arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
    z-index: 100001;
}
.risi-gallery-lightbox__arrow:hover:not(:disabled) {
    background: #c9a84c;
    color: #0d0d0d;
    border-color: #c9a84c;
}
.risi-gallery-lightbox__arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.risi-gallery-lightbox__arrow--prev { left: 40px; }
.risi-gallery-lightbox__arrow--next { right: 40px; }

body.risi-lightbox-open { overflow: hidden !important; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 1200px) {
    .risi-gallery {
        padding: 80px 40px;
    }
    .risi-gallery__container {
        padding: 0 20px;
    }
    .risi-gallery__item {
        flex: 0 0 60%;
        padding-bottom: 42% !important;
    }
}

@media (max-width: 1024px) {
    .risi-gallery {
        padding: 72px 32px;
    }
    .risi-gallery__header-wrap {
        margin-bottom: 48px;
    }
    .risi-gallery__item {
        flex: 0 0 70%;
        padding-bottom: 49% !important;
    }
    .risi-gallery__slider-arrow {
        width: 44px;
        height: 44px;
        font-size: 16px;
        margin: 0 8px;
    }
}

@media (max-width: 768px) {
    .risi-gallery {
        padding: 60px 20px;
    }
    .risi-gallery__header-wrap {
        margin-bottom: 36px;
    }
    .risi-gallery__page-title {
        font-size: clamp(32px, 8vw, 48px);
    }
    .risi-gallery__container {
        padding: 0 10px;
    }
    .risi-gallery__item {
        flex: 0 0 85%;
        padding-bottom: 60% !important;
        margin: 0 8px;
    }
    .risi-gallery__slider-arrow {
        width: 38px;
        height: 38px;
        font-size: 14px;
        margin: 0 4px;
    }
    /* Lightbox on mobile: arrows below image */
    .risi-gallery-lightbox__arrow {
        position: fixed;
        top: auto;
        bottom: 24px;
        transform: none;
        width: 44px;
        height: 44px;
    }
    .risi-gallery-lightbox__arrow--prev { left: calc(50% - 52px); }
    .risi-gallery-lightbox__arrow--next { right: calc(50% - 52px); }
    .risi-gallery-lightbox__img {
        max-height: 60vh;
        border-width: 4px;
    }
    .risi-gallery-lightbox__close {
        top: 16px;
        right: 16px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .risi-gallery {
        padding: 48px 16px;
    }
    .risi-gallery__item {
        flex: 0 0 92%;
        padding-bottom: 65% !important;
        margin: 0 4px;
    }
    .risi-gallery__slider-arrow {
        display: none; /* Use swipe on mobile instead */
    }
}
