/* ============================================================
   Народные темы (community) — премиум, teal-акцент, без теней
   ============================================================ */

:root {
    --ct-teal: #4A90A4;
    --ct-dark: #0F172A;
    --ct-soft: #F8FAFC;
    --ct-line: rgba(15, 23, 42, 0.07);
    --ct-muted: #64748B;
}

/* ---- Общие чипы ---- */
.ct-author-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.ct-author-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ct-author-chip--sm .ct-author-avatar { width: 20px; height: 20px; }
.ct-author-name { font-size: 13px; font-weight: 500; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-mp-chip {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(74, 144, 164, 0.12); color: #35788B;
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.ct-status-chip {
    display: inline-flex; padding: 3px 10px; border-radius: 999px;
    background: #FEF3C7; color: #92400E; font-size: 11.5px; font-weight: 600;
}

/* ============================================================
   Лента
   ============================================================ */
.ct-list-page { max-width: 1000px; margin: 0 auto; }
.ct-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.ct-list-title { font-size: 26px; font-weight: 700; color: var(--ct-dark); margin: 0 0 6px; }
.ct-list-sub { font-size: 14px; color: var(--ct-muted); margin: 0; max-width: 60ch; }
.ct-create-btn {
    display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
    padding: 11px 18px; border-radius: 12px;
    background: var(--ct-teal); color: #fff;
    font-size: 14px; font-weight: 600; text-decoration: none;
}
.ct-create-btn:hover { background: #3E7E90; color: #fff; text-decoration: none; }
.ct-create-btn svg { width: 18px; height: 18px; }

.ct-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.ct-filter-chip {
    padding: 7px 14px; border-radius: 999px;
    background: var(--ct-soft); color: #475569;
    font-size: 13px; font-weight: 500; text-decoration: none;
}
.ct-filter-chip:hover { background: #EEF2F6; color: var(--ct-dark); text-decoration: none; }
.ct-filter-chip.active { background: rgba(74, 144, 164, 0.14); color: #35788B; }

.ct-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ct-card {
    display: flex; gap: 14px; padding: 16px;
    background: var(--ct-soft); border: 1px solid var(--ct-line); border-radius: 16px;
    text-decoration: none;
}
.ct-card:hover { background: #F1F5F9; text-decoration: none; }
.ct-card-thermo {
    flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--ct-line);
}
.ct-card-temp { font-size: 16px; font-weight: 700; color: var(--ct-teal); }
.ct-card-body { min-width: 0; flex: 1; }
.ct-card-title { font-size: 15px; font-weight: 600; color: var(--ct-dark); line-height: 1.35; margin: 0 0 8px;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ct-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ct-card-foot { display: flex; gap: 12px; font-size: 12px; color: #94A3B8; }

.ct-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
.ct-page-btn { padding: 8px 16px; border-radius: 10px; background: var(--ct-soft); color: #475569; font-size: 13px; font-weight: 500; text-decoration: none; }
.ct-page-btn:hover { background: #EEF2F6; text-decoration: none; }
.ct-page-info { font-size: 13px; color: var(--ct-muted); }
.ct-empty { padding: 48px 16px; text-align: center; color: #94A3B8; font-size: 15px; }

/* ============================================================
   Детальная страница темы
   ============================================================ */
.ct-detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.ct-detail-main { min-width: 0; }

.ct-article-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ct-date { font-size: 12.5px; color: #94A3B8; }
.ct-article-title { font-size: 28px; font-weight: 700; color: var(--ct-dark); line-height: 1.25; margin: 0 0 14px; }
.ct-owner-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.ct-owner-btn {
    padding: 7px 14px; border-radius: 9px; border: 1px solid var(--ct-line);
    background: #fff; color: #475569; font-size: 13px; font-weight: 500;
    text-decoration: none; cursor: pointer; font-family: inherit;
}
.ct-owner-btn:hover { background: var(--ct-soft); color: var(--ct-dark); text-decoration: none; }
.ct-owner-btn--danger { color: #B91C1C; }
.ct-owner-btn--danger:hover { background: rgba(185, 28, 28, 0.07); }

.ct-article-body { font-size: 16px; line-height: 1.7; color: #1E293B; }
.ct-article-body p { margin: 0 0 16px; }
.ct-article-body h2, .ct-article-body h3 { color: var(--ct-dark); margin: 24px 0 12px; }

/* Виджет градусника на детальной */
.ct-widget { margin-top: 28px; padding: 18px; background: var(--ct-soft); border: 1px solid var(--ct-line); border-radius: 18px; }
.ct-widget-head { font-size: 15px; font-weight: 600; color: var(--ct-dark); margin-bottom: 14px; text-align: center; }
.ct-widget-main { display: flex; align-items: center; justify-content: center; gap: 28px; }

.ct-comments-col { min-width: 0; }
.ct-login-hint { font-size: 14px; color: var(--ct-muted); margin: 0; padding: 12px 0; }
.ct-login-hint a { color: var(--ct-teal); font-weight: 600; }

/* ============================================================
   Форма создания/редактирования
   ============================================================ */
.ct-form-page { max-width: 720px; margin: 0 auto; }
.ct-form-title { font-size: 24px; font-weight: 700; color: var(--ct-dark); margin: 0 0 20px; }
.ct-form-errors { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.ct-form-errors div + div { margin-top: 4px; }
.ct-form { display: flex; flex-direction: column; gap: 18px; }
.ct-field { display: flex; flex-direction: column; gap: 7px; }
.ct-field-label { font-size: 13.5px; font-weight: 600; color: #334155; }
.ct-field-opt { font-weight: 400; color: #94A3B8; }
.ct-field-hint { font-size: 12.5px; color: #94A3B8; }
.ct-input {
    width: 100%; box-sizing: border-box;
    padding: 12px 14px; border: 1px solid #E2E8F0; border-radius: 12px;
    background: #fff; color: var(--ct-dark); font-size: 15px; font-family: inherit;
}
.ct-input:focus { outline: none; border-color: var(--ct-teal); }
.ct-select { cursor: pointer; }
.ct-textarea { resize: vertical; line-height: 1.6; min-height: 220px; }
.ct-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.ct-btn-ghost { padding: 11px 20px; border-radius: 12px; background: var(--ct-soft); color: #475569; font-size: 14px; font-weight: 600; text-decoration: none; }
.ct-btn-ghost:hover { background: #EEF2F6; text-decoration: none; }
.ct-btn-primary { padding: 11px 22px; border-radius: 12px; border: none; background: var(--ct-teal); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.ct-btn-primary:hover { background: #3E7E90; }

/* Действия под постом (автор/жалоба) + «показаны последние» */
.ct-post-actions {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--ct-line);
}
.ct-comments-more { text-align: center; font-size: 12.5px; color: #94A3B8; padding: 12px 0 4px; }

/* ============================================================
   Жалоба
   ============================================================ */
.ct-report-link {
    display: inline-flex; align-items: center; gap: 5px; margin-left: auto;
    padding: 4px 8px; border: none; background: transparent;
    color: #94A3B8; font-size: 12.5px; font-weight: 500; cursor: pointer; font-family: inherit;
}
.ct-report-link:hover { color: #B91C1C; }
.ct-report-link svg { width: 14px; height: 14px; }

.ct-report-overlay {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(15, 23, 42, 0.45);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ct-report-overlay[hidden] { display: none; }
.ct-report-modal {
    position: relative; width: 100%; max-width: 420px;
    background: #fff; border-radius: 18px; padding: 24px;
}
.ct-report-close {
    position: absolute; top: 12px; right: 14px; border: none; background: transparent;
    font-size: 24px; line-height: 1; color: #94A3B8; cursor: pointer;
}
.ct-report-title { font-size: 17px; font-weight: 700; color: var(--ct-dark); margin: 0 0 16px; }
.ct-report-reasons { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ct-report-reason {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
    font-size: 14px; color: #334155; cursor: pointer; background: var(--ct-soft);
}
.ct-report-reason:hover { background: #EEF2F6; }
.ct-report-reason input { accent-color: var(--ct-teal); }
.ct-report-note {
    width: 100%; box-sizing: border-box; margin-bottom: 16px;
    padding: 10px 12px; border: 1px solid #E2E8F0; border-radius: 10px;
    font-family: inherit; font-size: 14px; resize: vertical;
}
.ct-report-note:focus { outline: none; border-color: var(--ct-teal); }
.ct-report-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ct-report-done { padding: 12px 0 0; color: #15803D; font-size: 14px; font-weight: 500; text-align: center; }

/* ============================================================
   Вкладки профиля + лента активности (Фаза 4)
   ============================================================ */
.profile-tabs {
    display: flex; gap: 4px; margin-bottom: 22px;
    border-bottom: 1px solid var(--ct-line);
}
.profile-tab {
    position: relative; padding: 11px 4px; margin-right: 20px;
    border: none; background: transparent; cursor: pointer; font-family: inherit;
    font-size: 15px; font-weight: 600; color: #94A3B8;
}
.profile-tab:hover { color: #475569; }
.profile-tab.active { color: var(--ct-dark); }
.profile-tab.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: var(--ct-teal); border-radius: 2px;
}
.profile-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
    background: rgba(74, 144, 164, 0.14); color: #35788B;
    font-size: 11px; font-weight: 700; border-radius: 999px; vertical-align: middle;
}
.profile-tab-panel[hidden] { display: none; }

.profile-activity-section { margin-bottom: 28px; }
.profile-activity-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.profile-activity-head h2 { font-size: 17px; font-weight: 700; color: var(--ct-dark); margin: 0; }
.profile-activity-action { font-size: 13px; font-weight: 600; color: var(--ct-teal); text-decoration: none; }
.profile-activity-action:hover { color: #3E7E90; text-decoration: none; }
.profile-activity-list { display: flex; flex-direction: column; gap: 8px; }
.profile-activity-empty { font-size: 14px; color: var(--ct-muted); padding: 8px 0; }
.profile-activity-empty a { color: var(--ct-teal); font-weight: 600; }

.profile-act-topic {
    display: flex; align-items: center; gap: 14px; padding: 12px 14px;
    background: var(--ct-soft); border: 1px solid var(--ct-line); border-radius: 14px; text-decoration: none;
}
.profile-act-topic:hover { background: #F1F5F9; text-decoration: none; }
.profile-act-temp {
    flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--ct-line);
    font-size: 14px; font-weight: 700; color: var(--ct-teal);
}
.profile-act-topic-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.profile-act-topic-title { font-size: 14px; font-weight: 600; color: var(--ct-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-act-topic-meta { font-size: 12.5px; color: #94A3B8; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-act-status { padding: 2px 8px; border-radius: 999px; background: #FEF3C7; color: #92400E; font-size: 11px; font-weight: 600; }

.profile-act-comment {
    display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
    background: var(--ct-soft); border: 1px solid var(--ct-line); border-radius: 14px; text-decoration: none;
}
.profile-act-comment:hover { background: #F1F5F9; text-decoration: none; }
.profile-act-comment-text { font-size: 14px; color: #1E293B; line-height: 1.5; }
.profile-act-comment-meta { font-size: 12.5px; color: #94A3B8; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 900px) {
    .ct-detail { grid-template-columns: 1fr; }
    .ct-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .ct-list-head { flex-direction: column; }
    .ct-article-title { font-size: 23px; }
    .ct-widget-main { flex-direction: column; gap: 16px; }
}
