.news-article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

.news-article__header {
    text-align: center;
    margin-bottom: 2rem;
}

.news-article__date {
    color: #666;
    font-size: 0.9em;
}

.news-article__title {
    font-size: 2em;
    margin: 1rem 0;
    color: #333;
}

.news-article__department {
    color: #666;
    font-size: 0.9em;
    margin-top: 0.5rem;
}

.news-article__preview {
    text-align: center;
    margin: 2rem 0;
}

.news-article__preview img {
    max-width: 85%;
    max-height: 400px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
}

.news-article__lead {
    display: none;
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 2rem;
    white-space: pre-wrap;
}

.news-article__divider {
    height: 1px;
    background: #eee;
    margin: 2rem 0;
}

.content-block-preview {
    margin-bottom: 2rem;
}

/* Стили для группы изображений */
.images-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 1rem;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
}

.images-group img {
    max-height: 350px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Позиционирование групп изображений */
.images-group.left {
    float: left;
    margin: 0 1rem 1rem 0;
    flex-direction: row;
}

.images-group.right {
    float: right;
    margin: 0 0 1rem 1rem;
    flex-direction: row;
}

.images-group.center {
    display: flex;
    justify-content: center;
    margin: 1rem auto;
    clear: both;
    width: 100%;
}

.content-block-preview p {
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.news-article__author {
    margin-top: 2rem;
    font-style: italic;
    color: #666;
}

.preview-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.edit-btn, .cancel-btn, .save-btn {
    padding: 8px 16px;
    background: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
}

.cancel-btn {
    background: #666;
}

.save-btn {
    background: #28a745;
}

.edit-btn:hover, .cancel-btn:hover, .save-btn:hover {
    opacity: 0.9;
}

/* Стили для режима редактирования */
.editable {
    border: 2px dashed #ddd;
    padding: 8px;
    margin: -8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-height: 1em;
    background: white;
}

.editable:focus {
    outline: none;
    border-color: #0066cc;
    background: #f8fbff;
}

.editable.large {
    min-height: 300px;
}

.image-editor {
    position: relative;
    display: inline-block;
    text-align: center;
}

.image-controls {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.image-upload-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    max-width: 300px;
}

.image-upload-input:hover {
    border-color: #0066cc;
}

.image-delete-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.image-delete-btn:hover {
    background: #e9ecef;
}

.image-delete-btn input[type="checkbox"] {
    margin: 0;
}

.edit-form-buttons {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    text-align: center;
}

/* Стили для замены изображений в детальном тексте */
.detail-images-replace {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.detail-images-replace h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.detail-image-replace-item {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.detail-image-replace-item:last-child {
    margin-bottom: 0;
}

/* Модальное окно */
.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    font-weight: bold;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    margin-bottom: 25px;
}

.modal-body p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.5;
    color: #555;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
}

#modalConfirm {
    background: #28a745;
    color: white;
}

#modalConfirm:hover {
    background: #218838;
}

#modalCancel {
    background: #6c757d;
    color: white;
}

#modalCancel:hover {
    background: #5a6268;
}

/* Адаптивность */
@media (max-width: 768px) {
    .preview-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .edit-btn, .cancel-btn, .save-btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin: 0;
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 1.3em;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .image-controls {
        align-items: stretch;
    }
    
    .image-upload-input {
        max-width: none;
    }
    
    .detail-images-replace {
        padding: 10px;
    }
    
    .images-group {
        flex-direction: column;
    }
    
    .images-group img {
        max-width: 100%;
        height: auto;
    }
    
    .images-group.left, 
    .images-group.right {
        float: none;
        margin: 1rem auto;
    }
}