/**
 * Composante Formations - Mini-cartes
 * UIkit 3 (jl-*) - Janvier 2026
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --compo-forma-primary: #0f7173;
    --compo-forma-primary-dark: #0a5456;
    --compo-forma-accent: #E63946;
    --compo-forma-text: #333;
    --compo-forma-text-muted: #666;
    --compo-forma-border: #e5e5e5;
    --compo-forma-bg: #fafafa;
}

/* ==========================================================================
   Section Formations
   ========================================================================== */
.compo-formations-section {
    background: var(--compo-forma-bg);
    padding: 30px 0;
}

.compo-formations-section .section-title {
    display: inline-block;
    border-bottom: 3px solid var(--compo-forma-primary);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

/* ==========================================================================
   Accordion personnalisé
   ========================================================================== */
.jl-accordion-formations {
    margin-bottom: 5px;
}

.jl-accordion-formations > .jl-accordion-title {
    background: #fff;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--compo-forma-primary);
    border: 1px solid var(--compo-forma-border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.jl-accordion-formations > .jl-accordion-title:hover {
    background: var(--compo-forma-primary);
    color: #fff;
    border-color: var(--compo-forma-primary);
}

.jl-accordion-formations.jl-open > .jl-accordion-title {
    background: var(--compo-forma-primary);
    color: #fff;
    border-color: var(--compo-forma-primary);
    border-radius: 6px 6px 0 0;
}

.jl-accordion-formations > .jl-accordion-content {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--compo-forma-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
}

/* ==========================================================================
   Filtres par mention (Subnav pills)
   ========================================================================== */
.compo-mentions-filter {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--compo-forma-border);
}

.compo-mentions-filter .jl-subnav-pill > li > a {
    font-size: 0.85em;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.compo-mentions-filter .jl-subnav-pill > .jl-active > a {
    background-color: var(--compo-forma-primary);
}

.compo-mentions-filter .jl-subnav-pill > li > a:hover {
    background-color: var(--compo-forma-primary-dark);
    color: #fff;
}

/* ==========================================================================
   Mini-cartes formations
   ========================================================================== */
.compo-forma-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--compo-forma-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.25s ease;
    position: relative;
}

.compo-forma-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--compo-forma-primary);
}

/* Lien pleine carte */
.compo-forma-card__link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

/* Header avec titre */
.compo-forma-card__header {
    padding: 15px 15px 10px;
    flex: 1 1 auto;
}

.compo-forma-card__title {
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.35;
    color: var(--compo-forma-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Body avec labels */
.compo-forma-card__body {
    padding: 0 15px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Labels M1, M2, BAC+X */
.compo-forma-label {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.compo-forma-label--m1 {
    background: #e3f2fd;
    color: #1565c0;
}

.compo-forma-label--m2 {
    background: #f3e5f5;
    color: #7b1fa2;
}

.compo-forma-label--l1 {
    background: #e8f5e9;
    color: #2e7d32;
}

.compo-forma-label--l2 {
    background: #fff3e0;
    color: #ef6c00;
}

.compo-forma-label--l3 {
    background: #fce4ec;
    color: #c2185b;
}

.compo-forma-label--bac {
    background: #f5f5f5;
    color: #616161;
}

.compo-forma-label--alternance {
    background: #fff8e1;
    color: #f57f17;
}

.compo-forma-label--distance {
    background: #e0f7fa;
    color: #00838f;
}

.compo-forma-label--du {
    background: #ede7f6;
    color: #5e35b1;
}

.compo-forma-label--fc {
    background: #fbe9e7;
    color: #d84315;
}

.compo-forma-label--double {
    background: #fff3e0;
    color: #e65100;
}

.compo-forma-label--intl {
    background: #e8eaf6;
    color: #3949ab;
}

/* Footer avec ville */
.compo-forma-card__footer {
    padding: 10px 15px;
    background: var(--compo-forma-bg);
    border-top: 1px solid var(--compo-forma-border);
    margin-top: auto;
}

.compo-forma-card__ville {
    font-size: 0.8em;
    color: var(--compo-forma-text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.compo-forma-card__ville::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23666'%3E%3Cpath fill-rule='evenodd' d='M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* ==========================================================================
   Grille responsive
   ========================================================================== */
.compo-forma-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

@media (min-width: 640px) {
    .compo-forma-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 960px) {
    .compo-forma-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .compo-forma-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ==========================================================================
   États vides et messages
   ========================================================================== */
.compo-forma-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--compo-forma-text-muted);
}

.compo-forma-empty .jl-icon {
    color: #ccc;
    margin-bottom: 15px;
}

/* ==========================================================================
   Compteur de résultats
   ========================================================================== */
.compo-forma-count {
    font-size: 0.85em;
    color: var(--compo-forma-text-muted);
    margin-bottom: 15px;
}

.compo-forma-count strong {
    color: var(--compo-forma-primary);
}
