/* CargoNews mobile cleanup – scoped responsive overrides */

@media screen and (max-width: 1002px) {
    /* The old theme fixes the footer to 94px, which no longer fits the refreshed footer. */
    footer.site-footer {
        height: auto !important;
        min-height: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .site-footer .site-footer-nav ul {
        height: auto !important;
        text-align: left !important;
    }

    footer.site-footer .site-footer-nav ul li {
        display: block !important;
        height: auto !important;
        line-height: 1.35 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* The new footer is in normal document flow, so the legacy mobile spacer is unnecessary. */
    section#content {
        padding-bottom: 0 !important;
    }

    /* Legacy header CSS forces all nested spans to 14px. Keep the masthead readable on tablet/mobile. */
    section#content > header .cargonews-site-masthead,
    section#content > header .cargonews-site-masthead * {
        font-family: "Open Sans", Arial, sans-serif !important;
        font-size: 32px !important;
        font-weight: 800 !important;
        line-height: 1 !important;
    }

    /* Clean mobile category drawer instead of the old tiny Arial list. */
    aside.left-sidebar div.widget_categories {
        width: 100%;
        margin: 0;
        background: #fff;
        box-sizing: border-box;
    }

    aside.left-sidebar .editorial-categories ul {
        width: 100%;
        margin: 0;
        padding: 6px 18px 10px;
        border: 1px solid #e8e8e8;
        background: #fff;
        box-sizing: border-box;
        list-style: none;
    }

    aside.left-sidebar .editorial-categories ul li {
        margin: 0 !important;
        padding: 0 !important;
        border-bottom: 1px solid #ededed;
        line-height: 1.35;
    }

    aside.left-sidebar .editorial-categories ul li:last-child {
        border-bottom: 0;
    }

    aside.left-sidebar .editorial-categories ul li a {
        display: block;
        padding: 11px 0 12px;
        color: #202020;
        font-family: "Open Sans", Arial, sans-serif;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.35;
        text-decoration: none;
    }

    aside.left-sidebar .editorial-categories ul li.current-cat a {
        color: #f38118;
        font-weight: 700;
    }

    /* Old responsive rules force article-image links to 50% width. */
    .category-archive .category-card > a.category-card-image {
        float: none !important;
    }

    article#single iframe,
    article#single video {
        max-width: 100%;
    }

    article#single table {
        max-width: 100%;
        overflow-x: auto;
    }
}

@media screen and (max-width: 700px) {
    .category-archive .category-card > a.category-card-image {
        display: block !important;
        width: 100% !important;
    }
}

@media screen and (max-width: 620px) {
    .search-archive .search-card > a.search-card-image {
        display: block !important;
        width: 132px !important;
        float: none !important;
    }
}

@media screen and (max-width: 600px) {
    /* Two compact header rows: masthead, then menu + language switcher. */
    section#content > header {
        min-height: 78px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    section#content > header .cargonews-site-masthead,
    section#content > header .cargonews-site-masthead * {
        font-size: 29px !important;
        letter-spacing: -1.2px !important;
    }

    .cargonews-site-masthead {
        top: 9px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    #content > header .lang-switcher {
        position: absolute !important;
        top: 51px !important;
        right: 0 !important;
        left: auto !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #content > header .lang-switcher li a {
        margin-right: 10px;
        font-size: 14px;
    }

    #content > header .lang-switcher li:last-child a {
        margin-right: 0;
    }

    #sidebar-toggle {
        top: 45px !important;
        left: 0 !important;
    }

    .site-footer .inner {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .site-footer-nav ul {
        gap: 0 !important;
    }

    .site-footer-nav a {
        display: block;
        padding: 8px 0;
    }
}
