/* ============================================================
   RCCG BETHEL PARISH MANSFIELD
   GALLERY STYLES
============================================================ */


/* ============================================================
   GALLERY CATEGORY FILTER
============================================================ */

.gallery-filter-section {
    width: 100%;
    margin-top: 45px;
    margin-bottom: 45px;
}


/* ============================================================
   FILTER HEADING
============================================================ */

.gallery-filter-heading {
    text-align: center;
    margin-bottom: 25px;
}


.gallery-filter-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 8px;

    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}


.gallery-filter-eyebrow i {
    font-size: 0.95rem;
}


.gallery-filter-heading h3 {
    margin: 0 0 8px;

    font-size: 1.65rem;
    font-weight: 700;
}


.gallery-filter-heading p {
    max-width: 650px;

    margin: 0 auto;

    font-size: 0.95rem;
    line-height: 1.7;

    opacity: 0.75;
}


/* ============================================================
   FILTER WRAPPER

   IMPORTANT:
   Do not centre the overflow content.

   This ensures the FIRST button is always reachable
   and cannot be clipped.
============================================================ */

.gallery-filter-wrapper {
    width: 100%;

    display: block;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 6px 4px 15px;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
}


/* ============================================================
   FILTER BUTTON ROW
============================================================ */

.gallery-filter {
    display: flex;

    align-items: center;

    justify-content: flex-start;

    gap: 12px;

    width: max-content;

    min-width: 100%;

    margin: 0;

    padding: 0 4px;
}


/* ============================================================
   CATEGORY BUTTON
============================================================ */

.gallery-filter-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 9px;

    min-height: 48px;

    padding: 11px 16px;

    border: 1px solid rgba(0, 0, 0, 0.12);

    border-radius: 50px;

    background: #ffffff;

    color: inherit;

    text-decoration: none;

    font-size: 0.9rem;
    font-weight: 600;

    white-space: nowrap;

    flex: 0 0 auto;

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.05);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}


/* ============================================================
   CATEGORY ICON
============================================================ */

.gallery-filter-btn > i:first-child {
    font-size: 1.05rem;

    flex-shrink: 0;
}


/* ============================================================
   BUTTON ARROW
============================================================ */

.gallery-filter-arrow {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    font-size: 0.72rem;

    opacity: 0.5;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}


/* ============================================================
   BUTTON HOVER
============================================================ */

.gallery-filter-btn:hover {
    transform: translateY(-2px);

    text-decoration: none;

    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.10);

    border-color:
        rgba(0, 0, 0, 0.22);
}


.gallery-filter-btn:hover
.gallery-filter-arrow {

    transform: translateX(3px);

    opacity: 1;
}


/* ============================================================
   ACTIVE BUTTON
============================================================ */

.gallery-filter-btn.active {
    color: #165004;

    border-color: transparent;

    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.15);

    

    border: 1px solid rgba(207, 16, 16, 0.12);

    border-radius: 50px;

    background: #5BC0AB;

    transform: translateY(-1px);
}


.gallery-filter-btn.active
.gallery-filter-arrow {

    opacity: 1;
}


/* ============================================================
   KEYBOARD ACCESSIBILITY
============================================================ */

.gallery-filter-btn:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.35);

    outline-offset: 3px;
}


/* ============================================================
   PHOTO GRID
============================================================ */

.gallery-grid {
    row-gap: 18px;

    margin-left: -6px;
    margin-right: -6px;
}


.gallery-grid > .gallery-item {
    padding-left: 6px;
    padding-right: 6px;
}


/* ============================================================
   GALLERY CARD
============================================================ */

.gallery-card {
    position: relative;

    width: 100%;

    overflow: hidden;

    border-radius: 8px;

    background: #ffffff;

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.07);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


.gallery-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.12);
}


/* ============================================================
   IMAGE LINK
============================================================ */

.gallery-image-link {
    position: relative;

    display: block;

    width: 100%;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    text-decoration: none;
}


/* ============================================================
   GALLERY IMAGE
============================================================ */

.gallery-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.35s ease;
}


.gallery-card:hover
.gallery-image {

    transform: scale(1.05);
}


/* ============================================================
   IMAGE OVERLAY
============================================================ */

.gallery-image-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        rgba(0, 0, 0, 0.45);

    opacity: 0;

    transition:
        opacity 0.25s ease;
}


.gallery-card:hover
.gallery-image-overlay {

    opacity: 1;
}


/* ============================================================
   OVERLAY CONTENT
============================================================ */

.gallery-overlay-content {
    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 5px;

    color: #ffffff;

    font-size: 0.75rem;

    font-weight: 600;
}


.gallery-overlay-content i {
    font-size: 1.35rem;
}


/* ============================================================
   IMAGE CATEGORY LABEL
============================================================ */

.gallery-card-info {
    display: flex;

    align-items: center;

    justify-content: center;

    min-height: 36px;

    padding: 7px 5px;

    background: #ffffff;

    text-align: center;
}


.gallery-category {
    display: block;

    max-width: 100%;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 0.72rem;

    font-weight: 600;
}


/* ============================================================
   EMPTY STATE
============================================================ */

.gallery-empty {
    padding: 70px 20px;

    text-align: center;
}


.gallery-empty-icon {
    margin-bottom: 15px;

    font-size: 3rem;

    opacity: 0.35;
}


.gallery-empty h4 {
    margin-bottom: 10px;
}


.gallery-empty p {
    margin: 0;

    opacity: 0.7;
}


/* ============================================================
   IMAGE MODAL / LIGHTBOX
============================================================ */

.gallery-modal {
    padding: 0 !important;
}


.gallery-modal .modal-dialog {
    width: 100%;
    max-width: 100vw;

    height: 100vh;

    margin: 0;

    overflow: hidden;
}


.gallery-modal .modal-content {
    position: relative;

    width: 100%;
    height: 100vh;

    min-height: 100vh;

    overflow: hidden;

    border: 0;

    border-radius: 0;

    background: #101010;
}


/* ============================================================
   MODAL BODY
============================================================ */

.gallery-modal .modal-body {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    padding: 0;

    overflow: hidden;
}


/* ============================================================
   IMAGE WRAPPER
============================================================ */

.gallery-modal-image-wrapper {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    padding: 70px 100px 80px;

    overflow: hidden;

    background: #101010;
}


/* ============================================================
   PREVIEW IMAGE
============================================================ */

.gallery-modal-image-wrapper img {
    display: block;

    width: auto;
    height: auto;

    max-width: 100%;

    max-height:
        calc(100vh - 150px);

    object-fit: contain;

    margin: auto;

    border-radius: 4px;
}


/* ============================================================
   CLOSE BUTTON
============================================================ */

.gallery-modal-close {
    position: absolute;

    top: 18px;
    right: 22px;

    z-index: 50;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 0;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.14);

    color: #ffffff;

    font-size: 1rem;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}


.gallery-modal-close:hover {
    background:
        rgba(255, 255, 255, 0.28);

    transform: scale(1.05);
}


/* ============================================================
   PREVIOUS / NEXT NAVIGATION
============================================================ */

.gallery-modal-nav {
    position: absolute;

    top: 50%;

    z-index: 50;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 54px;
    height: 54px;

    padding: 0;

    margin: 0;

    border: 0;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.16);

    color: #ffffff;

    font-size: 1.5rem;

    cursor: pointer;

    transform:
        translateY(-50%);

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}


/* ============================================================
   PREVIOUS
============================================================ */

.gallery-modal-prev {
    left: 24px;
}


/* ============================================================
   NEXT
============================================================ */

.gallery-modal-next {
    right: 24px;
}


/* ============================================================
   NAVIGATION HOVER
============================================================ */

.gallery-modal-nav:hover {
    background:
        rgba(255, 255, 255, 0.30);
}


.gallery-modal-prev:hover {
    transform:
        translate(-3px, -50%);
}


.gallery-modal-next:hover {
    transform:
        translate(3px, -50%);
}


/* ============================================================
   MODAL CAPTION
============================================================ */

.gallery-modal-caption {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 40;

    display: flex;

    align-items: center;

    justify-content: space-between;

    min-height: 70px;

    padding: 18px 30px;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.85),
            rgba(0, 0, 0, 0)
        );

    color: #ffffff;

    pointer-events: none;
}


.gallery-modal-caption
span:first-child {

    font-size: 0.95rem;

    font-weight: 600;
}


.gallery-modal-counter {
    font-size: 0.85rem;

    opacity: 0.8;
}


/* ============================================================
   REMOVE BOOTSTRAP MODAL SCROLLING
============================================================ */

body.modal-open {
    overflow: hidden !important;

    padding-right: 0 !important;
}


/* ============================================================
   LARGE DESKTOP
============================================================ */

@media (min-width: 1200px) {

    .gallery-modal-image-wrapper {
        padding-left: 110px;
        padding-right: 110px;
    }


    .gallery-modal-image-wrapper img {

        max-width:
            calc(100vw - 220px);

        max-height:
            calc(100vh - 150px);
    }


    .gallery-modal-nav {

        width: 58px;
        height: 58px;
    }


    .gallery-modal-prev {
        left: 28px;
    }


    .gallery-modal-next {
        right: 28px;
    }

}


/* ============================================================
   TABLET / MEDIUM DESKTOP
============================================================ */

@media (min-width: 768px)
and (max-width: 1199.98px) {

    .gallery-modal-image-wrapper {

        padding:
            70px 85px 80px;
    }


    .gallery-modal-image-wrapper img {

        max-width:
            calc(100vw - 170px);

        max-height:
            calc(100vh - 150px);
    }


    .gallery-modal-prev {
        left: 18px;
    }


    .gallery-modal-next {
        right: 18px;
    }

}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 767.98px) {

    /* --------------------------------------------------------
       CATEGORY FILTER
    -------------------------------------------------------- */

    .gallery-filter-section {

        margin-top: 35px;

        margin-bottom: 35px;
    }


    .gallery-filter-heading {

        margin-bottom: 20px;
    }


    .gallery-filter-heading h3 {

        font-size: 1.4rem;
    }


    .gallery-filter-heading p {

        font-size: 0.9rem;

        padding:
            0 10px;
    }


    .gallery-filter-wrapper {

        justify-content: flex-start;

        padding-left: 4px;

        padding-right: 4px;
    }


    .gallery-filter {

        justify-content: flex-start;

        gap: 9px;

        padding-left: 2px;

        padding-right: 2px;
    }


    .gallery-filter-btn {

        min-height: 44px;

        padding:
            9px 14px;

        font-size: 0.84rem;
    }


    .gallery-filter-btn > i:first-child {

        font-size: 0.95rem;
    }


    /* --------------------------------------------------------
       PHOTO GRID
       2 images per row on mobile
    -------------------------------------------------------- */

    .gallery-grid {

        row-gap: 12px;

        margin-left: -4px;

        margin-right: -4px;
    }


    .gallery-grid > .gallery-item {

        padding-left: 4px;

        padding-right: 4px;
    }


    .gallery-card {

        border-radius: 6px;
    }


    .gallery-card-info {

        min-height: 32px;

        padding:
            5px 4px;
    }


    .gallery-category {

        font-size: 0.65rem;
    }


    /* --------------------------------------------------------
       MODAL
    -------------------------------------------------------- */

    .gallery-modal .modal-dialog {

        width: 100%;

        max-width: 100%;

        height: 100dvh;

        min-height: 100dvh;
    }


    .gallery-modal .modal-content {

        height: 100dvh;

        min-height: 100dvh;
    }


    .gallery-modal .modal-body {

        height: 100dvh;
    }


    .gallery-modal-image-wrapper {

        width: 100%;

        height: 100%;

        padding:
            65px 60px 80px;
    }


    .gallery-modal-image-wrapper img {

        max-width: 100%;

        max-height:
            calc(100dvh - 145px);
    }


    .gallery-modal-nav {

        width: 44px;

        height: 44px;

        font-size: 1.15rem;
    }


    .gallery-modal-prev {

        left: 8px;
    }


    .gallery-modal-next {

        right: 8px;
    }


    .gallery-modal-close {

        top: 12px;

        right: 12px;

        width: 40px;

        height: 40px;
    }


    .gallery-modal-caption {

        min-height: 60px;

        padding:
            12px 18px;
    }


    .gallery-modal-caption
    span:first-child {

        font-size: 0.82rem;
    }


    .gallery-modal-counter {

        font-size: 0.78rem;
    }

}


/* ============================================================
   VERY SMALL PHONES
============================================================ */

@media (max-width: 480px) {

    .gallery-modal-image-wrapper {

        padding-left: 50px;

        padding-right: 50px;
    }


    .gallery-modal-image-wrapper img {

        max-width: 100%;

        max-height:
            calc(100dvh - 140px);
    }


    .gallery-modal-nav {

        width: 40px;

        height: 40px;
    }


    .gallery-modal-prev {

        left: 5px;
    }


    .gallery-modal-next {

        right: 5px;
    }

}
