/* ========== СТРАНИЦА БЛОГА ========== */

.blog-page {
    min-height: 100vh;
    background: var(--body-bg);
    padding: 40px 0;
}

.blog-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 0 20px;
}

.blog-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.blog-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 48px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-title svg {
    stroke: var(--accent-color);
    -webkit-text-fill-color: initial;
    background: none;
}

.blog-description {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ========== ПОИСК ПО БЛОГУ ========== */

.blog-search {
    margin-bottom: 32px;
    padding: 0 20px;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    background: var(--post-bg);
    border: 2px solid var(--post-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px;
    background: var(--sidebar-bg);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    background: var(--error-color);
    color: white;
}

.search-results-info {
    text-align: center;
    margin-top: 16px;
    padding: 12px 20px;
    background: var(--sidebar-bg);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.search-results-info strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* Подсветка результатов поиска */
.blog-card mark,
.search-results-info mark {
    background: var(--accent-color);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Анимация при поиске */
.blog-grid.searching {
    opacity: 0.6;
    pointer-events: none;
}

/* Фильтры */
.filter-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.filter-tabs::-webkit-scrollbar {
    height: 6px;
}

.filter-tabs::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
    border-radius: 3px;
}

.filter-tabs::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 3px;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--post-bg);
    border: 2px solid var(--post-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: var(--accent-color);
    background: var(--sidebar-bg);
    transform: translateY(-2px);
}

.filter-tab.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--sidebar-bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    border-radius: 12px;
}

.filter-tab.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Сетка статей */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
    padding: 0 20px;
}

/* Карточка статьи */
.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

/* Задержка анимации для каждой карточки */
.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }
.blog-card:nth-child(n+7) { animation-delay: 0.7s; }

.blog-card-cover {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--sidebar-bg);
}

.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-cover img {
    transform: scale(1.08);
}

.blog-card-category {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
}

.category-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent-color);
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.blog-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.blog-card-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.blog-card-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== ТЕГИ В КАРТОЧКАХ ПОИСКА ========== */

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.search-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--sidebar-bg);
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-tag mark {
    background: var(--accent-color);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
}

.tag-more {
    display: inline-block;
    padding: 4px 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--post-border);
}

.blog-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.blog-card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.blog-card-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.blog-card-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.blog-card-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.blog-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blog-card-meta-item svg {
    width: 16px;
    height: 16px;
}

/* Кнопка "Загрузить ещё" */
.blog-load-more {
    text-align: center;
    padding: 0 20px;
    margin-bottom: 40px;
}

#loadMoreBtn {
    min-width: 200px;
}

/* Загрузчик */
.blog-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.loader-animation {
    display: flex;
    gap: 12px;
}

.loader-circle {
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loader-circle:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-circle:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.blog-loader p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Сообщение об отсутствии статей */
.no-posts {
    text-align: center;
    padding: 80px 20px;
}

.no-posts-animation {
    margin-bottom: 24px;
}

.no-posts-animation svg {
    color: var(--text-secondary);
    opacity: 0.5;
}

.no-posts h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.no-posts p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* ========== РЕЗУЛЬТАТЫ ПОИСКА ========== */

/* Состояние "не найдено" */
.no-search-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.4s ease;
}

.no-search-results svg {
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 16px;
}

.no-search-results h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.no-search-results p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.no-search-results p:last-of-type {
    margin-bottom: 24px;
}

.no-search-results .search-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
}

.search-suggestion {
    padding: 8px 16px;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-suggestion:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== СТРАНИЦА ОТДЕЛЬНОЙ СТАТЬИ ========== */

.blog-post-page {
    min-height: 100vh;
    background: var(--body-bg);
    padding: 40px 0 80px;
}

/* ========== BREADCRUMBS ========== */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.breadcrumb-item:hover {
    color: var(--accent-color);
    background: var(--sidebar-bg);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    pointer-events: none;
    font-weight: 600;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-separator {
    color: var(--text-secondary);
    opacity: 0.3;
    flex-shrink: 0;
}

/* Контейнер статьи */
.blog-post-container {
    max-width: 840px;
    margin: 0 auto;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Обложка статьи */
.blog-post-cover {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
    background: var(--sidebar-bg);
}

.blog-post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Заголовок статьи */
.blog-post-header {
    padding: 48px 48px 32px;
}

.blog-post-category {
    margin-bottom: 20px;
}

.blog-post-title {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.blog-post-excerpt {
    font-size: 20px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
}

.blog-post-meta {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blog-post-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.author-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 700;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-name:hover {
    color: var(--accent-color);
}

.post-details {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.separator {
    opacity: 0.5;
}

/* Теги */
.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 14px;
    background: var(--sidebar-bg);
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    border: 1px solid transparent;
}

.tag:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.3);
}

.tag:active {
    transform: translateY(0);
}

/* Контент статьи */
.blog-post-content {
    padding: 0 48px 48px;
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4,
.blog-post-content h5,
.blog-post-content h6 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.blog-post-content h1 { font-size: 36px; }
.blog-post-content h2 { font-size: 30px; }
.blog-post-content h3 { font-size: 24px; }
.blog-post-content h4 { font-size: 20px; }

.blog-post-content p {
    margin-bottom: 24px;
}

.blog-post-content a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.blog-post-content a:hover {
    border-bottom-color: var(--link-color);
}

/* ========== УЛУЧШЕННЫЕ ИЗОБРАЖЕНИЯ В СТАТЬЕ ========== */

.blog-post-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    cursor: zoom-in;
}

.blog-post-content img:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
}

.blog-post-content figure {
    margin: 32px 0;
    text-align: center;
    background: var(--sidebar-bg);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--post-border);
    overflow: hidden;
}

.blog-post-content figure img {
    margin: 0 auto 16px;
    border-radius: 8px;
    max-width: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.blog-post-content figcaption {
    font-size: 15px;
    color: var(--text-secondary);
    font-style: italic;
    padding: 0 16px;
    line-height: 1.6;
    font-weight: 500;
}

/* Убираем лишние отступы между изображениями */
.blog-post-content img + img,
.blog-post-content figure + img,
.blog-post-content img + figure,
.blog-post-content figure + figure {
    margin-top: 24px;
}

.blog-post-content blockquote {
    margin: 32px 0;
    padding: 24px 32px;
    border-left: 4px solid var(--accent-color);
    background: var(--sidebar-bg);
    font-style: italic;
    font-size: 20px;
    color: var(--text-primary);
    border-radius: 0 12px 12px 0;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 24px;
    padding-left: 32px;
}

.blog-post-content li {
    margin-bottom: 12px;
}

.blog-post-content pre {
    background: var(--sidebar-bg);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 32px 0;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.6;
}

.blog-post-content code {
    background: var(--sidebar-bg);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
}

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--post-border);
}

.blog-post-content th,
.blog-post-content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--post-border);
}

.blog-post-content th {
    background: var(--sidebar-bg);
    font-weight: 600;
}

.blog-post-content tr:last-child td {
    border-bottom: none;
}

/* Разделитель */
.blog-post-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--post-border), transparent);
    margin: 48px 48px;
}

/* ========== КОММЕНТАРИИ ========== */

.blog-comments-section {
    padding: 0 48px 48px;
}

.comments-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 32px 0;
}

/* Форма комментария */
.comment-form {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    padding: 24px;
    background: var(--sidebar-bg);
    border-radius: 16px;
}

.comment-form-avatar img,
.comment-form-avatar .avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-form-avatar .avatar-placeholder {
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.comment-form-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 14px 16px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.15);
}

.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comment-counter {
    font-size: 13px;
    color: var(--text-secondary);
}

.comment-counter.warning {
    color: var(--warning-color);
}

.comment-counter.error {
    color: var(--error-color);
}

/* Сообщение для неавторизованных */
.comment-auth-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 24px;
    background: var(--sidebar-bg);
    border-radius: 16px;
    text-align: center;
    margin-bottom: 40px;
}

.comment-auth-message svg {
    color: var(--accent-color);
}

.comment-auth-message p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.comment-auth-message a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}

.comment-auth-message a:hover {
    text-decoration: underline;
}

/* Список комментариев */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment-item {
    position: relative;
    display: flex;
    gap: 16px;
    animation: slideInComment 0.4s ease forwards;
}

@keyframes slideInComment {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.comment-avatar img,
.comment-avatar .avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-avatar .avatar-placeholder {
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 700;
}

/* ========== НОВЫЙ LAYOUT ДЛЯ КНОПОК ПОД КОММЕНТАРИЕМ ========== */

.comment-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-header {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-username {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.comment-username:hover {
    color: var(--accent-color);
}

.comment-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.comment-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.comment-edited {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 8px;
}

/* ========== КНОПКИ ДЕЙСТВИЙ ПОД КОММЕНТАРИЕМ ========== */

.comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.comment-action-btn {
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-action-btn:hover {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

.comment-action-btn.reply:hover {
    color: var(--accent-color);
}

.comment-action-btn.edit:hover {
    color: var(--warning-color);
}

.comment-action-btn.delete:hover {
    color: var(--error-color);
}

.comment-action-btn svg {
    width: 14px;
    height: 14px;
}

/* ========== ОТВЕТЫ В КОММЕНТАРИЯХ ========== */

.comment-replies {
    margin-top: 20px;
    padding-left: 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-replies .comment-item {
    background: none;
    padding: 0;
    border-radius: 0;
    border: none;
}

/* Форма ответа */
.reply-form {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background: var(--sidebar-bg);
    border-radius: 12px;
}

.reply-form.active {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.reply-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.reply-form-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* Форма редактирования */
.edit-form {
    display: none;
}

.edit-form.active {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

.edit-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
}

.edit-form textarea:focus {
    outline: none;
    border-color: var(--warning-color);
}

.edit-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.edit-form-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* Загрузчик комментариев */
.comments-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.comments-loader .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--sidebar-bg);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.comments-loader p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Сообщение об отсутствии комментариев */
.no-comments {
    text-align: center;
    padding: 60px 20px;
}

.no-comments svg {
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 16px;
}

.no-comments p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* ========== АДАПТИВНОСТЬ ========== */

@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .blog-title {
        font-size: 36px;
    }
    
    .blog-description {
        font-size: 16px;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .blog-card-cover {
        height: 200px;
    }
    
    .blog-post-cover {
        height: 320px;
    }
    
    .blog-post-header,
    .blog-post-content,
    .blog-comments-section {
        padding-left: 24px;
        padding-right: 24px;
    }
    
    .blog-post-title {
        font-size: 32px;
    }
    
    .blog-post-excerpt {
        font-size: 17px;
    }
    
    .blog-post-content {
        font-size: 16px;
    }
    
    .blog-post-divider {
        margin-left: 24px;
        margin-right: 24px;
    }
    
    /* Уменьшаем аватарки */
    .comment-form-avatar img,
    .comment-form-avatar .avatar-placeholder {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .comment-avatar img,
    .comment-avatar .avatar-placeholder {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    /* Уменьшаем отступ для ответов */
    .comment-replies {
        padding-left: 32px;
    }
    
    /* Уменьшаем размер кнопок */
    .comment-action-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .comment-action-btn svg {
        width: 12px;
        height: 12px;
    }
    
    /* Компактная форма комментария */
    .comment-form {
        padding: 16px;
        gap: 12px;
    }
    
    .comment-form-footer {
        flex-direction: column-reverse;
        gap: 8px;
        align-items: stretch;
    }
    
    .comment-form-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .comment-counter {
        text-align: right;
    }
    
    /* Адаптация поиска */
    .search-input {
        font-size: 16px;
        padding: 12px 44px 12px 44px;
    }
    
    .search-icon {
        left: 14px;
    }
    
    .search-clear {
        right: 10px;
    }
    
    .blog-card-tags {
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .search-tag {
        padding: 3px 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .blog-title {
        font-size: 28px;
    }
    
    .blog-post-title {
        font-size: 26px;
    }
    
    .blog-post-header,
    .blog-post-content,
    .blog-comments-section {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Еще меньше аватарки */
    .comment-form-avatar img,
    .comment-form-avatar .avatar-placeholder {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .comment-avatar img,
    .comment-avatar .avatar-placeholder {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    /* Минимальный отступ для ответов */
    .comment-replies {
        padding-left: 16px;
        gap: 16px;
    }
    
    /* Компактный gap для комментариев */
    .comment-item {
        gap: 10px;
    }
    
    /* Уменьшаем шрифты */
    .comment-username {
        font-size: 14px;
    }
    
    .comment-time {
        font-size: 12px;
    }
    
    .comment-text {
        font-size: 14px;
    }
    
    /* ========== СКРЫВАЕМ ТЕКСТ В КНОПКАХ НА МОБИЛЬНЫХ ========== */
    .comment-action-btn {
        padding: 6px;
        min-width: 28px;
        height: 28px;
        justify-content: center;
    }
    
    .comment-action-btn span {
        display: none;
    }
    
    .comment-action-btn svg {
        width: 14px;
        height: 14px;
        margin: 0;
    }
    
    /* Уменьшаем gap между кнопками */
    .comment-actions {
        gap: 4px;
    }
    
    /* Компактная форма */
    .comment-form {
        padding: 12px;
    }
    
    .comment-textarea {
        min-height: 70px;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .reply-form textarea,
    .edit-form textarea {
        min-height: 70px;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .reply-form-actions .btn,
    .edit-form-actions .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* Заголовок комментариев */
    .comments-title {
        font-size: 22px;
        margin-bottom: 24px;
    }
    
    /* Другие элементы */
    .filter-tabs {
        gap: 8px;
    }
    
    .filter-tab {
        padding: 8px 14px;
        font-size: 14px;
    }
    
    .breadcrumb-item {
        font-size: 13px;
        padding: 2px 4px;
    }
    
    .breadcrumb-item.active {
        max-width: 200px;
    }
    
    /* Поиск */
    .blog-search {
        padding: 0 16px;
    }
    
    .search-results-info {
        font-size: 13px;
        padding: 10px 16px;
    }
}

@media (max-width: 360px) {
    /* Минимальные отступы для ответов */
    .comment-replies {
        padding-left: 12px;
    }
}

.blog-filters {
    margin-bottom: 40px;
    padding: 0 20px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.blog-filters.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Кнопка жалобы для комментариев */
.comment-action-btn.report {
    color: var(--error-color);
}

.comment-action-btn.report:hover {
    background: rgba(231, 76, 60, 0.1);
}

.comment-action-btn.report.reported {
    color: var(--warning-color, #f39c12);
}

.comment-action-btn.report.reported:hover {
    background: rgba(243, 156, 18, 0.1);
}