/* v3.1.8 BLOG01: stable per-post tile; blog_image_fit=contain. */
/* MODUS Blog Tutti Bambini — controlled editorial mosaic */

.tb-blog-layout {
    width: 100%;
    min-width: 0;
}

.tb-blog-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin: 8px 0 30px;
}

.tb-blog-header__copy {
    min-width: 0;
}

.tb-blog-header h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.tb-blog-header__copy p {
    margin: 8px 0 0;
    color: #687078;
    font-size: 15px;
    line-height: 1.55;
}

.tb-blog-search {
    flex: 0 0 330px;
    display: flex;
    align-items: stretch;
}

.tb-blog-search input {
    min-width: 0;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(15, 32, 51, .14);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: #fff;
    box-shadow: none;
    outline: none;
    font-size: 14px;
}

.tb-blog-search input:focus {
    border-color: rgba(15, 32, 51, .32);
}

.tb-blog-search button {
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--main-color, #4F6258);
    border-radius: 0 8px 8px 0;
    background: var(--main-color, #4F6258);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}

.tb-blog-search button:hover {
    border-color: var(--main-color-hover, #2F3F35);
    background: var(--main-color-hover, #2F3F35);
}

.tb-blog-grid {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 24px;
}

.tb-blog-grid--mosaic {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    align-items: start;
}

.tb-blog-grid--simple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tb-blog-card {
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
}

/* BLOG01: width is controlled only by the permanent tile class.
   Featured state may change order/styling, but never the grid span. */
.tb-blog-grid--mosaic .tb-blog-card--normal {
    grid-column: span 4;
}

.tb-blog-grid--mosaic .tb-blog-card--wide {
    grid-column: span 8;
}

.tb-blog-card__image {
    position: relative;
    display: block;
    width: 100%;
    height: clamp(250px, 22vw, 360px);
    overflow: hidden;
    border-radius: 8px;
    background: #f5f6f6;
}

.tb-blog-card__image > img,
.tb-blog-card__image > picture,
.tb-blog-card__image > picture > img,
.tb-blog-card__placeholder,
.tb-blog-card__placeholder > img {
    width: 100%;
    height: 100%;
}

.tb-blog-card__image > picture {
    display: block;
}

.tb-blog-card__image > img,
.tb-blog-card__image > picture > img,
.tb-blog-card__placeholder > img {
    display: block;
    object-fit: cover;
    object-position: center;
}

.tb-blog-card__placeholder {
    display: block;
    padding: 18%;
}

.tb-blog-card__placeholder > img {
    object-fit: contain;
    opacity: .72;
}

/* Optional per-post mode for comparison collages and product lineups.
   Blog -> post -> additional parameters: blog_image_fit=contain
   Use blog_image_fit=contain for cards that must preserve the entire image. */
.tb-blog-card--image-contain .tb-blog-card__image {
    background: #fff;
}

.tb-blog-card--image-contain .tb-blog-card__image > img,
.tb-blog-card--image-contain .tb-blog-card__image > picture > img {
    object-fit: contain;
    object-position: center;
}

.tb-blog-card__body {
    padding: 13px 1px 5px;
}

.tb-blog-card--featured .tb-blog-card__body,
.tb-blog-card--wide .tb-blog-card__body {
    padding-top: 16px;
}

.tb-blog-card__date {
    margin-bottom: 6px;
    color: #687078;
    font-size: 13px;
    line-height: 1.4;
}

.tb-blog-card__title {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.tb-blog-card--featured .tb-blog-card__title {
    font-size: 24px;
    line-height: 1.25;
}

.tb-blog-card--wide .tb-blog-card__title {
    font-size: 20px;
    line-height: 1.3;
}

.tb-blog-card__title a {
    color: inherit;
    text-decoration: none;
}

.tb-blog-card__title a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tb-blog-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 9px;
    color: #687078;
    font-size: 14px;
    line-height: 1.55;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.tb-blog-card--featured .tb-blog-card__excerpt {
    max-width: 780px;
    font-size: 15px;
}

.tb-blog-empty {
    padding: 28px 0;
    color: var(--gray-color, #74777b);
}

@media (max-width: 1023px) {
    .tb-blog-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .tb-blog-search {
        flex-basis: auto;
        width: min(100%, 420px);
    }

    .tb-blog-grid--mosaic {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 20px;
    }

    .tb-blog-grid--mosaic .tb-blog-card--normal {
        grid-column: span 1;
    }

    .tb-blog-grid--mosaic .tb-blog-card--wide {
        grid-column: 1 / -1;
    }

    .tb-blog-grid--simple {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639px) {
    .tb-blog-header {
        margin-bottom: 22px;
    }

    .tb-blog-header h1 {
        font-size: 25px;
    }

    .tb-blog-header__copy p {
        font-size: 14px;
    }

    .tb-blog-search {
        width: 100%;
    }

    .tb-blog-grid--mosaic,
    .tb-blog-grid--simple {
        grid-template-columns: minmax(0, 1fr);
        gap: 26px;
    }

    .tb-blog-grid--mosaic .tb-blog-card--normal,
    .tb-blog-grid--mosaic .tb-blog-card--featured-secondary,
    .tb-blog-grid--mosaic .tb-blog-card--featured,
    .tb-blog-grid--mosaic .tb-blog-card--wide {
        grid-column: 1;
    }

    .tb-blog-card__image {
        height: auto;
        aspect-ratio: 3 / 2;
    }

    .tb-blog-card__body,
    .tb-blog-card--featured .tb-blog-card__body,
    .tb-blog-card--wide .tb-blog-card__body {
        padding-top: 12px;
    }

    .tb-blog-card--featured .tb-blog-card__title,
    .tb-blog-card--wide .tb-blog-card__title,
    .tb-blog-card__title {
        font-size: 18px;
        line-height: 1.35;
    }

    .tb-blog-card__excerpt {
        -webkit-line-clamp: 2;
        font-size: 14px;
    }
}

/* Dedicated post page */
.tb-blog-breadcrumbs {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 7px;
    margin: 4px 0 18px;
    color: var(--gray-color, #74777b);
    font-size: 13px;
    line-height: 1.4;
}

.tb-blog-breadcrumbs a {
    flex: 0 0 auto;
    color: var(--main-color, #4F6258);
    text-decoration: none;
}

.tb-blog-breadcrumbs a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tb-blog-breadcrumbs__sep {
    flex: 0 0 auto;
    color: #a2a5a8;
}

.tb-blog-breadcrumbs__current {
    overflow: hidden;
    min-width: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@media (max-width: 767px) {
    .tb-blog-breadcrumbs {
        gap: 6px;
        font-size: 12px;
    }

    .tb-blog-breadcrumbs__current {
        display: none;
    }

    .tb-blog-breadcrumbs__sep:last-of-type {
        display: none;
    }
}


/* MODUS BLOG02: multiple blog channels + progressive AJAX load more. */
.tb-blog-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -8px 0 28px;
}

.tb-blog-channels__item {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(15, 32, 51, .12);
    border-radius: 999px;
    background: #fff;
    color: #394552;
    font-size: 13px;
    line-height: 1;
    text-decoration: none !important;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.tb-blog-channels__item:hover,
.tb-blog-channels__item.is-active {
    border-color: var(--main-color, #4F6258);
    background: var(--main-color, #4F6258);
    color: #fff !important;
}

.tb-blog-more-wrap {
    display: flex;
    justify-content: center;
    margin: 34px 0 8px;
}

.tb-blog-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 44px;
    padding: 0 24px;
    border: 1px solid var(--main-color, #4F6258);
    border-radius: 8px;
    background: #fff;
    color: var(--main-color, #4F6258) !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.tb-blog-more:hover {
    background: var(--main-color, #4F6258);
    color: #fff !important;
}

.tb-blog-more.is-loading {
    pointer-events: none;
    opacity: .58;
}

@media (max-width: 639px) {
    .tb-blog-channels {
        flex-wrap: nowrap;
        gap: 7px;
        margin-bottom: 22px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .tb-blog-channels::-webkit-scrollbar {
        display: none;
    }

    .tb-blog-channels__item {
        flex: 0 0 auto;
    }

    .tb-blog-more-wrap {
        margin-top: 28px;
    }

    .tb-blog-more {
        width: 100%;
    }
}


/* UI01: clear cross-blog tabs. CSS-only; no theme settings touched. */
.tb-blog-crossnav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 24px;
    padding: 0;
    border: 0;
    background: transparent;
}
.tb-blog-crossnav__label {
    display: none;
}
.tb-blog-crossnav__items {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
#main-content .tb-blog-crossnav a.tb-blog-crossnav__item,
#main-content .tb-blog-crossnav a.tb-blog-crossnav__item:link,
#main-content .tb-blog-crossnav a.tb-blog-crossnav__item:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 15px;
    border: 1px solid #cbd3db !important;
    border-radius: 2px !important;
    background: #fff !important;
    color: var(--main-color, #4F6258) !important;
    -webkit-text-fill-color: var(--main-color, #4F6258) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
#main-content .tb-blog-crossnav a.tb-blog-crossnav__item:hover {
    border-color: var(--main-color, #4F6258) !important;
    background: #f3f5f6 !important;
    color: var(--main-color, #4F6258) !important;
    -webkit-text-fill-color: var(--main-color, #4F6258) !important;
}
#main-content .tb-blog-crossnav a.tb-blog-crossnav__item.is-active,
#main-content .tb-blog-crossnav a.tb-blog-crossnav__item.is-active:link,
#main-content .tb-blog-crossnav a.tb-blog-crossnav__item.is-active:visited,
#main-content .tb-blog-crossnav a.tb-blog-crossnav__item.is-active:hover {
    border-color: var(--main-color, #4F6258) !important;
    background: var(--main-color, #4F6258) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-weight: 700;
    box-shadow: none !important;
    pointer-events: none;
}
@media (max-width: 600px) {
    .tb-blog-crossnav {
        margin: 8px 0 18px;
    }
    .tb-blog-crossnav__items {
        width: 100%;
    }
    #main-content .tb-blog-crossnav a.tb-blog-crossnav__item {
        flex: 1 1 0;
        min-height: 34px;
        padding: 7px 10px;
        font-size: 14px;
    }
}


/* MODUS PRODUCT WIDGET v04 */

.modus-product-widget {
    float: left;

    width: 280px;
    max-width: 32%;

    margin:
        0
        30px
        22px
        0;

    padding: 9px;

    box-sizing: border-box;

    background: #fff;

    border: 1px solid #e5e8ec;
    border-radius: 9px;
}


.modus-product-widget .webasyst-shop-script-product {
    width: 100% !important;
    max-width: 100% !important;

    box-sizing: border-box;
}


.modus-product-widget .webasyst-shop-script-product > a {
    color: #0b2239 !important;

    font-weight: 600;

    text-decoration: none !important;
}


.modus-product-widget .webasyst-shop-script-product img {
    display: block;

    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;

    margin: 0 auto 7px;
}


/* Defensive hiding of native purchase controls */

.modus-product-widget .webasyst-shop-script-product button,
.modus-product-widget .webasyst-shop-script-product input[type="submit"],
.modus-product-widget .webasyst-shop-script-product input[type="button"] {
    display: none !important;
}


/* Our only CTA */

.modus-product-widget__more {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 38px;

    margin-top: 9px;

    padding: 8px 12px;

    box-sizing: border-box;

    background: #0b2239;
    color: #fff !important;

    border-radius: 4px;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;

    text-align: center;
    text-decoration: none !important;
}


.modus-product-widget__more:hover {
    opacity: .88;
}


/* Mobile: no float */

@media (max-width: 720px) {

    .modus-product-widget {
        float: none;

        width: 100%;
        max-width: 300px;

        margin:
            24px
            auto
            30px;

        padding: 10px;
    }

}


/* MODUS PRODUCT WIDGET single-click */

.modus-product-widget {
    position: relative;

    /* место под визуальную кнопку, которая является частью overlay-link */
    padding-bottom: 56px;
}


/* iframe нужен только для динамических фото/названия/цены.
   Все клики принимает единая ссылка поверх карточки. */
.modus-product-widget iframe {
    pointer-events: none !important;
}


/* ОДНА ссылка на всю площадь карточки */
.modus-product-widget > .modus-product-widget__link {
    position: absolute;

    inset: 0;

    z-index: 30;

    display: block;

    border-radius: 9px;

    cursor: pointer;

    text-decoration: none !important;
    color: inherit !important;
}


/* "Подробнее" — не отдельная ссылка, а надпись внутри той же ссылки */
.modus-product-widget > .modus-product-widget__link > .modus-product-widget__cta {
    position: absolute;

    left: 9px;
    right: 9px;
    bottom: 9px;

    min-height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 8px 12px;

    box-sizing: border-box;

    background: #0b2239;
    color: #fff;

    border-radius: 4px;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;

    text-align: center;
}


/* Вся карточка реагирует как ссылка */
.modus-product-widget:hover {
    border-color: #cbd2d9;
}

.modus-product-widget__link:hover .modus-product-widget > .modus-product-widget__link > .modus-product-widget__cta {
    opacity: .88;
}



/* MODUS PRODUCT WIDGET section flow v01
   Each product section must begin below any preceding floated product card.
   Keep the article container aware of the final float as well. */
.blogpost__text > .modus-product-widget ~ h2 {
    clear: both;
}

.blogpost__text::after {
    content: "";
    display: table;
    clear: both;
}


/* MODUS PRODUCT WIDGET orphan-safety v02
   Overlay styles are intentionally scoped to links that are really inside a card.
   Legacy/orphan links are normalized or removed by post.html before they can cover the article. */
.blogpost__text > a.modus-product-widget__link {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
}
