/* ============================================================
   Just2Minutes - final frontend fixes
   Loaded last so routing/layout fixes are not overridden by legacy CSS.
   ============================================================ */
html{scroll-behavior:smooth;}
body.j2m-site{overflow-x:hidden;}
.site-header{position:relative;z-index:1060;}
.site-header .header-main{position:relative;}
.j2m-site .main-nav{min-width:0;}
.j2m-site .mobile-menu-btn{cursor:pointer;}
@media (max-width:992px){
  .j2m-site .main-nav{display:none!important;}
  .j2m-site .main-nav.show{display:flex!important;position:fixed;top:0;right:0;bottom:0;width:min(340px,88vw);height:100dvh;overflow-y:auto;overflow-x:hidden;padding:78px 18px 24px;background:#fff;box-shadow:-10px 0 30px rgba(0,0,0,.16);justify-content:flex-start;z-index:1050;}
  .j2m-site .main-nav .nav-menu{display:flex;flex-direction:column;align-items:stretch;width:100%;gap:4px;}
  .j2m-site .main-nav .nav-menu li{width:100%;}
  .j2m-site .main-nav .nav-menu a{width:100%;min-height:46px;height:auto;justify-content:flex-start;padding:11px 12px;font-size:13px;}
  .j2m-site .nav-search{margin:10px 0 0 auto;}
  .j2m-site .mobile-menu-btn{position:relative;z-index:1060;}
}
@media (max-width:575.98px){
  .j2m-site .main-nav.show{width:min(320px,92vw);padding-left:14px;padding-right:14px;}
  .j2m-site .header-main{padding-left:12px;padding-right:12px;}
  .j2m-site .site-logo img{max-width:240px;}
}
/* Prevent long titles/URLs from breaking cards and tables. */
.frontend-post-card h2,.frontend-post-card h3,.latest-page-card h2,.post-content h1,.post-content h2,.post-content h3{overflow-wrap:anywhere;}
.post-content img{max-width:100%;height:auto;}
.post-content table{width:100%;display:block;overflow-x:auto;}
/* Accessible focus state */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid rgba(46,139,87,.28);outline-offset:2px;}

/* ============================================================
   MOBILE NAVIGATION - FINAL RELIABLE FIX
   ============================================================ */
@media (max-width: 992px) {
    .j2m-site .site-header {
        position: relative;
        z-index: 1200;
    }

    .j2m-site .header-main {
        position: relative;
        min-height: 78px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-left: 60px;
        padding-right: 60px;
    }

    /* Center the logo independently of the hamburger button. */
    .j2m-site .site-logo {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: min(270px, calc(100% - 82px));
        height: 70px;
        margin: 0;
        z-index: 1202;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .j2m-site .site-logo img {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: contain;
        object-position: center;
    }

    .j2m-site .mobile-menu-btn {
        position: absolute !important;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1205 !important;
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 0;
        border-radius: 8px;
        cursor: pointer;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .j2m-site .mobile-menu-btn i {
        pointer-events: none;
        font-size: 20px;
    }

    /* Hidden drawer must never intercept taps. */
    .j2m-site .main-nav {
        pointer-events: none !important;
        visibility: hidden;
        opacity: 0;
        display: none !important;
    }

    .j2m-site .main-nav.show {
        display: flex !important;
        visibility: visible;
        opacity: 1;
        pointer-events: auto !important;
        position: fixed;
        top: 78px;
        right: 0;
        bottom: 0;
        width: min(340px, 92vw);
        height: calc(100dvh - 78px);
        margin: 0;
        padding: 14px 16px 28px;
        overflow-x: hidden;
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        background: #fff;
        box-shadow: -12px 0 32px rgba(0,0,0,.18);
        z-index: 1190;
        -webkit-overflow-scrolling: touch;
    }

    .j2m-site .main-nav .nav-menu {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        margin: 0;
        padding: 0;
    }

    .j2m-site .main-nav .nav-menu li {
        width: 100%;
        display: block;
    }

    .j2m-site .main-nav .nav-menu a {
        width: 100%;
        min-height: 50px;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 13px 14px;
        font-size: 14px;
        border-radius: 8px;
        pointer-events: auto;
        touch-action: manipulation;
    }

    .j2m-site .main-nav .nav-search {
        width: 100%;
        height: 50px;
        margin: 8px 0 0;
        padding: 13px 14px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        pointer-events: auto;
    }

    .j2m-site .mobile-nav-backdrop {
        z-index: 1180;
        pointer-events: none;
    }

    .j2m-site.mobile-nav-open .mobile-nav-backdrop {
        pointer-events: auto;
    }
}

@media (max-width: 575px) {
    .j2m-site .header-main {
        min-height: 78px;
        padding-left: 55px;
        padding-right: 55px;
    }

    .j2m-site .site-logo {
        width: min(270px, calc(100% - 72px));
        height: 72px;
    }

    .j2m-site .mobile-menu-btn {
        right: 10px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 360px) {
    .j2m-site .site-logo {
        width: calc(100% - 72px);
        height: 68px;
    }
}

/* ============================================================
   MOBILE CONTENT-ONLY LAYOUT
   Keep the full desktop website; remove secondary homepage/inner-page
   widgets on mobile so they never stack underneath the content.
   ============================================================ */
@media (max-width: 991px) {
    /* Homepage sidebars: Latest Posts / Search / Popular Posts / Categories / Subscribe */
    .j2m-site .home-left,
    .j2m-site .home-right {
        display: none !important;
    }

    /* Homepage secondary sections requested to be desktop-only. */
    .j2m-site .most-viewed-section,
    .j2m-site .quick-tips-section,
    .j2m-site .home-newsletter-section,
    .j2m-site .about-home-section,
    .j2m-site .faq-home-section {
        display: none !important;
    }

    /* Inner-page sidebars: never move below the article/content. */
    .j2m-site .frontend-page-left,
    .j2m-site .frontend-page-right,
    .j2m-site .category-page-sidebar,
    .j2m-site .single-post-shell > .frontend-page-right {
        display: none !important;
    }

    /* Nested sidebar widgets that may be present in shared templates. */
    .j2m-site .sidebar-widget,
    .j2m-site .sidebar-subscribe-card,
    .j2m-site .search-widget,
    .j2m-site .popular-widget,
    .j2m-site .category-side-widget {
        display: none !important;
    }

    /* Keep the main content full width after removing sidebars. */
    .j2m-site .frontend-page-main,
    .j2m-site .single-post-main,
    .j2m-site .category-page-main {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
}
