/**
 * Урезанная главная под статьёй (#mainpage) + квадратный Adfox.
 * Подключается в egheader.php (внутренние) и в ?main=1.
 */

#mainpage .main2019_bottom {
    background-color: #f0f0f0;
}

#mainpage .div66-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

#mainpage .div66-item {
    flex: 1;
    min-width: calc(50% - 4px);
    box-sizing: border-box;
    background-color: white;
    margin-bottom: 8px;
    box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.2), 0 0 1px 0 rgba(0, 0, 0, 0.2);
    padding: 0;
    border-radius: 7px;
}

#mainpage .padding_25 {
    padding: 25px;
}

#mainpage .padding_25lr {
    padding-left: 25px;
    padding-right: 25px;
}

#mainpage .div66-item4 {
    flex: 1;
    min-width: calc(25% - 8px);
    box-sizing: border-box;
    background-color: white;
    margin-bottom: 8px;
    box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.2), 0 0 1px 0 rgba(0, 0, 0, 0.2);
    padding: 0;
    border-radius: 7px;
}

#mainpage .div66-item img,
#mainpage .div66-item4 img {
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
}

#mainpage .allrounded img {
    border-radius: 7px;
}

#mainpage .nobox {
    background-color: initial;
    box-shadow: initial;
    box-sizing: initial;
}

#mainpage .div66-container-min-height {
    min-height: 500px;
}

#mainpage .main2019_vertical-news-image,
#mainpage .main2019_top-news-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
}

#mainpage .nofixed-top.eg-adfox-rastyagka #adfox_rastyagka_0 {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    #mainpage .div66-item {
        min-width: 100%;
    }

    #mainpage .padding_25lr {
        padding-left: 16px;
        padding-right: 16px;
    }

    #mainpage .div66-item4 {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    #mainpage .div66-container {
        flex-direction: column-reverse;
    }

    #mainpage .div66-item,
    #mainpage .div66-item4 {
        box-shadow: initial;
        background-color: #f0f0f0;
        margin-bottom: 0;
        padding-bottom: 10px;
    }

    #mainpage .padding_25 {
        padding: 0;
        padding-bottom: 15px;
    }

    #mainpage .whitemob {
        background-color: white;
    }

    #mainpage .main2019_vertical-news-image-wrapper {
        display: none;
    }

    #mainpage .main2019_vertical-news-image-link {
        margin-left: -15px;
        margin-top: -15px;
        margin-right: -15px;
        border-radius: 0 !important;
        display: block;
        width: calc(100% + 15px);
        padding-bottom: 8px;
    }

    #mainpage .div66-item4 .padding_25lr {
        padding-top: 24px;
    }
}

/* квадратный Adfox */
#mainpage .div66-item.eg-adfox-square,
#mainpage .eg-adfox-square-mob-wrap,
.div66-item.eg-adfox-square,
.eg-adfox-square-mob-wrap {
    background-color: white;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.2), 0 0 1px 0 rgba(0, 0, 0, 0.2);
    border-radius: 7px;
}

#mainpage .eg-adfox-square-mob-wrap,
.eg-adfox-square-mob-wrap {
    margin-top: 11px;
    margin-bottom: 0;
    padding: 12px 0 4px;
}

#adfox_first1col_1,
#adfox_first1col_0,
#adfox_first1col_0_mob {
    font-family: 'PT Sans', Arial, Helvetica, sans-serif;
    width: 100%;
    max-width: none;
    margin: 0;
    position: relative;
    display: block;
    box-sizing: border-box;
}

#adfox_first1col_1 .onlyDesktop, #adfox_first1col_0 .onlyDesktop,
#adfox_first1col_0_mob .onlyDesktop,
#adfox_first1col_1 .onlyMobile, #adfox_first1col_0 .onlyMobile,
#adfox_first1col_0_mob .onlyMobile,
#adfox_first1col_1 .news-grid__elem_row, #adfox_first1col_0 .news-grid__elem_row,
#adfox_first1col_0_mob .news-grid__elem_row {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#adfox_first1col_1 .onlyMobile, #adfox_first1col_0 .onlyMobile,
#adfox_first1col_0_mob .onlyMobile {
    display: none !important;
}

#adfox_first1col_1 .news-grid__elem_row, #adfox_first1col_0 .news-grid__elem_row,
#adfox_first1col_0_mob .news-grid__elem_row {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#adfox_first1col_1 .onlyDesktop, #adfox_first1col_0 .onlyDesktop,
#adfox_first1col_0_mob .onlyDesktop {
    padding: 12px 0 0;
    box-sizing: border-box;
}

#adfox_first1col_1 .new-news-grid__elem__photo, #adfox_first1col_0 .new-news-grid__elem__photo,
#adfox_first1col_0_mob .new-news-grid__elem__photo {
    display: block;
    width: calc(100% - 36px);
    margin-left: 18px;
    margin-right: 18px;
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    border-radius: 4px;
    box-sizing: border-box;
}

#adfox_first1col_1 .new-news-grid__elem__photo-el, #adfox_first1col_0 .new-news-grid__elem__photo-el,
#adfox_first1col_0_mob .new-news-grid__elem__photo-el {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

#adfox_first1col_1 .news-grid__elem_row:hover .new-news-grid__elem__photo-el,
#adfox_first1col_0 .news-grid__elem_row:hover .new-news-grid__elem__photo-el,
#adfox_first1col_0_mob .news-grid__elem_row:hover .new-news-grid__elem__photo-el {
    transform: scale(1.05);
}

#adfox_first1col_1 .news-piece_major-wrap, #adfox_first1col_0 .news-piece_major-wrap,
#adfox_first1col_0_mob .news-piece_major-wrap,
#adfox_first1col_1 .onlyDesktop > a:not([class*="photo"]),
#adfox_first1col_0 .onlyDesktop > a:not([class*="photo"]),
#adfox_first1col_0_mob .onlyDesktop > a:not([class*="photo"]) {
    padding: 14px 18px 18px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

#adfox_first1col_1 .new-news-piece__link, #adfox_first1col_0 .new-news-piece__link,
#adfox_first1col_0_mob .new-news-piece__link {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.3em;
    color: #000;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.2s ease;
    text-align: center;
    box-sizing: border-box;
}

#adfox_first1col_1 .new-news-piece__link:hover, #adfox_first1col_0 .new-news-piece__link:hover,
#adfox_first1col_0_mob .new-news-piece__link:hover {
    color: #ff5400;
}

#adfox_first1col_1 .new-news-piece__tags, #adfox_first1col_0 .new-news-piece__tags,
#adfox_first1col_0_mob .new-news-piece__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

#adfox_first1col_1 .new-news-piece__tag, #adfox_first1col_0 .new-news-piece__tag,
#adfox_first1col_0_mob .new-news-piece__tag {
    font-size: 13px;
    color: #6a920f;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
}

#adfox_first1col_1 .new-news-piece__tag:hover, #adfox_first1col_0 .new-news-piece__tag:hover,
#adfox_first1col_0_mob .new-news-piece__tag:hover {
    text-decoration: underline;
}

@media screen and (max-width: 700px) {
    #adfox_first1col_1 .onlyDesktop, #adfox_first1col_0 .onlyDesktop,
    #adfox_first1col_0_mob .onlyDesktop {
        display: none !important;
    }

    #adfox_first1col_1 .onlyMobile, #adfox_first1col_0 .onlyMobile,
    #adfox_first1col_0_mob .onlyMobile {
        display: block !important;
        padding: 12px 18px 16px;
        box-sizing: border-box;
    }

    #adfox_first1col_1 .img-link, #adfox_first1col_0 .img-link,
    #adfox_first1col_0_mob .img-link {
        display: flex;
        flex-direction: column;
        text-decoration: none;
        align-items: stretch;
    }

    #adfox_first1col_1 .img-link__img, #adfox_first1col_0 .img-link__img,
    #adfox_first1col_0_mob .img-link__img {
        width: 100%;
        display: block;
        border-radius: 4px;
        height: auto;
        margin: 0;
    }

    #adfox_first1col_1 .img-link__desc, #adfox_first1col_0 .img-link__desc,
    #adfox_first1col_0_mob .img-link__desc {
        display: block;
        font-size: 16px;
        font-weight: bold;
        color: #000;
        padding: 14px 4px 4px;
        line-height: 1.35em;
        text-align: center;
        box-sizing: border-box;
    }

    #mainpage .eg-adfox-square-mob-wrap,
    .eg-adfox-square-mob-wrap {
        padding: 12px 12px 8px;
    }
}
