/**
 * WPLudo Games Preview Shortcode Styles
 * Apercu des jeux du catalogue (homepage)
 *
 * Shortcode : [ludo_games_preview]
 *
 * @package WPLudo
 */

/* ==========================================================================
   Container
   ========================================================================== */

.ludo-games-preview {
    padding: clamp(16px, 2.5vw, 30px) 0 !important;
}

/* ==========================================================================
   Grille de jeux
   ========================================================================== */

.ludo-games-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: clamp(12px, 1.8vw, 24px) !important;
    margin-bottom: clamp(20px, 3vw, 40px) !important;
}

.ludo-games-preview[data-columns="3"] .ludo-games-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

.ludo-games-preview[data-columns="6"] .ludo-games-grid {
    grid-template-columns: repeat(6, 1fr) !important;
}

/* ==========================================================================
   Carte jeu
   ========================================================================== */

.ludo-game-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: clamp(14px, 1.4vw, 20px) !important;
    overflow: hidden !important;
    transition: all 0.4s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
}

.ludo-game-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* ==========================================================================
   Zone image (fond colore par categorie)
   ========================================================================== */

.ludo-game-image {
    position: relative !important;
    padding: clamp(12px, 1.6vw, 20px) !important;
    min-height: clamp(140px, 16vw, 180px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.ludo-game-image picture {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.ludo-game-image img {
    max-width: 100% !important;
    max-height: clamp(100px, 11vw, 140px) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    transition: transform 0.4s ease !important;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1)) !important;
    border-radius: 12px !important;
}

.ludo-game-card:hover .ludo-game-image img {
    transform: scale(1.08) !important;
}

/* ==========================================================================
   Badges (Nouveau / Populaire)
   ========================================================================== */

.ludo-game-badge {
    position: absolute !important;
    top: clamp(8px, 1vw, 12px) !important;
    left: clamp(8px, 1vw, 12px) !important;
    padding: clamp(4px, 0.5vw, 6px) clamp(8px, 1vw, 12px) !important;
    border-radius: 20px !important;
    font-size: clamp(9px, calc(8px + 0.2vw), 11px) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    z-index: 2 !important;
}

.ludo-badge-new {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.ludo-badge-popular {
    background: linear-gradient(135deg, var(--global-palette1, #E36C1D) 0%, #D4590A 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(227, 108, 29, 0.3) !important;
}

/* ==========================================================================
   Informations jeu
   ========================================================================== */

.ludo-game-info {
    padding: clamp(12px, 1.5vw, 18px) clamp(14px, 1.7vw, 20px) clamp(14px, 1.8vw, 20px) !important;
}

.ludo-game-code {
    display: block !important;
    font-size: clamp(9px, calc(8px + 0.2vw), 11px) !important;
    font-weight: 500 !important;
    color: var(--global-palette1, #E36C1D) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
    opacity: 0.85 !important;
}

.ludo-game-title {
    font-size: clamp(13px, calc(12px + 0.2vw), 15px) !important;
    font-weight: 500 !important;
    color: #1A1A2E !important;
    margin: 0 0 10px !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* ==========================================================================
   Meta-infos (joueurs, public cible)
   ========================================================================== */

.ludo-game-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: clamp(8px, 1vw, 12px) !important;
    align-items: center !important;
}

.ludo-game-players,
.ludo-game-age,
.ludo-game-target {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: clamp(11px, calc(10px + 0.2vw), 13px) !important;
    color: var(--global-palette6, #6B7280) !important;
}

.ludo-game-players svg,
.ludo-game-age svg,
.ludo-game-target svg {
    color: var(--global-palette1, #E36C1D) !important;
    opacity: 0.8 !important;
}

/* ==========================================================================
   CTA "Explorer le catalogue"
   ========================================================================== */

.ludo-games-cta {
    text-align: center !important;
    margin-top: clamp(14px, 1.8vw, 20px) !important;
}

.ludo-btn-catalog {
    display: inline-block !important;
    background: var(--global-palette1, #E36C1D) !important;
    color: #ffffff !important;
    padding: clamp(12px, 1.4vw, 16px) clamp(24px, 3vw, 36px) !important;
    border-radius: 50px !important;
    font-size: clamp(13px, calc(12px + 0.2vw), 15px) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 8px 25px rgba(227, 108, 29, 0.25) !important;
}

.ludo-btn-catalog:hover {
    background: var(--global-palette2, #F5820A) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 35px rgba(227, 108, 29, 0.35) !important;
}

/* ==========================================================================
   Responsive : Tablette (la grille reste en media query — clamp ne marche pas pour grid-template-columns)
   ========================================================================== */

@media (max-width: 980px) {
    .ludo-games-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .ludo-games-preview[data-columns="6"] .ludo-games-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ==========================================================================
   Responsive : Mobile
   ========================================================================== */

@media (max-width: 767px) {
    .ludo-games-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .ludo-games-preview[data-columns="3"] .ludo-games-grid,
    .ludo-games-preview[data-columns="6"] .ludo-games-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
