/* ==========================================================================
   Job Access – Formations grid
   Compatible avec la plupart des thèmes WordPress (pas de reset global)
   ========================================================================== */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.ja-formations-wrapper {
    font-family: inherit;
    color: inherit;
    box-sizing: border-box;
}

.ja-formations-wrapper *,
.ja-formations-wrapper *::before,
.ja-formations-wrapper *::after {
    box-sizing: inherit;
}

/* ── Barre d'outils ─────────────────────────────────────────────────────── */
.ja-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

/* ── Recherche ───────────────────────────────────────────────────────────── */
.ja-search-wrap {
    position: relative;
    flex: 1 1 260px;
}

.ja-search {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1.5px solid #d0d5dd;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.4;
    background: #fff;
    color: #111;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
}

.ja-search:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.ja-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #667085;
    pointer-events: none;
}

/* ── Filtres prix ────────────────────────────────────────────────────────── */
.ja-price-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ja-price-btn {
    padding: 8px 16px;
    border: 1.5px solid #d0d5dd;
    border-radius: 20px;
    background: #fff;
    color: #344054;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
}

.ja-price-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.ja-price-btn.is-active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* ── Compteur ────────────────────────────────────────────────────────────── */
.ja-count {
    margin: 0 0 16px;
    font-size: 14px;
    color: #667085;
    min-height: 1.4em;
}

/* ── Grille ──────────────────────────────────────────────────────────────── */
.ja-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ── Carte ───────────────────────────────────────────────────────────────── */
.ja-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    text-decoration: none !important;
    color: inherit !important;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}

.ja-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    transform: translateY(-3px);
}

/* Miniature */
.ja-card__thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%;  /* ratio 16:9 */
    background: #f2f4f7;
    overflow: hidden;
}

.ja-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ja-card__img--placeholder {
    background: linear-gradient(135deg, #e4e7ec 0%, #d0d5dd 100%);
}

/* Badge catégorie */
.ja-card__category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

/* Corps */
.ja-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px;
    gap: 8px;
}

.ja-card__title {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    color: #101828 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ja-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #667085;
}

.ja-card__teacher::before {
    content: '👤 ';
}

.ja-card__duration::before {
    content: '⏱ ';
}

/* Pied de carte */
.ja-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f2f4f7;
    flex-wrap: wrap;
    gap: 8px;
}

/* Prix */
.ja-price-value {
    font-size: 17px;
    font-weight: 700;
    color: #101828;
}

.ja-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.ja-badge--free {
    background: #ecfdf3;
    color: #027a48;
}

/* Étoiles */
.ja-rating {
    display: flex;
    align-items: center;
    gap: 3px;
}

.ja-star {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.ja-star--full {
    color: #f79009;
}

.ja-star--half {
    color: #f79009;
}

.ja-star--empty {
    color: #d0d5dd;
    fill: none;
}

.ja-rating-value {
    font-size: 13px;
    color: #667085;
    margin-left: 2px;
}

/* ── État vide / erreur ──────────────────────────────────────────────────── */
.ja-empty,
.ja-error {
    text-align: center;
    padding: 48px 24px;
    color: #667085;
    font-size: 15px;
}

.ja-error {
    color: #b42318;
    background: #fff4f2;
    border: 1px solid #fda29b;
    border-radius: 8px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ja-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ja-search-wrap {
        flex: 1 1 auto;
    }

    .ja-price-filter {
        justify-content: center;
    }

    .ja-grid {
        grid-template-columns: 1fr;
    }
}
