/* =============================================================================
   Amphyx — squelettes de chargement (shimmer)
   - images : fond animé tant que l'image n'est pas arrivée ;
   - .cx-skel-card / .cx-skel-line / .cx-skel-box : blocs réutilisables (listes, résultats, widgets).
   ============================================================================= */
:root {
    --cx-skel-base: #edf1f6;
    --cx-skel-shine: #f8fafc;
}
@keyframes cxSkelShimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -20% 0; }
}
.cx-skel,
img.cx-skel-img,
.cx-skel-line,
.cx-skel-box,
.cx-skel-card .cx-skel-media {
    background-color: var(--cx-skel-base) !important;
    background-image: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, var(--cx-skel-shine) 50%, rgba(255, 255, 255, 0) 70%) !important;
    background-size: 220% 100% !important;
    background-repeat: no-repeat !important;
    animation: cxSkelShimmer 1.4s ease-in-out infinite;
}
/* Image en cours de chargement : on masque le texte alternatif et l'icône d'image cassée */
img.cx-skel-img {
    color: transparent;
}
img.cx-skel-img:not([src]),
img.cx-skel-img[src=""] {
    visibility: hidden;
}
img.cx-skel-loaded {
    animation: cxSkelReveal 0.35s ease-out;
}
@keyframes cxSkelReveal {
    from { opacity: 0.25; }
    to { opacity: 1; }
}

/* Carte fantôme (ajoutée pendant le chargement d'une liste) */
.cx-skel-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 220px;
    padding: 12px;
    border: 1px solid #e8edf3;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
}
.cx-skel-card .cx-skel-media {
    flex: 0 0 52%;
    min-height: 110px;
    border-radius: 12px;
}
.cx-skel-line {
    display: block;
    height: 12px;
    border-radius: 6px;
}
.cx-skel-line.w-90 { width: 90%; }
.cx-skel-line.w-70 { width: 70%; }
.cx-skel-line.w-50 { width: 50%; }
.cx-skel-line.w-30 { width: 30%; }
.cx-skel-line.lg { height: 16px; }
.cx-skel-box {
    display: block;
    border-radius: 12px;
}
.cx-skel-wrap {
    pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
    .cx-skel, img.cx-skel-img, .cx-skel-line, .cx-skel-box, .cx-skel-card .cx-skel-media,
    img.cx-skel-loaded {
        animation: none !important;
    }
}
