/* Стили для текстовой страницы */

.default-page-text {
    padding: 40px 0 60px;
    background: #fff;
}



/* Оглавление */
.text-page-toc {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 999;
    background: #FAFAFA;
    border-radius: 8px;
    border-left: 4px solid #C23016;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    /* transition: all 0.3s ease; */
    max-width: 320px;
    max-height: 80vh;
    overflow: hidden;
}

/* Компактное состояние (свернуто) */
.text-page-toc.text-page-toc--collapsed {
    max-width: 60px;
    max-height: 60px;
    border-left: 0px;
    max-width: fit-content;
}

.text-page-toc.text-page-toc--collapsed .text-page-toc__content {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    padding: 0;
}

/* Кнопка не должна скрываться вместе с контентом */
.text-page-toc--collapsed .text-page-toc__toggle {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* На десктопе при сворачивании показываем только заголовок */
@media (min-width: 769px) {
    .text-page-toc--collapsed {
        max-width: 200px;
        max-height: none;
    }

    .text-page-toc--collapsed .text-page-toc__content {
        opacity: 1;
        visibility: visible;
        max-height: none;
        padding: 15px 20px;
    }

    .text-page-toc--collapsed .text-page-toc__list {
        display: none;
    }

    .text-page-toc--collapsed .text-page-toc__title {
        margin-bottom: 0;
        font-size: 16px;
        text-align: center;
    }
}

/* Кнопка переключения */
.text-page-toc__toggle {
    display: none;
    width: 100%;
    padding: 12px 15px;
    background: #C23016;
    color: #fff;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    /* transition: all 0.3s ease; */
    position: relative;
    z-index: 10;
}

/* На десктопе делаем заголовок кликабельным для сворачивания */
@media (min-width: 769px) {
    .text-page-toc__title {
        cursor: pointer;
        user-select: none;
        position: relative;
        padding-right: 25px;
        transition: all 0.3s ease;
    }

    .text-page-toc__title:hover {
        color: #C23016;
    }

    .text-page-toc__title:after {
        content: '−';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        color: #C23016;
        transition: transform 0.3s ease;
        font-weight: bold;
    }

    .text-page-toc--collapsed .text-page-toc__title:after {
        content: '+';
    }

    /* На ПК в свернутом состоянии показываем кнопку с текстом */
    .text-page-toc--collapsed {
        max-width: 180px;
    }

    .text-page-toc--collapsed .text-page-toc__toggle {
        display: block !important;
        border-radius: 8px;
    }

    .text-page-toc--collapsed .text-page-toc__toggle-text {
        display: inline-block !important;
    }

    .text-page-toc--collapsed .text-page-toc__toggle-icon {
        margin-right: 8px;
    }
}

.text-page-toc__toggle:hover {
    background: #A02812;
}

.text-page-toc__toggle-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 18px;
    vertical-align: middle;
}

.text-page-toc__toggle-text {
    vertical-align: middle;
}

.text-page-toc--collapsed .text-page-toc__toggle {
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.text-page-toc--collapsed .text-page-toc__toggle-text {
    display: none;
}

.text-page-toc--collapsed .text-page-toc__toggle-icon {
    margin-right: 0;
}

/* Контент оглавления */
.text-page-toc__content {
    padding: 20px 25px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
    transition: all 0.3s ease;
}

.text-page-toc__content::-webkit-scrollbar {
    width: 6px;
}

.text-page-toc__content::-webkit-scrollbar-track {
    background: #F0F0F0;
    border-radius: 3px;
}

.text-page-toc__content::-webkit-scrollbar-thumb {
    background: #C23016;
    border-radius: 3px;
}

.text-page-toc__content::-webkit-scrollbar-thumb:hover {
    background: #A02812;
}

.text-page-toc__title {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
    text-transform: uppercase;
    color: #1E1E1E;
    margin: 0 0 15px 0;
    padding: 0;
}

.text-page-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.text-page-toc__item {
    margin-bottom: 6px;
    margin-left: 0px;
}

.text-page-toc__item:last-child {
    margin-bottom: 0;
}

.text-page-toc__link {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1E1E1E;
    text-decoration: none;
    display: block;
    padding: 4px 0;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 18px;
}

.text-page-toc__link:before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: #C23016;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.text-page-toc__link:hover {
    color: #C23016;
    padding-left: 22px;
}

.text-page-toc__link:hover:before {
    /* transform: scale(1.05);  */
    background: #C23016;
}

.text-page-toc__link.active {
    color: #C23016;
    font-weight: 600;
    padding-left: 22px;
}


.text:hover {
  box-shadow: none !important;
}
.text-page-toc__sublist {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
}

/* Вложенные уровни оглавления */
.text-page-toc__item--level-2 {
    /* margin-left: 15px; */
    margin-top: 4px;
    margin-left: 0px;
}

.text-page-toc__item--level-2 .text-page-toc__link {
    font-size: 14px;
    color: #4A4A4A;
    padding-left: 16px;
}

.text-page-toc__item--level-3 {
    margin-left: 30px;
    margin-top: 3px;
}

.text-page-toc__item--level-3 .text-page-toc__link {
    font-size: 13px;
    color: #6A6A6A;
    padding-left: 14px;
}

.text-page-toc__item--level-4 {
    margin-left: 45px;
    margin-top: 2px;
}

.text-page-toc__item--level-4 .text-page-toc__link {
    font-size: 12px;
    color: #8A8A8A;
    padding-left: 12px;
}

/* Контент страницы */
.default-page-text .text {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #1E1E1E;
    max-width: 100%;
}

.default-page-text .text p {
    margin: 0 0 10px 0;
}

.default-page-text .text p:last-child {
    margin-bottom: 0;
}

/* Заголовки в контенте */
.default-page-text .text h1,
.default-page-text .text h2,
.default-page-text .text h3,
.default-page-text .text h4,
.default-page-text .text h5,
.default-page-text .text h6 {
    /* font-family: 'Pobeda', sans-serif; */
    font-weight: 700;
    text-transform: uppercase; 
    color: #1E1E1E;
    margin: 40px 0 20px 0;
    line-height: 1.3;
    scroll-margin-top: 80px;
}

.default-page-text .text h1 {
    font-size: 22px;
    margin-top: 50px;
    padding-bottom: 15px;
    border-bottom: 3px solid #C23016;
}

.default-page-text .text h1:first-of-type {
    margin-top: 0;
}

.default-page-text .text h2 {
    font-size: 28px;
    margin-top: 40px;
    padding-bottom: 12px;
    border-bottom: 2px solid #E0E0E0;
}

.default-page-text .text h3 {
    font-size: 24px;
    margin-top: 35px;
    padding-bottom: 10px;
    border-bottom: 1px solid #F0F0F0;
}

.default-page-text .text h4 {
    font-size: 20px;
    margin-top: 30px;
}

.default-page-text .text h5 {
    font-size: 18px;
    margin-top: 25px;
}

.default-page-text .text h6 {
    font-size: 16px;
    margin-top: 20px;
}

/* Ссылки */
.default-page-text .text a {
    color: #C23016;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.default-page-text .text a:hover {
    color: #A02812;
    text-decoration: none;
}

/* Списки */
.default-page-text .text ul,
.default-page-text .text ol {
    margin: 20px 0;
    padding-left: 30px;
}

.default-page-text .text ul {
    list-style-type: disc;
}

.default-page-text .text ol {
    list-style-type: decimal;
}

.default-page-text .text li {
    margin-bottom: 4px;
    line-height: 140%;
}

.default-page-text .text li:last-child {
    margin-bottom: 0;
}

/* Изображения */
.default-page-text .text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.default-page-text .text figure {
    margin: 30px 0;
    text-align: center;
}

.default-page-text .text figcaption {
    font-size: 14px;
    color: #6A6A6A;
    margin-top: 10px;
    font-style: italic;
}

/* Цитаты */
.default-page-text .text blockquote {
    margin: 30px 0;
    padding: 20px 25px;
    background: #FAFAFA;
    border-left: 4px solid #C23016;
    border-radius: 4px;
    font-style: italic;
    color: #4A4A4A;
}

.default-page-text .text blockquote p {
    margin: 0;
}

/* Таблицы */
.default-page-text .text table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.default-page-text .text table th,
.default-page-text .text table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #E0E0E0;
}

.default-page-text .text table th {
    background: #C23016;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
}

.default-page-text .text table tr:last-child td {
    border-bottom: none;
}

.default-page-text .text table tr:hover {
    background: #FAFAFA;
}

/* Код */
.default-page-text .text code {
    background: #F5F5F5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #C23016;
}

.default-page-text .text pre {
    background: #1E1E1E;
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 30px 0;
}

.default-page-text .text pre code {
    background: transparent;
    padding: 0;
    color: #fff;
}

/* Разделители */
.default-page-text .text hr {
    border: none;
    border-top: 2px solid #E0E0E0;
    margin: 40px 0;
}

/* Выделение текста */
.default-page-text .text strong,
.default-page-text .text b {
    font-weight: 600;
    color: #1E1E1E;
}

.default-page-text .text em,
.default-page-text .text i {
    font-style: italic;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .text-page-toc {
        left: 15px;
        max-width: 280px;
    }

    .text-page-toc__content {
        padding: 18px 20px;
    }

    .default-page-text .text h1 {
        font-size: 28px;
    }

    .default-page-text .text h2 {
        font-size: 24px;
    }

    .default-page-text .text h3 {
        font-size: 20px;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .default-page-text {
        padding: 30px 0 40px;
    }

    .text-page-toc {
        top: auto;
        bottom: 20px;
        left: 15px;
        left: auto;
        transform: none;
        max-width: 260px;
        max-height: 70vh;
        border-left: 0px;
    }

    .text-page-toc.text-page-toc--collapsed {
        max-width: 160px;
        max-height: 50px;
        bottom: 15px;
        left: 15px;
    }

    .text-page-toc__toggle {
        display: block !important;
        border-radius: 8px;
        white-space: nowrap;
    }

    /* Кнопка должна быть видна даже когда оглавление свернуто */
    .text-page-toc--collapsed .text-page-toc__toggle {
        display: block !important;
        border-radius: 8px 8px 0px 0px; 
    }

    /* Текст кнопки всегда виден на мобильных */
    .text-page-toc--collapsed .text-page-toc__toggle-text {
        display: inline-block !important;
    }

    .text-page-toc--collapsed .text-page-toc__toggle-icon {
        margin-right: 8px;
    }

    .text-page-toc__content {
        padding: 15px 18px;
        max-height: calc(70vh - 50px);
    }

    .text-page-toc__title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .text-page-toc__item {
        margin-bottom: 4px;
    }

    .text-page-toc__link {
        font-size: 14px;
        padding: 3px 0;
        padding-left: 16px;
    }

    .text-page-toc__link:hover,
    .text-page-toc__link.active {
        padding-left: 20px;
    }

    .text-page-toc__link:before {
        top: 8px;
    }

    .text-page-toc__item--level-2 {
        /* margin-left: 12px; */
        margin-top: 3px;
    }

    .text-page-toc__item--level-2 .text-page-toc__link {
        font-size: 13px;
        padding-left: 14px;
    }

    .text-page-toc__item--level-3 {
        margin-left: 24px;
        margin-top: 2px;
    }

    .text-page-toc__item--level-3 .text-page-toc__link {
        font-size: 12px;
        padding-left: 12px;
    }

    .text-page-toc__item--level-4 {
        margin-left: 36px;
        margin-top: 2px;
    }

    .text-page-toc__item--level-4 .text-page-toc__link {
        font-size: 11px;
        padding-left: 10px;
    }

    .default-page-text .text {
        font-size: 15px;
        line-height: 1.7;
    }

    .default-page-text .text h1 {
        font-size: 24px;
        margin-top: 35px;
        padding-bottom: 12px;
        scroll-margin-top: 60px;
    }

    .default-page-text .text h2 {
        font-size: 22px;
        margin-top: 30px;
        padding-bottom: 10px;
    }

    .default-page-text .text h3 {
        font-size: 20px;
        margin-top: 25px;
        padding-bottom: 8px;
    }

    .default-page-text .text h4 {
        font-size: 18px;
        margin-top: 20px;
    }

    .default-page-text .text h5 {
        font-size: 16px;
        margin-top: 18px;
    }

    .default-page-text .text h6 {
        font-size: 15px;
        margin-top: 15px;
    }

    .default-page-text .text p {
        margin-bottom: 18px;
    }

    .default-page-text .text ul,
    .default-page-text .text ol {
        padding-left: 25px;
        margin: 18px 0;
    }

    .default-page-text .text img {
        margin: 20px 0;
    }

    .default-page-text .text blockquote {
        padding: 15px 20px;
        margin: 25px 0;
    }

    .default-page-text .text table {
        font-size: 14px;
        margin: 20px 0;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .default-page-text .text table th,
    .default-page-text .text table td {
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .default-page-text {
        padding: 20px 0 30px;
    }

    .text-page-toc {
        bottom: 15px;
        left: 10px;
        max-width: 240px;
        max-height: 65vh;
    }

    .text-page-toc.text-page-toc--collapsed {
        max-width: 140px;
        max-height: 45px;
    }

    .text-page-toc__toggle {
        padding: 10px 12px;
        font-size: 12px;
        border-radius: 8px;
    }

    /* Текст кнопки всегда виден на маленьких экранах */
    .text-page-toc--collapsed .text-page-toc__toggle-text {
        display: inline-block !important;
        font-size: 11px;
    }

    .text-page-toc--collapsed .text-page-toc__toggle-icon {
        margin-right: 6px;
        font-size: 16px;
    }

    .text-page-toc__content {
        padding: 12px 15px;
        max-height: calc(65vh - 45px);
    }

    .text-page-toc__title {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .text-page-toc__item {
        margin-bottom: 3px;
    }

    .text-page-toc__link {
        font-size: 13px;
        padding: 2px 0;
        padding-left: 14px;
    }

    .text-page-toc__link:hover,
    .text-page-toc__link.active {
        padding-left: 18px;
    }


    .text-page-toc__item--level-2 .text-page-toc__link {
        font-size: 12px;
        padding-left: 12px;
    }

    .text-page-toc__item--level-3 {
        margin-left: 20px;
    }

    .text-page-toc__item--level-3 .text-page-toc__link {
        font-size: 11px;
        padding-left: 10px;
    }

    .text-page-toc__item--level-4 {
        margin-left: 30px;
    }

    .text-page-toc__item--level-4 .text-page-toc__link {
        font-size: 10px;
        padding-left: 8px;
    }

    .default-page-text .text {
        font-size: 14px;
        line-height: 1.6;
    }

    .default-page-text .text h1 {
        font-size: 18px;
        margin-top: 30px;
    }

    .default-page-text .text h2 {
        font-size: 16px;
        margin-top: 30px;
    }
    .text p, .text ul, .text li {
      font-size: 15px;
    }

    .default-page-text .text h3 {
        font-size: 18px;
        margin-top: 20px;
    }

    .default-page-text .text h4 {
        font-size: 16px;
    }

    .default-page-text .text h5 {
        font-size: 15px;
    }

    .default-page-text .text h6 {
        font-size: 14px;
    }
}

