/*
 * TweetNews24 V2 - Responsive & lightweight UI refinements
 * Existing theme/options remain intact. These rules only control layout behaviour.
 */

html, body {
    overflow-x: hidden;
}

#nav .navbar-default {
    box-shadow: none;
}

#nav .navbar-toggle {
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 3px;
    padding: 8px 9px;
}

#nav .navbar-toggle .icon-bar {
    width: 22px;
    height: 2px;
    border-radius: 2px;
}

#nav .navbar-toggle:focus {
    outline: 2px solid rgba(255,255,255,.55);
    outline-offset: 2px;
}

#nav .navbar-nav > li > a {
    transition: background-color .15s ease, color .15s ease;
}

/* Desktop/tablet: reserve a dedicated date column. Menu can wrap inside its own area. */
@media (min-width: 768px) {
    #nav .navbar-default {
        display: flex;
        align-items: flex-start;
        width: 100%;
        border-bottom: 2px solid #dddbdb;
    }

    #nav .navbar-collapse {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        padding: 0;
        overflow: visible;
    }

    #nav .navbar-collapse > .menu-main-menu-container,
    #nav .navbar-collapse > div {
        min-width: 0;
    }

    #nav .navbar-nav {
        float: none !important;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        width: 100%;
        margin: 0;
    }

    #nav .navbar-nav > li {
        float: none;
    }

    #nav .date {
        flex: 0 0 auto;
        float: none;
        clear: none;
        width: auto;
        max-width: 34%;
        margin: 0;
        padding: 6px 0 6px 10px;
        white-space: nowrap;
        text-align: right;
        color: #b80000;
    }

    #nav .date p {
        float: none;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

    #nav .dropdown-menu {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .skbd-menu-wrp {
        margin-top: 5px;
}
}

/* Mobile: toggle and date stay on the same header row; menu drops below them. */
@media (max-width: 767px) {
    .body-wrap,
    .menu-container,
    .body_container,
    .footer-container {
        max-width: 100%;
        overflow-x: hidden;
    }

    .top-header .container,
    .menu-container .container,
    .body_container .container,
    .footer-container .container {
        width: 100%;
    }

    .top-header {
        padding: 0 10px;
    }

    .logo img {
        width: min(230px, 78vw) !important;
        padding: 6px 0 10px;
    }

    #nav .navbar-default {
        position: relative;
        display: block;
        margin: 0 -15px;
        border-radius: 0;
        min-height: 46px;
    }

    #nav .navbar-header {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        min-height: 46px;
        width: 100%;
    }

    #nav .navbar-toggle {
        float: none !important;
        flex: 0 0 auto;
        margin: 6px 8px 6px 10px;
    }

    /* The date is anchored to the right of the toggle, never pushed below it. */
    #nav .date {
        position: absolute;
        top: 0;
        left: 60px;
        right: auto;
        z-index: 5;
        display: flex;
        align-items: center;
        width: auto;
        max-width: calc(100% - 64px);
        min-height: 46px;
        float: none;
        clear: none;
        margin: 0;
        padding: 0 4px;
        color: #fff;
        text-align: right;
        white-space: nowrap;
        overflow: hidden;
    }

    #nav .date p {
        float: none;
        margin: 0;
        padding: 0;
        line-height: 1.35;
        text-align: right;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #nav .navbar-collapse {
        width: 100%;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
        border-top: 1px solid rgba(255,255,255,.15);
        border-bottom: 1px solid rgba(0,0,0,.12);
    }

    #nav .navbar-nav {
        margin: 0;
        width: 100%;
        display: block;
    }

    #nav .navbar-nav > li {
        float: none;
        width: 100%;
    }

    #nav .navbar-nav > li > a {
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 9px 14px;
        margin: 0;
        border-bottom: 1px solid rgba(255,255,255,.20);
    }

    #nav .navbar-nav > .active > a,
    #nav .navbar-nav > .active > a:focus,
    #nav .navbar-nav > .active > a:hover {
        border-bottom-width: 3px;
    }

    /* Submenus use the same theme surface rather than black/grey blocks. */
    #nav .navbar-nav .open .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin: 0;
        padding: 0;
        background: inherit;
        border: 0;
        box-shadow: none;
    }

    #nav .navbar-nav .open .dropdown-menu > li {
        background: transparent;
        border-bottom: 1px solid rgba(255,255,255,.13);
    }

    #nav .navbar-nav .open .dropdown-menu > li > a,
    #nav .navbar-nav .open .dropdown-menu > li:hover > a,
    #nav .navbar-nav .open .dropdown-menu > li > a:hover,
    #nav .navbar-nav .open .dropdown-menu > li > a:focus {
        min-height: 40px;
        padding: 9px 28px;
        white-space: normal;
        color: #fff !important;
        background: rgba(255,255,255,.07);
    }

    #nav .navbar-nav .open .dropdown-menu > li > a:hover,
    #nav .navbar-nav .open .dropdown-menu > li > a:focus {
        background: rgba(255,255,255,.13);
    }

    #nav .navbar-nav .caret {
        margin-left: 8px;
        flex: 0 0 auto;
    }

    .single-ditails p {
        font-size: 20px !important;
        line-height: 1.75;
    }

    .footer_logo,
    .footer-logo {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .skbd-content-wrp-footer {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .social {
        margin-left: 0;
        text-align: center;
    }

    .box-news-list {
        gap: 12px;
    }

    .box-news-list .boxlist-card .boxlist-image img {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .box-news-list {
        grid-template-columns: 1fr !important;
    }

    .cat-wrap p {
        font-size: 17px;
    }

    .hadding_1 {
        line-height: 1.45;
    }

    #nav .date {
        left: 60px;
        right: auto;
        max-width: calc(100% - 62px);
    }

    #nav .date p {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #nav .navbar-nav > li > a {
        transition: none;
    }
}
