/**
 * Форум: корректное отображение на всех экранах, без overflow
 * Отступ сверху — чтобы заголовок темы не скрывался под фиксированной шапкой
 */
.forum__container {
    max-width: 100%;
    overflow-x: hidden;
    padding-top: 32px;
}

/* Форум: дополнительная компенсация фиксированной шапки с 2 строками меню */
html .main-site-wrapper:has(.forum__container) {
    margin-top: 122px !important;
}
body.page-forum .main-site-wrapper {
    margin-top: 122px !important;
}
body.page-forum {
    padding-top: calc(128px + env(safe-area-inset-top, 0px)) !important;
}
@media (max-width: 767px) {
    body.page-forum,
    body:has(.forum_wrapper) {
        padding-top: calc(128px + env(safe-area-inset-top, 0px)) !important;
    }
    body.page-forum .main-site-wrapper,
    body:has(.forum_wrapper) .main-site-wrapper,
    html .main-site-wrapper:has(.forum__container) {
        margin-top: 0 !important;
    }
}

.forum__header {
    min-width: 0;
    scroll-margin-top: 100px;
}

.forum__header-find {
    min-width: 0;
}

.forum__header-find-form {
    min-width: 140px;
}

.forum__header-find-input {
    min-width: 0;
}

.forum__themes {
    min-width: 0;
    overflow-x: hidden;
}

.forum__theme {
    min-width: 0;
}

.forum__theme-text {
    min-width: 0;
}

.forum__theme-title,
.forum__theme-title-link,
a.forum__theme-title-link {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.forum__theme-tags {
    min-width: 0;
}

@media (max-width: 600px) {
    .forum__header {
        padding: 12px 16px;
        gap: 16px;
    }
    .forum__header-title {
        font-size: 18px;
    }
}

/* Страница темы: цитаты и кнопки */
.forum_theme__container,
.forum_theme__message_container,
.forum_theme__content,
.forum_messages,
.forum_message {
    max-width: 100%;
    min-width: 0;
}

.forum_message__quote {
    max-width: min(450px, 100%);
}

.forum_theme__head_buttons {
    flex-wrap: wrap;
    min-width: 0;
}

.forum_theme__head_button {
    white-space: normal;
}

@media (max-width: 500px) {
    .forum_theme__head_button {
        width: 100%;
        text-align: center;
    }
}
.forum-topic-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 10px 0 16px;
}
.forum-topic-pagination--bottom {
    justify-content: center;
    margin: 20px 0 24px;
    padding: 12px 0;
    border-top: 1px solid rgba(15, 166, 171, 0.16);
    border-bottom: 1px solid rgba(15, 166, 171, 0.16);
}
.forum-topic-pagination a {
    text-decoration: none;
}
.forum-topic-pagination .box2r,
.forum-topic-pagination .pagination-arrow {
    margin: 0;
    min-width: 36px;
    min-height: 36px;
}
.forum-topic-pagination .box2r {
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 640px) {
    .forum-topic-pagination {
        justify-content: center;
        gap: 6px;
        margin: 12px 0 18px;
    }
    .forum-topic-pagination--bottom {
        position: relative;
        z-index: 1;
        margin: 22px 0 24px;
        padding: 14px 0;
    }
    .forum-topic-pagination .box2r,
    .forum-topic-pagination .pagination-arrow {
        min-width: 40px;
        min-height: 40px;
        padding: 8px 10px;
    }
}
@media (max-width: 640px) {
    .forum__theme-img-link {
        aspect-ratio: 16 / 9;
        height: auto;
        min-height: 180px;
        align-items: center;
        justify-content: center;
        background-color: #edeff2;
    }
    .forum__theme-img {
        object-fit: contain;
        object-position: center;
        background-color: transparent;
    }
}