/* MQH LinkedIn Display — styles du feed (.ld-*). */

.ld-feed {
    display: grid;
    grid-template-columns: repeat(var(--ld-columns, 3), minmax(0, 1fr));
    gap: var(--ld-gap, 1.25rem);
    justify-content: start;
    justify-items: stretch;
    align-items: start;
    margin: 1.5rem 0;
    --ld-columns: 3;
    --ld-columns-lg: 3;
    --ld-columns-md: 2;
    --ld-columns-xs: 1;
    --ld-gap: 1.25rem;
    --ld-embed-w: 504;
    --ld-embed-h: 900;
}

.ld-feed--compact {
    --ld-embed-h: 569;
}

/* Track horizontal — wrapper etsem-snap-carousel (ou ancien .ld-feed--carousel BC) */
.etsem-snap-carousel .ld-feed,
.ld-feed.ld-feed--carousel {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0;
    padding-bottom: 4px;
}
.etsem-snap-carousel .ld-feed::-webkit-scrollbar,
.ld-feed.ld-feed--carousel::-webkit-scrollbar {
    display: none;
}
.etsem-snap-carousel .ld-feed > .ld-embed,
.etsem-snap-carousel .ld-feed > .ld-local-wrap,
.ld-feed.ld-feed--carousel > .ld-embed,
.ld-feed.ld-feed--carousel > .ld-local-wrap {
    flex: 0 0 auto;
    scroll-snap-align: start;
}
.ld-carousel__nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    position: relative;
    z-index: 2;
}
.ld-carousel__btn {
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid #1e13aa;
    border-radius: 0;
    background: #fff;
    color: #1e13aa;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.ld-carousel__btn span {
    display: block;
    line-height: 1;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 400;
    transform: translateY(-1px);
}
.ld-carousel__btn:hover,
.ld-carousel__btn:focus-visible {
    background: #1e13aa;
    color: #fff;
    outline: none;
}
.ld-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}
.ld-carousel__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #1e13aa;
    opacity: 0.25;
    cursor: pointer;
}
.ld-carousel__dot.is-active {
    opacity: 1;
    background: #e28633;
}

/* Colonnes LG/MD/XS : @media injectés depuis les réglages BO (bp_lg / bp_md / bp_xs). */

.ld-embed {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    /* Hauteur = ratio embed (iframe remplit la boîte — pas de scale 504px). */
    aspect-ratio: var(--ld-embed-w) / var(--ld-embed-h);
    overflow: hidden;
}

.ld-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    transform: none;
}

.ld-empty {
    color: #666;
    font-size: 0.95rem;
}

/* Card locale : remplit la cellule grille (plus de plafond 504px). */
.ld-local-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
}

.ld-card {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1rem 1.1rem 0.85rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #191919;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}

.ld-card--admin {
    margin-top: 1rem;
}

.ld-card__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ld-card__avatar {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #0a66c2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.ld-card__avatar-img {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f2ef;
}

.ld-card__author a {
    color: inherit;
    text-decoration: none;
}

.ld-card__author a:hover {
    color: #0a66c2;
    text-decoration: underline;
}

.ld-card__nested {
    margin: 0.65rem 0 0.85rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.ld-card__nested .ld-card__header {
    margin-bottom: 0.5rem;
}

.ld-card__nested .ld-card__avatar,
.ld-card__nested .ld-card__avatar-img {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
}

.ld-card__nested .ld-card__text {
    margin-bottom: 0;
    font-size: 13px;
}

.ld-card__meta {
    flex: 1 1 auto;
    min-width: 0;
}

.ld-card__author {
    font-weight: 600;
    color: #191919;
}

.ld-card__followers,
.ld-card__date,
.ld-card__subtitle {
    color: #666;
    font-size: 12px;
}

.ld-card__hashtag,
.ld-card__link,
.ld-card .ld-card__text a.ld-card__hashtag,
.ld-card .ld-card__text a.ld-card__link {
    color: #0a66c2;
    text-decoration: none;
    font-weight: 600;
}

.ld-card__hashtag:hover,
.ld-card__link:hover,
.ld-card .ld-card__text a.ld-card__hashtag:hover,
.ld-card .ld-card__text a.ld-card__link:hover {
    text-decoration: underline;
}

.ld-card__open {
    flex: 0 0 auto;
    font-size: 12px;
    color: #0a66c2;
    text-decoration: none;
}

.ld-card__open:hover {
    text-decoration: underline;
}

.ld-card__title {
    margin: 0 0 0.5rem;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.ld-card__media video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    background: #000;
}

.ld-card__media-fallback {
    margin: 0.35rem 1.1rem 0.75rem;
    font-size: 12px;
}

.ld-card__media-fallback a {
    color: #0a66c2;
}

.ld-card__media--video-link {
    display: block;
    position: relative;
    margin: 0 -1.1rem 0.75rem;
    background: #f3f2ef;
}

.ld-card__media--video-link img {
    display: block;
    width: 100%;
    height: auto;
}

.ld-card__play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(10, 102, 194, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ld-card__text {
    margin-bottom: 0.75rem;
    color: #191919;
    line-height: 1.45;
}

.ld-card__media {
    margin: 0 -1.1rem 0.75rem;
    background: #f3f2ef;
}

.ld-card__media img {
    display: block;
    width: 100%;
    height: auto;
}

.ld-card__stats {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    padding: 0.35rem 0 0.65rem;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
    font-size: 12px;
}

.ld-card__reactions {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.ld-card__stats-sep {
    margin: 0 0.15rem;
    color: #666;
}

.ld-card__reaction-icons {
    display: inline-flex;
    align-items: center;
}

.ld-card__reaction-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: #fff;
    margin-left: -4px;
}

.ld-card__reaction-icon:first-child {
    margin-left: 0;
}

.ld-card__reaction-count {
    margin-left: 0.15rem;
}

.ld-admin-preview .ld-card,
.ld-card--admin {
    margin-top: 0.5rem;
}

/* BO : données sync (gauche) + preview (droite) */
.ld-admin-split {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.25rem;
    align-items: start;
}

.ld-admin-split__title {
    margin: 0 0 0.5em;
}

.ld-admin-fields .ld-admin-field {
    margin: 0 0 0.75em;
}

.ld-admin-section {
    margin: 1.25em 0 0.35em;
    padding-top: 0.75em;
    border-top: 1px solid #dcdcde;
    font-size: 13px;
}

.ld-admin-fields label {
    display: block;
    margin-bottom: 0.25em;
}

.ld-admin-fields textarea {
    width: 100%;
    max-width: 100%;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.4;
}

@media (min-width: 1100px) {
    .ld-admin-split {
        grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.15fr);
    }

    .ld-admin-details {
        position: sticky;
        top: 46px;
        max-height: calc(100vh - 80px);
        overflow: auto;
        padding-right: 0.5rem;
    }
}

.ld-card__actions {
    display: flex;
    justify-content: space-around;
    gap: 0.5rem;
    padding-top: 0.55rem;
}

.ld-card__actions a {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.45rem 0.35rem;
    color: #666;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    border-radius: 4px;
}

.ld-card__actions a:hover {
    background: #f3f2ef;
    color: #0a66c2;
}
