html {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #b3b3b3 transparent;
}

/*=============================================
            Страница статьи блога
===============================================*/

.blog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 24px;
    font-family: 'Onest', sans-serif;
    font-size: 14px;
}

.blog-breadcrumb-link {
    color: #888;
    text-decoration: none;
    transition: color 0.15s;
}

.blog-breadcrumb-link:hover {
    color: #000;
}

.blog-breadcrumb-sep {
    color: #ccc;
}

.blog-breadcrumb-current {
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

/*=============================================
            Панель администратора
===============================================*/

.blog-article-admin-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.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: 6px 14px;
    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-edit-btn {
    color: #000;
    font-weight: 600;
    border-color: #999;
}

/*=============================================
            Верхняя зона: заголовок + автор
===============================================*/

.blog-article-top {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 28px;
}

/*=============================================
            Заголовок статьи
===============================================*/

.blog-article-header {
    flex: 1;
    min-width: 0;
}

.blog-article-title {
    font-family: 'Onest', sans-serif;
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 600;
    color: #000;
    margin: 0 0 16px;
    line-height: 1.25;
}

.blog-article-lead {
    font-family: 'Onest', sans-serif;
    font-size: clamp(15px, 1.5vw, 18px);
    color: #555;
    margin: 0;
    line-height: 1.55;
}

/*=============================================
            Заглавная картинка
===============================================*/

.blog-article-cover {
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
}

.blog-article-cover-img {
    width: 100%;
    display: block;
    max-height: 500px;
    object-fit: cover;
}

/*=============================================
            Содержимое статьи (Quill)
===============================================*/

.blog-article-content {
    font-family: 'Onest', sans-serif;
    font-size: clamp(15px, 1.4vw, 17px);
    line-height: 1.7;
    color: #222;
    margin-bottom: 48px;
}

.blog-article-content .ql-editor {
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
    color: inherit;
}

.blog-article-content .ql-editor p {
    margin-bottom: 16px;
}

.blog-article-content .ql-editor h1,
.blog-article-content .ql-editor h2,
.blog-article-content .ql-editor h3 {
    font-family: 'Onest', sans-serif;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: #000;
}

.blog-article-content .ql-editor h1 {
    font-size: clamp(22px, 2.5vw, 32px);
}

.blog-article-content .ql-editor h2 {
    font-size: clamp(19px, 2vw, 26px);
}

.blog-article-content .ql-editor h3 {
    font-size: clamp(17px, 1.7vw, 22px);
}

.blog-article-content .ql-editor ul,
.blog-article-content .ql-editor ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.blog-article-content .ql-editor li {
    margin-bottom: 6px;
}

.blog-article-content .ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px auto;
    display: block;
}

.blog-article-content .ql-editor blockquote {
    border-left: 4px solid #e0e0e0;
    padding-left: 16px;
    color: #666;
    margin: 20px 0;
    font-style: italic;
}

.blog-article-content .ql-editor a {
    color: #000;
    text-decoration: underline;
}

/*=============================================
            Блок автора (верхний правый)
===============================================*/

.blog-article-author {
    flex-shrink: 0;
    min-width: 200px;
    max-width: 280px;
    padding: 16px 18px;
    background: #fafafa;
    border: 1px solid #efefef;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: flex-start;
}

.blog-article-author-label {
    font-family: 'Onest', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.blog-article-author-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.blog-article-author-photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.blog-article-author-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.blog-article-author-name {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-article-author-bio {
    font-family: 'Onest', sans-serif;
    font-size: 12px;
    color: #777;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .blog-article-top {
        flex-direction: column;
        gap: 20px;
    }

    .blog-article-author {
        width: 100%;
        box-sizing: border-box;
    }
}

/*=============================================
            Ссылка "Все статьи"
===============================================*/

.blog-article-back {
    margin-bottom: 40px;
}

.blog-back-link {
    font-family: 'Onest', sans-serif;
    font-size: 15px;
    color: #555;
    text-decoration: none;
    transition: color 0.15s;
}

.blog-back-link:hover {
    color: #000;
}

/*=============================================
            Модальное окно (те же стили, что в blog.css)
===============================================*/

.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;
}

.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;
}
