/* =========================================
   ISOLATED EXPAND SLIDER
   ========================================= */

.gx-expand-slider .gx-expand-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding-bottom: 10px;
    height: 420px; /* Desktop Height */
    width: 100%;
}

.gx-expand-slider .gx-expand-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* --- DESKTOP (4 Items Per View) --- */
@media (min-width: 992px) {
    .gx-expand-slider .gx-expand-slide {
        /* Math: (100% - (3 gaps * 16px)) / 6 units */
        flex: 0 0 calc(16.666% - 13.33px); 
        scroll-snap-align: start;
        transition: flex 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        cursor: pointer;
        position: relative;
        border-radius: var(--radius-lg);
        overflow: hidden;
    }
    
    .gx-expand-slider .gx-expand-slide.is-active {
        /* Math: 3 units + 2 gaps */
        flex: 0 0 calc(50% - 8px); 
        cursor: default;
    }
}

/* --- TABLET (3 Items Per View to prevent squishing) --- */
@media (min-width: 768px) and (max-width: 991px) {
    .gx-expand-slider .gx-expand-slide {
        flex: 0 0 calc(25% - 12px);
        scroll-snap-align: start;
        transition: flex 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        cursor: pointer;
        position: relative;
        border-radius: var(--radius-lg);
        overflow: hidden;
    }
    .gx-expand-slider .gx-expand-slide.is-active {
        flex: 0 0 calc(50% - 8px);
    }
}

/* --- MOBILE (1 Full Card Per View) --- */
@media (max-width: 767px) {
    .gx-expand-slider .gx-expand-track {
        height: 350px;
    }
    .gx-expand-slider .gx-expand-slide {
        flex: 0 0 100%; 
        scroll-snap-align: start;
        border-radius: var(--radius-lg);
        overflow: hidden;
        position: relative;
    }
    /* Force "active" state visuals on mobile */
    .gx-expand-slider .card-title {
        white-space: normal !important;
        font-size: 1.5rem !important;
    }
    .gx-expand-slider .card-meta {
        opacity: 1 !important;
        height: auto !important;
        margin-top: 6px !important;
    }
    .gx-expand-slider .card-info {
        padding-right: 150px !important; /* Buffer for the mobile button */
    }
    .gx-expand-slider .btn-circle { 
        display: none !important; 
    }
    .gx-expand-slider .btn-explore {
        opacity: 1 !important;
        transform: translateX(0) !important;
        pointer-events: auto !important;
        padding: 8px 16px !important; /* Slightly smaller button on tiny screens */
    }
}

/* --- Shared Inner Card Styles --- */
.gx-expand-slider .bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.8s ease;
}

.gx-expand-slider .gx-expand-slide:hover .bg-img {
    transform: scale(1.05);
}

.gx-expand-slider .gx-expand-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%);
    z-index: 2;
    pointer-events: none;
}

.gx-expand-slider .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.gx-expand-slider .card-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    transition: padding-right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gx-expand-slider .card-title {
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.3;
    margin: 0;
    word-break: break-word;
    transition: font-size 0.4s ease;
}

.gx-expand-slider .card-meta {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, margin 0.3s ease;
}

.gx-expand-slider .card-action {
    position: relative;
    flex-shrink: 0;
    margin-left: 15px;
    display: flex;
    align-items: flex-end;
}

.gx-expand-slider .btn-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--brand-dark-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gx-expand-slider .btn-explore {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--brand-teal);
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.gx-expand-slider .btn-explore:hover {
    background: var(--brand-teal-hover);
}

/* Desktop Active Overrides */
@media (min-width: 768px) {
    .gx-expand-slider .gx-expand-slide.is-active .card-info {
        padding-right: 110px; /* Buffer for the sliding button */
    }
    .gx-expand-slider .gx-expand-slide.is-active .card-title {
        font-size: 1.6rem;
        white-space: nowrap;
    }
    .gx-expand-slider .gx-expand-slide.is-active .card-meta {
        opacity: 1;
        height: auto;
        margin-top: 6px;
    }
    .gx-expand-slider .gx-expand-slide.is-active .btn-circle {
        opacity: 0;
        transform: scale(0.5);
        pointer-events: none;
    }
    .gx-expand-slider .gx-expand-slide.is-active .btn-explore {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }
}