/* =========================================
   OSHO CUSTOM GALLERY
   FRONT-END GALLERY GRID
========================================= */

.ocg-gallery {
    width: 100%;
    margin: 0 auto;
}

.ocg-grid {
    display: grid;
    grid-template-columns: repeat(var(--ocg-columns), minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}

.ocg-item {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
}

.ocg-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.ocg-item:hover img {
    transform: scale(1.04);
}


/* =========================================
   LIGHTBOX
========================================= */

.ocg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(20, 12, 12, 0.96);

    opacity: 0;
    visibility: hidden;

    transition: opacity 0.25s ease;
}

.ocg-lightbox.ocg-open {
    opacity: 1;
    visibility: visible;
}


/* =========================================
   LIGHTBOX IMAGE AREA
========================================= */

.ocg-lightbox-stage {
    position: relative;

    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    touch-action: none;
}

.ocg-lightbox-image {
    display: block;

    max-width: 92vw;
    max-height: 88vh;

    width: auto;
    height: auto;

    object-fit: contain;

    user-select: none;
    -webkit-user-drag: none;

    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: center center;

    transition: transform 0.2s ease;
}


/* =========================================
   COMMON LIGHTBOX BUTTON STYLE
========================================= */

.ocg-lightbox button {
    box-sizing: border-box;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;
    margin: 0;

    border: 0 !important;
    outline: none !important;

    background: #5a3b39 !important;
    color: #e79973 !important;

    cursor: pointer;

    line-height: 1 !important;
    text-align: center;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.ocg-lightbox button:hover {
    background: #e79973 !important;
    color: #5a3b39 !important;
}


/* =========================================
   CLOSE BUTTON
========================================= */

.ocg-lightbox-close {
    position: absolute;

    top: 20px;
    right: 24px;

    z-index: 100;

    width: 46px;
    height: 46px;

    border-radius: 50% !important;

    background: #5a3b39 !important;
    color: #e79973 !important;

    font-size: 27px !important;
    font-weight: 400;

    line-height: 1 !important;
}

.ocg-lightbox-close:hover {
    background: #e79973 !important;
    color: #5a3b39 !important;

    transform: scale(1.05);
}


/* =========================================
   PREVIOUS / NEXT
========================================= */

.ocg-lightbox-prev,
.ocg-lightbox-next {
    position: absolute;

    top: 50%;

    z-index: 100;

    width: 46px;
    height: 46px;

    margin-top: -23px;

    border-radius: 50% !important;

    background: #5a3b39 !important;
    color: #e79973 !important;

    font-size: 28px !important;
    line-height: 1 !important;
}

.ocg-lightbox-prev {
    left: 20px;
}

.ocg-lightbox-next {
    right: 20px;
}

.ocg-lightbox-prev:hover,
.ocg-lightbox-next:hover {
    background: #e79973 !important;
    color: #5a3b39 !important;

    transform: scale(1.05);
}


/* =========================================
   TOP ACTIONS
   +  -  FULLSCREEN
========================================= */

.ocg-lightbox-actions {
    position: absolute;

    top: 20px;
    left: 24px;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    gap: 8px;
}


/* Individual action buttons */

.ocg-lightbox-action {
    width: 46px !important;
    height: 46px !important;

    flex: 0 0 46px;

    border-radius: 50% !important;

    background: #5a3b39 !important;
    color: #e79973 !important;

    font-size: 21px !important;
    font-weight: 400;

    line-height: 1 !important;
}

.ocg-lightbox-action:hover {
    background: #e79973 !important;
    color: #5a3b39 !important;

    transform: scale(1.05);
}


/* =========================================
   ICON ALIGNMENT
========================================= */

.ocg-lightbox-action svg,
.ocg-lightbox-close svg,
.ocg-lightbox-prev svg,
.ocg-lightbox-next svg {
    display: block;

    width: 20px;
    height: 20px;

    margin: 0;
    padding: 0;

    fill: currentColor;
    stroke: currentColor;
}


/* =========================================
   CAPTION
========================================= */

.ocg-lightbox-caption {
    position: absolute;

    left: 50%;
    bottom: 24px;

    z-index: 10;

    width: min(800px, 80vw);

    transform: translateX(-50%);

    color: #e79973;

    text-align: center;

    font-size: 15px;
    line-height: 1.5;

    padding: 8px 15px;

    background: rgba(90, 59, 57, 0.90);

    border-radius: 20px;

    box-sizing: border-box;
}


/* =========================================
   IMAGE COUNTER
========================================= */

.ocg-lightbox-counter {
    position: absolute;

    bottom: 25px;
    right: 25px;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 54px;
    height: 34px;

    box-sizing: border-box;

    padding: 0 12px;

    color: #e79973;

    font-size: 13px;
    font-weight: 500;

    line-height: 1;

    background: #5a3b39;

    border-radius: 20px;
}


/* =========================================
   NO SCROLL WHEN LIGHTBOX IS OPEN
========================================= */

body.ocg-lightbox-open {
    overflow: hidden;
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 900px) {

    .ocg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .ocg-lightbox-image {
        max-width: 94vw;
        max-height: 84vh;
    }
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {

    .ocg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .ocg-item {
        border-radius: 5px;
        aspect-ratio: 1 / 1;
    }

    .ocg-item:hover img {
        transform: none;
    }

    .ocg-lightbox button {
        background: none;
    }


    /* =====================================
       FULL SCREEN MOBILE LIGHTBOX
    ===================================== */

    .ocg-lightbox {
        background: #140c0c;
    }

    .ocg-lightbox-stage {
        width: 100vw;
        height: 100vh;
    }

    .ocg-lightbox-image {
        max-width: 100vw;
        max-height: 100vh;

        width: auto;
        height: auto;

        object-fit: contain;
    }


    /* =====================================
       TOP ACTIONS
    ===================================== */

    .ocg-lightbox-actions {
        top: 12px;
        left: 12px;

        gap: 6px;
    }

    .ocg-lightbox-action {
        width: 42px !important;
        height: 42px !important;

        flex: 0 0 42px;

        font-size: 18px !important;
    }


    /* =====================================
       CLOSE
    ===================================== */

    .ocg-lightbox-close {
        top: 12px;
        right: 12px;

        width: 42px;
        height: 42px;

        font-size: 25px !important;
    }


    /* =====================================
       PREVIOUS / NEXT
       MOBILE ARROW FIX
    ===================================== */

    .ocg-lightbox-prev,
    .ocg-lightbox-next {
        position: absolute !important;

        width: 40px !important;
        height: 40px !important;

        margin-top: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        padding: 0 !important;

        font-size: 24px !important;
        line-height: 1 !important;

        /* No background */
        background: transparent !important;
        background-color: transparent !important;

        /* No border/shadow */
        border: none !important;
        box-shadow: none !important;

        /* Keep arrow vertically centered */
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    .ocg-lightbox-prev {
        left: 8px !important;
        right: auto !important;
    }

    .ocg-lightbox-next {
        right: 8px !important;
        left: auto !important;
    }


    /* Make the actual arrow/icon centered too */
    .ocg-lightbox-prev *,
    .ocg-lightbox-next * {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        line-height: 1 !important;
    }


    /* =====================================
       CAPTION
    ===================================== */

    .ocg-lightbox-caption {
        bottom: 18px;

        width: 80vw;

        font-size: 13px;

        padding: 6px 12px;
    }


    /* =====================================
       COUNTER
    ===================================== */

    .ocg-lightbox-counter {
        right: 12px;
        bottom: 12px;

        min-width: 50px;
        height: 32px;

        padding: 0 10px;

        font-size: 12px;
    }
}

/* =========================================
   VERY SMALL MOBILE
========================================= */

@media (max-width: 380px) {

    .ocg-grid {
        gap: 6px;
    }

    .ocg-lightbox-prev,
    .ocg-lightbox-next {
        display: none;
    }
}