/* Bannières CSS cours/modules — remplace les PNG FLUX (22 Mo).
 * Pattern : dégradé teinte/slug (style="--cover-h: {{ slug|cover_hue }}")
 * + halo radial (cf. support/category) + formes flottantes + icône FA + titre texte.
 * Scopé .css-cover (jamais de h1/h2 nus). Texte réel = SEO + a11y. */

.css-cover {
    --cover-h: 222;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
    padding: 1rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg,
        hsl(var(--cover-h), 62%, 45%) 0%,
        hsl(calc(var(--cover-h) + 45), 68%, 30%) 100%);
}

/* Halo lumineux (miroir .support-category .cat-header::before) */
.css-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.22) 0%, transparent 55%);
    pointer-events: none;
}

/* Formes décoratives animées */
.css-cover__shape {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.css-cover__shape--a {
    width: 140px;
    height: 140px;
    top: -45px;
    right: -35px;
    background: rgba(255, 255, 255, 0.12);
    animation: css-cover-float 7s ease-in-out infinite;
}

.css-cover__shape--b {
    width: 90px;
    height: 90px;
    bottom: -30px;
    left: -25px;
    background: rgba(255, 255, 255, 0.09);
    animation: css-cover-float 9s ease-in-out infinite reverse;
}

.css-cover__shape--ring {
    width: 70px;
    height: 70px;
    bottom: 12%;
    right: 12%;
    background: transparent;
    border: 10px solid rgba(255, 255, 255, 0.14);
    animation: css-cover-float 8s ease-in-out infinite;
}

@keyframes css-cover-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Icône géante (logos FA déjà chargés, 0 Ko) */
.css-cover__icon {
    position: relative;
    z-index: 1;
    font-size: 2.8rem;
    color: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.25));
}

/* Titre stylé : 2 lignes max, ellipsis */
.css-cover__title {
    position: relative;
    z-index: 1;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tailles */
.css-cover--hero {
    min-height: 230px;
    padding: 2.5rem 1.5rem;
    border-radius: 1rem;
}

.css-cover--hero .css-cover__icon {
    font-size: 3.4rem;
}

.css-cover--hero .css-cover__title {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
}

.css-cover--mini {
    min-height: 130px;
}

.css-cover--mini .css-cover__icon {
    font-size: 2rem;
}

.css-cover--mini .css-cover__title {
    font-size: 0.85rem;
}

/* Zoom doux au survol des cartes (remplace l'ancien scale sur <img>) */
.course-card:hover .css-cover,
.module-card:hover .css-cover,
.card_show:hover .css-cover {
    filter: brightness(1.06);
}

@media (prefers-reduced-motion: reduce) {
    .css-cover__shape {
        animation: none;
    }
}
