/* ==========================================================================
   Feed — RSE Social Wall (LinkedIn-style Neumorphic)
   ========================================================================== */

.feed {
    max-width: 680px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-3) var(--space-10);
}

/* ── Compose Box ─────────────────────────────────────────────────────────── */

.feed__compose {
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--neu-raised);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-4);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.feed__compose-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

.feed__compose-btn {
    flex: 1;
    min-width: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: none;
    color: var(--color-text-tertiary);
    font-size: var(--text-sm);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.feed__compose-btn:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
}

.feed__compose-actions {
    display: flex;
    gap: var(--space-1);
    width: 100%;
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-1);
}

.feed__compose-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: none;
    border-radius: var(--radius-lg);
    background: none;
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.feed__compose-action:hover {
    background: var(--color-bg-secondary);
}

/* ── Article Cards ───────────────────────────────────────────────────────── */

.feed__articles {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.feed__card {
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--neu-raised);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.25s ease;
}

.feed__card:hover {
    box-shadow: var(--neu-raised-lg);
}

.feed__card--pinned {
    border-top: 3px solid var(--color-accent);
}

.feed__card--skeleton {
    padding: var(--space-5);
}

/* ── Author Bar ──────────────────────────────────────────────────────────── */

.feed__card-author-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5) 0;
}

.feed__card-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

.feed__card-author-info {
    flex: 1;
    min-width: 0;
}

.feed__card-author-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.feed__card-author-sub {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-top: 1px;
}

.feed__card-pin-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-text-tertiary);
}

.feed__card-pin-label {
    color: var(--color-accent);
    font-weight: 500;
}

.feed__card-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Menu / Dropdown ─────────────────────────────────────────────────────── */

.feed__card-menu {
    position: relative;
    flex-shrink: 0;
}

.feed__card-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: background 0.2s;
}

.feed__card-menu-btn:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.feed__card-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 100;
    overflow: hidden;
}

.feed__card-dropdown.is-open {
    display: block;
}

.feed__card-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: none;
    background: none;
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.feed__card-dropdown-item:hover {
    background: var(--color-bg-secondary);
}

.feed__card-dropdown-item--danger {
    color: #ef4444;
}

.feed__card-dropdown-item--danger:hover {
    background: #fef2f2;
}

[data-theme="dark"] .feed__card-dropdown-item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .feed__comments-section {
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.2), inset -2px -2px 5px rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .feed__comment-compose {
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.15), inset -1px -1px 3px rgba(255, 255, 255, 0.02);
}

/* ── Card Text Content ───────────────────────────────────────────────────── */

.feed__card-text {
    padding: var(--space-3) var(--space-5) var(--space-2);
}

.feed__card-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2);
    line-height: 1.4;
}

.feed__card-body-text {
    font-size: var(--text-sm);
    line-height: 1.7;
    color: var(--color-text-secondary);
    overflow: hidden;
    max-height: 5.1em; /* ~3 lines */
}

.feed__card-body-text--expanded {
    max-height: none;
}

.feed__card-body-text .feed__list-item {
    display: block;
    padding-left: var(--space-4);
    position: relative;
}

.feed__card-body-text .feed__list-item::before {
    content: '';
    position: absolute;
    left: var(--space-2);
    top: 0.65em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-accent);
}

.feed__card-see-more {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-text-tertiary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.feed__card-see-more:hover {
    color: var(--color-accent);
}

/* ── Media (Images & Video) ──────────────────────────────────────────────── */

.feed__media {
    margin: var(--space-3) var(--space-5) 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: var(--neu-inset);
}

.feed__media--image {
    aspect-ratio: 16 / 9;
    background: var(--color-bg-tertiary);
}

.feed__media--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.feed__card:hover .feed__media--image img {
    transform: scale(1.02);
}

.feed__media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(transparent, rgba(0,0,0,0.15));
    pointer-events: none;
}

.feed__media--video {
    background: #000;
}

.feed__video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.feed__video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    overflow: hidden;
}

.feed__video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s, filter 0.3s;
}

.feed__video-thumb:hover img {
    transform: scale(1.03);
    filter: brightness(0.85);
}

.feed__video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    transition: opacity 0.2s, transform 0.2s;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.feed__video-thumb:hover .feed__video-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
}

.feed__video-iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border: none;
}

/* ── Reactions Bar ───────────────────────────────────────────────────────── */

.feed__reactions {
    padding: 0 var(--space-5);
}

.feed__reactions-bar {
    display: flex;
    border-top: 1px solid var(--color-border);
    padding: var(--space-1) 0;
}

.feed__react-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-2);
    border: none;
    border-radius: var(--radius-lg);
    background: none;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.feed__react-btn:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.feed__react-btn--active {
    color: var(--color-accent);
}

.feed__react-btn--active:hover {
    color: var(--color-accent);
}

/* ── Comments Section ────────────────────────────────────────────────────── */

.feed__comments-section {
    padding: var(--space-4) var(--space-5);
    margin: 0 var(--space-4) var(--space-3);
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--neu-raised);
}

.feed__comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    max-height: 400px;
    overflow-y: auto;
}

.feed__comments-empty {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    text-align: center;
    padding: var(--space-4) 0;
    margin: 0;
}

.feed__comments-loading {
    padding: var(--space-2) 0;
}

.feed__comment {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
}

.feed__comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.feed__comment-bubble {
    flex: 1;
    min-width: 0;
    background: var(--color-bg-secondary);
    border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
    padding: var(--space-2) var(--space-3);
}

.feed__comment-bubble-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.feed__comment-name {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-primary);
}

.feed__comment-del {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--color-text-tertiary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s;
}

.feed__comment:hover .feed__comment-del {
    opacity: 1;
}

.feed__comment-del:hover {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
}

.feed__comment-bubble-text {
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin: 2px 0 0;
}

.feed__comment-time {
    font-size: 10px;
    color: var(--color-text-tertiary);
    margin-top: 2px;
    display: block;
}

/* ── Comment Compose ─────────────────────────────────────────────────────── */

.feed__comment-compose {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    padding: var(--space-3);
    margin-top: var(--space-3);
    border: none;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--neu-inset);
}

.feed__comment-compose-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.feed__comment-compose-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0 var(--space-1) 0 var(--space-4);
    background: var(--color-bg-primary);
    transition: border-color 0.2s;
}

.feed__comment-compose-input-wrap:focus-within {
    border-color: var(--color-accent);
}

.feed__comment-compose-input {
    flex: 1;
    padding: var(--space-2) 0;
    border: none;
    background: none;
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    outline: none;
}

.feed__comment-compose-input::placeholder {
    color: var(--color-text-tertiary);
}

.feed__comment-compose-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--color-accent);
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.feed__comment-compose-send:hover {
    background: var(--color-bg-secondary);
}

/* ── Load More ───────────────────────────────────────────────────────────── */

.feed__load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin: var(--space-5) auto 0;
    padding: var(--space-3) var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg-primary);
    box-shadow: var(--neu-raised);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.feed__load-more:hover {
    background: var(--color-bg-secondary);
    box-shadow: var(--neu-raised-lg);
    color: var(--color-text-primary);
}

/* ── Empty State ─────────────────────────────────────────────────────────── */

.feed__empty {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--color-text-tertiary);
}

.feed__empty-icon {
    margin-bottom: var(--space-4);
    opacity: 0.25;
}

.feed__empty h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-2);
}

.feed__empty p {
    font-size: var(--text-sm);
    margin: 0;
}

.feed__loading {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .feed {
        padding: var(--space-2) 0 var(--space-10);
    }

    .feed__compose {
        border-radius: 0;
        margin-bottom: var(--space-2);
    }

    .feed__card {
        border-radius: var(--radius-lg);
        margin: 0 var(--space-2);
    }

    .feed__articles {
        gap: var(--space-3);
    }

    .feed__card-author-bar {
        padding: var(--space-3) var(--space-4) 0;
    }

    .feed__card-text {
        padding: var(--space-2) var(--space-4) var(--space-1);
    }

    .feed__reactions {
        padding: 0 var(--space-4);
    }

    .feed__comments-section {
        padding: 0 var(--space-4) var(--space-3);
    }

    .feed__media {
        margin-left: var(--space-4);
        margin-right: var(--space-4);
        border-radius: var(--radius-lg);
    }

    .feed__compose-action span {
        display: none;
    }

    .feed__card-cat-pill {
        font-size: 10px;
        padding: 2px 8px;
    }
}
