/* Mobile (max 715px) */
@media (max-width: 715px) {

    /* body {
        overflow-x: hidden;
    } */
    /* Header */
    .header-banner {
        /* flex-wrap: wrap;  */
        justify-content: flex-end; 
        /* align-content: center;
        padding-left: 80px; 
        padding-bottom: 10px;
        padding-top: 10px;
        padding-right: 15px; */
        position: relative;
        /* height: auto; */
        
    }

    .menu-btn-icon {
        width: 2em;
        height: 3px;
        background: white;
        display: inline-block;
        position: relative;
        box-shadow: 0 -10px 0 white, 0 10px 0 white;
        /* bottom: 14px; */
        border-radius: 2px;
    }

    .menu-btn {




        padding: 14px 5px; /* This creates a large, invisible clickable area around the icon */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        outline: none;


        /* display: block; */
        position: absolute;
        left: 0;
        /* bottom: 5px; */
        border: none;
        margin: 0;
        z-index: 10;
        background: none;
        /* border-radius: 4px;
        color: white;
        font-size: xx-large; */
        cursor: pointer;
    }

    body.rtl-mode .menu-btn {
        left: unset;
        right: 0px;
        /* bottom: 5px; */
    }

    .logo-img {
        display: block;
        position: absolute;
        top: 5px;
        left: 20px;
    }

    body.rtl-mode .logo-img {
        right: 15px;
    }
    
    .logo-text {
        line-height: .8;
        position: absolute;
        top: 10px;
        right: 0;
    }
    
    body.rtl-mode .logo-text {
        left: 0;
        right: unset;
        top: 10px;
    }

    /* body.rtl-mode .language-switcher-wrapper {
        left: 50%;
    } */
    /* .search-compact { margin-left: 0; width: auto; margin-bottom: 0; } */
    .search-input-field { width: 110px; }
    /* .language-switcher { margin-left: 10px; margin-bottom: 0; white-space: nowrap; } */

    /* Main Grid Stack */
    .main-layout {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas: "main" "left" "right";
        gap: 0.5rem;
    }

    .footer-modules { grid-template-columns: 1fr; }

    /* Mobile Nav (Off-Canvas) */
    nav {
        font-weight: 700;
        padding-top: 100px;
        position: fixed;
        width: 310px;
        top: 0;
        left: -100%;
        height: 100vh;
        background: #1a3658dd;
        transition: left 0.3s ease;
        backdrop-filter: blur(8px);
        overflow-y: auto;
        max-width: 100%;
    }
    body.rtl-mode nav {
        left: unset;
        right: -100%;
        transition: right 0.3s ease;
    }
    nav.open { left: 0; opacity: 1; box-shadow: 5px 0 15px rgba(0,0,0,0.5); }
    body.rtl-mode nav.open {
        left: unset;
        right: 0;
    }

    nav > ul { flex-direction: column; padding: 0; margin: 0; background: transparent; }
    nav li { width: 100%; display: block; border-bottom: 1px solid #1f3e63; }
    nav li a { padding: 12px 12px; display: block; width: 100%; font-size: 15px; }
    nav li li a { font-size: 14px;color: #ffd; }
    nav li li li a { font-size: 13px; color: #fc9;}
    nav li:hover > a { background: none; }

    /* Mobile Accordion Logic */
    nav li ul {
        display: block; 
        position: relative;
        max-height: 0;
        overflow: hidden;
        background: #23466a;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        top: auto; left: auto;
        width: 100%;
    }
    
    nav li ul ul { left: 5%; top: 0; }
    nav li ul li { border-bottom: none; border-left: none; }

    body.rtl-mode  nav  li > ul > li > ul > li { right: 20px; }
    body.rtl-mode nav li ul ul {
        right: unset;
    }

    nav li ul.open { max-height: 1000px; opacity: 1; }

    .submenu-toggle {
        margin-left: 10px;
        font-size: 1rem;
        transform: rotate(0deg);
        transition: transform 0.3s;
    }
    .submenu-li.open .submenu-toggle { transform: rotate(-60deg); }

    .close-nav {
        display: flex;
        position: fixed;
        right: 10px;
        top: 70px;
        width: 25px;
        height: 25px;
        border-radius: 4px;
        border: solid lightgrey 1px;
        background: #fff00000;
        align-items: center;
        justify-content: center;
        color: lightgrey;
        font-size: 28px;
        cursor: pointer;
    }
    body.rtl-mode .close-nav {
        right: unset;
        left: 10px;
    }
    /* Modules Mobile Tweak */
    .comment-header { align-items: flex-start; }
    .header-left { flex-direction: column; gap: 0; }
    .comment-date { margin-top: 2px; font-size: 11px; }
    .comment-number { font-size: 12px; }
    .comment-box { padding: 10px; }
    .vote-badge { font-size: 14px; }

    .poll-data { flex-wrap: wrap; }
    .poll-bar-container { width: 100%; order: 3; margin-top: 5px; }
    .poll-percent { margin-left: auto; }

    .articles_table th, .articles_table td { padding: 10px 5px; }
    .articles_table .label { font-size: 0.7rem; padding: 2px 5px; }


    .container {
        max-width: unset;
        margin: unset;
        /* padding: unset;
        width: unset;
        position: unset; */
    }

    /* Force the menu list to stack vertically on mobile */
    nav .container > ul { 
        flex-direction: column; 
        display: block; /* Overrides the flexbox from desktop */
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .meta-sep {
        display: none; /* Hide dots on mobile to save space */
    }


    /* .header-flex-container {
        flex-direction: column !important;
        align-items: center;
    } */

    .main-layout.article-view {
        grid-template-columns: 1fr;
        grid-template-areas: "main" "left";
    }

     .feature-slide {min-height: 260px; }
}



/* Mobile (max 600px) */
@media (max-width: 600px) { 

/* ==========================================================================
   Handling img inside article meat
   ========================================================================== */
    .article-preview img, #tab-text img, #article_meat img {
        max-width: 100%;
        margin: 10px auto ;
      }

    .article-preview img , .topRight, .middleRight, .topLeft, .middleLeft{
        float: unset; 
        /* margin: unset; */
    }

    /* #article_meat .midCenterP {
         text-align: unset ;  
         text-indent: unset; 
    } */

    #article_meat p.midCenterP img.midCenterImg{
        /* display:unset ;  */
        max-width:100% ; 
    }

    .header-banner {
        clip-path: inset(0 0 0 0);
    }


    .feature-slide img {
        max-height: unset;
        max-width: 100%;
    }

   
}

@media (max-width: 450px) { 
    .logo-text {
        top: 24px !important;
    }
}