/**
 * Styles du template taxonomy-chj_residence.php
 * Namespace BEM : .chj-residence__*
 * Couleur de marque : #E22E86
 */

/* -----------------------------------------------
   1. Container commun
   ----------------------------------------------- */
.chj-residence__section {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px 30px;
}

/* -----------------------------------------------
   2. Hero (60 / 40 flexbox)
   ----------------------------------------------- */
.chj-residence__hero {
    display: flex;
    gap: 30px;
    padding-top: 30px;
    padding-bottom: 40px;
}

.chj-residence__hero-media {
    flex: 0 0 60%;
    min-width: 0;
}

.chj-residence__hero-img {
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
    max-height: 25vw;
    margin: auto;
}

.chj-residence__hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chj-residence__hero-logo {
    margin-bottom: 20px;
}

.chj-residence__logo-img {
    max-width: 200px;
    height: auto;
}

.chj-residence__hero-desc {
    font-size: 16px;
    line-height: 1.7;
    color: #555;
}

/* -----------------------------------------------
   3. Features — Avantages / Services (50/50)
   ----------------------------------------------- */
.chj-residence__features {
    display: flex;
    gap: 30px;
    padding-top: 10px;
    padding-bottom: 40px;
}

.chj-residence__features-col {
    flex: 1;
    min-width: 0;
}

.chj-residence__features-col h3 {
    color: #E22E86;
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* -----------------------------------------------
   4. Listes (avantages + services)
   ----------------------------------------------- */
.chj-residence__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chj-residence__list li {
    display: flex;
    align-items: start;
    gap: 10px;
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 16px;
    color: #444;
}

.chj-residence__list li i {
    width: 20px;
    color: #E22E86;
    flex-shrink: 0;
    text-align: center;
    margin-top: 3px;
}

/* -----------------------------------------------
   5. Logements
   ----------------------------------------------- */
.chj-residence__logements {
    padding-bottom: 100px;
}

.chj-residence__logements h2 {
    color: #E22E86;
    font-size: 28px;
    margin: 30px 0;
    font-weight: 600;
}

/* -----------------------------------------------
   6. Actualités
   ----------------------------------------------- */
.chj-residence__actualites {
    padding-top: 20px;
}

/* -----------------------------------------------
   7. CAF (bandeau vert pleine largeur)
   ----------------------------------------------- */
.chj-residence__caf {
    position: relative;
    background-image: url("../../../../uploads/2020/06/back_nos-missions.png");
    background-position: center center;
    background-size: cover;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 70px 15px;
    text-align: center;
    overflow: hidden;
}

.chj-residence__caf::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #A0DE48;
    opacity: 0.5;
}

.chj-residence__caf-inner {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.chj-residence__caf h2 {
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
}

.chj-residence__caf p {
    color: #fff;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.chj-residence__btn {
    display: inline-block;
    background-color: #E22E86;
    border: 2px solid #E22E86;
    color: #fff;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.chj-residence__btn:hover,
.chj-residence__btn:focus {
    background-color: #c9246f;
    border-color: #c9246f;
    color: #fff;
    text-decoration: none;
}

/* -----------------------------------------------
   8. Formulaire de demande
   ----------------------------------------------- */
.chj-residence__form {
    padding-top: 50px;
    margin-bottom: 50px;
}

.chj-residence__form h2 {
    color: #E22E86;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
}

/* -----------------------------------------------
   9. Responsive (< 768px)
   ----------------------------------------------- */
@media (max-width: 767px) {
    .chj-residence__hero {
        flex-direction: column;
    }

    .chj-residence__hero-media {
        flex: none;
        width: 100%;
    }

    .chj-residence__hero-info {
        width: 100%;
    }

    .chj-residence__features {
        flex-direction: column;
    }

    .chj-residence__features-col {
        width: 100%;
    }

    .chj-residence__caf {
        padding: 40px 15px;
    }

    .chj-residence__caf h2 {
        font-size: 28px;
    }
}

/* -----------------------------------------------
   10. Services disponibles — pleine largeur, grille multi-colonnes
   ----------------------------------------------- */
.chj-residence__services h3 {
    color: #E22E86;
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
}

.chj-residence__services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 30px;
}

@media (max-width: 991px) {
    .chj-residence__services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .chj-residence__services-grid {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------------
   11. Layout 2 colonnes — desktop (≥ 992px)
       main 70% (hero + avantages) | sidebar actualités 30%
       Sur tablette/mobile : layout neutre, comportement inchangé.
   ----------------------------------------------- */
@media (min-width: 992px) {
    /* Layout : stretch pour que la sidebar atteigne la hauteur de la colonne principale */
    .chj-residence__layout {
        display: flex;
        align-items: stretch;
        gap: 30px;
        max-width: 1140px;
        margin: 0 auto;
        padding: 0 15px;
    }

    .chj-residence__main {
        flex: 0 0 70%;
        min-width: 0;
    }

    /* Sidebar : position:relative + enfant absolu pour neutraliser sa hauteur intrinsèque.
       Sans ce trick, la hauteur du contenu (feed) gonflerait la sidebar et donc le layout flex. */
    .chj-residence__sidebar {
        flex: 1;
        min-width: 0;
        position: relative;
    }

    /* Inner absolu : ne contribue pas au calcul de hauteur du parent flex.
       inset:0 le fait remplir la sidebar étirée par align-items:stretch. */
    .chj-residence__sidebar-inner {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Les sections dans le layout gèrent déjà leur centrage via le wrapper —
       on retire le max-width/margin/padding horizontal pour éviter la double contrainte. */
    .chj-residence__layout .chj-residence__section {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    /* Hero : hero-media pleine largeur, hero-info empilé dessous */
    .chj-residence__main .chj-residence__hero {
        flex-direction: column;
    }

    .chj-residence__main .chj-residence__hero-media {
        flex: none;
        width: 100%;
    }

    .chj-residence__main .chj-residence__hero-img {
        max-height: 380px;
        width: 100%;
        object-fit: cover;
    }

    .chj-residence__main .chj-residence__hero-info {
        width: 100%;
    }

    /* Features : colonnes avantages/services empilées l'une sur l'autre */
    .chj-residence__main .chj-residence__features {
        flex-direction: column;
    }

    .chj-residence__main .chj-residence__features-col {
        width: 100%;
    }

    /* Section actualités : occupe toute la hauteur restante dans la sidebar */
    .chj-residence__sidebar .chj-residence__actualites {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding-top: 30px;
        padding-bottom: 0;
    }

    /* Feed wrapper : se dilate pour remplir la section */
    .chj-residence__sidebar .so-chj-feed-wrapper {
        flex: 1;
        min-height: 0;
    }

    /* .so-chj-feed--compact-list est déjà flex: 1; overflow-y: auto; min-height: 0 dans feed.css */
}
