/* ============================================================
   LinkedIn News Slider — Frontend Styles
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=Inter:wght@400;500&display=swap');

/* ── Variables & Reset ───────────────────────────────────────── */
.lns-wrapper {
    --lns-accent: #0A66C2;
    --lns-accent-light: rgba(10, 102, 194, 0.08);
    --lns-accent-mid: rgba(10, 102, 194, 0.15);
    --lns-radius: 14px;
    --lns-card-radius: 12px;
    --lns-gap: 20px;
    --lns-slides: 4;
    --lns-transition: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    --lns-shadow: 0 4px 20px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05);
    --lns-shadow-hover: 0 12px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);

    font-family: 'Inter', sans-serif;
    padding: 48px 0;
    position: relative;
    overflow: hidden;
}

/* ── Section Header ──────────────────────────────────────────── */
.lns-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding: 0 4px;
}

.lns-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lns-li-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--lns-accent);
    color: white;
    border-radius: 8px;
    flex-shrink: 0;
}

.lns-title {
    font-family: 'Sora', sans-serif;
    font-size: clamp(18px, 2.5vw, 26px);
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -.02em;
    line-height: 1.2;
}

/* ── Navigation Buttons ──────────────────────────────────────── */
.lns-nav {
    display: flex;
    gap: 8px;
}

.lns-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lns-btn:hover:not(:disabled) {
    background: var(--lns-accent);
    border-color: var(--lns-accent);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3);
}

.lns-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lns-btn:focus-visible {
    outline: 2px solid var(--lns-accent);
    outline-offset: 3px;
}

/* ── Track Container (the viewport) ─────────────────────────── */
.lns-track-container {
    overflow: hidden;
    border-radius: var(--lns-radius);
}

/* ── Track (the moving strip) ────────────────────────────────── */
.lns-track {
    display: flex;
    gap: var(--lns-gap);
    transition: transform var(--lns-transition);
    will-change: transform;
    align-items: stretch;
}

/* ── Individual Slide / Card ─────────────────────────────────── */
.lns-slide {
    flex: 0 0 calc((100% - (var(--lns-slides) - 1) * var(--lns-gap)) / var(--lns-slides));
    background: #ffffff;
    border-radius: var(--lns-card-radius);
    overflow: hidden;
    box-shadow: var(--lns-shadow);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.lns-slide:hover {
    box-shadow: var(--lns-shadow-hover);
    transform: translateY(-3px);
}

/* ── Thumbnail ───────────────────────────────────────────────── */
.lns-thumb-link {
    display: block;
    text-decoration: none;
}

.lns-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: linear-gradient(135deg, #e8f0fe, #dbeafe);
    overflow: hidden;
}

.lns-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.lns-slide:hover .lns-thumb img {
    transform: scale(1.04);
}

.lns-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 102, 194, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lns-thumb-link:hover .lns-thumb-overlay {
    opacity: 1;
}

.lns-view-label {
    color: white;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
}

.lns-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f0fe 0%, #dbeafe 100%);
    position: relative;
    padding-top: 56.25%;
}

.lns-thumb-placeholder svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--lns-accent);
}

/* ── Card Content ────────────────────────────────────────────── */
.lns-content {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lns-date {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--lns-accent);
    display: block;
}

.lns-excerpt {
    font-size: 14px;
    line-height: 1.65;
    color: #334155;
    margin: 0;
    flex: 1;
    /* Clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Read More Button ────────────────────────────────────────── */
.lns-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--lns-accent);
    text-decoration: none;
    letter-spacing: .02em;
    transition: gap 0.2s ease, opacity 0.2s ease;
    align-self: flex-start;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    margin-top: auto;
}

.lns-read-more:hover {
    gap: 10px;
    opacity: 0.8;
    color: var(--lns-accent);
}

/* ── Dots / Pagination ───────────────────────────────────────── */
.lns-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.lns-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s ease;
}

.lns-dot.active {
    background: var(--lns-accent);
    width: 24px;
    border-radius: 4px;
}

.lns-dot:hover:not(.active) {
    background: #94a3b8;
}

/* ── Empty state ─────────────────────────────────────────────── */
.lns-no-posts {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    color: #64748b;
    font-size: 15px;
}

.lns-no-posts a {
    color: var(--lns-accent);
    font-weight: 600;
}

/* ── Loading state ───────────────────────────────────────────── */
.lns-slide.lns-skeleton .lns-thumb {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: lns-shimmer 1.5s infinite;
}

@keyframes lns-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .lns-wrapper {
        --lns-slides: 3;
    }
}

@media (max-width: 768px) {
    .lns-wrapper {
        --lns-slides: 2;
    }
    .lns-title {
        font-size: 18px;
    }
    .lns-content {
        padding: 14px 16px 16px;
    }
}

@media (max-width: 480px) {
    .lns-wrapper {
        --lns-slides: 1;
        padding: 32px 0;
    }
    .lns-btn {
        width: 36px;
        height: 36px;
    }
}

/* ── Dark mode support ───────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .lns-slide {
        background: #1e293b;
        border-color: #334155;
    }
    .lns-title {
        color: #f1f5f9;
    }
    .lns-excerpt {
        color: #94a3b8;
    }
    .lns-btn {
        background: #1e293b;
        border-color: #334155;
        color: #94a3b8;
    }
    .lns-dot {
        background: #334155;
    }
}
