:root {
    --onisep-image-width: 20%;
    --onisep-image-min-width: 60px; /* taille minimale absolue */
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}
body {
    background: #f4f9ff;
    color: #1e2a3e;
    padding: 1rem;
}
.container {
    max-width: 1400px;
    margin: 0 auto;
}
h1 {
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
h1 i {
    color: #2c7da0;
    font-size: 1.8rem;
}
.badge {
    font-size: 0.8rem;
    background: #e2eef9;
    padding: 0.2rem 0.8rem;
    border-radius: 60px;
    font-weight: normal;
}
.sub {
    color: #2c3e66;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2c7da0;
    padding-left: 1rem;
    font-weight: 500;
    font-size: 0.95rem;
}
.series-glossary {
    background: white;
    border-radius: 24px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1f5068;
}
.section-title i {
    font-size: 1.2rem;
}
.series-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}
.serie-card {
    background: #fefefe;
    border-radius: 18px;
    border-left: 6px solid;
    padding: 0.8rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e9f0f5;
}
.serie-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.serie-card p {
    color: #2c3e50;
    line-height: 1.4;
    font-size: 0.85rem;
}
.card-stmg { border-left-color: #1b8c5e; }
.card-st2s { border-left-color: #2c7da0; }
.card-sti2d { border-left-color: #e76f51; }
.card-stl { border-left-color: #f4a261; }
.card-std2a { border-left-color: #9c89b8; }
.card-sthr { border-left-color: #e9c46a; }
.card-stav { border-left-color: #6c9e6f; }
.selector-panel {
    background: white;
    border-radius: 24px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 15px;
}
.select-group {
    width: 100%;
}
.select-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1f5068;
    font-size: 0.9rem;
}
select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border-radius: 40px;
    border: 1px solid #cbdde9;
    background: white;
    font-weight: 500;
    cursor: pointer;
}
select:focus {
    outline: none;
    border-color: #2c7da0;
    box-shadow: 0 0 0 3px rgba(44,125,160,0.2);
}
.info-badge {
    background: #eef2fa;
    border-radius: 60px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    width: fit-content;
}
.btn-all {
    background: #2c7da0;
    color: white;
    border: none;
    border-radius: 60px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
.btn-all:hover {
    background: #1f5e7a;
    transform: scale(0.98);
}
.results-section {
    background: white;
    border-radius: 24px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
}
.etab-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}
.etab-card {
    background: #f9fdfe;
    border-radius: 18px;
    padding: 0.8rem 1rem;
    border: 1px solid #dfecf2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.etab-info {
    flex: 1;
}
.etab-name {
    font-weight: 800;
    font-size: 1rem;
    color: #0b3b4f;
    margin-bottom: 5px;
}
.etab-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.75rem;
    color: #3e5a6b;
    margin-bottom: 8px;
}
.etab-details i {
    width: 18px;
    color: #2c7da0;
}
.etab-series {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}
.serie-badge {
    display: inline-block;
    background: #e9f0f5;
    border-radius: 30px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1e4663;
}
.serie-badge.stmg { background: #d4f0e3; color: #1b6e4a; }
.serie-badge.st2s { background: #d4e8f0; color: #2c6a8c; }
.serie-badge.sti2d { background: #ffe0d4; color: #c45c3a; }
.serie-badge.stl { background: #fef0dc; color: #c97e2a; }
.serie-badge.sthr { background: #fdf0cf; color: #c28f2e; }
.serie-badge.stav { background: #e2f0e2; color: #4b7a4b; }
.serie-badge.stdd2a { background: #ede3f5; color: #6a4c8c; }
.etab-contact {
    font-size: 0.75rem;
    border-top: 1px solid #e2edf3;
    padding-top: 8px;
    margin-top: 4px;
}
.etab-contact div {
    margin-bottom: 4px;
}
.etab-contact i {
    width: 22px;
    color: #2c7da0;
}
.empty-message {
    text-align: center;
    padding: 2rem;
    background: #f1f9fe;
    border-radius: 20px;
    color: #5f7f9a;
    font-size: 0.9rem;
}
.map-container {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border: 1px solid #cde3ed;
}
#map {
    height: 350px;
    width: 100%;
    background: #d9e3e8;
}
footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.7rem;
    color: #6c86a3;
}

/* ========== MEDIA QUERIES pour tablette et desktop ========== */
@media (min-width: 768px) {
    body {
        padding: 1.5rem;
    }
    h1 {
        font-size: 2rem;
    }
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    .selector-panel {
        flex-direction: row;
        align-items: flex-end;
    }
    .select-group {
        flex: 2;
        min-width: 220px;
    }
    .info-badge {
        width: auto;
    }
    .btn-all {
        width: auto;
    }
    .etab-card {
        flex-direction: row;
        align-items: flex-start;
    }
    .etab-contact {
        border-top: none;
        padding-top: 0;
        text-align: right;
        flex: 1;
    }
    #map {
        height: 460px;
    }
}

/* Pour les très petits écrans (moins de 480px) */
@media (max-width: 480px) {
    .etab-details {
        flex-direction: column;
        gap: 4px;
    }
    .serie-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    .etab-name {
        font-size: 0.95rem;
    }
    #map {
        height: 280px;
    }
}

/* Effet de survol sur les vignettes des séries */
.serie-card {
    transition: all 0.2s ease;
}
.serie-card:hover {
    cursor: pointer;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    background: #ffffff;
}

.btn-all {
    background: #2c7da0;
    color: white;
    border: none;
    border-radius: 60px;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.btn-all:hover {
    background: #e76f51;      /* couleur chaude au survol */
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

select:hover {
    border-color: #2c7da0;
    background-color: #f9fdfe;
}

.serie-card {
    transition: all 0.2s ease;
    cursor: pointer;
}
.serie-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    background: #ffffff;
}
/* Effet de coloration au survol des cartes d'établissements */
.etab-card {
    transition: all 0.2s ease;
}
.etab-card:hover {
    background-color: #b5dfff;   /* couleur de fond légèrement bleutée */
    cursor: pointer;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.serie-badge {
    transition: all 0.15s ease;
}
.serie-badge:hover {
    transform: scale(1.05);
    background-color: #cde3ef;
}
/* Personnalisation de la scrollbar pour la liste des établissements */
.etab-list::-webkit-scrollbar {
    width: 10px;
}
.etab-list::-webkit-scrollbar-track {
    background: #eef2fa;
    border-radius: 10px;
}
.etab-list::-webkit-scrollbar-thumb {
    background: #e76f51;  /* orange */
    border-radius: 10px;
}
.etab-list::-webkit-scrollbar-thumb:hover {
    background: #c45c3a;
}

/* Augmenter la hauteur de la liste (pour afficher 5 établissements) */
.etab-list {
    max-height: 500px; /* au lieu de 400px */
}
/* Ajout d'un filet coloré autour des badges de séries */
.serie-badge {
    border: 1px solid;
}

/* Couleurs de bordure cohérentes avec chaque série */
.serie-badge.stmg {
    border-color: #1b6e4a;
}
.serie-badge.st2s {
    border-color: #2c6a8c;
}
.serie-badge.sti2d {
    border-color: #c45c3a;
}
.serie-badge.stl {
    border-color: #c97e2a;
}
.serie-badge.sthr {
    border-color: #c28f2e;
}
.serie-badge.stav {
    border-color: #4b7a4b;
}
.serie-badge.stdd2a {
    border-color: #6a4c8c;
}
/* Badges des séries - filet élargi et couleurs renforcées */
.serie-badge {
    border: 2px solid;  /* filet plus épais */
    border-radius: 30px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

/* Couleurs de bordure spécifiques par série */
.serie-badge.stmg {
    background: #d4f0e3;
    color: #1b6e4a;
    border-color: #1b6e4a;
}
.serie-badge.st2s {
    background: #d4e8f0;
    color: #2c6a8c;
    border-color: #2c6a8c;
}
.serie-badge.sti2d {
    background: #ffe0d4;
    color: #c45c3a;
    border-color: #c45c3a;
}
.serie-badge.stl {
    background: #fef0dc;
    color: #c97e2a;
    border-color: #c97e2a;
}
.serie-badge.sthr {
    background: #fdf0cf;
    color: #c28f2e;
    border-color: #c28f2e;
}
.serie-badge.stav {
    background: #e2f0e2;
    color: #4b7a4b;
    border-color: #4b7a4b;
}
.serie-badge.stdd2a {
    background: #ede3f5;
    color: #6a4c8c;
    border-color: #6a4c8c;
}
/* Bordure complète autour des cartes de série, avec la couleur de la série */
.serie-card {
    border: 1px solid;
    border-left-width: 6px;
    transition: all 0.2s ease;
}

.card-stmg {
    border-color: #1b8c5e;
}
.card-st2s {
    border-color: #2c7da0;
}
.card-sti2d {
    border-color: #e76f51;
}
.card-stl {
    border-color: #f4a261;
}
.card-std2a {
    border-color: #9c89b8;
}
.card-sthr {
    border-color: #e9c46a;
}
.card-stav {
    border-color: #6c9e6f;
}
.card-s2tmd {
    border-left-color: #d45d9e;
    border-color: #d45d9e;
}
.serie-badge.s2tmd {
    background: #f5e0ed;
    color: #b83a7a;
    border-color: #b83a7a;
}
/* Bloc d'introduction élégant */
.intro-card {
    background: white;
    border-radius: 28px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    border-left: 6px solid #2c7da0;
    transition: all 0.2s ease;
}
.intro-icon {
    font-size: 2.5rem;
    color: #2c7da0;
    flex-shrink: 0;
}
.intro-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1e2a3e;
}
@media (max-width: 768px) {
    :root {
        --onisep-image-width: 80px;  /* valeur fixe en px pour bien voir */
        --onisep-image-min-width: 80px;
    }
    .intro-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.2rem;
        gap: 0.8rem;
    }
    .intro-icon {
        font-size: 2rem;
    }
    .intro-text {
        font-size: 0.9rem;
    }
}
/* Effet au survol de l'image ONISEP */
.onisep-link img {
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.2s ease;
    border-radius: 12px; /* déjà présent, mais on s'assure */
}

.onisep-link img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    filter: brightness(1.05);
    cursor: pointer;
}
/* Structure de la carte */
.serie-card {
    display: flex;
    flex-direction: column;
    height: 100%; /* pour homogénéité */
}

.serie-description {
    flex: 1;
    margin: 0.5rem 0 1rem 0;
}

.serie-footer {
    margin-top: auto;
    border-top: 1px solid #e9f0f5;
    padding-top: 0.8rem;
}

/* Lien ONISEP : image + texte sur la même ligne */
.onisep-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: #2c7da0;
    font-weight: 500;
    transition: all 0.2s ease;
}

.serie-image {
    width: var(--onisep-image-width);
    min-width: var(--onisep-image-min-width);
    height: auto;                /* conservation des proportions */
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.onisep-text {
    font-size: 0.85rem;
}

/* Effet au survol du lien complet */
.onisep-link:hover .serie-image {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.onisep-link:hover .onisep-text {
    text-decoration: underline;
    color: #e76f51;
}
@media (max-width: 480px) {
    .serie-image {
        width: 30px;
        height: auto;
    }
    :root {
        --onisep-image-width: 70px;
        --onisep-image-min-width: 70px;
    }
    /* Optionnel : passer le lien en colonne pour éviter le rétrécissement */
    .onisep-link {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}


