.mtv36-infinite-root {
    clear: both;
    width: 100%;
}

.mtv36-context-title {
    margin-bottom: 12px;
}

.mtv36-infinite-home {
    margin: 30px auto 0;
    padding: 0 0 30px;
}

.mtv36-infinite-heading {
    margin-bottom: 25px;
}

.mtv36-infinite-grid > [class*="col-"] {
    margin-bottom: 30px;
}

/*
 * На главной тема добавляет к колонке ещё 50px от самой .mg-blog-post-box.
 * Убираем этот второй отступ: итоговый интервал остаётся 30px, как в рубриках.
 */
.mtv36-infinite-home .mtv36-infinite-grid > .mtv36-infinite-item {
    margin-bottom: 30px !important;
}

.mtv36-infinite-home .mtv36-infinite-grid > .mtv36-infinite-item > .mg-blog-post-box {
    margin-bottom: 0 !important;
}

/*
 * Server-rendered placeholders reserve the first AJAX batch before the first
 * paint. Their 570px card height matches the tallest real cards on the site;
 * JavaScript also preserves the measured grid height during replacement.
 */
.mtv36-infinite-skeleton-card {
    display: flex;
    min-height: 570px;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none;
}

.mtv36-infinite-skeleton-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    background: #e7ebf0;
}

.mtv36-infinite-skeleton-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 13px;
}

.mtv36-infinite-skeleton-line {
    display: block;
    width: 100%;
    height: 15px;
    border-radius: 5px;
    background: #e7ebf0;
}

.mtv36-infinite-skeleton-line.is-category {
    width: 34%;
    height: 24px;
    margin-bottom: 3px;
}

.mtv36-infinite-skeleton-line.is-title {
    height: 20px;
}

.mtv36-infinite-skeleton-line.is-title-short {
    width: 82%;
    height: 20px;
    margin-bottom: 9px;
}

.mtv36-infinite-skeleton-line.is-copy-short {
    width: 68%;
}

.mtv36-infinite-root .entry-title,
.mtv36-infinite-root .entry-title a,
.mtv36-infinite-root .title,
.mtv36-infinite-root .title a {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    text-transform: none;
}

.mtv36-infinite-item img,
.mtv36-infinite-home .mg-blog-post-box img,
.mtv36-infinite-card-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}


.mtv36-infinite-picture {
    display: contents;
}

.mtv36-infinite-card-image {
    display: block;
    overflow: hidden;
}

.mtv36-infinite-card-img {
    display: block;
    height: auto;
}

.mtv36-infinite-teaser {
    margin: 34px 0 0;
    padding: 0;
    border: 0;
}

.mtv36-infinite-teaser-link {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #3389b8, #0c3f78);
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    isolation: isolate;
}

.mtv36-infinite-teaser-link:focus-visible {
    outline: 4px solid #2563eb;
    outline-offset: 3px;
}

.mtv36-infinite-teaser-image,
.mtv36-infinite-root .mtv36-infinite-teaser-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.mtv36-infinite-teaser-placeholder {
    background: linear-gradient(135deg, #3389b8, #0c3f78);
}

.mtv36-infinite-teaser-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 20%, rgba(0, 0, 0, 0.2) 48%, rgba(0, 0, 0, 0.86) 100%);
}

.mtv36-infinite-teaser-content {
    position: absolute;
    right: clamp(20px, 5%, 38px);
    bottom: clamp(22px, 7%, 40px);
    left: clamp(20px, 5%, 38px);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    color: #fff;
}

.mtv36-infinite-teaser-category {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 7px;
    background: linear-gradient(135deg, #2869ff, #07458f);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    text-transform: none !important;
}

.mtv36-infinite-root .mtv36-infinite-teaser-title {
    width: 100%;
    margin: 0;
    color: #fff !important;
    font-size: 24px !important;
    font-weight: 500;
    line-height: 1.16;
    letter-spacing: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.mtv36-infinite-teaser-link:hover .mtv36-infinite-teaser-image {
    transform: scale(1.025);
}

.mtv36-infinite-status {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    color: inherit;
    text-align: center;
}

.mtv36-infinite-status-text:empty,
.mtv36-infinite-status:not(.is-loading) .mtv36-infinite-spinner {
    display: none;
}

.mtv36-infinite-spinner {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: mtv36-infinite-spin 0.8s linear infinite;
}

.mtv36-infinite-status.is-error {
    color: #b42318;
    cursor: pointer;
    text-decoration: underline;
}

.mtv36-infinite-status.is-finished {
    opacity: 0.72;
}

.mtv36-infinite-sentinel {
    width: 100%;
    height: 1px;
}

/* Only the new single-news loader; existing card layout is unchanged. */
.mtv36-infinite-single .mtv36-infinite-status {
    flex-wrap: wrap;
}

.mtv36-infinite-single .mtv36-infinite-status.is-error {
    cursor: default;
    text-decoration: none;
}

.mtv36-infinite-single .mtv36-infinite-retry {
    padding: 9px 16px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(120deg, #2863f6, #05346a);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.mtv36-infinite-single .mtv36-infinite-retry[hidden] {
    display: none;
}

.mtv36-infinite-single .mtv36-infinite-retry:focus-visible {
    outline: 3px solid #2863f6;
    outline-offset: 3px;
}

@keyframes mtv36-infinite-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .mtv36-infinite-home {
        margin-top: 20px;
    }

    .mtv36-infinite-teaser {
        margin-top: 28px;
    }

    .mtv36-infinite-teaser-link {
        border-radius: 10px;
    }

    .mtv36-infinite-teaser-content {
        right: 18px;
        bottom: 20px;
        left: 18px;
        gap: 11px;
    }

    .mtv36-infinite-teaser-category {
        padding: 6px 10px;
        font-size: 14px;
    }

    .mtv36-infinite-root .mtv36-infinite-teaser-title {
        font-size: 24px !important;
        line-height: 1.16 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mtv36-infinite-spinner {
        animation-duration: 1.6s;
    }

    .mtv36-infinite-teaser-image {
        transition: none;
    }
}


/* Patisson layout. */
.mtv36-infinite-patisson {
    max-width: 1240px;
    margin-right: auto;
    margin-left: auto;
}

.mtv36-infinite-patisson.mtv36-infinite-home {
    margin-top: 0;
    padding-bottom: 0;
}

.mtv36-infinite-patisson.mtv36-infinite-single .mtv36-infinite-items {
    width: min(100%, 900px);
    margin-right: auto;
    margin-left: auto;
}

.mtv36-infinite-patisson .mtv36-infinite-status {
    color: #6b7179;
}

.mtv36-infinite-patisson .mtv36-infinite-spinner {
    border-color: rgba(213, 28, 39, .18);
    border-top-color: #d51c27;
}

.mtv36-patisson-item {
    width: 100%;
}

.mtv36-patisson-item .p-stream-media img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
}

.mtv36-infinite-patisson-teaser .mtv36-infinite-teaser-category {
    background: #d51c27;
}

@media (max-width: 700px) {
    .mtv36-infinite-patisson {
        width: 100%;
    }
}


/* Patisson 0.6+: AJAX output is intentionally rendered with native Patisson cards. */
.mtv36-infinite-patisson .mtv36-patisson-item {
    min-width: 0;
}

.mtv36-infinite-patisson .mtv36-patisson-item.p-card {
    margin: 0;
}

.mtv36-infinite-patisson .mtv36-patisson-item.p-card > a {
    display: flex;
    height: 100%;
    flex-direction: column;
}

.mtv36-infinite-patisson .mtv36-patisson-item .p-card-body {
    flex: 1 1 auto;
}


/* Patisson 0.7+: theme owns all card presentation.
 * The plugin only supplies data/loading mechanics.
 */
.mtv36-infinite-patisson .mtv36-infinite-items.p-grid {
    width: 100%;
    align-items: stretch;
}

.mtv36-infinite-patisson .p-card {
    margin: 0;
}


/* Patisson 0.8+: never impose Newsup card presentation on native Patisson cards. */
.mtv36-infinite-patisson .p-card {
    width: auto;
    max-width: none;
    margin: 0;
}

.mtv36-infinite-patisson .p-card::before,
.mtv36-infinite-patisson .p-card::after {
    box-sizing: border-box;
}

/* 1.9.4 — the first single-page batch is server-rendered and must be visible
 * even before JavaScript runs. */
.mtv36-infinite-patisson.mtv36-infinite-single {
    width: min(100% - 32px, 1240px);
    margin: 36px auto 0;
}
.mtv36-infinite-single-heading {
    margin: 0 0 22px;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.08;
    font-weight: 800;
}
@media (max-width: 700px) {
    .mtv36-infinite-patisson.mtv36-infinite-single {
        width: min(100% - 24px, 1240px);
        margin-top: 28px;
    }
}
