/* =========================================================
   🎨 directory.css — Styles globaux pour Les Plates-Formes
   ========================================================= */

/* =========================================================
   🎨 VARIABLES GLOBALES (Design Tokens)
   ========================================================= */
:root {
    /* Couleurs principales */
    --color-primary: #278FE2;          /* Bleu principal utilisé pour titres/links */
    --color-primary-dark: #1e3d7b;     /* Bleu foncé au survol */
    --color-dark-blue: #092851;        /* Bleu foncé pour boutons non-actifs */
    --color-orange: #f28c00;           /* Orange accent / département */
    --color-accent: #f57c00;           /* autre orange (breadcrumbs) */

    /* Textes et fonds */
    --color-text-dark: #333;
    --color-text-medium: #444;
    --color-text-light: #999;
    --color-background-light: #e0e0e0;
    --color-background-off-white: #f1f1f1;
    --color-row-even: #ffffff;
    --color-row-odd: #eeeeee;
    --color-row-hover: #d7dff2;

    /* Espacement */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;

    /* Rayons */
    --radius-sm: 5px;
    --radius-lg: 25px;

    /* Typographie */
    --font-family: 'Raleway', sans-serif;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 1.8rem;
}

.plateforme-layout {
    display: flex;
    flex-direction: column;
    width: min(90%, 1600px);
    box-sizing: border-box;
    margin: 40px auto;
    padding: 0 var(--spacing-lg);
    box-sizing: border-box;
    background-color: #fff;
}

.content-align-logo {
    margin-top: var(--spacing-xl);
}

/* ===== FILTRE ===== */
.filter-dropdown-container {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.filter-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    border-top: none;
    left: 0;
    top: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-menu.show {
    display: block;
}
.menu-item {
    padding: 8px 15px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.menu-item:hover {
    color: orange;
    background-color: rgba(255, 165, 0, 0.1); /* Très léger voile orange au fond */
}

.menu-item.reset {
    color: #333;
}

.menu-item.reset:hover {
    color: orange;
    background-color: rgba(255, 165, 0, 0.1); /* Très léger voile orange au fond */
}

.filter-btn {
    border: none;
    padding: 6px 14px;
    font-size: 18px;
    cursor: pointer;
    color: white;
    background-color: var(--color-dark-blue);
    transition: all 0.16s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px; /* Évite que le bouton saute en changeant de taille */
    justify-content: space-between;
    text-transform: uppercase;
}

.filter-btn.active {
    background-color: var(--color-orange);
    color: white;
}

.filter-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.filter-icon {
    width: 25px;
    height: 25px;
    vertical-align: middle;
    filter: brightness(1.3) contrast(1.2);
}

/* ===== GRID ===== */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
}

/* ===== CARD ===== */
.platform-card {
    position: relative;       /* pour positionner le thème */
    height: 400px;
    width: 300px;
    background: #F8F6F2;
    border-bottom-right-radius: 25px;
    overflow: hidden;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;  /* image au-dessus du texte */
}

.platform-card:hover {
    transform: translateY(-5px);
}

.admin-edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 165, 0, 0.9); /* Orange CRAN */
    color: white !important;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.admin-edit-btn:hover {
    transform: scale(1.1);
    background: #e69500;
}

.platform-image {
    width: 100%;
    height: 200px;           /* hauteur de l’image */
    object-fit: cover;
}

.platform-category {
    position: absolute;      /* superposé */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #278EE1;     /* bleu */
    color: white;
    padding: 10px 20px 10px 15px;
    font-weight: 500;
    text-align: left;
    z-index: 2;              /* au-dessus de l’image et du texte */
    width: 100%;
    box-sizing: border-box;
}

.platform-content {
    padding: 40px 0 0 15px;
    z-index: 1;              /* texte en dessous du thème superposé */
    color: #707070;
}

.platform-content h3 {
    text-transform: none;
}
.platform-content p {
    text-align: left;
    padding-top: 10px;
    font-size: 14px;
}
.platform-more {
    display: inline-block;
    margin-top: 15px;
    color: #278EE1;
    font-weight: bold;
}

.platform-content h3 {
    color: #278EE1;
    font-weight: 800;
}

@media (max-width: 768px) {
    .plateforme-layout {
        padding: 5px ;
    }
    /* 1. On centre le conteneur principal et on réduit sa largeur */
    .platform-grid {
        width: 95% !important;
        margin-left: auto !important;
        margin-right: auto !important;

        /* On s'assure que les cartes s'empilent proprement */
        display: flex !important;
        flex-direction: column !important;
        gap: 20px; /* Espace vertical entre les cartes */
    }

    /* 2. On force les cartes à prendre toute la largeur du conteneur (les 95%) */
    .platform-card {
        position: relative; /* Indispensable pour l'absolute du badge */
        display: flex;
        flex-direction: column;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box; /* Évite que le padding ne fasse déborder la carte */
    }

    .platform-category {
        position: absolute;

        /* On le place à 50% du haut et 50% de la gauche */
        left: 50%;

        /* Le "Magic Trick" pour compenser la propre taille du badge */
        transform: translate(-50%, -50%);

        /* Design du badge */
        width: auto;
        padding: 8px 15px;
        text-align: center;
        white-space: nowrap; /* Évite que le texte ne revienne à la ligne */
        z-index: 5;

        /* Force le centrage du texte à l'intérieur du badge lui-même */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 3. Ajustement de l'image pour qu'elle ne soit pas déformée */
    .platform-image {
        width: 100% !important;
        height: 200px !important; /* Force une hauteur fixe pour stabiliser le badge */
        object-fit: cover;
        display: block;
    }
}