/**
 * GHA Courses Archive - Styles custom
 * Page listing des formations (/courses/)
 *
 * Scope : body.gha-courses-archive
 * Aligned with: GHA UI Design System v2 (gha-dashboard.css, gha-woocommerce.css)
 *
 * @package GHA Theme
 * @since 1.1.0
 * @date 2026-01-30
 */

/* ==========================================================================
   CSS VARIABLES - GHA Design System v2 (redeclared for non-dashboard pages)
   ========================================================================== */
:root {
    /* Primary - Blue */
    --gha-primary: #1e40af;
    --gha-primary-hover: #1e3a8a;
    --gha-primary-light: #dbeafe;
    --gha-primary-dark: #1e3a8a;

    /* Text - Slate */
    --gha-text: #1e293b;
    --gha-text-secondary: #64748b;
    --gha-text-light: #94a3b8;

    /* Borders & Backgrounds - Slate */
    --gha-border: #e2e8f0;
    --gha-border-hover: #cbd5e1;
    --gha-bg: #f8fafc;
    --gha-bg-hover: #f1f5f9;
    --gha-white: #ffffff;

    /* Spacing */
    --gha-radius: 12px;
    --gha-radius-sm: 8px;
    --gha-radius-xs: 6px;

    /* Shadows - Subtle & Premium */
    --gha-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --gha-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --gha-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);

    /* Focus ring */
    --gha-focus-ring: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* ==========================================================================
   1. Page Container
   ========================================================================== */
.gha-courses-archive {
    background: var(--gha-bg);
}

.gha-courses-archive .gha-archive-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Neutraliser le fix-pack css-tutor-courses-layout sur l'archive --- */
.gha-courses-archive .tutor-gx-xl-5,
.gha-courses-archive .tutor-row,
.gha-courses-archive .tutor-col-xl-8,
.gha-courses-archive .tutor-course-filter-container {
    all: unset !important;
    display: block !important;
}

/* ==========================================================================
   2. Barre de Filtres Horizontaux
   ========================================================================== */
.gha-courses-archive .gha-filters-bar {
    background: var(--gha-white);
    border: 1px solid var(--gha-border);
    border-radius: var(--gha-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--gha-shadow-sm);
}

.gha-courses-archive .gha-filters-bar-inner {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* --- Search input --- */
.gha-courses-archive .gha-filter-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.gha-courses-archive .gha-filter-search::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
}

.gha-courses-archive .gha-filter-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--gha-border);
    border-radius: var(--gha-radius-sm);
    font-size: 14px;
    color: var(--gha-text);
    background: var(--gha-white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.gha-courses-archive .gha-filter-search input::placeholder {
    color: var(--gha-text-light);
}

.gha-courses-archive .gha-filter-search input:focus {
    border-color: var(--gha-primary);
    box-shadow: var(--gha-focus-ring);
}

/* --- Filter dropdowns --- */
.gha-courses-archive .gha-filter-dropdowns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gha-courses-archive .gha-filter-dropdown {
    position: relative;
}

.gha-courses-archive .gha-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--gha-border);
    border-radius: var(--gha-radius-sm);
    background: var(--gha-white);
    font-size: 14px;
    color: var(--gha-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.gha-courses-archive .gha-filter-btn:hover {
    border-color: var(--gha-border-hover);
    background: var(--gha-bg-hover);
}

.gha-courses-archive .gha-filter-btn.active,
.gha-courses-archive .gha-filter-btn.has-selection {
    border-color: var(--gha-primary);
    color: var(--gha-primary);
    background: var(--gha-primary-light);
}

.gha-courses-archive .gha-filter-chevron {
    font-size: 10px;
    transition: transform 0.15s ease;
    line-height: 1;
}

.gha-courses-archive .gha-filter-dropdown.open .gha-filter-chevron {
    transform: rotate(180deg);
}

/* --- Filter panel (dropdown content) --- */
.gha-courses-archive .gha-filter-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--gha-white);
    border: 1px solid var(--gha-border);
    border-radius: var(--gha-radius-sm);
    padding: 12px;
    box-shadow: var(--gha-shadow-md);
    min-width: 200px;
    z-index: 100;
    display: none;
}

.gha-courses-archive .gha-filter-dropdown.open .gha-filter-panel {
    display: block;
}

.gha-courses-archive .gha-filter-panel label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 12px;
    border-radius: var(--gha-radius-xs);
    cursor: pointer;
    font-size: 13px;
    line-height: 1.3;
    color: var(--gha-text);
    transition: background-color 0.15s ease;
}

.gha-courses-archive .gha-filter-panel label:hover {
    background: var(--gha-bg-hover);
}

.gha-courses-archive .gha-filter-panel input[type="checkbox"] {
    accent-color: var(--gha-primary);
    width: 16px;
    height: 16px;
    margin-top: 1px;
    cursor: pointer;
    flex-shrink: 0;
}

/* --- Active filter tags --- */
.gha-courses-archive .gha-active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.gha-courses-archive .gha-active-filters:empty {
    display: none;
}

.gha-courses-archive .gha-active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--gha-primary-light);
    color: var(--gha-primary-dark);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.gha-courses-archive .gha-active-filter-tag button {
    background: none;
    border: none;
    color: var(--gha-primary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.15s ease;
}

.gha-courses-archive .gha-active-filter-tag button:hover {
    color: var(--gha-primary-dark);
}

/* ==========================================================================
   3. Barre de Tri (Sort)
   ========================================================================== */
.gha-courses-archive .gha-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.gha-courses-archive .gha-sort-bar .gha-results-count {
    font-size: 14px;
    color: var(--gha-text-secondary);
}

.gha-courses-archive .gha-sort-bar select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--gha-border);
    border-radius: var(--gha-radius-sm);
    font-size: 14px;
    color: var(--gha-text);
    background-color: var(--gha-white);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.gha-courses-archive .gha-sort-bar select:focus {
    border-color: var(--gha-primary);
    box-shadow: var(--gha-focus-ring);
}

/* ==========================================================================
   4. Grille de Cours
   ========================================================================== */
.gha-courses-archive .gha-courses-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* ==========================================================================
   5. Carte de Cours
   ========================================================================== */
.gha-courses-archive .gha-course-card {
    background: var(--gha-white);
    border-radius: var(--gha-radius);
    border: 1px solid var(--gha-border);
    overflow: hidden;
    box-shadow: var(--gha-shadow-sm);
    display: flex;
    flex-direction: column;
}

/* --- Thumbnail (portrait A3, height fixe) --- */
.gha-courses-archive .gha-course-card-thumbnail {
    position: relative;
    height: 320px;
    overflow: hidden;
    background: var(--gha-bg);
}

/* Gradient overlay pour lisibilité du titre */
.gha-courses-archive .gha-course-card-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 22%,
        rgba(0, 0, 0, 0.12) 38%,
        rgba(0, 0, 0, 0.30) 52%,
        rgba(0, 0, 0, 0.55) 66%,
        rgba(0, 0, 0, 0.78) 80%,
        rgba(0, 0, 0, 0.92) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.gha-courses-archive .gha-course-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Badge PQK overlay (top right, sur image) --- */
.gha-courses-archive .gha-badge-pqk-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.3;
    z-index: 2;
}

.gha-courses-archive .gha-badge-pqk-overlay .gha-pqk-label-short {
    display: none;
}

/* --- Overlay content (titre + auteur flottants bas image) --- */
.gha-courses-archive .gha-card-overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    z-index: 2;
}

/* --- Title (overlay, blanc Sora 800) --- */
.gha-courses-archive .gha-course-card-title {
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.gha-courses-archive .gha-course-card-title a {
    color: inherit;
    text-decoration: none;
}

/* --- Overlay author --- */
.gha-courses-archive .gha-card-overlay-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

.gha-courses-archive .gha-card-overlay-author img,
.gha-courses-archive .gha-card-overlay-author .tutor-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* --- Footer : Rating --- */
.gha-courses-archive .gha-footer-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gha-courses-archive .gha-stars {
    color: #f59e0b;
    font-size: 14px;
    letter-spacing: 1px;
    line-height: 1;
}

.gha-courses-archive .gha-star-full {
    color: #f59e0b;
}

.gha-courses-archive .gha-star-half {
    color: #f59e0b;
    position: relative;
    display: inline-block;
}

.gha-courses-archive .gha-star-empty {
    color: var(--gha-border-hover);
}

.gha-courses-archive .gha-no-rating .gha-stars {
    opacity: 0.4;
}

.gha-courses-archive .gha-rating-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--gha-text);
}

.gha-courses-archive .gha-rating-count {
    font-size: 13px;
    color: var(--gha-text-secondary);
}

/* --- Footer : Duration --- */
.gha-courses-archive .gha-footer-duration {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--gha-text-secondary);
}

.gha-courses-archive .gha-footer-duration svg {
    flex-shrink: 0;
    color: var(--gha-text-secondary);
}

/* --- Footer : Date événement --- */
.gha-courses-archive .gha-footer-date {
    font-size: 12px;
    font-weight: 500;
    color: var(--gha-text-secondary);
    letter-spacing: 0.01em;
}

.gha-courses-archive .gha-footer-date--event {
    margin-top: 1px;
    border: 1px solid #ddd6fe;
    border-radius: var(--gha-radius-sm);
    background: #ffffff;
    padding: 7px 9px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gha-courses-archive .gha-footer-date-top {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    line-height: 1;
}

.gha-courses-archive .gha-footer-date-line {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    min-width: 0;
}

.gha-courses-archive .gha-footer-date-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6d28d9;
    box-shadow: 0 0 0 3px #f5f3ff;
    flex: 0 0 auto;
}

.gha-courses-archive .gha-footer-date-value {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    color: #312e81;
}

.gha-courses-archive .gha-footer-duration-pill {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid #ddd6fe;
    background: #f5f3ff;
    color: #4c1d95;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

/* --- Footer : CTA Row (prix + bouton) --- */
.gha-courses-archive .gha-footer-cta-row {
    border-top: 1px solid var(--gha-border);
    padding-top: 8px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- Card Footer --- */
.gha-courses-archive .gha-course-card-footer {
    padding: 10px 16px 12px;
    border-top: 1px solid var(--gha-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 70px;
}

/* --- Footer : Boutons Tutor natifs styles GHA --- */
.gha-courses-archive .gha-course-card-footer .tutor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--gha-radius-xs);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.gha-courses-archive .gha-course-card-footer .tutor-btn-outline-primary {
    background: transparent;
    color: var(--gha-primary);
    border: 1px solid var(--gha-primary);
}

.gha-courses-archive .gha-course-card-footer .tutor-btn-outline-primary:hover {
    background: var(--gha-primary);
    color: #ffffff;
}

/* --- CTA contract (stable hooks from course.php) --- */
.gha-courses-archive .gha-cta-row .gha-cta--price {
    margin-right: auto;
}

.gha-courses-archive .gha-cta-row .gha-cta--cart {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.gha-courses-archive .gha-cta-row .gha-cta--primary {
    flex: 1 1 100%;
    width: 100%;
    display: flex;
}

.gha-courses-archive .gha-cta-row .gha-cta--primary .gha-cta-button--primary,
.gha-courses-archive .gha-cta-row > .gha-cta-button--primary {
    width: 100%;
    display: flex;
    justify-content: center;
}

.gha-courses-archive .gha-cta-row > .gha-cta-button--primary {
    flex: 1 1 100%;
}

.gha-courses-archive .gha-cta-row > .gha-cta-button--cart {
    margin-left: auto;
}

.gha-courses-archive .gha-cta-row .gha-cta-button--cart {
    width: auto;
    white-space: nowrap;
}

/* "View cart" variant (Tutor in-cart template) wraps CTA in .tutor-course-loop-price */
.gha-courses-archive .gha-cta-row .tutor-course-loop-price {
    width: 100%;
}

/* Tutor price/cart line wrapper: force full width so cart can sit on the far right */
.gha-courses-archive .gha-cta-row > .tutor-d-flex.tutor-justify-between,
.gha-courses-archive .gha-cta-row .tutor-d-flex.tutor-justify-between {
    width: 100%;
}

.gha-courses-archive .gha-cta-row .tutor-d-flex.tutor-justify-between .list-item-button,
.gha-courses-archive .gha-cta-row .tutor-d-flex.tutor-justify-between .tutor-loop-cart-btn-wrap {
    margin-left: auto;
}

/* Prix WooCommerce dans la carte */
.gha-courses-archive .gha-course-card-footer .tutor-course-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--gha-text);
}

/* Booking progress dans la carte */
.gha-courses-archive .gha-course-card-footer .tutor-course-booking-progress {
    font-size: 12px;
    color: var(--gha-text-secondary);
}

/* Enrollment status (coming soon, paused, etc.) */
.gha-courses-archive .gha-course-card-footer .tutor-enrollment-status-wrapper {
    font-size: 12px;
    color: #ef4444;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

/* ==========================================================================
   6. Pagination (override Tutor styles)
   ========================================================================== */
.gha-courses-archive .tutor-pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.gha-courses-archive .tutor-pagination .page-numbers {
    padding: 8px 14px;
    border: 1px solid var(--gha-border);
    border-radius: var(--gha-radius-sm);
    font-size: 14px;
    color: var(--gha-text);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.gha-courses-archive .tutor-pagination .page-numbers:hover {
    border-color: var(--gha-primary);
    color: var(--gha-primary);
}

.gha-courses-archive .tutor-pagination .page-numbers.current {
    background: var(--gha-primary);
    color: #ffffff;
    border-color: var(--gha-primary);
}

/* ==========================================================================
   7. Etat vide (no results)
   ========================================================================== */
.gha-courses-archive .gha-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gha-text-secondary);
}

.gha-courses-archive .gha-empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.gha-courses-archive .gha-empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gha-text);
    margin-bottom: 8px;
}

.gha-courses-archive .gha-empty-state-text {
    font-size: 14px;
}

/* ==========================================================================
   8. Section Headers (titres "Visio & GLEK-PR" / "E-Learnings")
   ========================================================================== */

/* Section headers */
.gha-courses-archive .gha-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.gha-courses-archive .gha-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gha-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gha-courses-archive .gha-section-title svg {
    flex-shrink: 0;
}

.gha-courses-archive .gha-section-toggle {
    font-size: 14px;
    font-weight: 500;
    color: var(--gha-primary);
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
    background: none;
    border: none;
    padding: 0;
}

.gha-courses-archive .gha-section-toggle:hover {
    color: var(--gha-primary-hover);
}

.gha-courses-archive .gha-events-section {
    margin-bottom: 40px;
}

.gha-courses-archive .gha-elearnings-section {
    margin-bottom: 24px;
}

/* Séparateur entre sections */
.gha-courses-archive .gha-section-divider {
    border: none;
    border-top: 1px solid var(--gha-border);
    margin: 0 0 24px 0;
}

/* ==========================================================================
   9. Carousel événements
   ========================================================================== */

/* Carousel événements */
.gha-courses-archive .gha-events-carousel-wrap {
    position: relative;
    overflow: hidden;
}

.gha-courses-archive .gha-events-carousel {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 4px;
}

.gha-courses-archive .gha-events-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.gha-courses-archive .gha-events-carousel .gha-course-card {
    flex: 0 0 calc(25% - 18px);
    scroll-snap-align: start;
    min-width: 240px;
}

/* Fade-out à droite quand il y a plus de 3 cartes */
.gha-courses-archive .gha-events-carousel-wrap.has-overflow::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 4px;
    width: 120px;
    background: linear-gradient(to right, transparent, var(--gha-bg));
    pointer-events: none;
    z-index: 2;
}

/* Grille événements (quand "Voir tout" est activé) */
.gha-courses-archive .gha-events-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.gha-courses-archive .gha-events-grid .gha-course-card {
    min-width: 0;
}

/* ==========================================================================
   10. Badges de type de cours
   ========================================================================== */

/* Badges de type de cours */
.gha-courses-archive .gha-badge-type {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 2;
    line-height: 1.3;
}

.gha-courses-archive .gha-badge-type-elearning {
    background: #dbeafe;
    color: #1e40af;
}

.gha-courses-archive .gha-badge-type-visio {
    background: #fee2e2;
    color: #991b1b;
}

.gha-courses-archive .gha-badge-type-peerreview {
    background: #ede9fe;
    color: #5b21b6;
}

/* ==========================================================================
   11. (Removed - dates now in footer via .gha-footer-date)
   ========================================================================== */

/* ==========================================================================
   12. Responsive - Tablet (max-width: 992px)
   ========================================================================== */
@media (max-width: 992px) {
    .gha-courses-archive .gha-courses-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .gha-courses-archive .gha-events-carousel .gha-course-card {
        flex: 0 0 calc(33.333% - 16px);
    }

    .gha-courses-archive .gha-events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* ==========================================================================
   13. Responsive - Mobile (max-width: 600px)
   ========================================================================== */
@media (max-width: 600px) {
    /* Réduire l'écart header → filtres sur mobile */
    .gha-courses-archive .gha-archive-wrap {
        padding-top: 8px !important;
        margin-top: 0 !important;
    }

    .gha-courses-archive .tutor-wrap,
    .gha-courses-archive .tutor-container,
    .gha-courses-archive .tutor-wrap-parent {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .gha-courses-archive .gha-filters-bar {
        margin-top: 16px;
        margin-bottom: 12px;
    }

    .gha-courses-archive .gha-courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gha-courses-archive .gha-filters-bar-inner {
        flex-direction: column;
    }

    .gha-courses-archive .gha-filter-search {
        min-width: 100%;
    }

    .gha-courses-archive .gha-filter-dropdowns {
        width: 100%;
    }

    .gha-courses-archive .gha-filter-dropdown {
        flex: 1;
    }

    .gha-courses-archive .gha-filter-btn {
        width: 100%;
        justify-content: space-between;
    }

    .gha-courses-archive .gha-filter-panel {
        position: absolute;
        top: calc(100% + 4px);
        bottom: auto;
        left: 0;
        right: auto;
        min-width: 220px;
        max-height: 50vh;
        overflow-y: auto;
        z-index: 100;
    }

    .gha-courses-archive .gha-sort-bar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    /* --- Cartes compactes mobile (portrait A3) --- */

    .gha-courses-archive .gha-course-card {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    .gha-courses-archive .gha-course-card-thumbnail {
        height: 220px;
    }

    .gha-courses-archive .gha-course-card-thumbnail img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Mobile: garder l'espace entre badge type (gauche) et badge PQK (droite). */
    .gha-courses-archive .gha-badge-type {
        max-width: calc(100% - 94px);
        font-size: 10px;
        padding: 3px 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .gha-courses-archive .gha-badge-pqk-overlay {
        font-size: 10px;
        padding: 3px 8px;
    }

    .gha-courses-archive .gha-badge-pqk-overlay .gha-pqk-label-full {
        display: none;
    }

    .gha-courses-archive .gha-badge-pqk-overlay .gha-pqk-label-short {
        display: inline;
    }

    /* Titre overlay compact mobile */
    .gha-courses-archive .gha-course-card-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .gha-courses-archive .gha-card-overlay-content {
        padding: 10px;
    }

    .gha-courses-archive .gha-card-overlay-author {
        font-size: 10px;
    }

    .gha-courses-archive .gha-card-overlay-author img,
    .gha-courses-archive .gha-card-overlay-author .tutor-avatar {
        width: 14px;
        height: 14px;
    }

    /* Footer compact visible */
    .gha-courses-archive .gha-course-card-footer {
        padding: 8px 10px;
        min-height: auto;
        gap: 2px;
    }

    /* Mobile: remove image/footer seam on e-learning cards. */
    .gha-courses-archive .gha-course-card:not(.gha-course-card--event) .gha-course-card-footer {
        border-top: none;
    }

    .gha-courses-archive .gha-footer-rating {
        gap: 4px;
    }

    .gha-courses-archive .gha-stars {
        font-size: 12px;
    }

    .gha-courses-archive .gha-rating-value {
        font-size: 12px;
    }

    .gha-courses-archive .gha-rating-count {
        display: none;
    }

    .gha-courses-archive .gha-footer-duration {
        font-size: 11px;
    }

    .gha-courses-archive .gha-footer-date--event {
        padding: 6px 8px;
    }

    .gha-courses-archive .gha-footer-date-top {
        font-size: 9px;
    }

    .gha-courses-archive .gha-footer-date-line {
        gap: 6px;
    }

    .gha-courses-archive .gha-footer-date-bullet {
        width: 7px;
        height: 7px;
    }

    .gha-courses-archive .gha-footer-date-value {
        font-size: 11px;
    }

    .gha-courses-archive .gha-footer-duration-pill {
        font-size: 10px;
        padding: 2px 6px;
        margin-left: 0;
    }

    .gha-courses-archive .gha-footer-cta-row {
        padding-top: 6px;
        gap: 6px;
    }

    .gha-courses-archive .gha-cta-row .gha-cta--primary,
    .gha-courses-archive .gha-cta-row > .gha-cta-button--primary {
        width: 100%;
        flex: 1 1 100%;
    }

    .gha-courses-archive .gha-cta-row .gha-cta--primary .gha-cta-button--primary,
    .gha-courses-archive .gha-cta-row > .gha-cta-button--primary {
        width: 100%;
        justify-content: center;
    }

    .gha-courses-archive .gha-cta-row .gha-cta--price {
        margin-right: auto;
    }

    .gha-courses-archive .gha-cta-row .gha-cta--cart,
    .gha-courses-archive .gha-cta-row > .gha-cta-button--cart {
        margin-left: auto;
        justify-content: flex-end;
    }

    /* Mobile: variantes panier compactes (add="+", view="Voir") */
    .gha-courses-archive .gha-cta-row .gha-cta-button--cart .cart-text {
        display: none;
    }

    .gha-courses-archive .gha-cta-row .gha-cta-button--cart {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 6px 8px;
    }

    .gha-courses-archive .gha-cta-row .gha-cta-button--cart .tutor-icon-cart-line {
        margin-right: 0 !important;
        line-height: 1;
    }

    .gha-courses-archive .gha-cta-row .gha-cta-button--add::after {
        content: '+';
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
    }

    .gha-courses-archive .gha-cta-row .gha-cta-button--view::after {
        content: 'Voir';
        font-size: 11px;
        font-weight: 600;
        line-height: 1;
    }

    /* --- Événements : carousel compact, garde le swipe --- */

    .gha-courses-archive .gha-events-carousel .gha-course-card {
        flex: 0 0 calc(80%);
    }

    .gha-courses-archive .gha-events-carousel {
        gap: 12px;
    }

    .gha-courses-archive .gha-events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gha-courses-archive .gha-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .gha-courses-archive .gha-section-toggle {
        display: none;
    }

    /* Mobile: raccourcir le fade uniquement quand il y a un vrai overflow. */
    .gha-courses-archive .gha-events-carousel-wrap.has-overflow::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 4px;
        width: 64px;
        background: linear-gradient(to right, rgba(247, 249, 250, 0) 0%, var(--gha-bg) 100%);
        pointer-events: none;
        z-index: 2;
    }

    /* Désactiver les animations scroll-reveal sur mobile — affichage immédiat */
    .gha-courses-archive .gha-ar-reveal,
    .gha-courses-archive .gha-ar-reveal .gha-course-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   14. Overlay mobile (backdrop for filter panels)
   ========================================================================== */
.gha-courses-archive .gha-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
}

.gha-courses-archive .gha-filter-overlay.active {
    display: block;
}

/* ==========================================================================
   15. Scroll Reveal & Stagger Animations
   Piloté par gha-archive-animations.js (IntersectionObserver).
   Les classes .gha-ar-reveal sont ajoutées en PHP dans archive-course-init.php.
   Fallback no-JS : sans le JS, .gha-ar-visible n'est jamais ajouté,
   mais les éléments restent visibles car le JS ajoute aussi .gha-ar-reveal.
   ========================================================================== */

/* --- Sections : fade-in + slide-up au scroll --- */
.gha-courses-archive .gha-ar-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gha-courses-archive .gha-ar-reveal.gha-ar-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Cartes enfants : stagger via transitionDelay (assigné par JS) --- */
.gha-courses-archive .gha-ar-reveal .gha-course-card {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gha-courses-archive .gha-ar-reveal.gha-ar-visible .gha-course-card {
    opacity: 1;
    transform: translateY(0);
}

/* --- Fallback no-JS : tout visible --- */
.no-js .gha-courses-archive .gha-ar-reveal,
.no-js .gha-courses-archive .gha-ar-reveal .gha-course-card {
    opacity: 1;
    transform: none;
    transition: none;
}

/* --- Accessibilité : respect prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
    .gha-courses-archive .gha-ar-reveal,
    .gha-courses-archive .gha-ar-reveal .gha-course-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   16. Hover cartes amélioré
   Plus marqué que le défaut : -4px au lieu de -2px, shadow renforcée,
   image scale 1.06 au lieu de 1.03.
   ========================================================================== */

.gha-courses-archive .gha-course-card {
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.25s ease,
                opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gha-courses-archive .gha-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.10), 0 4px 8px -2px rgba(0, 0, 0, 0.05);
    border-color: rgba(30, 64, 175, 0.12);
}

.gha-courses-archive .gha-course-card-thumbnail img {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gha-courses-archive .gha-course-card:hover .gha-course-card-thumbnail img {
    transform: scale(1.06);
}

.gha-courses-archive .gha-card-overlay-content {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gha-courses-archive .gha-course-card:hover .gha-card-overlay-content {
    transform: translateY(-4px);
}

/* --- Mobile : animations plus rapides, pas de stagger visible --- */
@media (max-width: 600px) {
    .gha-courses-archive .gha-ar-reveal {
        transform: translateY(16px);
        transition-duration: 0.4s;
    }

    .gha-courses-archive .gha-ar-reveal .gha-course-card {
        transform: translateY(10px);
        transition-duration: 0.35s;
    }
}
