/* ============================================================
   MJ Slider — Saraya-style Hero Slider v2
   ============================================================ */

/* ============================================================
   GLOBAL MOBILE FIX — force Elementor columns to stack
   ============================================================ */
@media (max-width: 767px) {
    /* Elementor v2 */
    .elementor-section > .elementor-container > .elementor-row {
        flex-wrap: wrap !important;
    }
    .elementor-section > .elementor-container > .elementor-row > .elementor-column {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    /* Elementor v3 (flexbox containers) */
    .elementor-container.elementor-column-gap-default,
    .elementor-container.elementor-column-gap-narrow,
    .elementor-container.elementor-column-gap-extended,
    .elementor-container.elementor-column-gap-wide,
    .elementor-container.elementor-column-gap-wider,
    .e-con-inner,
    .e-con {
        flex-wrap: wrap !important;
        flex-direction: column !important;
    }
    .elementor-column,
    .e-con > .e-con-inner,
    .e-con > .elementor-widget {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* Section header */
.mjs-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mjs-section-title { margin: 0; font-size: 16px; font-weight: 700; color: #111827; display: flex; align-items: center; gap: 8px; }
.mjs-section-line { display: inline-block; width: 4px; height: 20px; background-color: #dc2626; border-radius: 2px; flex-shrink: 0; }
.mjs-section-more { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: #dc2626; text-decoration: none; }
.mjs-section-more:hover { opacity: 0.8; }

.mjs-wrap {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    direction: ltr;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.mjs-rtl { direction: rtl; }

/* ---- Grid: 50/50 ---- */
.mjs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
}

/* ============================================================
   BIG CARD — single card, content swapped by JS
   ============================================================ */
.mjs-bigbox {
    position: relative;
}

.mjs-big-card {
    display: block;
    width: 100%;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.mjs-big-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Image — fixed height on desktop, aspect-ratio on mobile */
.mjs-big-image {
    position: relative;
    height: 448px;
    overflow: hidden;
    background: #eee;
    display: block;
}

.mjs-big-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s ease;
}

.mjs-big-card:hover .mjs-big-image img {
    transform: scale(1.05);
}

.mjs-big-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mjs-big-card:hover .mjs-big-overlay { opacity: 1; }

/* Badge */
.mjs-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background-color: #dc2626;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.mjs-rtl .mjs-badge { right: auto; left: 14px; }

/* Body — white card below image */
.mjs-big-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
    box-sizing: border-box;
    background: #fff;
}

.mjs-big-title {
    margin: 0;
    font-size: clamp(16px, 1.8vw, 22px);
    font-weight: 700;
    color: #111827;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.mjs-big-card:hover .mjs-big-title { color: #dc2626; }

.mjs-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #6b7280;
    font-size: 13px;
    flex-wrap: wrap;
}
.mjs-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ============================================================
   SMALL LIST
   ============================================================ */
.mjs-smallbox {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow-y: auto;
    scroll-behavior: smooth;
    box-sizing: border-box;
    max-height: 613px;
}

.mjs-rtl .mjs-smallbox { direction: rtl; }

/* Scrollbar */
.mjs-smallbox::-webkit-scrollbar { width: 4px; }
.mjs-smallbox::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 2px; }
.mjs-smallbox::-webkit-scrollbar-thumb { background: #dc2626; border-radius: 2px; }

/* Each small item */
.mjs-small-item {
    height: 96px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
}

.mjs-small-item:hover { border-color: rgba(220,38,38,0.3); }

.mjs-small-item.mjs-active { border-right: 3px solid #dc2626; }
.mjs-rtl .mjs-small-item.mjs-active {
    border-right: 1px solid #e5e7eb;
    border-left: 3px solid #dc2626;
}

.mjs-small-link {
    display: flex;
    align-items: center;
    height: 96px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

/* Thumbnail */
.mjs-small-thumb {
    width: 128px;
    min-width: 128px;
    height: 100%;
    overflow: hidden;
    background: #eee;
    flex-shrink: 0;
}
.mjs-small-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.mjs-small-item:hover .mjs-small-thumb img { transform: scale(1.05); }

/* Text */
.mjs-small-text {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 5px;
    overflow: hidden;
}

.mjs-small-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mjs-small-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background-color: rgba(220,38,38,0.1);
    color: #dc2626;
    white-space: nowrap;
}

.mjs-small-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}

.mjs-small-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.mjs-small-item:hover .mjs-small-title { color: #dc2626; }

/* Arrow */
.mjs-small-arrow {
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(220,38,38,0.08);
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.2s;
    margin-right: 8px;
}
.mjs-rtl .mjs-small-arrow { margin-right: 0; margin-left: 8px; }
.mjs-small-item:hover .mjs-small-arrow { opacity: 1; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .mjs-grid {
        grid-template-columns: 1fr;
    }
    /* Switch to aspect-ratio so image scales naturally with card width */
    .mjs-big-image {
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .mjs-smallbox { max-height: 350px; }
}

@media (max-width: 600px) {
    .mjs-grid { grid-template-columns: 1fr; gap: 0; }

    /* Big card — title overlaid on image */
    .mjs-bigbox { width: 100%; }
    .mjs-big-card { position: static; border: none; border-radius: 0; width: 100%; overflow: hidden; }
    .mjs-big-link { position: relative; display: block; width: 100%; overflow: hidden; }
    .mjs-big-image {
        position: relative !important;
        width: 100% !important;
        height: 0 !important;
        padding-bottom: 56.25% !important;
        overflow: hidden !important;
    }
    .mjs-big-image img {
        position: absolute !important;
        top: 0 !important; left: 0 !important;
        width: 100% !important; height: 100% !important;
        object-fit: cover !important;
    }
    .mjs-big-overlay {
        position: absolute !important;
        top: 0; left: 0; right: 0; bottom: 0;
    }
    .mjs-big-overlay {
        opacity: 1 !important;
        background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    }
    .mjs-big-body {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;
        background: none;
        padding: 12px 14px;
        min-height: 0;
        z-index: 3;
    }
    .mjs-big-title {
        font-size: 15px;
        -webkit-line-clamp: 2;
        color: #fff !important;
    }
    .mjs-meta { color: rgba(255,255,255,0.85); font-size: 12px; }

    /* Small list */
    .mjs-smallbox { max-height: none; gap: 0; margin-top: 8px; }
    .mjs-small-item { height: 80px; }
    .mjs-small-link { height: 80px; }
    .mjs-small-thumb { width: 100px; min-width: 100px; }
    .mjs-small-title { font-size: 12px; -webkit-line-clamp: 2; }
    .mjs-small-badge { font-size: 10px; padding: 1px 6px; }
    .mjs-small-meta { font-size: 10px; }
}
