.reading-feed {
    --feed-ink: #33343a;
    --feed-muted: #675f6b;
    --feed-purple: #5749e1;
    --feed-purple-dark: #3327ad;
    --feed-pink: #f2ebf4;
    --feed-lilac: #cdcefb;
    --feed-white: #ffffff;
    position: relative;
    width: 100%;
    color: var(--feed-ink);
    /* Экраны вставляются перед контролами. Если браузер выбирает кнопку
       scroll-anchor, он удерживает её на месте и читатель сразу оказывается
       в середине подгруженной статьи, выше её заголовка. */
    overflow-anchor: none;
}

.reading-feed[hidden],
.reading-feed [hidden] {
    display: none !important;
}

.reading-feed::selection,
.reading-feed *::selection {
    color: var(--feed-ink);
    background: var(--feed-lilac);
}

.reading-feed__title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.reading-feed__items {
    min-width: 0;
}

/* Один боковой слот обслуживает активную статью. Несколько sticky-баннеров в
   DOM конфликтовали бы между собой; содержимое этого меняется вместе с URL. */
.reading-feed__sidebar[hidden] {
    display: none;
}

.article-page .reading-feed__sidebar .card-promo-container {
    margin-block-start: 64px;
    margin-top: 64px;
}

.feed-article {
    min-width: 0;
    padding-block: 64px 24px;
}

.feed-screen {
    min-width: 0;
}

/* Fallback повторяет колонку исходной статьи, пока старый HTML страницы ещё
   живёт в микрокеше. Это важно при выкладке: CSS обновляется раньше кеша HTML. */
.feed-screen > .container-small {
    width: calc(100% - 20px);
    max-width: none;
    margin-inline: 10px;
}

/* В актуальной разметке колонку уже задаёт `.container-inner__left`, поэтому
   фрагмент занимает её целиком без повторного расчёта от viewport. */
.reading-feed-layout .feed-screen > .container-small {
    width: 100%;
    margin-inline: 0;
}

.feed-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px 28px;
    width: min(720px, calc(100% - 48px));
    padding: 24px 28px;
    margin: 0 auto 56px;
    color: var(--feed-ink);
    background: var(--feed-pink);
    border-radius: 16px;
}

.feed-cta__text {
    max-width: 48ch;
    margin: 0;
    overflow-wrap: anywhere;
    font-family: "Cera Round Pro", sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.feed-cta__action,
.reading-feed__more,
.reading-feed__continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    font-family: "Cera Round Pro", sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border-radius: 12px;
    transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease,
        transform 180ms cubic-bezier(.2, .8, .2, 1);
}

.feed-cta__action {
    color: var(--feed-white);
    background: var(--feed-purple-dark);
}

.feed-cta__action:hover {
    color: var(--feed-white);
    background: var(--feed-purple);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -12px rgba(51, 39, 173, .7);
}

.feed-cta__action:focus-visible,
.reading-feed__more:focus-visible,
.reading-feed__continue:focus-visible {
    outline: 3px solid var(--feed-lilac);
    outline-offset: 4px;
}

.feed-article__meta {
    margin-block-end: 14px;
}

.feed-article__category {
    color: var(--feed-purple-dark);
    font-family: "Cera Round Pro", sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.feed-article__category:hover {
    color: var(--feed-purple);
}

.feed-article__title {
    max-width: 21ch;
    margin: 0 0 28px;
    overflow-wrap: anywhere;
    color: var(--feed-ink);
    font-family: "Cera_Round-Black-Web", "Cera Round Pro", sans-serif;
    font-size: clamp(32px, 4.4vw, 56px);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.feed-article__title a {
    color: inherit;
    text-decoration: none;
}

.feed-article__title a:hover {
    color: var(--feed-purple-dark);
}

.feed-article__title a:focus-visible,
.feed-article__category:focus-visible {
    outline: 3px solid var(--feed-lilac);
    outline-offset: 4px;
    border-radius: 4px;
}

.feed-article__figure {
    margin: 0 0 40px;
}

.feed-article__image {
    overflow: hidden;
    background: var(--feed-pink);
    border-radius: 16px;
}

.feed-article__image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 720px;
    object-fit: cover;
}

.feed-article__image-caption {
    margin: 10px 4px 0;
    overflow-wrap: anywhere;
    color: var(--feed-muted);
    font-family: "Montserrat", sans-serif, -apple-system;
    font-size: 12px;
    line-height: 1.5;
}

.feed-article__image-caption a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.feed-article__image-caption a:hover {
    color: var(--feed-purple-dark);
}

.feed-article__image-caption a:focus-visible {
    outline: 3px solid var(--feed-lilac);
    outline-offset: 3px;
    border-radius: 3px;
}

.feed-screen .article-content {
    min-width: 0;
    overflow-wrap: anywhere;
}

.feed-screen .article-content iframe,
.feed-screen .article-content video,
.feed-screen .article-content img,
.feed-screen .article-content table {
    max-width: 100%;
}

.reading-feed__controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(720px, calc(100% - 48px));
    padding-block: 24px 72px;
    margin-inline: auto;
}

.reading-feed__more {
    position: relative;
    min-width: min(100%, 260px);
    color: var(--feed-white);
    background: var(--feed-ink);
    border: 0;
    appearance: none;
}

.reading-feed__more:hover:not(:disabled) {
    background: var(--feed-purple-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -14px rgba(51, 39, 173, .8);
}

.reading-feed__more:disabled {
    padding-inline-end: 52px;
    cursor: wait;
    opacity: .72;
}

.reading-feed__more:disabled::after {
    position: absolute;
    inset-inline-end: 22px;
    width: 16px;
    height: 16px;
    content: "";
    border: 2px solid rgba(255, 255, 255, .38);
    border-block-start-color: var(--feed-white);
    border-radius: 50%;
    animation: reading-feed-spin 700ms linear infinite;
}

.reading-feed__status {
    max-width: 52ch;
    margin: 0;
    color: var(--feed-muted);
    font-family: "Cera Round Pro", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

.reading-feed__status:empty {
    display: none;
}

.reading-feed__continue {
    min-height: 44px;
    padding: 8px 4px;
    color: var(--feed-purple-dark);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.reading-feed__continue:hover {
    color: var(--feed-purple);
}

@keyframes reading-feed-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 767px) {
    .feed-article {
        padding-block-start: 44px;
    }

    .feed-cta {
        grid-template-columns: 1fr;
        width: calc(100% - 32px);
        padding: 22px 20px;
        margin-block-end: 40px;
    }

    .feed-cta__text {
        font-size: 17px;
    }

    .feed-cta__action {
        width: 100%;
    }

    .feed-article__title {
        margin-block-end: 22px;
        font-size: clamp(30px, 10vw, 42px);
        line-height: 1.08;
    }

    .feed-article__figure {
        margin-block-end: 30px;
    }

    .feed-article__image {
        border-radius: 12px;
    }

    .reading-feed__controls {
        width: calc(100% - 32px);
        padding-block: 16px 56px;
    }

    .reading-feed__more {
        width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .feed-screen > .container-small {
        width: 630px;
        margin-inline: auto;
    }
}

@media (min-width: 1280px) {
    .feed-screen > .container-small {
        width: 800px;
        margin-inline: 0;
        margin-inline-start: calc((100% - 1180px) / 2 + 60px);
    }
}

@media (min-width: 1350px) {
    .feed-screen > .container-small {
        width: 850px;
        margin-inline-start: calc((100% - 1290px) / 2 + 112px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .feed-cta__action,
    .reading-feed__more,
    .reading-feed__continue {
        transition: none;
    }

    .reading-feed__more:disabled::after {
        animation-duration: 1400ms;
    }
}
