/* ============================================================
   LinkedIn Posts — Loop Card Styles
   Works inside Elementor Loop Grid / Loop Carousel.
   BEM naming: .lp-card
   ============================================================ */

:root {
    --lp-blue:        #0a66c2;
    --lp-blue-dark:   #004182;
    --lp-white:       #ffffff;
    --lp-surface:     #ffffff;
    --lp-border:      #e0e0e0;
    --lp-text:        #1a1a1a;
    --lp-muted:       #666666;
    --lp-radius:      12px;
    --lp-shadow:      0 2px 12px rgba(0, 0, 0, 0.08);
    --lp-shadow-hover:0 8px 28px rgba(10, 102, 194, 0.18);
    --lp-transition:  0.25s ease;
}

/* ── Card container ─────────────────────────────────────── */
.lp-card {
    display: flex;
    flex-direction: column;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    overflow: hidden;
    box-shadow: var(--lp-shadow);
    transition: transform var(--lp-transition), box-shadow var(--lp-transition);
    height: 100%;
}

.lp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--lp-shadow-hover);
}

/* ── Single-image thumbnail ─────────────────────────────── */
.lp-card__image-link {
    display: block;
    text-decoration: none;
}

.lp-card__thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e9edf0;
}

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

.lp-card:hover .lp-card__thumbnail img {
    transform: scale(1.04);
}

/* LinkedIn badge overlay — used in all media types */
.lp-card__linkedin-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: var(--lp-blue);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 5;
}

.lp-card__linkedin-badge svg {
    display: block;
}

/* ── Body ───────────────────────────────────────────────── */
.lp-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 16px;
    gap: 10px;
}

/* ── Date ───────────────────────────────────────────────── */
.lp-card__date {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lp-blue);
    display: block;
}

/* ── Excerpt ────────────────────────────────────────────── */
.lp-card__excerpt {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--lp-text);
    flex: 1;

    /* Clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Footer ─────────────────────────────────────────────── */
.lp-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--lp-border);
}

/* ── Engagement stats ───────────────────────────────────── */
.lp-card__engagement {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lp-card__stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--lp-muted);
    font-weight: 500;
}

.lp-card__stat-icon {
    font-size: 0.9rem;
    line-height: 1;
}

/* ── CTA link ───────────────────────────────────────────── */
.lp-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lp-blue);
    text-decoration: none;
    white-space: nowrap;
    border: 1.5px solid var(--lp-blue);
    border-radius: 20px;
    padding: 4px 12px;
    transition: background var(--lp-transition), color var(--lp-transition);
}

.lp-card__cta:hover {
    background: var(--lp-blue);
    color: var(--lp-white);
}

/* ── Media-type badge (top-left overlay) ────────────────── */
.lp-card__media-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   CAROUSEL
   ============================================================ */

.lp-carousel {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #e9edf0;
    /* focusable for keyboard nav */
    outline: none;
}

.lp-carousel:focus-visible {
    box-shadow: inset 0 0 0 3px var(--lp-blue);
}

/* ── Track & slides ──────────────────────────────────────── */
.lp-carousel__track {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

.lp-carousel__slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.lp-carousel__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
}

/* ── Arrow buttons ───────────────────────────────────────── */
.lp-carousel__prev,
.lp-carousel__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--lp-text);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    line-height: 1;
}

.lp-carousel:hover .lp-carousel__prev,
.lp-carousel:hover .lp-carousel__next,
.lp-carousel:focus-within .lp-carousel__prev,
.lp-carousel:focus-within .lp-carousel__next {
    opacity: 1;
}

.lp-carousel__prev:hover,
.lp-carousel__next:hover {
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.lp-carousel__prev { left: 10px; }
.lp-carousel__next { right: 10px; }

/* ── Dot indicators ──────────────────────────────────────── */
.lp-carousel__dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 4;
}

.lp-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lp-carousel__dot.is-active {
    background: #fff;
    transform: scale(1.25);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.lp-carousel__dot:hover {
    background: rgba(255, 255, 255, 0.85);
}

/* ── Slide counter badge ─────────────────────────────────── */
.lp-carousel__counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    z-index: 5;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}


/* ============================================================
   VIDEO
   ============================================================ */

.lp-video {
    position: relative;
    background: #000;
    overflow: hidden;
}

/* Direct HTML5 video */
.lp-video video {
    display: block;
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: #000;
}

/* oEmbed wrapper — responsive 16:9 */
.lp-video__oembed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.lp-video__oembed iframe,
.lp-video__oembed video,
.lp-video__oembed object,
.lp-video__oembed embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Fallback iframe */
.lp-video > iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

/* Play icon overlay for HTML5 video (before interaction) */
.lp-video__play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 3;
}

.lp-video__play-overlay:hover {
    background: rgba(0, 0, 0, 0.15);
}

.lp-video__play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.lp-video__play-overlay:hover .lp-video__play-icon {
    transform: scale(1.08);
}

.lp-video__play-icon svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
    fill: var(--lp-blue);
}

/* ============================================================
   TEXT-ONLY CARD (no media)
   ============================================================ */

.lp-card[data-media-type="none"] .lp-card__body {
    padding-top: 22px;
}

.lp-card[data-media-type="none"] .lp-card__excerpt {
    -webkit-line-clamp: 6;
    font-size: 0.95rem;
}

/* ── Elementor Loop Grid overrides ─────────────────────── */
.elementor-loop-container .lp-card {
    width: 100%;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .lp-card__body {
        padding: 14px 16px 12px;
    }

    .lp-card__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .lp-carousel__prev,
    .lp-carousel__next {
        width: 30px;
        height: 30px;
        font-size: 1rem;
        opacity: 1;
    }

    .lp-video__play-icon {
        width: 48px;
        height: 48px;
    }

    .lp-video__play-icon svg {
        width: 20px;
        height: 20px;
    }
}
