/* Стили для внешнего контейнера */
.text-outer-container {
    margin-bottom: 20px;
    position: relative;
}

/* Стили для внутреннего контейнера с текстом */
.text-inner-container {
    position: relative;
    line-height: 1.5;
    transition: max-height 0.5s ease;
    max-height: 100px;
    overflow: hidden;
}

/* Когда контейнер развёрнут */
.text-inner-container.expanded {
    max-height: none;
    overflow: visible;
}

/* Градиент */
.text-inner-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    transition: opacity 0.3s ease;
}

/* Когда контейнер развёрнут - УБИРАЕМ градиент полностью */
.text-inner-container.expanded::after {
    display: none !important;
}

/* Стили для ссылки */
.toggle-link {
    display: inline-block;
    margin-top: 10px;
    color: #2782de !important;
    text-decoration: none !important;
    cursor: pointer;
    border-bottom: 1px dashed #2782de;
    padding-bottom: 1px;
    transition: none !important;
}

.toggle-link:hover {
    color: #0056b3 !important;
    border-bottom-color: #2782de;
}

.toggle-link:visited,
.toggle-link:active,
.toggle-link:focus {
    color: #2782de !important;
    border-bottom-color: #2782de;
    outline: none;
}

/* Скрыть кнопку, если текст не нуждается в обрезке */
.toggle-link.hidden {
    display: none;
}

/* Для контейнеров с всегда развёрнутым текстом */
.text-outer-container.miniset-expand-always .text-inner-container {
    max-height: none !important;
    overflow: visible !important;
}

.text-outer-container.miniset-expand-always .text-inner-container::after {
    display: none !important;
}

/* Скрываем кнопку в режиме без переключения */
.text-outer-container.miniset-no-toggle .toggle-link {
    display: none !important;
}

/* Скрываем языковое меню когда отключено */
.text-outer-container.miniset-no-language-switch ~ .wrapper-dropdown-5,
.text-outer-container.miniset-no-language-switch ~ .clearfix {
    display: none !important;
}

.text-inner-container:not(.expanded) {
    mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
    overflow: visible; /* Разрешаем выделение */
    position: relative;
}

.text-inner-container:not(.expanded)::after {
    display: none; /* Убираем старый градиент */
}

/* Градиент только для скрытого состояния */
.text-inner-container:not(.expanded):not(.no-gradient)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8) 100%);
    pointer-events: none;
}

/* Скрываем градиент для коротких текстов */
.text-inner-container.no-gradient::after {
    display: none !important;
}