/* ---- Section Localisation / Bâtiment ---- */

main #localisation {
    position: relative;
}

main #localisation .background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../media/colored_background_3.webp");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: .12;
    z-index: -1;
}

main #localisation h2 {
    text-align: center;
}

.batiment_grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-template-areas: 
    'image batiment'
    'image reignac';
    gap: 48px;
    align-items: start;
    margin-bottom: 48px;
}

/* Le bloc "Reignac-sur-Indre" est hors grille par défaut (pleine largeur, sous le bloc ci-dessus) */
.batiment_text_full {
    margin-top: 0;
}

/* ---- Carrousel ---- */

.batiment_carousel {
    grid-area: image;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background-color: #111;
    box-shadow: 0 0 8px RGBa(10, 10, 10, .5);
    outline: none;
}

.batiment_carousel:focus-visible {
    outline: 3px solid var(--BLUE-COLOR);
    outline-offset: 3px;
}

.batiment_desc{
    grid-area: batiment;
}

.batiment_ville{
    grid-area: reignac;
}

.carousel_track {
    display: flex;
    height: 100%;
    transition: transform .5s ease;
}

.carousel_slide {
    flex: 0 0 100%;
    height: 100%;
}

.carousel_slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel_btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: RGBa(0, 0, 0, .4);
    color: white;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .3s;
}

.carousel_btn:hover {
    background-color: var(--BLUE-COLOR);
    opacity: 1;
}

.carousel_btn:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
}

.carousel_btn.prev {
    left: 14px;
}

.carousel_btn.next {
    right: 14px;
}

.carousel_dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel_dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: RGBa(255, 255, 255, .5);
    cursor: pointer;
    transition: .3s;
}

.carousel_dots button.active {
    width: 22px;
    border-radius: 6px;
    background-color: white;
}

.carousel_dots button:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* ---- Texte descriptif ---- */

.batiment_text h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.batiment_text h3:not(:first-child) {
    margin-top: 32px;
}

.batiment_text p {
    text-align: justify;
    line-height: 1.6;
    margin-bottom: 12px;
}

.batiment_text ul {
    list-style: inside;
    margin: 4px 0 16px;
    line-height: 1.7;
}

/* ---- Respect du mouvement réduit ---- */

@media (prefers-reduced-motion: reduce) {
    .carousel_track {
        transition: none;
    }
}

/* ----------------------------------------------------------------
   Responsive
   > 1500px : mise en page large d'origine (3fr / 2fr), déjà équilibrée
   1000-1500px : la colonne texte devient trop étroite pour son contenu
     et s'étire verticalement bien plus que l'image → on passe à une
     grille plus large (image + description) puis "Reignac-sur-Indre"
     en pleine largeur en dessous, comme demandé.
   < 1000px : tout empilé en une colonne
------------------------------------------------------------------- */

@media screen and (max-width: 1500px) {
    .batiment_grid {
        align-items: center;
        grid-template-areas: 
        'image batiment'
        'reignac reignac';
        grid-template-columns: 3fr 2fr;
    }
}

@media screen and (max-width: 1000px) {
    .batiment_grid {
        grid-template-columns: 1fr;
        grid-template-areas: 
        'image'
        'batiment'
        'reignac';
        gap: 32px;
    }

    .batiment_carousel {
        aspect-ratio: 16 / 10;
    }
}

@media screen and (max-width: 600px) {
    .carousel_btn {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}