/* ============================================================
   LinkedIn Posts Widget – Frontend Styles
   Matches the card layout shown in the design screenshot
   ============================================================ */

/* ---------- Variables ---------- */
.lpw-wrap {
    --lpw-bg:         #e8f3fb;
    --lpw-card-bg:    #ffffff;
    --lpw-radius:     12px;
    --lpw-shadow:     0 2px 12px rgba(0, 0, 0, 0.08);
    --lpw-text:       #1a1a1a;
    --lpw-muted:      #666;
    --lpw-li-blue:    #0A66C2;
    --lpw-border:     #e5e5e5;
    --lpw-gap:        20px;
    --lpw-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    font-family: var(--lpw-font);
    background: var(--lpw-bg);
    padding: 40px 32px 48px;
    border-radius: 16px;
    box-sizing: border-box;
}

/* ---------- Heading ---------- */
.lpw-heading {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--lpw-text);
    margin: 0 0 32px;
    letter-spacing: -0.02em;
}

/* ---------- Grid ---------- */
.lpw-grid {
    display: grid;
    gap: var(--lpw-gap);
}

.lpw-cols-1 { grid-template-columns: 1fr; }
.lpw-cols-2 { grid-template-columns: repeat(2, 1fr); }
.lpw-cols-3 { grid-template-columns: repeat(3, 1fr); }
.lpw-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
    .lpw-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .lpw-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .lpw-grid { grid-template-columns: 1fr !important; }
    .lpw-wrap { padding: 24px 16px; }
    .lpw-heading { font-size: 1.5rem; }
}

/* ---------- Card ---------- */
.lpw-card {
    background: var(--lpw-card-bg);
    border-radius: var(--lpw-radius);
    box-shadow: var(--lpw-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lpw-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13);
    transform: translateY(-2px);
}

/* ---------- Card Header ---------- */
.lpw-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
}

.lpw-company-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lpw-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--lpw-border);
}

.lpw-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--lpw-li-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.lpw-company-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lpw-company-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--lpw-text);
    line-height: 1.2;
}

.lpw-date {
    font-size: 0.72rem;
    color: var(--lpw-muted);
}

.lpw-li-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.lpw-li-icon:hover {
    opacity: 1;
}

/* ---------- Card Body ---------- */
.lpw-card-body {
    padding: 2px 16px 12px;
    flex: 1;
}

.lpw-text {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--lpw-text);
    margin: 0 0 6px;
}

.lpw-read-more {
    font-size: 0.78rem;
    color: var(--lpw-muted);
    text-decoration: none;
    display: block;
    margin-top: 2px;
}

.lpw-read-more:hover {
    color: var(--lpw-li-blue);
    text-decoration: underline;
}

/* ---------- Card Image ---------- */
.lpw-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #111;
}

.lpw-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

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

.lpw-card:hover .lpw-card-image img {
    transform: scale(1.03);
}

/* ---------- Card Footer ---------- */
.lpw-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--lpw-border);
    margin-top: auto;
}

.lpw-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lpw-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--lpw-muted);
    font-size: 0.78rem;
    padding: 0;
    transition: color 0.15s;
}

.lpw-action-btn:hover {
    color: var(--lpw-li-blue);
}

.lpw-action-btn.lpw-like-btn:hover {
    color: #e0245e;
}

.lpw-action-btn svg {
    flex-shrink: 0;
}

.lpw-share-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--lpw-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.lpw-share-btn:hover {
    color: var(--lpw-li-blue);
}

/* ---------- Error / Empty ---------- */
.lpw-error,
.lpw-empty {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.9rem;
    color: #664d03;
}

.lpw-error a {
    color: var(--lpw-li-blue);
}
