/* Стили для контента из CKEditor */
.editor-content {
    /* Базовые стили для текста */
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

/* Параграфы */
.editor-content p {
    margin-bottom: 1rem;
    margin-top: 0;
}

/* Заголовки */
.editor-content h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.editor-content h2 {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 0.875rem;
    margin-top: 1.25rem;
}

.editor-content h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.editor-content h4 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.625rem;
    margin-top: 0.875rem;
}

.editor-content h5 {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    margin-top: 0.75rem;
}

.editor-content h6 {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    margin-top: 0.75rem;
}

/* Списки */
.editor-content ul {
    margin-bottom: 1rem;
    margin-top: 0;
    padding-left: 2rem;
}

.editor-content ul li {
    list-style-type: disc;
    margin-bottom: 0.5rem;
}

.editor-content ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.editor-content ul ul li {
    list-style-type: circle;
}

.editor-content ul ul ul li {
    list-style-type: square;
}

.editor-content ol {
    margin-bottom: 1rem;
    margin-top: 0;
    padding-left: 2rem;
}

.editor-content ol li {
    list-style-type: decimal;
    margin-bottom: 0.5rem;
}

.editor-content ol ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.editor-content ol ol li {
    list-style-type: lower-alpha;
}

/* Ссылки */
.editor-content a {
    color: #3780DD;
    text-decoration: underline;
}

.editor-content a:hover {
    color: #2060BD;
    text-decoration: underline;
}

/* Жирный и курсив */
.editor-content strong,
.editor-content b {
    font-weight: bold;
}

.editor-content em,
.editor-content i {
    font-style: italic;
}

/* Подчеркнутый текст */
.editor-content u {
    text-decoration: underline;
}

/* Цитаты */
.editor-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #666;
}

/* Горизонтальная линия */
.editor-content hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 2rem 0;
}

/* Таблицы */
.editor-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.editor-content table th,
.editor-content table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}

.editor-content table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* Изображения */
.editor-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

/* Код */
.editor-content code {
    background-color: #f4f4f4;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
}

.editor-content pre {
    background-color: #f4f4f4;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.editor-content pre code {
    background-color: transparent;
    padding: 0;
}

/* Выравнивание текста */
.editor-content .text-left {
    text-align: left;
}

.editor-content .text-center {
    text-align: center;
}

.editor-content .text-right {
    text-align: right;
}

.editor-content .text-justify {
    text-align: justify;
}

/* Отступы для первого и последнего элемента */
.editor-content > *:first-child {
    margin-top: 0;
}

.editor-content > *:last-child {
    margin-bottom: 0;
}

/* Стили для элементов span с атрибутом style (сохраняем стили из CKEditor) */
.editor-content span[style] {
    /* Стили будут применяться из инлайн атрибутов */
}

/* Переносы строк */
.editor-content br {
    display: block;
    margin-bottom: 0.5rem;
}

/* Информационный блок (Info Block) */
.editor-content .info-block {
    background-color: #f1f1f1;
    border-radius: 20px;
    padding: 20px 16px;
    margin: 16px 0;
    display: block;
    position: relative;
}

.editor-content .info-block p {
    margin-bottom: 0.5rem;
}

.editor-content .info-block p:last-child {
    margin-bottom: 0;
}

.editor-content .info-block ul,
.editor-content .info-block ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Блоки документов - дизайн согласно Figma */
.editor-content .document-block {
    background-color: #F1F1F1;
    border-radius: 24px;
    padding: 20px 16px;
    margin: 16px 0;
    display: block;
    position: relative;
    transition: background-color 0.3s ease;
}

.editor-content .document-block:hover {
    background-color: #E8E8E8;
}

/* Ссылка документа с flexbox layout */
.editor-content .document-block .document-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #045CA7;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    transition: color 0.3s ease;
}

/* Иконка документа */
.editor-content .document-block .document-link svg {
    flex-shrink: 0;
    width: 22px;
    height: 26px;
}

/* Текст документа */
.editor-content .document-block .document-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    color: #045CA7;
}

/* Состояния ссылки */
.editor-content .document-block .document-link:visited .document-text {
    color: #045CA7;
}

.editor-content .document-block .document-link:hover {
    color: #034A85;
}

.editor-content .document-block .document-link:hover .document-text {
    color: #034A85;
}

/* Контейнер для блоков в ряд - CSS Grid согласно дизайну Figma */
.editor-content .content-blocks-row {
    margin: 20px 0;
    display: grid;
    grid-gap: 20px;
    width: 100%;
}

/* 2 колонки */
.editor-content .content-blocks-row.cols-2 {
    grid-template-columns: 1fr 1fr;
}

/* 3 колонки */
.editor-content .content-blocks-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 4 колонки */
.editor-content .content-blocks-row.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Блоки внутри сетки */
.editor-content .content-blocks-row .info-block,
.editor-content .content-blocks-row .document-block {
    margin: 0;
    height: auto;
    min-height: 80px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .editor-content .content-blocks-row.cols-2,
    .editor-content .content-blocks-row.cols-3,
    .editor-content .content-blocks-row.cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .editor-content .content-blocks-row.cols-3,
    .editor-content .content-blocks-row.cols-4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Bootstrap-подобные колонки */
.editor-content .col-12 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .editor-content .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 992px) {
    .editor-content .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .editor-content .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .editor-content .info-block {
        padding: 16px 12px;
        border-radius: 16px;
    }
    
    .editor-content .document-block {
        padding: 16px 12px;
        border-radius: 16px;
    }
    
    .editor-content .content-blocks-row {
        margin-left: -4px;
        margin-right: -4px;
    }
    
    .editor-content .content-blocks-row > div {
        padding-left: 4px;
        padding-right: 4px;
    }
}