/* =========================================================
   legacy-temp.css
   Временный мост: только правила, которые ещё нужны
   текущей разметке главной (footer, старые контейнеры).
   Без старого мобильного меню и без мёртвых блоков.
   ========================================================= */

/* --- Базовые контейнеры (ещё в HTML) --- */
.siteBackground {
    /* фон страницы задаётся на body inline / redesign */
}

.s3 {
    word-wrap: break-word;
}
.s3 p {
    margin: 0;
    line-height: normal;
    letter-spacing: normal;
}

.clearfix {
    clear: both;
}

/* --- Footer: старые классы (ещё в footer-m3.php) --- */
.s8screenWidthBackground {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.s8_bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: #B1C1CE;
    border-top: 0 solid #D4D6D7;
    border-bottom: 0 solid #D4D6D7;
}

.s8centeredContent {
    position: relative;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.s14screenWidthBackground {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.s14_bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.font_9 {
    font: normal normal normal 14px/1.4em Arial, sans-serif;
    color: #01153B;
}

.sFooterLink {
    color: #1D5377;
}

a.sFooterLink:hover {
    color: #0057FF;
}

.s10label {
    font: normal normal normal 15px/1.4em Arial, sans-serif;
    transition: color 0.4s ease 0s;
    cursor: pointer;
    white-space: nowrap;
    display: inline-block;
}

.s10label:hover {
    text-decoration: underline;
}

/* Footer links layout — БЕЗ min-width: 980px (источник overflow) */
.popular_links {
    /* min-width: 980px;  ← УБРАНО, вызывало overflow */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.popular_links_bg {
    padding: 20px 0 0 0;
}

.popular_links_centered_content {
    /* width: 980px;  ← УБРАНО */
    width: 100%;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.popular_links_centered_content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 16px 20px;
    width: 100%;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.popular_links_block {
    float: none;
    width: 230px;
    max-width: 100%;
    padding-bottom: 4px;
    border-radius: 5px;
    background: #eaeaea;
    background: linear-gradient(to bottom, #ffffff, #d7d7d7);
    box-sizing: border-box;
}

.popular_links_block a {
    display: block;
    margin: 5px 20px;
}

/* сдвиг только на широких экранах; на узких flex-gap заменяет margin */
.withMarginLeft {
    margin-left: 0;
}

@media (min-width: 981px) {
    .popular_links_centered_content {
        gap: 16px 20px;
    }
}

/* --- Адаптив footer (из mobile3, очищенный) --- */
@media (max-width: 1270px) {
    .popular_links_centered_content {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px 16px;
        max-width: 980px;
        width: 100%;
        margin: 0 auto;
    }

    .popular_links_block {
        margin: 0;
        float: none;
    }

    .withMarginLeft {
        margin-left: 0;
    }
}

@media (max-width: 710px) {
    .popular_links_block {
        width: min(100%, 480px);
        float: none;
        margin: 0;
    }

    .popular_links_block span,
    .s10label {
        white-space: normal;
        font-size: 1rem;
        line-height: 1.5;
    }

    .withMarginLeft {
        margin-left: 0;
    }

    /* Защита от overflow */
    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }

    #SITE_ROOT {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    #SITE_PAGES {
        padding: 12px;
        box-sizing: border-box;
    }
}
