/* ============================================================

   Blog Listing Widget v1.2.0 – Styles Front-end

   ============================================================ */



/* ── Grid ────────────────────────────────────────────────── */

.blw-wrapper { width: 100%; }



.blw-grid {

    display: grid;

    gap: 24px;

    width: 100%;

    align-items: start;

}



@media (max-width: 1024px) {

    .blw-grid { grid-template-columns: repeat(2, 1fr) !important; }

}

@media (max-width: 600px) {

    .blw-grid { grid-template-columns: 1fr !important; }

}



/* ── Card ────────────────────────────────────────────────── */

/*

 * IMPORTANT: overflow is intentionally NOT set here.

 * - border-spin effect needs ::before to extend outside the card

 * - sheen / overlay effects add their own overflow:hidden via their class

 * - .blw-card__thumb handles image clipping with its own overflow:hidden

 */

.blw-card {

    --blw-transition-speed: 300ms;

    --blw-lift-y: 6px;

    --blw-scale-factor: 1.03;

    --blw-glow-color: rgba(99, 102, 241, 0.55);

    --blw-glow-spread: 18px;

    --blw-sheen-color: rgba(255, 255, 255, 0.42);

    --blw-sheen-width: 42%;

    --blw-border-c1: #6366f1;

    --blw-border-c2: #ec4899;

    --blw-border-c3: #f59e0b;

    --blw-border-w: 3px;

    --blw-border-anim-speed: 2s;

    --blw-overlay-color: rgba(26, 60, 110, 0.80);



    background-color: #ffffff;

    border-radius: 12px;

    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);

    display: flex;

    flex-direction: column;

    position: relative;

    z-index: 0;

    transition:

        box-shadow var(--blw-transition-speed) ease,

        transform  var(--blw-transition-speed) ease,

        background-color var(--blw-transition-speed) ease;

}



/* ── Alignement horizontal (prefix_class) ────────────────── */

.blw-content-left   .blw-card__body { text-align: left;   }

.blw-content-center .blw-card__body { text-align: center; }

.blw-content-right  .blw-card__body { text-align: right;  }



.blw-content-center .blw-card__readmore,

.blw-content-right  .blw-card__readmore { display: block; }



/* ── Thumb wrap (positions the badge absolutely over the image) */

.blw-card__thumb-wrap {

    position: relative;

    flex-shrink: 0;

}



.blw-card__thumb-link {

    display: block;

    text-decoration: none;

}



.blw-card__thumb {

    position: relative;

    overflow: hidden;          /* clips image on zoom */

    aspect-ratio: 16 / 9;

    background: #e8edf3;

}



.blw-card__thumb .blw-card__image {

    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;

    transition: transform var(--blw-transition-speed) ease;

}



/* ── Badge ───────────────────────────────────────────────── */

.blw-card__badge {

    position: absolute;

    top: 12px;

    right: 12px;

    background-color: #1a3c6e;

    color: #ffffff;

    font-size: 0.65rem;

    font-weight: 700;

    letter-spacing: 0.07em;

    padding: 4px 10px;

    border-radius: 50px;

    text-transform: uppercase;

    white-space: nowrap;

    line-height: 1.4;

    text-decoration: none;

    cursor: pointer;

    transition:

        background-color 0.2s ease,

        color 0.2s ease,

        transform 0.2s ease;

    z-index: 10;

}



.blw-card__badge:hover {

    transform: scale(1.06);

}



/* Badge – position par coin (prefix_class) */

.blw-badge-h-left  .blw-card__badge { left: 12px;   right: auto;   }

.blw-badge-h-right .blw-card__badge { right: 12px;  left: auto;    }

.blw-badge-v-top    .blw-card__badge { top: 12px;    bottom: auto;  }

.blw-badge-v-bottom .blw-card__badge { bottom: 12px; top: auto;     }



/* ── Body ────────────────────────────────────────────────── */

.blw-card__body {

    padding: 20px 22px 16px;

    flex: 1;

    display: flex;

    flex-direction: column;

}



.blw-card__title {

    font-size: 1rem;

    font-weight: 700;

    line-height: 1.4;

    margin: 0 0 12px;

}



.blw-card__title a {

    color: #1a3c6e;

    text-decoration: none;

    transition: color 0.2s;

}



.blw-card__title a:hover { color: #e05a00; }



.blw-card__excerpt {

    font-size: 0.875rem;

    line-height: 1.6;

    color: #555e6c;

    margin: 0 0 16px;

    flex: 1;

    display: -webkit-box;

    -webkit-line-clamp: 4;

    -webkit-box-orient: vertical;

    overflow: hidden;

}



.blw-card__readmore {

    display: inline-block;

    font-size: 0.875rem;

    font-weight: 700;

    color: #1a3c6e;

    text-decoration: none;

    margin-top: auto;

    transition: color 0.2s;

}



.blw-card__readmore:hover {

    color: #e05a00;

    text-decoration: underline;

}



/* ── Footer / Meta ───────────────────────────────────────── */

.blw-card__footer {

    display: flex;

    flex-wrap: wrap;

    gap: 6px 10px;

    align-items: center;

    padding: 12px 22px 14px;

    border-top: 1px solid #eef0f4;

    font-size: 0.775rem;

    color: #8892a4;

}



.blw-card__meta {

    display: inline-flex;

    align-items: center;

    gap: 4px;

}



/*

 * Icônes de meta – chaque type a son propre ::before.

 * L'auteur utilise un vrai avatar circulaire (img.blw-card__author-avatar)

 * rendu côté PHP via get_avatar() — pas de ::before texte pour lui.

 */

/* Icônes SVG réelles – mask-image hérite de la couleur du texte (currentColor) */

.blw-card__meta--date::before,

.blw-card__meta--comments::before {

    content: '';

    display: inline-block;

    width: 1em;

    height: 1em;

    margin-right: 0.3em;

    vertical-align: -0.15em;

    background-color: currentColor;

    -webkit-mask-size: contain;

    mask-size: contain;

    -webkit-mask-repeat: no-repeat;

    mask-repeat: no-repeat;

    -webkit-mask-position: center;

    mask-position: center;

}



/* Icône calendrier */

.blw-card__meta--date::before {

    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");

    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");

}



/* Icône bulle de commentaire */

.blw-card__meta--comments::before {

    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");

    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");

}



/* Avatar auteur – petit cercle aligné avec le texte */

.blw-card__author-avatar {

    width: 20px;

    height: 20px;

    border-radius: 50% !important;

    object-fit: cover;

    flex-shrink: 0;

    margin-right: 5px;

    vertical-align: middle;

    border: 1.5px solid #d0d5de;

}



.blw-card__author-link {

    color: inherit;

    text-decoration: none;

    transition: color 0.2s;

}

.blw-card__author-link:hover {

    color: #1a3c6e;

    text-decoration: underline;

}



/* ── No posts ────────────────────────────────────────────── */

.blw-no-posts {

    grid-column: 1 / -1;

    text-align: center;

    color: #888;

    padding: 40px 0;

}



/* ─────────────────────────────────────────────────────────

   EFFETS DE SURVOL

   Chaque effet est activé via prefix_class sur le widget

   wrapper : .blw-hover-{effet}

───────────────────────────────────────────────────────── */



/* ── none : aucun effet (base neutre) ───────────────────── */

.blw-hover-none .blw-card:hover { /* no-op */ }



/* ── lift : élévation + ombre ───────────────────────────── */

.blw-hover-lift .blw-card:hover {

    transform: translateY(calc(-1 * var(--blw-lift-y, 6px)));

    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);

}

.blw-hover-lift .blw-card:hover .blw-card__image {

    transform: scale(1.05);

}



/* ── zoom : zoom image uniquement ──────────────────────── */

.blw-hover-zoom .blw-card:hover .blw-card__image {

    transform: scale(1.10);

}



/* ── scale : agrandissement de la carte ─────────────────── */

.blw-hover-scale .blw-card:hover {

    transform: scale(var(--blw-scale-factor, 1.03));

    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);

}



/* ── glow : lueur colorée ───────────────────────────────── */

.blw-hover-glow .blw-card:hover {

    box-shadow:

        0 0 0 3px var(--blw-glow-color, rgba(99,102,241,0.55)),

        0 8px var(--blw-glow-spread, 18px) rgba(0,0,0,0.10),

        0 0 var(--blw-glow-spread, 18px) var(--blw-glow-color, rgba(99,102,241,0.35));

}



/* ── tilt : inclinaison 3D ──────────────────────────────── */

.blw-hover-tilt .blw-card {

    transform-style: preserve-3d;

    will-change: transform;

}

.blw-hover-tilt .blw-card:hover {

    transform: perspective(600px) rotateX(5deg) rotateY(-5deg) translateZ(10px);

    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);

}



/* ── sheen : reflet de vitre ────────────────────────────── */

/*

 * Un rayon lumineux diagonal glisse de gauche à droite au survol.

 * Dégradé adouci : fondu progressif sur les bords (plus de 25%

 * de zones transparentes de chaque côté) pour un rendu "glass"

 * doux et naturel, sans arête vive.

 * La couleur est contrôlable via --blw-sheen-color.

 */

.blw-hover-sheen .blw-card {

    overflow: hidden;

}



.blw-hover-sheen .blw-card::after {

    content: '';

    position: absolute;

    top: -20%;

    left: calc(-1 * var(--blw-sheen-width, 42%) - 30%);

    /* Élément 30 % plus large pour avoir de la place pour fondre */

    width: calc(var(--blw-sheen-width, 42%) * 1.6);

    height: 140%;

    background: linear-gradient(

        108deg,

        transparent                                        0%,

        transparent                                       15%,

        color-mix(in srgb, var(--blw-sheen-color, rgba(255,255,255,0.42)) 15%, transparent) 30%,

        var(--blw-sheen-color, rgba(255,255,255,0.42))    50%,

        color-mix(in srgb, var(--blw-sheen-color, rgba(255,255,255,0.42)) 15%, transparent) 70%,

        transparent                                       85%,

        transparent                                      100%

    );

    transform: skewX(-12deg);

    pointer-events: none;

    z-index: 10;

    transition: left calc(var(--blw-transition-speed) * 1.4) cubic-bezier(0.25, 0.46, 0.45, 0.94);

}



.blw-hover-sheen .blw-card:hover::after {

    left: calc(100% + 30%);

}



/* ── border-spin : bordure conic-gradient tournante ─────── */

/*

 * Technique CSS mask (la seule fiable) :

 *   - ::before occupe EXACTEMENT la carte (inset:0)

 *   - padding = épaisseur de la bordure

 *   - Le mask EXCLUT le content-box (zone centrale) →

 *     seule la zone padding (l'anneau de bordure) reste visible

 *   - z-index:2 = au-dessus du contenu, mais le centre

 *     est transparent → le texte/images restent lisibles

 *   - L'angle du conic-gradient est animé via @property

 *     sans rotation de l'élément

 */

.blw-hover-border-spin .blw-card {

    isolation: isolate; /* crée un stacking context propre */

}



.blw-hover-border-spin .blw-card::before {

    content: '';

    position: absolute;

    inset: 0;

    border-radius: inherit;

    padding: var(--blw-border-w, 3px);

    background: conic-gradient(

        from var(--blw-spin-angle, 0deg),

        var(--blw-border-c1, #6366f1)  0%,

        var(--blw-border-c2, #ec4899) 33%,

        var(--blw-border-c3, #f59e0b) 66%,

        var(--blw-border-c1, #6366f1) 100%

    );

    /* Découpe : affiche uniquement l'anneau de padding */

    -webkit-mask:

        linear-gradient(#fff 0 0) content-box,

        linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;

    mask-composite: exclude;

    z-index: 2;

    opacity: 0;

    transition: opacity calc(var(--blw-transition-speed) * 0.5) ease;

}



.blw-hover-border-spin .blw-card:hover::before {

    opacity: 1;

    animation: blw-border-spin var(--blw-border-anim-speed, 2s) linear infinite;

}



/* ── overlay : superposition couleur glissante ──────────── */

.blw-hover-overlay .blw-card {

    overflow: hidden;

}



.blw-hover-overlay .blw-card::after {

    content: '';

    position: absolute;

    inset: 0;

    background: var(--blw-overlay-color, rgba(26,60,110,0.80));

    pointer-events: none;

    z-index: 8;

    border-radius: inherit;

    transition: transform var(--blw-transition-speed) cubic-bezier(0.4, 0, 0.2, 1);

}



/* Direction bas → haut (défaut) */

.blw-overlay-dir-bottom .blw-card::after { transform: translateY(101%); }

.blw-overlay-dir-bottom .blw-card:hover::after { transform: translateY(0); }



/* Direction haut → bas */

.blw-overlay-dir-top .blw-card::after { transform: translateY(-101%); }

.blw-overlay-dir-top .blw-card:hover::after { transform: translateY(0); }



/* Direction gauche → droite */

.blw-overlay-dir-left .blw-card::after { transform: translateX(-101%); }

.blw-overlay-dir-left .blw-card:hover::after { transform: translateX(0); }



/* Direction droite → gauche */

.blw-overlay-dir-right .blw-card::after { transform: translateX(101%); }

.blw-overlay-dir-right .blw-card:hover::after { transform: translateX(0); }



/* ─────────────────────────────────────────────────────────

   CSS CUSTOM PROPERTY ANIMATABLE – border-spin

   Anime l'angle du conic-gradient sans faire tourner l'élément

   (évite le rectangle coloré qui tourne sur lui-même)

───────────────────────────────────────────────────────── */

@property --blw-spin-angle {

    syntax: '<angle>';

    initial-value: 0deg;

    inherits: false;

}



/* ─────────────────────────────────────────────────────────

   ANIMATIONS KEYFRAMES

───────────────────────────────────────────────────────── */

@keyframes blw-border-spin {

    from { --blw-spin-angle: 0deg;   }

    to   { --blw-spin-angle: 360deg; }

}



@keyframes blw-spin {

    to { transform: rotate(360deg); }

}



@keyframes blw-fadeup {

    from { opacity: 0; transform: translateY(16px); }

    to   { opacity: 1; transform: translateY(0); }

}



@keyframes blw-float {

    0%, 100% {

        transform: translateY(0px);

        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);

    }

    50% {

        transform: translateY(calc(-1 * var(--blw-float-height, 8px)));

        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);

    }

}



@keyframes blw-neon-pulse {

    0%, 100% {

        box-shadow:

            0 0 4px  var(--blw-neon-color, #a855f7),

            0 0 12px var(--blw-neon-color, #a855f7),

            0 0 24px var(--blw-neon-color, #a855f7),

            inset 0 0 6px rgba(168, 85, 247, 0.1);

    }

    50% {

        box-shadow:

            0 0 8px  var(--blw-neon-color, #a855f7),

            0 0 28px var(--blw-neon-color, #a855f7),

            0 0 60px var(--blw-neon-color, #a855f7),

            inset 0 0 12px rgba(168, 85, 247, 0.15);

    }

}



@keyframes blw-morph {

    0%, 100% { border-radius: 12px; }

    25%       { border-radius: 20px 8px 20px 8px; }

    50%       { border-radius: 8px 20px 8px 20px; }

    75%       { border-radius: 20px 8px 8px 20px; }

}



/* ─────────────────────────────────────────────────────────

   NOUVEAUX EFFETS DE SURVOL

───────────────────────────────────────────────────────── */



/* ── float : lévitation douce permanente ────────────────── */

/*

 * Animation continue (pas seulement au survol).

 * La carte monte et descend doucement en boucle.

 * Chaque carte dans la grille a un délai décalé (géré via JS

 * ou par :nth-child si souhaité).

 */

.blw-hover-float .blw-card {

    animation: blw-float var(--blw-float-duration, 3s) ease-in-out infinite;

    will-change: transform;

}



/* Décalage des cartes pour éviter qu'elles bougent toutes en même temps */

.blw-hover-float .blw-card:nth-child(2) { animation-delay: -1s;   }

.blw-hover-float .blw-card:nth-child(3) { animation-delay: -2s;   }

.blw-hover-float .blw-card:nth-child(4) { animation-delay: -0.5s; }

.blw-hover-float .blw-card:nth-child(5) { animation-delay: -1.5s; }

.blw-hover-float .blw-card:nth-child(6) { animation-delay: -2.5s; }



/* Pause au survol pour permettre l'interaction */

.blw-hover-float .blw-card:hover {

    animation-play-state: paused;

}



/* ── neon : bordure néon pulsante ───────────────────────── */

/*

 * Box-shadow coloré qui pulse au survol, simulant une enseigne néon.

 * Ajoute une fine bordure solide de la couleur néon.

 */

.blw-hover-neon .blw-card {

    --blw-neon-color: #a855f7;

    --blw-neon-speed: 1.5s;

    transition:

        box-shadow  var(--blw-transition-speed) ease,

        border-color var(--blw-transition-speed) ease,

        transform   var(--blw-transition-speed) ease;

    border: 2px solid transparent;

}



.blw-hover-neon .blw-card:hover {

    border-color: var(--blw-neon-color, #a855f7);

    transform: translateY(-3px);

    animation: blw-neon-pulse var(--blw-neon-speed, 1.5s) ease-in-out infinite;

}



/* ── spotlight : projecteur suivant le curseur ───────────── */

/*

 * Un cercle de lumière suit la souris sur la carte.

 * Les variables --blw-spot-x et --blw-spot-y sont mises à jour

 * en temps réel par le JS ci-dessous.

 */

.blw-hover-spotlight .blw-card {

    overflow: hidden;

    --blw-spot-x: -200%;

    --blw-spot-y: -200%;

    --blw-spot-color: rgba(255, 255, 255, 0.15);

    --blw-spot-size: 220px;

}



.blw-hover-spotlight .blw-card::after {

    content: '';

    position: absolute;

    inset: 0;

    background: radial-gradient(

        circle var(--blw-spot-size, 220px) at var(--blw-spot-x) var(--blw-spot-y),

        var(--blw-spot-color, rgba(255,255,255,0.15))  0%,

        transparent                                    70%

    );

    pointer-events: none;

    z-index: 5;

    border-radius: inherit;

    opacity: 0;

    transition: opacity 0.3s ease;

}



.blw-hover-spotlight .blw-card:hover::after {

    opacity: 1;

}



/* ── morph : morphing de forme au survol ─────────────────── */

/*

 * La carte change doucement de forme (border-radius) au survol,

 * avec un léger agrandissement pour amplifier l'effet.

 */

.blw-hover-morph .blw-card {

    transition:

        border-radius var(--blw-transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1),

        box-shadow    var(--blw-transition-speed) ease,

        transform     var(--blw-transition-speed) ease;

}



.blw-hover-morph .blw-card:hover {

    border-radius: var(--blw-morph-radius, 28px 8px 28px 8px) !important;

    transform: scale(1.02);

    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);

}



.blw-hover-morph .blw-card:hover .blw-card__thumb {

    border-radius: var(--blw-morph-radius, 26px 6px 0 0) !important;

}



/* Cards apparition lors de l'injection AJAX */

.blw-card-enter {

    animation: blw-fadeup 0.4s ease both;

}



/* ── Load more area ──────────────────────────────────────── */

.blw-loadmore-wrap {

    display: flex;

    justify-content: center;

    margin-top: 36px;

}



.blw-loadmore-btn {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    background-color: #1a3c6e;

    color: #ffffff;

    border: none;

    border-radius: 6px;

    padding: 13px 30px;

    font-size: 0.95rem;

    font-weight: 600;

    cursor: pointer;

    transition: background-color 0.2s, transform 0.15s;

    letter-spacing: 0.02em;

}



.blw-loadmore-btn:hover {

    background-color: #0f2649;

    transform: translateY(-1px);

}



.blw-loadmore-btn:active { transform: translateY(0); }



.blw-loadmore-btn:disabled,

.blw-loadmore-btn.is-loading {

    opacity: 0.65;

    pointer-events: none;

}



.blw-loadmore-btn.is-loading::after {

    content: '';

    display: inline-block;

    width: 14px;

    height: 14px;

    border: 2px solid rgba(255,255,255,0.4);

    border-top-color: #fff;

    border-radius: 50%;

    animation: blw-spin 0.7s linear infinite;

}



/* Infinite sentinel */

.blw-infinite-sentinel {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 10px;

    padding: 20px;

    color: #8892a4;

    font-size: 0.875rem;

}



.blw-infinite-sentinel.is-hidden { display: none; }



.blw-spinner {

    display: inline-block;

    width: 30px;

    height: 30px;

    border: 3px solid #d0d5de;

    border-top-color: #1a3c6e;

    border-radius: 50%;

    animation: blw-spin 0.7s linear infinite;

}

