html {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #b3b3b3 transparent;
}

/*=============================================
            Страница блога (список)
===============================================*/

.blog-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.blog-title {
    font-family: 'Onest', sans-serif;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 400;
    color: #000;
    margin: 0;
}

.blog-add-btn {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    font-weight: 600;
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.blog-add-btn:hover {
    background-color: #333;
}

/*=============================================
            Сетка карточек
===============================================*/

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    font-family: 'Onest', sans-serif;
    font-size: 16px;
    color: #888;
}

/*=============================================
            Карточка статьи
===============================================*/

.blog-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.blog-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.blog-card--hidden {
    opacity: 0.55;
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f5f5f5;
}

.blog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.blog-card:hover .blog-card-image {
    transform: scale(1.03);
}

.blog-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0ece4 0%, #e8e0d5 100%);
}

.blog-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-title {
    font-family: 'Onest', sans-serif;
    font-size: clamp(15px, 1.4vw, 18px);
    font-weight: 600;
    color: #000;
    margin: 0 0 8px;
    line-height: 1.35;
}

.blog-card-description {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/*=============================================
            Панель администратора на карточке
===============================================*/

.blog-card-admin-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid #e8e8e8;
    background: #fafafa;
    justify-content: flex-end;
}

.blog-hidden-badge {
    font-family: 'Onest', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #e74c3c;
    border-radius: 4px;
    padding: 2px 7px;
    margin-right: auto;
}

.blog-admin-btn {
    font-family: 'Onest', sans-serif;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 5px 12px;
    background: #fff;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.blog-admin-btn:hover {
    background: #f0f0f0;
    border-color: #aaa;
}

.blog-toggle-btn {
    color: #555;
}

/*=============================================
            Модальное окно
===============================================*/

.blog-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.blog-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.blog-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.blog-modal-title {
    font-family: 'Onest', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #000;
}

.blog-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s;
}

.blog-modal-close:hover {
    color: #000;
}

.blog-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.blog-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
}

/*=============================================
            Элементы формы
===============================================*/

.blog-form-group {
    margin-bottom: 20px;
}

.blog-form-label {
    display: block;
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.blog-form-input,
.blog-form-textarea {
    width: 100%;
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    color: #000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 14px;
    box-sizing: border-box;
    transition: border-color 0.15s;
    resize: vertical;
}

.blog-form-input:focus,
.blog-form-textarea:focus {
    outline: none;
    border-color: #000;
}

/*=============================================
            Загрузка обложки
===============================================*/

.blog-cover-upload {
    position: relative;
}

.blog-cover-preview {
    width: 100%;
    min-height: 140px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s;
    background: #fafafa;
    flex-direction: column;
    gap: 8px;
}

.blog-cover-preview:hover {
    border-color: #999;
}

#coverPreviewText {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    color: #888;
    text-align: center;
    padding: 16px;
}

#coverPreviewImg {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

/*=============================================
            Редактор Quill
===============================================*/

.blog-quill-editor {
    min-height: 300px;
    font-family: 'Onest', sans-serif;
    font-size: 15px;
}

.blog-quill-editor .ql-container {
    font-size: 15px;
    font-family: 'Onest', sans-serif;
}

/*=============================================
            Кнопки футера модала
===============================================*/

.blog-btn-cancel,
.blog-btn-save {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 24px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.blog-btn-cancel {
    background: #f0f0f0;
    color: #555;
}

.blog-btn-cancel:hover {
    background: #e0e0e0;
}

.blog-btn-save {
    background: #000;
    color: #fff;
}

.blog-btn-save:hover {
    background: #333;
}

.blog-btn-save:disabled {
    background: #999;
    cursor: not-allowed;
}
