/* Card Image Button Repeater Styles */
.brxe-card-image-button-repeater {
    display: flex;
    justify-content: center;
    margin-top:30px !important;
}

.brxe-card-image-button-repeater .cibr-container {
    max-width: var(--site-container-width);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
    margin-bottom: 35px;
}

.brxe-card-image-button-repeater .cibr-heading {
    text-align: center;
    margin-bottom: 60px !important;
    color: var(--color-primary);
    font-family: var(--font-secondary);
    font-size: 1.6em;
    text-transform: uppercase;
}

.brxe-card-image-button-repeater .cibr-grid {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

/* ---------------------------------------------------- */
/* --- CARD STYLES (FIXED ZOOM EFFECT) --- */
/* ---------------------------------------------------- */
.brxe-card-image-button-repeater .cibr-card {
    flex: 1 1 300px;
    min-height: 500px;
    position: relative;
    border-radius: 35px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    /* FIX: Hide the base background to prevent ghosting on mobile */
    background-image: none !important; 
}

/* 1. Create the smooth, zoomable background layer */
.brxe-card-image-button-repeater .cibr-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* FIX: Use the variable passed from PHP */
    background-image: var(--bg-image); 
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat; 
    
    transform: scale(1); 
    /* Using a robust transition timing function */
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
    
    z-index: 0; 
    backface-visibility: hidden;
}

/* 2. Zoom effect on hover/tap */
.brxe-card-image-button-repeater .cibr-card:hover::after {
    transform: scale(1.05);
}

/* Additionally, use :active for a stronger guarantee that the effect happens on tap */
.brxe-card-image-button-repeater .cibr-card:active::after {
    transform: scale(1.05);
}
/* ---------------------------------------------------- */

.brxe-card-image-button-repeater .cibr-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.brxe-card-image-button-repeater .cibr-content {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    text-transform: uppercase;
    font-weight: 500;
    text-align: center;
    font-size: 1.2em;
    width: 90%;
}

.brxe-card-image-button-repeater .cibr-arrow {
    display: block;
    max-width: 80px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    /* *** NOTE: Removed the hover reset here to allow the zoom to work on tap. *** */

    .brxe-card-image-button-repeater {
        margin-top:0px !important;
    }


    .brxe-card-image-button-repeater .cibr-card {
        min-height: 230px;
        font-size: 0.8em;
        border-radius: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .brxe-card-image-button-repeater .cibr-card .cibr-content {
        position: static;
        transform: none;
        width: 100%;
        text-align: center;
        padding: 30px;
    }

    .brxe-card-image-button-repeater{
        margin-bottom:2px !important; 
        margin-left:0px !important;
        margin-right:0px !important;
        
    }

    .brxe-card-image-button-repeater .cibr-card {
        border-radius:0px;
    }

    .brxe-card-image-button-repeater .cibr-grid {
        gap: 2px;
    }

    .brxe-card-image-button-repeater .cibr-heading{
        margin-bottom:40px !important;
        margin-top:30px !important;
    }

    .brx-cta-text-link {
        margin-top:35px !important;
        margin-bottom:35px !important;
    }

    .brxe-card-image-button-repeater .cibr-container {
        margin-bottom: 0px;
    }

}