/* ==========================================================================
   oncocentr.ru — дополнения к style.css
   ========================================================================== */

/* --- Прижимаем футер к низу окна на коротких страницах --- */
html,
body {
    height: auto;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrapper > .content,
.main-wrapper > .container {
    flex: 1 0 auto;
}

.main-wrapper > .footer {
    margin-top: auto;
    flex-shrink: 0;
}

/* --- Справочник заболеваний: шапка раздела --- */
.disease-intro {
    max-width: 760px;
    margin: 0 auto 32px;
}

.disease-intro h1 {
    font-size: 32px;
    font-weight: 600;
    color: #272b41;
    margin-bottom: 14px;
}

.disease-intro p {
    color: #757575;
    font-size: 16px;
    margin-bottom: 0;
}

/* --- Поиск по справочнику --- */
.disease-search {
    position: relative;
    max-width: 560px;
    margin: 0 auto 28px;
}

.disease-search i {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: #b0b0b0;
    font-size: 15px;
    pointer-events: none;
}

.disease-search input {
    width: 100%;
    height: 52px;
    padding: 0 20px 0 48px;
    font-size: 15px;
    color: #272b41;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 26px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.disease-search input:focus {
    border-color: #ee344e;
    box-shadow: 0 0 0 4px rgba(238, 52, 78, .1);
}

.disease-search input::placeholder {
    color: #b0b0b0;
}

/* --- Алфавитный указатель --- */
.disease-alphabet {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 36px;
    padding-bottom: 26px;
    border-bottom: 1px solid #f0f0f0;
}

.disease-alphabet a,
.disease-alphabet span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
}

.disease-alphabet a {
    color: #ee344e;
    background: rgba(238, 52, 78, .08);
    transition: background .2s ease, color .2s ease;
}

.disease-alphabet a:hover {
    background: #ee344e;
    color: #fff;
    text-decoration: none;
}

.disease-alphabet span {
    color: #d5d5d5;
    cursor: default;
}

/* --- Группы «буква + список» --- */
.disease-index {
    max-width: 980px;
    margin: 0 auto;
}

.disease-group {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    padding: 24px 0;
    border-bottom: 1px solid #f0f0f0;
    scroll-margin-top: 24px;
}

.disease-group:last-child {
    border-bottom: 0;
}

.disease-group__letter {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    color: #ee344e;
    background: rgba(238, 52, 78, .08);
    border-radius: 12px;
}

.disease-group__list {
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    list-style: none;
    column-count: 2;
    column-gap: 36px;
}

.disease-group__list li {
    break-inside: avoid;
    margin-bottom: 12px;
}

.disease-group__list a {
    display: inline-block;
    font-size: 15.5px;
    line-height: 1.45;
    color: #272b41;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

.disease-group__list a:hover {
    color: #ee344e;
    border-bottom-color: #ee344e;
    text-decoration: none;
}

.disease-empty {
    margin: 32px 0 0;
    text-align: center;
    color: #757575;
}

/* --- Содержание внутри статьи о заболевании --- */
.toc {
    margin: 0 0 28px;
    padding: 22px 26px;
    background: #fbfbfc;
    border: 1px solid #f0f0f0;
    border-left: 3px solid #ee344e;
    border-radius: 8px;
}

.toc__title {
    font-size: 17px;
    font-weight: 600;
    color: #272b41;
    margin-bottom: 14px;
}

.toc__title i {
    margin-right: 8px;
    color: #ee344e;
    font-size: 15px;
}

.toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.toc__list li {
    counter-increment: toc;
    position: relative;
    padding-left: 30px;
    margin-bottom: 10px;
}

.toc__list li:last-child {
    margin-bottom: 0;
}

.toc__list li::before {
    content: counter(toc);
    position: absolute;
    left: 0;
    top: 1px;
    min-width: 21px;
    height: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #ee344e;
    background: rgba(238, 52, 78, .1);
    border-radius: 5px;
}

.toc__list a {
    font-size: 15px;
    line-height: 1.5;
    color: #272b41;
    text-decoration: none;
    transition: color .15s ease;
}

.toc__list a:hover {
    color: #ee344e;
    text-decoration: underline;
}

/* якоря заголовков не должны прятаться под верхний край окна */
.blog-content h2 {
    scroll-margin-top: 20px;
}

/* --- Вводный абзац страницы --- */
.page-intro {
    font-size: 17px;
    line-height: 1.6;
    color: #4a4f63;
    padding: 16px 20px;
    margin-bottom: 24px;
    background: #fbfbfc;
    border-left: 3px solid #ee344e;
    border-radius: 6px;
}

/* --- Блок «Виды и уточнения» --- */
.subtypes__list,
.related-block__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.subtypes__list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.subtypes__list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.subtypes__list a {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #272b41;
    text-decoration: none;
    transition: color .15s ease;
}

.subtypes__list a:hover {
    color: #ee344e;
}

.subtypes__list span {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #757575;
}

.related-block__list li {
    display: inline-block;
    margin: 0 8px 8px 0;
}

.related-block__list a {
    display: inline-block;
    padding: 7px 14px;
    font-size: 14px;
    color: #272b41;
    background: #f6f6f7;
    border-radius: 16px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.related-block__list a:hover {
    background: #ee344e;
    color: #fff;
}

/* --- Частые вопросы --- */
.faq-item {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.faq-item:first-child {
    padding-top: 0;
}

.faq-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.faq-item__q {
    font-size: 16px;
    font-weight: 600;
    color: #272b41;
    margin-bottom: 8px;
}

.faq-item__a {
    font-size: 15px;
    line-height: 1.65;
    color: #4a4f63;
}

/* --- Отметка о врачебной проверке --- */
.checked-at {
    margin: 10px 0 0;
    font-size: 13px;
    color: #757575;
}

/* --- Счётчик подстраниц в указателе --- */
.disease-group__count {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #757575;
    background: #f0f0f0;
    border-radius: 10px;
    vertical-align: middle;
}

/* --- Заголовки страниц внутри .row без колонки --- */
.content > .container > .row > h1 {
    width: 100%;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * .5);
}

/* --- Планшет --- */
@media (max-width: 991px) {
    .disease-group__list {
        column-count: 2;
        column-gap: 26px;
    }
}

/* --- Мобильная версия --- */
@media (max-width: 767px) {
    .disease-intro {
        margin-bottom: 24px;
    }

    .disease-intro h1 {
        font-size: 24px;
    }

    .disease-search input {
        height: 48px;
    }

    .disease-alphabet {
        gap: 4px;
        margin-bottom: 26px;
        padding-bottom: 20px;
    }

    .disease-alphabet a,
    .disease-alphabet span {
        min-width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .disease-group {
        gap: 16px;
        padding: 20px 0;
    }

    .disease-group__letter {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        font-size: 22px;
        border-radius: 10px;
    }

    .disease-group__list {
        column-count: 1;
    }

    .toc {
        padding: 18px 18px;
    }

    /* длинные названия и URL не должны распирать страницу */
    .blog-content,
    .blog-view {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* широкие таблицы в текстах статей — скроллом, а не разъезжанием макета */
    .blog-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }

    .blog-content img {
        max-width: 100%;
        height: auto;
    }
}
