/* =================================================
   AJESH PHYSIO EXERCISE – THEME SAFE CSS
   SCOPE: /exercise/ PAGE ONLY
================================================= */

/* ===============================
   GLOBAL SAFETY (EXERCISE PAGE)
=============================== */
body.page-slug-exercise *,
body.page-id-13248 *{
    box-sizing: border-box !important;
}

/* ===============================
   EXERCISE HOME SECTIONS
=============================== */
body.page-slug-exercise .ex-section,
body.page-id-13248 .ex-section{
    width:100% !important;
    max-width:100% !important;
    margin-bottom:48px;
    overflow:hidden;
}

/* ===============================
   HEADER ROW
=============================== */
body.page-slug-exercise .ex-head,
body.page-id-13248 .ex-head{
    display:flex !important;
    justify-content:space-between;
    align-items:center;
    margin-bottom:16px;
}

body.page-slug-exercise .ex-head h2,
body.page-id-13248 .ex-head h2{
    font-size:24px;
    font-weight:600;
    color:#1f3c5a;
}

body.page-slug-exercise .ex-head a,
body.page-id-13248 .ex-head a{
    font-size:14px;
    color:#3b82f6;
    text-decoration:none;
    font-weight:500;
}

/* ===============================
   HORIZONTAL SCROLL ROW (CORE FIX)
=============================== */
body.page-slug-exercise .ex-row,
body.page-id-13248 .ex-row{
    display:flex !important;
    flex-wrap:nowrap !important;
    gap:20px;
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    overflow-y:hidden;
    scroll-snap-type:x mandatory;
    padding-bottom:12px;
    -webkit-overflow-scrolling:touch;
}

/* Scrollbar */
body.page-slug-exercise .ex-row::-webkit-scrollbar,
body.page-id-13248 .ex-row::-webkit-scrollbar{
    height:6px;
}
body.page-slug-exercise .ex-row::-webkit-scrollbar-thumb,
body.page-id-13248 .ex-row::-webkit-scrollbar-thumb{
    background:#cfd8e3;
    border-radius:10px;
}

/* ===============================
   EXERCISE CARDS (UNBREAKABLE)
=============================== */
body.page-slug-exercise .ex-card,
body.page-id-13248 .ex-card{
    min-width:240px !important;
    flex-shrink:0 !important;
    background:rgba(255,255,255,0.95);
    border-radius:24px;
    padding:14px;
    box-shadow:0 8px 24px rgba(0,0,0,0.08);
    scroll-snap-align:start;
    transition:all .25s ease;
}

body.page-slug-exercise .ex-card:hover,
body.page-id-13248 .ex-card:hover{
    transform:translateY(-4px);
    box-shadow:0 14px 32px rgba(59,130,246,0.25);
}

body.page-slug-exercise .ex-card img,
body.page-id-13248 .ex-card img{
    width:100%;
    height:140px;
    object-fit:cover;
    border-radius:18px;
    margin-bottom:12px;
}

/* ===============================
   CARD CONTENT
=============================== */
body.page-slug-exercise .ex-title,
body.page-id-13248 .ex-title{
    font-size:16px;
    font-weight:500;
    color:#1f2937;
    margin-bottom:10px;
}

body.page-slug-exercise .ex-btn,
body.page-id-13248 .ex-btn{
    display:inline-flex;
    align-items:center;
    gap:6px;
    background:#3b82f6;
    color:#fff;
    padding:8px 16px;
    border-radius:999px;
    text-decoration:none;
    font-size:14px;
    transition:.25s ease;
}

body.page-slug-exercise .ex-btn:hover,
body.page-id-13248 .ex-btn:hover{
    background:#2563eb;
    box-shadow:0 0 10px rgba(59,130,246,0.5);
}

/* ===============================
   HIDE LISTING ON HOME
=============================== */
body.page-slug-exercise .exercise-listing,
body.page-slug-exercise .pem-grid,
body.page-slug-exercise .pem-card,
body.page-id-13248 .exercise-listing,
body.page-id-13248 .pem-grid,
body.page-id-13248 .pem-card{
    display:none !important;
}

/* ===============================
   PROTECT FROM ELEMENTOR / THEME
=============================== */
body.page-slug-exercise .elementor-section,
body.page-slug-exercise .elementor-container,
body.page-slug-exercise .elementor-widget-wrap,
body.page-id-13248 .elementor-section,
body.page-id-13248 .elementor-container,
body.page-id-13248 .elementor-widget-wrap{
    max-width:100% !important;
    width:100% !important;
    overflow:visible !important;
}

.pem-order{
    width:22px;
    height:22px;
    background:#2563eb;
    color:#fff;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:12px;
    font-weight:600;
}

.pem-order:empty{
    display:none;
}

/* ===============================
   EXERCISE IMAGE (VIDEO KE NICHE)
=============================== */

body .pem-ex-img{
    margin-top:12px;
    display:flex;
    justify-content:center;
}

/* ===============================
   VIDEO + IMAGE PERFECT ALIGN FIX
=============================== */

.pem-media-wrap{
    display:flex;
    gap:15px;
    margin-top:10px;
    align-items:center;   /* 🔥 CHANGE: stretch → center */
}

/* VIDEO (70%) */
.pem-video{
    flex:7;
    height:260px;
    display:flex;
}

.pem-video iframe{
    width:100%;
    height:100%;
    border-radius:10px;
    display:block;
}

/* IMAGE (30%) */
.pem-ex-img{
    flex:3;
    height:260px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#000;
    border-radius:10px;
	overflow:hidden;
	
	padding:10px;
}

/* IMAGE */
.pem-ex-img img{
    width:100%;
    height:100%;
    object-fit:contain;
}

/* 📱 MOBILE */
@media(max-width:768px){
    .pem-media-wrap{
        flex-direction:column;
    }

    .pem-video,
    .pem-ex-img{
        height:auto;
    }
}