/* =========================================================
   G2SI — ÉTAPE 2
   Modernisation des cartes et des boutons de la page d'accueil
   À charger APRÈS Bootstrap et après style.css
   ========================================================= */

/* ---------- Titre de la zone des centres ---------- */
.section1 > .space-medium h3 {
    margin-bottom: 14px;
    color: #292d39;
    font-size: clamp(1.8rem, 2.5vw, 2.45rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section1 > .space-medium h3::after {
    content: "";
    display: block;
    width: 54px;
    height: 4px;
    margin: 16px auto 0;
    border-radius: 999px;
    background: #393467;
}

/* Neutralise l'ancien trait-image sous ce titre */
.section1 > .space-medium h3::after {
    background-image: none !important;
}

/* ---------- Fond de la zone des cartes ---------- */
.pres-centre {
    align-items: stretch;
    padding: 10px 3% 70px;
    background:
        linear-gradient(180deg, #ffffff 0%, #ffffff 19%, #f4f6f9 19%, #f4f6f9 100%);
}

.pres-centre > [class*="col-"] {
    display: flex;
    margin-bottom: 28px;
}

/* ---------- Cartes des centres ---------- */
.container1 {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 390px;
    min-height: 500px;
    margin: 0 auto !important;
    padding: 30px 26px 28px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e8ebf0 !important;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(24, 31, 46, 0.08);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

/* Liseré de marque discret en haut de chaque carte */
.container1::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--centre-color, #393467);
}

#quiris-block { --centre-color: #ec660a; }
#tamia-block { --centre-color: #be216c; }
#idl-block { --centre-color: #c52018; }
#chloro-block { --centre-color: #93c022; }

.container1:hover {
    transform: translateY(-7px);
    border-color: rgba(57, 52, 103, 0.16) !important;
    box-shadow: 0 18px 42px rgba(24, 31, 46, 0.14);
}

.container1 .logo-orga {
    width: auto;
    max-width: 135px;
    height: 72px;
    margin: 4px auto 20px;
    padding: 0;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.container1:hover .logo-orga {
    transform: scale(1.035);
}

.container1 p {
    margin-bottom: 18px;
    color: #555b67;
    font-size: 1.02rem !important;
    line-height: 1.65;
}

/* Icône de localisation */
.container1 .fa-map-marker-alt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--centre-color, #393467) !important;
    background: color-mix(in srgb, var(--centre-color, #393467) 11%, white);
    border-radius: 50%;
    font-size: 1.25rem;
}

/* ---------- Liens/villes transformés en boutons légers ---------- */
.villes {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 100%;
    margin: 0 0 18px;
    padding: 0;
}

.villes li {
    margin: 0;
}

.villes li a {
    position: relative;
    display: block;
    padding: 10px 38px 10px 15px;
    color: #343843 !important;
    background: #f6f7f9;
    border: 1px solid #eceef2;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none !important;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.villes li a::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: 14px;
    color: var(--centre-color, #393467);
    font-size: 1rem;
    transform: translateY(-52%);
    transition: transform 0.2s ease;
}

.villes li a:hover {
    color: var(--centre-color, #393467) !important;
    background: #ffffff;
    border-color: var(--centre-color, #393467);
    transform: translateX(3px);
}

.villes li a:hover::after {
    transform: translate(3px, -52%);
}

/* Lien Titres Pro de Chlorophylle */
#chloro-block > a:not(:first-child) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-height: 44px;
    margin-top: auto;
    padding: 10px 18px;
    color: #ffffff;
    background: #7ca51c;
    border-radius: 11px;
    box-shadow: 0 7px 16px rgba(124, 165, 28, 0.2);
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#chloro-block > a:not(:first-child):hover {
    color: #ffffff;
    background: #6e9417;
    box-shadow: 0 10px 22px rgba(124, 165, 28, 0.28);
    transform: translateY(-2px);
}

.container1 .tiny-font {
    display: block;
    margin-top: 10px;
    color: #777d87;
    font-size: 0.84rem !important;
}

/* ---------- Boutons des domaines de formation ---------- */
.formations ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin: 26px 0 0;
    padding: 0;
}

.formations ul:nth-last-of-type(1) {
    margin-top: 14px;
}

.formations ul li {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    line-height: normal;
    white-space: normal;
}

.formations ul li a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    padding: 12px 18px;
    color: #393467;
    background: #ffffff;
    border: 1px solid #e1e4ea;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(24, 31, 46, 0.06);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.25;
    text-decoration: none !important;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.formations ul li a:hover {
    transform: translateY(-3px);
    border-color: currentColor;
    box-shadow: 0 10px 24px rgba(24, 31, 46, 0.12);
}

/* ---------- Bloc certifications ---------- */
.certifs {
    margin-top: 65px;
    padding: 32px 36px;
    background: #f7f8fa;
    border: 1px solid #e9ebef;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(24, 31, 46, 0.05);
}

.certifs h4 {
    color: #303440;
    font-size: 1.25rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .pres-centre {
        padding-right: 15px;
        padding-left: 15px;
        background: #f4f6f9;
    }

    .container1 {
        max-width: 520px !important;
        min-height: 0;
    }
}

@media (max-width: 767px) {
    .formations ul {
        gap: 10px;
    }

    .formations ul li {
        width: 100%;
    }

    .formations ul li a {
        justify-content: flex-start;
        width: 100%;
        min-height: 48px;
    }

    .container1 {
        padding: 27px 20px 24px;
        border-radius: 15px;
    }

    .certifs {
        padding: 25px 20px;
        border-radius: 15px;
    }
}

/* Compatibilité navigateurs ne prenant pas encore en charge color-mix */
@supports not (background: color-mix(in srgb, red 10%, white)) {
    .container1 .fa-map-marker-alt {
        background: #f3f3f6;
    }
}
