/* =============================================================
   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 {
    min-height: 500px; /* fallback – min-height laisse autoHeight de Swiper grandir */
    border-radius: 12px;
    overflow: hidden; /* requis pour border-radius */
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.10);
}

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

.ps-slide-inner {
    display: flex;
    height: auto; /* laisse le contenu dicter la hauteur (Swiper autoHeight) */
}

/* ── Colonne gauche ──────────────────────────────────────────  */

.ps-col-image {
    flex: 0 0 60%;
    max-width: 60%;
    background-color: #f3f4f6;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Image en haut de la colonne gauche */
.ps-left-img {
    display: block;
    align-self: stretch; /* pleine largeur par défaut dans le flex-column */
    height: 280px;
    min-height: 280px;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
}

/* Contenu textuel sous l'image */
.ps-left-content {
    padding: 1.75rem 2rem 1.75rem 3.5rem; /* 3.5rem gauche = espace pour la flèche prev (44px + 12px marge) */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    background-color: #ffffff;
}

.ps-left-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a2e;
}

.ps-left-desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #555e6c;
}

/* ── Colonne contenu article (droite, 40%) ───────────────────  */

.ps-col-content {
    flex: 1;
    min-width: 0;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 3.5rem 2.5rem 2rem; /* 3.5rem droite = espace pour la flèche next (44px + 12px marge) */
}

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

.ps-article-thumb {
    display: block;
    align-self: flex-start; /* ne pas étirer dans le flex column */
    width: 100%;
    max-width: 100%;
    height: 180px;
    max-height: 180px;
    object-fit: cover;
    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;    }

/* ── Méta article (catégorie + date) ────────────────────────  */

.ps-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ps-meta-date {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 500;
    color: #9ca3af;
    line-height: 1;
    white-space: nowrap;
}

.ps-meta-date svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── Catégories de l'article ────────────────────────────────  */

.ps-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.ps-cat-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background-color: #e0e7ff;
    color: #4338ca;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    line-height: 1.4;
}

/* ── 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 1.5rem;
    }

    .ps-left-content {
        padding: 1.5rem 2rem;
    }

    .ps-left-title {
        font-size: 1.25rem;
    }

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

/* Tablette petite / paysage mobile (≤ 767px) — passage en colonne */
@media (max-width: 767px) {
    /* Hauteur auto : le slider s'étire pour afficher tout le contenu */
    .ps-slider {
        height: auto !important;
    }

    .ps-slide-inner {
        flex-direction: column;
        height: auto;
    }

    /* !important requis : le contrôle Elementor génère une spécificité supérieure */
    .ps-col-image {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .ps-left-img {
        height: 180px !important;
        min-height: 180px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .ps-left-content {
        padding: 1.25rem 1.5rem;
        gap: 0.5rem;
    }

    .ps-left-title {
        font-size: 1.1rem;
    }

    .ps-left-desc {
        font-size: 0.85rem;
        -webkit-line-clamp: 3;
    }

    /* Hauteur naturelle : plus de contrainte flex */
    .ps-col-content {
        flex: 0 0 auto;
        padding: 1.25rem 1.5rem;
        justify-content: flex-start;
        overflow-y: visible;
    }

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

    .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;
    }
}
