/* ═══════════════════════════════════════════════
   LinkedIn Activity Feed – front.css
   Matches LinkedIn's card design language
═══════════════════════════════════════════════ */

:root {
    --lfa-bg:           #f3f2ef;
    --lfa-card:         #ffffff;
    --lfa-border:       #e0dfdc;
    --lfa-text:         #191919;
    --lfa-text-muted:   #666666;
    --lfa-text-light:   #00000099;
    --lfa-link:         #0a66c2;
    --lfa-link-hover:   #004182;
    --lfa-action-hover: #f3f2ef;
    --lfa-radius:       8px;
    --lfa-li-blue:      #0a66c2;
    --lfa-shadow:       0 0 0 1px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
    --lfa-avatar-size:  48px;
    --lfa-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ── Feed wrapper ────────────────────────────── */

.lfa-feed {
    max-width: 552px;
    margin: 0 auto;
    font-family: var(--lfa-font);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lfa-style-grid {
    max-width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.lfa-style-compact {
    max-width: 100%;
    gap: 0;
}

/* ── Card ────────────────────────────────────── */

.lfa-card {
    background: var(--lfa-card);
    border-radius: var(--lfa-radius);
    box-shadow: var(--lfa-shadow);
    overflow: hidden;
    transition: box-shadow .15s ease;
}

.lfa-card:hover {
    box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.1);
}

.lfa-style-compact .lfa-card {
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--lfa-border);
}

/* ── Header ──────────────────────────────────── */

.lfa-card__header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 16px 0;
    position: relative;
}

.lfa-avatar-link { flex-shrink: 0; }

.lfa-avatar {
    width: var(--lfa-avatar-size);
    height: var(--lfa-avatar-size);
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid transparent;
    transition: border-color .15s;
}

.lfa-avatar-link:hover .lfa-avatar {
    border-color: var(--lfa-li-blue);
}

.lfa-avatar--placeholder {
    background: linear-gradient(135deg, #0a66c2, #004182);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    width: var(--lfa-avatar-size);
    height: var(--lfa-avatar-size);
    border-radius: 50%;
}

.lfa-card__author {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lfa-author-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--lfa-text);
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lfa-author-name:hover { color: var(--lfa-link); text-decoration: underline; }

.lfa-author-tagline {
    font-size: .78rem;
    color: var(--lfa-text-muted);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.lfa-post-date {
    font-size: .75rem;
    color: var(--lfa-text-light);
    margin-top: 1px;
}

.lfa-post-date a {
    color: inherit;
    text-decoration: none;
}
.lfa-post-date a:hover { text-decoration: underline; }

/* LinkedIn logo badge (top-right) */
.lfa-li-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    color: var(--lfa-li-blue);
    opacity: .85;
    transition: opacity .15s;
    text-decoration: none;
}
.lfa-li-badge:hover { opacity: 1; }
.lfa-li-badge svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* ── Body / text ─────────────────────────────── */

.lfa-card__body {
    padding: 12px 16px;
    font-size: .93rem;
    line-height: 1.6;
    color: var(--lfa-text);
    word-break: break-word;
    position: relative;
}

.lfa-card__body p {
    margin: 0 0 .6em;
}
.lfa-card__body p:last-of-type { margin-bottom: 0; }

/* Truncation via max-height + fade */
.lfa-card__body.lfa-truncated {
    max-height: 120px;
    overflow: hidden;
}

.lfa-card__body.lfa-truncated::after {
    content: '';
    position: absolute;
    bottom: 28px;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, transparent, var(--lfa-card));
    pointer-events: none;
}

.lfa-card__body.lfa-expanded {
    max-height: none;
}
.lfa-card__body.lfa-expanded::after { display: none; }

.lfa-see-more {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: .93rem;
    font-weight: 600;
    color: var(--lfa-text-muted);
    font-family: var(--lfa-font);
    display: block;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}
.lfa-see-more:hover { color: var(--lfa-text); }

/* ── Image ───────────────────────────────────── */

.lfa-card__image {
    margin: 0;
    line-height: 0;
}

.lfa-card__image img {
    width: 100%;
    max-height: 440px;
    object-fit: cover;
    display: block;
    transition: opacity .2s;
}

.lfa-card__image img:hover { opacity: .95; }

/* ── Article / link preview ──────────────────── */

.lfa-card__article {
    display: flex;
    flex-direction: column;
    margin: 0 16px 0;
    border: 1px solid var(--lfa-border);
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}

.lfa-card__article:hover { background: #f8f8f8; }

.lfa-card__article-img {
    height: 136px;
    background-size: cover;
    background-position: center;
    background-color: #e5e5e5;
}

.lfa-card__article-text {
    padding: 10px 12px;
    border-top: 1px solid var(--lfa-border);
    background: #f8f6f2;
}

.lfa-article-domain {
    display: block;
    font-size: .72rem;
    color: var(--lfa-text-light);
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 3px;
}

.lfa-article-title {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    color: var(--lfa-text);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* ── Engagement counts row ───────────────────── */

.lfa-card__engagement-counts {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    font-size: .78rem;
    color: var(--lfa-text-muted);
    border-bottom: 1px solid var(--lfa-border);
}

.lfa-emoji-stack {
    font-size: .85rem;
    margin-right: 4px;
    letter-spacing: -3px;
    padding-right: 4px;
}

.lfa-engagement-right {
    display: flex;
    gap: 8px;
}

/* ── Action buttons ──────────────────────────── */

.lfa-card__actions {
    display: flex;
    align-items: center;
    padding: 2px 8px 6px;
    gap: 2px;
}

.lfa-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 4px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--lfa-text-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.lfa-action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.lfa-action-btn:hover {
    background: var(--lfa-action-hover);
    color: var(--lfa-text);
}

.lfa-action-btn--primary {
    color: var(--lfa-li-blue);
}

.lfa-action-btn--primary:hover {
    background: #eef3fb;
    color: var(--lfa-link-hover);
}

/* ── Compact style adjustments ───────────────── */

.lfa-style-compact .lfa-card__header { padding: 12px 12px 0; }
.lfa-style-compact .lfa-card__body   { padding: 8px 12px; font-size: .87rem; }
.lfa-style-compact .lfa-card__actions { display: none; }
.lfa-style-compact .lfa-li-badge svg  { width: 16px; height: 16px; }

/* ── Pagination ──────────────────────────────── */

.lfa-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
    font-family: var(--lfa-font);
}

.lfa-pagination .page-numbers {
    padding: 6px 14px;
    border: 1px solid var(--lfa-border);
    border-radius: 4px;
    text-decoration: none;
    font-size: .87rem;
    color: var(--lfa-text-muted);
    background: var(--lfa-card);
    transition: all .15s;
}

.lfa-pagination .page-numbers:hover,
.lfa-pagination .page-numbers.current {
    background: var(--lfa-li-blue);
    border-color: var(--lfa-li-blue);
    color: #fff;
}

/* ── Empty / error states ────────────────────── */

.lfa-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--lfa-text-muted);
    font-family: var(--lfa-font);
    font-size: .93rem;
}

/* ── Responsive ──────────────────────────────── */

@media ( max-width: 600px ) {
    .lfa-feed { max-width: 100%; }

    .lfa-card__actions { gap: 0; }
    .lfa-action-btn    { font-size: .75rem; padding: 8px 4px; }

    .lfa-style-grid {
        grid-template-columns: 1fr;
    }

    .lfa-author-tagline {
        -webkit-line-clamp: 1;
    }
}
