/* /domains/gromadan.com/public_html/css/comment/style.css
   Блок коментарів під постом (comment/index.php) */

.cm-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px 24px 24px;
    width: 100%;
    max-width: 760px;
    margin: 16px auto 0;
}

.cm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.cm-header__title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}
.cm-header__count {
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
}
.cm-header__back {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}
.cm-header__back:hover { text-decoration: underline; }

.cm-empty {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 10px 0 4px;
}

.cm-list {
    display: flex;
    flex-direction: column;
}

.cm {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.cm:last-child { border-bottom: none; }
.cm--target {
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 14px 10px;
    margin: 0 -10px;
}
.cm--best {
    border: 1px solid var(--primary-light);
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 14px 10px;
    margin: 0 -10px 4px;
}
.cm__best-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--surface);
    padding: 1px 8px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}
.cm--new { animation: cm-fade-in .35s ease; }
.cm--flash {
    animation: cm-flash 2s ease;
    border-radius: var(--radius-lg);
    padding: 14px 10px;
    margin: 0 -10px;
}
@keyframes cm-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cm-flash {
    0%, 100% { background: transparent; }
    15% { background: var(--primary-light); }
}

.cm__head { flex-shrink: 0; }
.cm__avatar-link { position: relative; display: inline-block; text-decoration: none; }
.cm__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.cm__avatar-ph {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cm__online-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border: 2px solid var(--surface);
    border-radius: 50%;
}

.cm__content { flex: 1; min-width: 0; }
.cm__name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
}
.cm__name:hover { color: var(--primary); }

.cm__quote {
    display: block;
    text-decoration: none;
    background: rgba(0,0,0,0.035);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    padding: 5px 10px;
    margin: 4px 0 6px;
}
.cm__quote-name {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
}
.cm__quote-text {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cm__body { margin-bottom: 6px; }
.cm__text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
    margin: 0;
}

.cm__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.cm__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cm__btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 999px;
    transition: background .15s, color .15s;
}
.cm__btn:hover { background: rgba(0,0,0,0.05); }

.cm__btn--like.is-liked { color: var(--like-bg); }
.cm__btn--dislike.is-disliked { color: var(--nope-bg); }
.cm__btn--reply { color: var(--text-secondary); }
.cm__btn--reply:hover { color: var(--primary); }
.cm__btn--thread {
    text-decoration: none;
    color: var(--primary);
    background: var(--primary-light);
}

.cm__count { font-size: 0.8rem; }
.cm__date { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }

/* ── Форма ── */
.cm-form-wrap { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(0,0,0,0.06); }
.cm-form { display: flex; gap: 12px; }
.cm-form__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cm-form__avatar-ph {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cm-form__right { flex: 1; min-width: 0; }
.cm-form__textarea {
    width: 100%;
    resize: none;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    max-height: 160px;
    overflow-y: auto;
}
.cm-form__textarea:focus { outline: none; border-color: var(--primary); }
.cm-form__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}
.cm-form__hint { font-size: 0.78rem; color: var(--text-secondary); }
.cm-form__submit {
    background: var(--primary);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 999px;
    cursor: pointer;
}
.cm-form__submit:disabled { opacity: .6; cursor: default; }
.cm-form__reply-chip {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.cm-form__reply-cancel { cursor: pointer; font-weight: 700; }

.cm-auth-prompt { font-size: 0.9rem; color: var(--text-secondary); text-align: center; }
.cm-auth-prompt__link { color: var(--primary); font-weight: 700; text-decoration: none; }
.cm-auth-prompt__link:hover { text-decoration: underline; }

@media (max-width: 900px) {
    .cm-section { max-width: 100%; padding: 16px; border-radius: var(--radius-lg); }
}