/* ============================================================
   ШАПКА КАРТОЧКИ — Новая структура
   ============================================================ */

/* ---- 1. ОСНОВНОЙ КОНТЕЙНЕР ---- */
.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    position: relative;
}

/* ---- 2. ЛЕВАЯ ЧАСТЬ ---- */
.card-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* ---- 3. АВАТАР ---- */
.card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    background: #f1f3f5;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-avatar:hover {
    opacity: 0.9;
}

/* Статус онлайн */
.card-avatar .avatar-status {

}

.card-avatar .avatar-status.online {
    background: #22c55e;
}

.card-avatar .avatar-status.away {
    background: #f59e0b;
}

/* ---- 4. ИНФОРМАЦИЯ ОБ АВТОРЕ ---- */
.card-author {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 2px;
}

/* ---- 5. ВЕРХНЯЯ СТРОКА: ИМЯ + БЕЙДЖ ---- */
.author-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.author-name {
    font-size: 15px;
    font-weight: 650;
    color: #0a0a0f;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1.35;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.author-name:hover {
    color: #2563eb;
}

/* ---- 6. БЕЙДЖ РОЛИ ---- */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 550;
    padding: 1px 10px 1px 8px;
    border-radius: 100px;
    background: rgba(37, 99, 235, 0.06);
    color: #2563eb;
    border: none;
    line-height: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.role-badge:hover {
    background: rgba(37, 99, 235, 0.10);
}

/* Цвета ролей */
.role-badge.admin {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.06);
}

.role-badge.moderator {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}

.role-badge.premium {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.06);
}

.role-badge.editor {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.06);
}

.role-badge.author {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

/* SVG в бейдже */
.role-badge svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ---- 7. НИЖНЯЯ СТРОКА: ДАТА + МЕТА ---- */
.author-bottom {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #8e8ea3;
}

.author-bottom .post-date {
    color: #8e8ea3;
    transition: color 0.2s ease;
}

.author-bottom .post-date:hover {
    color: #5a5a6e;
}

.author-bottom .meta-separator {
    color: #d0d2db;
    font-size: 10px;
    line-height: 1;
    user-select: none;
}

.author-bottom .meta-location,
.author-bottom .meta-privacy {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #8e8ea3;
}

.author-bottom .meta-location svg,
.author-bottom .meta-privacy svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    stroke: #8e8ea3;
    fill: none;
}

.author-bottom .meta-location:hover,
.author-bottom .meta-privacy:hover {
    color: #5a5a6e;
}

.author-bottom .meta-location:hover svg,
.author-bottom .meta-privacy:hover svg {
    stroke: #5a5a6e;
}

/* ---- 8. ПРАВАЯ ЧАСТЬ: МЕНЮ ---- */
.card-header-right {
    flex-shrink: 0;
    margin-left: auto;
    padding-top: 2px;
}

/* Кнопка меню */
.card-header-right .menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #8e8ea3;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-header-right .menu-btn:hover {
    background: #f1f3f5;
    color: #0a0a0f;
}

.card-header-right .menu-btn:active {
    transform: scale(0.92);
}

.card-header-right .menu-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---- 9. ВЫПАДАЮЩЕЕ МЕНЮ ---- */
.card-header-right .dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top right;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    z-index: 100;
}

.card-header-right .dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.card-header-right .dropdown-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 450;
    color: #0a0a0f;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    font-family: inherit;
}

.card-header-right .dropdown-menu .menu-item:hover {
    background: #f5f6f8;
}

.card-header-right .dropdown-menu .menu-item.danger {
    color: #dc2626;
}

.card-header-right .dropdown-menu .menu-item.danger:hover {
    background: #fef2f2;
}

.card-header-right .dropdown-menu .menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card-header-right .dropdown-menu .menu-divider {
    height: 1px;
    background: #eef0f2;
    margin: 4px 12px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Планшет */
@media (max-width: 768px) {
    .card-header {
        padding: 14px 14px 10px;
        gap: 10px;
    }
    
    .card-header-left {
        gap: 10px;
    }
    
    .card-avatar {
        width: 40px;
        height: 40px;
    }
    
    .card-avatar .avatar-status {
        width: 11px;
        height: 11px;
        border-width: 2px;
    }
    
    .author-name {
        font-size: 14px;
    }
    
    .role-badge {
        font-size: 10px;
        padding: 0 8px 0 6px;
        line-height: 18px;
    }
    
    .role-badge svg {
        width: 11px;
        height: 11px;
    }
    
    .author-bottom {
        font-size: 11px;
        gap: 3px;
    }
    
    .author-bottom .meta-separator {
        font-size: 8px;
    }
    
    .author-bottom .meta-location svg,
    .author-bottom .meta-privacy svg {
        width: 11px;
        height: 11px;
    }
    
    .card-header-right .menu-btn {
        width: 30px;
        height: 30px;
    }
    
    .card-header-right .menu-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Мобильный */
@media (max-width: 480px) {
    .card-header {
        padding: 12px 12px 8px;
        gap: 8px;
    }
    
    .card-header-left {
        gap: 8px;
    }
    
    .card-avatar {
        width: 36px;
        height: 36px;
    }
    
    .card-avatar .avatar-status {
        width: 10px;
        height: 10px;
        border-width: 1.5px;
    }
    
    .author-name {
        font-size: 13px;
    }
    
    .role-badge {
        font-size: 9px;
        padding: 0 6px 0 5px;
        line-height: 16px;
        gap: 3px;
    }
    
    .role-badge svg {
        width: 10px;
        height: 10px;
    }
    
    .author-bottom {
        font-size: 10px;
        gap: 2px;
    }
    
    .author-bottom .meta-separator {
        font-size: 7px;
    }
    
    .author-bottom .meta-location svg,
    .author-bottom .meta-privacy svg {
        width: 10px;
        height: 10px;
    }
    
    .card-header-right .menu-btn {
        width: 28px;
        height: 28px;
    }
    
    .card-header-right .menu-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .card-header-right .dropdown-menu {
        min-width: 160px;
        right: -8px;
    }
    
    .card-header-right .dropdown-menu .menu-item {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .card-header-right .dropdown-menu .menu-item svg {
        width: 14px;
        height: 14px;
    }
}