/* =============================================================
   Post Slider v3 — Layout split image / article
   Design cohérent avec Elementor
   ============================================================= */

/* ── Wrapper ─────────────────────────────────────────────────  */

.ps-wrapper {
    position: relative;
    font-family: inherit;
    line-height: 1;
}

/* ── Slider ──────────────────────────────────────────────────  */

.ps-slider {
    height: 500px; /* fallback – écrasé par le contrôle responsive Elementor */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.10);
}

/* ── Slide ───────────────────────────────────────────────────  */

.ps-slide-inner {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* ── Colonne image (gauche) ──────────────────────────────────  */

.ps-col-image {
    flex: 0 0 50%;
    max-width: 50%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #e5e7eb;
    position: relative;
    transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.swiper-slide-active .ps-col-image {
    transform: scale(1.04);
}

/* Ombre portée vers la colonne contenu → transition visuelle douce */
.ps-col-image::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 64px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.35));
    pointer-events: none;
}

/* ── Colonne contenu (droite) ────────────────────────────────  */

.ps-col-content {
    flex: 1;
    min-width: 0; /* évite le débordement flex */
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 3rem;
    overflow: hidden;
}

/* ── Image article (colonne droite) ─────────────────────────  */

.ps-article-thumb {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 180px;
    border-radius: 6px;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.ps-thumb-align-left   .ps-article-thumb { margin-left: 0;    margin-right: auto; }
.ps-thumb-align-center .ps-article-thumb { margin-left: auto; margin-right: auto; }
.ps-thumb-align-right  .ps-article-thumb { margin-left: auto; margin-right: 0;    }

/* ── Badge catégorie ─────────────────────────────────────────  */

.ps-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 0.28rem 0.7rem;
    background-color: #eef2ff;
    color: #6366f1;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    white-space: nowrap;
}

/* ── Titre ───────────────────────────────────────────────────  */

.ps-slide-title {
    margin: 0 0 0.875rem;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.22;
    color: #1a1a2e;
    letter-spacing: -0.02em;
    /* Tronque si trop long */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Extrait ─────────────────────────────────────────────────  */

.ps-excerpt {
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555e6c;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Bouton ──────────────────────────────────────────────────  */

.ps-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    align-self: flex-start;
    padding: 0.65rem 1.5rem;
    background-color: #6366f1;
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    transition:
        background-color 0.2s ease,
        color            0.2s ease,
        transform        0.15s ease;
    white-space: nowrap;
}

.ps-btn:hover,
.ps-btn:focus-visible {
    background-color: #4f46e5;
    transform: translateX(3px);
    outline: none;
}

.ps-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.ps-btn:hover svg {
    transform: translateX(3px);
}

/* ── Navigation prev / next ──────────────────────────────────  */

.ps-slider .swiper-button-prev,
.ps-slider .swiper-button-next {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: -22px; /* centrage vertical Swiper */
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.ps-slider .swiper-button-prev:hover,
.ps-slider .swiper-button-next:hover {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    transform: scale(1.07);
}

.ps-slider .swiper-button-prev::after,
.ps-slider .swiper-button-next::after {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1a1a2e;
}

/* ── Pagination (en dehors du slider) ────────────────────────  */

.ps-pagination.swiper-pagination {
    /* Annule le positionnement absolu de Swiper */
    position: static !important;
    bottom: auto !important;
    margin-top: 1rem;
    text-align: center;
    line-height: 1;
}

.ps-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #d1d5db;
    opacity: 1;
    transition: background 0.25s ease, transform 0.25s ease;
}

.ps-pagination .swiper-pagination-bullet-active {
    background: #6366f1;
    transform: scale(1.35);
}

/* ── Message vide ─────────────────────────────────────────────  */

.ps-no-slides {
    padding: 2.5rem;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
}

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

/* Tablette (≤ 1024px) */
@media (max-width: 1024px) {
    .ps-col-content {
        padding: 2rem 2.5rem;
    }

    .ps-slide-title {
        font-size: 1.5rem;
    }
}

/* Tablette petite / paysage mobile (≤ 767px) — passage en colonne */
@media (max-width: 767px) {
    .ps-slide-inner {
        flex-direction: column;
        overflow-y: auto;
    }

    /* Largeur colonne image = 100% en mode empilé
       La hauteur est gérée par le contrôle image_col_height (défaut 220px) */
    .ps-col-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        min-height: 160px;
    }

    /* Centrage horizontal forcé — l'inline style PHP ne peut pas être
       surchargé autrement qu'avec !important */
    .ps-col-image {
        background-position-x: center !important;
    }

    /* Fondu bas au lieu de fondu droite */
    .ps-col-image::after {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 56px;
        background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.4));
    }

    .ps-col-content {
        flex: 1 1 auto;
        padding: 1.25rem 1.5rem;
        justify-content: flex-start;
        overflow-y: auto;
    }

    .ps-slide-title {
        font-size: 1.15rem;
        -webkit-line-clamp: 3;
        margin-bottom: 0.5rem;
    }

    .ps-excerpt {
        font-size: 0.875rem;
        -webkit-line-clamp: 3;
        margin-bottom: 1rem;
    }

    .ps-btn {
        padding: 0.55rem 1.1rem;
        font-size: 0.8rem;
    }

    /* Flèches masquées sur mobile (trop petites pour être utilisables) */
    .ps-slider .swiper-button-prev,
    .ps-slider .swiper-button-next {
        display: none;
    }
}

/* Portrait mobile strict (≤ 480px) */
@media (max-width: 480px) {
    .ps-col-content {
        padding: 1rem 1.25rem;
    }

    .ps-badge {
        font-size: 0.65rem;
        margin-bottom: 0.6rem;
    }

    .ps-slide-title {
        font-size: 1rem;
    }
}
