/* ========================================
   Tab Navigation - ABOVE the container
   ======================================== */
/* Let the site nav dropdown appear above the media gallery */
.mb-media-gallery,
.mb-media-gallery__tabs,
.mb-media-gallery__container,
.mb-media-gallery__viewer {
    z-index: auto !important;  /* or 0 if you prefer */
}
.mb-media-gallery__tabs {
    display: flex;
    gap: 10px;
    margin: 0;;
    border-bottom: 2px solid #e0e0e0;
    background: transparent;
    position: relative;

}

/* INACTIVE TABS — both Images & Videos */
.mb-media-gallery__tab {
    flex: 1;
    margin-bottom: 10px;
    padding: 1rem;
    background: #DE7A39 !important;     /* orange */
    color: #ffffff !important;        /* white text */
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: normal;              /* normal weight */
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
}

/* Hover/focus on inactive tab */
.mb-media-gallery__tab:hover {
    background: #DE7A39 !important; /* a brighter orange on hover */
    color: #ffffff !important;
}

.mb-media-gallery__tab:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ACTIVE TAB — same for images & videos */
.mb-media-gallery__tab.active {
    background: #008345 !important;  /* green */
    color: #ffffff !important;       /* white text */
    font-weight: bold !important;    /* bold when active */
    border-bottom-color: #008345;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Remove any type-specific overrides */
.mb-media-gallery__tab--images.active,
.mb-media-gallery__tab--videos.active {
    background: #008345 !important;
    border-bottom-color: #008345 !important;
    color: #ffffff !important;
}

.mb-media-gallery__arrow {
    z-index: 10;
}

/* ============================
   Modal popup for full-size image
   ============================ */

.mb-media-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 99999; /* above nav & gallery */
    display: none;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.mb-media-gallery-modal.is-open {
    display: flex;
}

.mb-media-gallery-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.mb-media-gallery-modal__dialog {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    background: #111;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mb-media-gallery-modal__image-wrapper {
    flex: 1 1 auto;
    min-height: 200px;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mb-media-gallery-modal__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.mb-media-gallery-modal__buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.mb-media-gallery-modal__save,
.mb-media-gallery-modal__close {
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    line-height: 1.2;
    cursor: pointer;
    border: 1px solid #ccc;
    text-decoration: none;
}

.mb-media-gallery-modal__save {
    display: none;
    background: #008345;        /* match your green */
    color: #fff;
    border-color: #008345;
}

.mb-media-gallery-modal__save:hover {
    background: #006c39;
    border-color: #006c39;
}

.mb-media-gallery-modal__close {
    background: #f1f1f1;
    color: #222;
}

.mb-media-gallery-modal__close:hover {
    background: #e2e2e2;
}

/* Mobile tweaks */
@media (max-width: 600px) {
    .mb-media-gallery-modal__dialog {
        width: 94vw;
        padding: 0.6rem;
    }

    .mb-media-gallery-modal__buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.mb-media-gallery__view-larger {
    display: none;              /* JS will show/hide */
    margin-left: 0.5rem;
    font-size: 0.9rem;
    color: #008345;             /* match your green */
    text-decoration: underline;
    cursor: pointer;
}

.mb-media-gallery__view-larger:hover {
    color: #006c39;
}