/* ==========================================================================
   1. СТРУКТУРА И ЛЕЙАУТ (Запазваме твоите grid параметри)
   ========================================================================== */


.comments-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    align-items: start;
}

.comments-sidebar {
    position: sticky;
    top: 100px;
}

.comments-main {
    max-width: 720px;
    padding: 30px;
}

/* ==========================================================================
   2. КОМЕНТАР - ЕЛЕМЕНТ (Обединяваме отстоянията)
   ========================================================================== */
.comment-item {
    padding: 20px 0 !important;
    border-bottom: 1px solid var(--color-border-light, #eee);
    margin-bottom: 0 !important;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.comment-author {
    font-family: var(--font-serif), serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-text-primary);
}

.comment-text {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-left: 54px; /* Подравняване под името */
    margin-bottom: 12px;
}

/* ==========================================================================
   3. ДЕЙСТВИЯ И БУТОНИ (Твоите класове)
   ========================================================================== */
.comment-actions {
    margin-left: 54px;
    display: flex;
    gap: 18px;
    margin-top: 8px;
}

.comment-actions button,
.comment-actions a {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.comment-actions button:hover {
    color: var(--color-text-primary);
}

/* ==========================================================================
   4. РЕАКЦИИ И ОТГОВОРИ (REPLIES)
   ========================================================================== */
.reply-list {
    margin-left: 54px;
    margin-top: 15px;
    padding-left: 20px;
    border-left: 1px solid var(--color-border-light, #eee);
}

.reply-item {
    margin-bottom: 15px;
}

.reply-indent {
    margin-left: 54px;
    margin-top: 16px;
}

/* ==========================================================================
   5. ТВОЯТА EDITORIAL TEXTAREA (Запазена на 100%)
   ========================================================================== */
.comment-input-wrapper textarea,
.reply-textarea-container textarea,
.edit-textarea-container textarea,
.reply-textarea {
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
    border: none !important;
    border-bottom: 1px solid #ddd !important;
    background: transparent !important;
    padding: 10px 0 6px 0 !important;
    min-height: 40px;
    outline: none;
    resize: none;
    transition: border-color 0.3s;
}

.comment-input-wrapper textarea:focus,
.reply-textarea-container textarea:focus,
.edit-textarea-container textarea:focus,
.reply-textarea:focus {
    border-bottom: 1px solid var(--color-text-primary, #111) !important;
}

/* ==========================================================================
   6. ГРЕШКИ И МОДЕРАЦИЯ (Запазваме логиката ти)
   ========================================================================== */
.reply-form.hidden {
    display: none !important;
}

.reply-error-message:not(:empty) {
    display: block;
    color: #b54747;
    font-size: 0.85rem;
    margin-top: 8px;
}

.comment-moderation-note {
    margin-left: 54px;
    font-size: 0.8rem;
    color: #b54747;
    font-style: italic;
}


/* Поправка за заглавието в лявата колона */
.comments-sidebar .link-underline {
    display: inline-block;
    margin-bottom: 20px; /* Разстояние под "Back" */
}

.page-title-md {
    margin-top: 30px;    /* Допълнително разстояние отгоре */
    margin-bottom: 30px; /* Разстояние под заглавието, преди "ALL COMMENTS" */
    line-height: 1.2;
}

.label-caps {
    margin-top: 40px;    /* Отделя "ALL COMMENTS" още малко надолу */
    display: block;
    opacity: 0.6;
}

.empty-state {
    font-style: italic;
    color: var(--color-text-muted);
    margin-top: 10px;
    opacity: 0.7;
}

/* ==========================================================================
   7. РЕСПОНСИВ ДИЗАЙН (За телефони)
   ========================================================================== */
@media (max-width: 768px) {
    .comments-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .comments-sidebar {
        position: static;
        padding-bottom: 15px;
        border-bottom: 1px solid #eee;
    }

    /* На телефон премахваме големия марж, за да има място за текста */
    .comment-text,
    .comment-actions,
    .reply-list,
    .reply-form,
    .reply-indent,
    .comment-moderation-note {
        margin-left: 0;
    }

    .reply-list {
        margin-left: 15px; /* Запазваме лека нишка */
        padding-left: 15px;
    }

    .comment-header {
        gap: 10px;
    }

    .avatar--md {
        width: 36px;
        height: 36px;
    }
}