
/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Rubik', sans-serif;
    line-height: 1.4;
    color: #000;
    overflow-x: hidden;
}

/* Container principal */
.homepage-container {
    height: 100vh;
    height: 100svh;
    background: #6b92ff;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    padding-top: 6svh;
    box-sizing: border-box;
}

/* Section slider */
.slider-section {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 65svh;
    width: 100%;
}

/* SLIDER FULL WIDTH */
.slider-container {
    position: relative;
    width: 100vw;
    max-width: 100%;
    height: clamp(420px, 72svh, 680px);
    overflow: visible;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: grab;
    cursor: -webkit-grab;
    will-change: transform;
    touch-action: pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.slider-wrapper.dragging {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

/* Slides */
.slide {
    position: absolute;
    width: auto;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
    will-change: transform, opacity;
    contain: layout style paint;
    transform: translateX(-50%) translateZ(0);
    backface-visibility: hidden;
}

/* Positions initiales — correspondant aux formules calc() CSS */
.slide:nth-child(1) {
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    z-index: 10;
}

.slide:nth-child(2) {
    left: 50%;
    transform: translateX(calc(-50% - 16vh - 56vw)) translateZ(0);
    z-index: 5;
}

.slide:nth-child(3) {
    left: 50%;
    transform: translateX(calc(-50% + 16vh + 56vw)) translateZ(0);
    z-index: 5;
}

/* CARTES */
.card {
    height: clamp(385px, 66svh, 622px);
    aspect-ratio: 320 / 460;
    max-width: 78vw;
    border-radius: clamp(16px, 5.3vmin, 24px);
    border: clamp(2px, 0.8vmin, 4px) solid #000;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    z-index: 20;
}

.slide .card {
    opacity: 1 !important;
    transform: none !important;
}

.slide:nth-child(2) .card,
.slide:nth-child(3) .card {
    opacity: 1 !important;
}

/* Zone illustration */
.card-illustration {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.card.habitant .card-illustration {
    background: #eed05d;
}

.card.logement .card-illustration {
    background: #f5b0a5;
}

.card.foyer .card-illustration {
    background: linear-gradient(135deg, #7DCEA0 0%, #73C6B6 100%);
}

.illustration-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

.card.logement .illustration-image {
    transform: scale(1.05) translateY(clamp(30px, 6vh, 50px));
}

.illustration-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

/* Zone titre */
.card-title {
    background: #fb0400;
    padding: clamp(12px, 2.2svh, 20px) clamp(14px, 4.3vmin, 20px);
    text-align: center;
    min-height: clamp(70px, 12svh, 110px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; 
    border-top: clamp(3px, 1.1vmin, 5px) solid #000;
}

.card-title h2 {
    font-size: clamp(26px, 4.8svh, 38px);
    font-weight: 500; 
    color: #000;
    text-transform: uppercase;
    line-height: 1.3;
    text-decoration: underline;
    text-decoration-thickness: clamp(2px, 0.8vmin, 4px);
    text-underline-offset: clamp(2px, 0.8vmin, 4px);
    letter-spacing: 0.5px;
    margin: 0;
}

/* Logo au bas */
.bottom-logo {
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    text-align: center !important;
    z-index: 1 !important;
    max-width: none !important;
    width: auto !important;
}

.bottom-logo img {
    max-width: clamp(140px, 25svh, 200px) !important;
    max-height: clamp(140px, 25svh, 200px) !important;
    height: auto !important;
    width: auto !important;
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

.slider-container {
    touch-action: pan-y;
    user-select: none;
}

.illustration-image {
    background: rgba(255, 255, 255, 0.1);
}

.illustration-placeholder {
    background: rgba(255, 255, 255, 0.2);
    border-radius: clamp(8px, 2.7vmin, 12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80%;
    max-width: clamp(180px, 53.3vmin, 220px);
    height: clamp(130px, 22svh, 180px);
    padding: clamp(16px, 5.3vmin, 24px);
}

.illustration-placeholder span {
    font-size: clamp(40px, 7vh, 60px);
    margin-bottom: clamp(8px, 2.7vmin, 12px);
}

.illustration-placeholder p {
    text-align: center;
    font-size: clamp(12px, 2.1vh, 16px);
    color: rgba(0,0,0,0.7);
    margin: 0;
}

/* ============================================
   CLASSES D'ÉTAT JAVASCRIPT

   PATCH : transform sans !important.
   Le JS applique style.transform inline qui doit gagner
   sur les classes CSS. Avec !important CSS, le snap était
   écrasé et le drag utilisait une référence différente.
   Les z-index gardent leur !important (le JS ne les réécrit
   pas systématiquement sur tous les états).
   ============================================ */

.slide.slide-active {
    left: 50%;
    transform: translateX(-50%) translateZ(0); /* pas de !important : JS inline prend le relais */
    z-index: 10 !important;
}

.slide.slide-previous {
    left: 50%;
    transform: translateX(calc(-50% - 16vh - 56vw)) translateZ(0); /* pas de !important */
    z-index: 5 !important;
}

.slide.slide-next {
    left: 50%;
    transform: translateX(calc(-50% + 16vh + 56vw)) translateZ(0); /* pas de !important */
    z-index: 5 !important;
}

.slide.slide-hidden {
    left: 50%;
    transform: translateX(-300vw) translateZ(0); /* pas de !important */
    z-index: 1 !important;
    opacity: 0;
}

/* ============================================
   PAGINATION (DOTS)
   ============================================ */

.slider-dots {
    position: absolute;
    bottom: clamp(-19px, -3svh, -15px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: clamp(14px, 4.8vmin, 22px);
    z-index: 100;
    width: auto;
}

.dot {
    width: clamp(6px, 2.1vmin, 10px);
    height: clamp(6px, 2.1vmin, 10px);
    background: rgba(255, 255, 255, 0.5);
    border: 0px solid #000;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.dot.active {
    background: #fff;
    transform: scale(1.2);
}


.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation d'entrée */
.animate-in {
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(clamp(24px, 4.5vh, 36px));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE — iPhone 12/13/14 (390px)
   ============================================ */
@media (min-width: 390px) and (max-width: 395px) {
    .card-title h2 {
        font-size: clamp(23px, 4.2svh, 34px) !important;
        letter-spacing: 0.3px !important;
    }
}

/* ============================================
   RESPONSIVE — Petit mobile (360–374px)
   ============================================ */
@media (min-width: 360px) and (max-width: 374px) {
    .slide:nth-child(2) {
        transform: translateX(calc(-50% - 14vh - 53vw)) translateZ(0);
    }
    
    .slide:nth-child(3) {
        transform: translateX(calc(-50% + 14vh + 53vw)) translateZ(0);
    }
    
    /* PATCH : !important retiré — le JS utilise la même formule 14vh+53vw dans calculateSlideOffset() */
    .slide.slide-previous {
        transform: translateX(calc(-50% - 14vh - 53vw)) translateZ(0);
    }
    
    .slide.slide-next {
        transform: translateX(calc(-50% + 14vh + 53vw)) translateZ(0);
    }

    .card-title h2 {
        font-size: clamp(22px, 3.5svh, 28px) !important;
        letter-spacing: 0.2px !important;
    }

    .card-title {
        min-height: clamp(65px, 10svh, 95px) !important;
    }
}

/* ============================================
   RESPONSIVE — TABLETTES (768px+)
   ============================================ */
@media (min-width: 768px) {
    .slider-container {
        height: clamp(600px, 75svh, 850px);
    }
    
    .card {
        height: clamp(600px, 72svh, 820px);
        max-width: 80vw;
    }
    
    .slide:nth-child(2) {
        transform: translateX(calc(-50% - 90vw + 50px)) translateZ(0);
    }
    
    .slide:nth-child(3) {
        transform: translateX(calc(-50% + 90vw - 50px)) translateZ(0);
    }
    
    .card-title {
        padding: clamp(24px, 3svh, 36px) clamp(20px, 2.9vmin, 26px);
        min-height: clamp(110px, 13svh, 160px);
    }
    
    .card-title h2 {
        font-size: clamp(24px, 3.5vh, 32px);
        font-weight: 500;
        text-decoration-thickness: clamp(2px, 0.4vmin, 4px);
        text-underline-offset: clamp(2px, 0.4vmin, 4px);
        letter-spacing: 0.5px;
    }
    
    /* PATCH : !important retiré — le JS utilise 0.9*vw-50 dans calculateSlideOffset() */
    .slide.slide-previous {
        transform: translateX(calc(-50% - 90vw + 50px)) translateZ(0);
    }
    
    .slide.slide-next {
        transform: translateX(calc(-50% + 90vw - 50px)) translateZ(0);
    }
    
    .bottom-logo img {
        max-width: clamp(130px, 18svh, 180px) !important;
        max-height: clamp(130px, 18svh, 180px) !important;
    }
    
    .card.logement .illustration-image {
        transform: scale(1.05) translateY(clamp(35px, 5vh, 55px));
    }
}

/* ============================================
   DESKTOP (1024px+) — Layout flexbox statique,
   slider JS désactivé, règles inchangées.
   ============================================ */
@media (min-width: 1024px) {
    .homepage-container {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding-top: clamp(55px, 9vh, 100px);
    }

    .slider-section {
        width: 100%;
        height: auto;
        min-height: auto;
        padding: 0;
    }
    
    .slider-container {
        height: auto;
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    .slider-wrapper {
        position: static !important;
        display: flex !important;
        flex-direction: row;
        justify-content: center;
        align-items: flex-end;
        gap: clamp(20px, 2vw, 40px);
        width: 100%;
        height: auto;
        cursor: default;
        will-change: auto;
    }
    
    .slide {
        position: static !important;
        transform: none !important;
        width: auto;
        height: auto;
        opacity: 1 !important;
        transition: none;
        left: auto !important;
        will-change: auto;
        contain: none;
        backface-visibility: visible;
        flex: 0 0 auto;
    }
    
    /* Sur desktop, toutes les classes d'état sont neutralisées */
    .slide.slide-active,
    .slide.slide-previous,
    .slide.slide-next,
    .slide.slide-hidden {
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        z-index: auto !important;
        left: auto !important;
        will-change: auto;
        contain: none;
        backface-visibility: visible;
    }
    
    .card {
        height: clamp(450px, 54vh, 612px);
        width: 100%;
        max-width: 340px;
        flex-shrink: 0;
    }

    .card-title {
        padding: clamp(22px, 2.9vh, 34px) clamp(18px, 2.3vmin, 24px);
        min-height: clamp(108px, 12.5vh, 148px);
    }

    .card-title h2 {
        font-size: clamp(23px, 3vh, 32px);
        font-weight: 500;
        text-decoration-thickness: clamp(2px, 0.4vmin, 4px);
        text-underline-offset: clamp(2px, 0.4vmin, 4px);
        letter-spacing: 0.5px;
    }

    .slider-wrapper {
        gap: clamp(16px, 2vw, 34px);
    }

    .slider-dots {
        display: none !important;
    }

    .bottom-logo {
        position: static !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        margin-top: clamp(12px, 1.5vh, 22px);
    }

    .bottom-logo img {
        max-width: clamp(162px, 18vh, 215px) !important;
        max-height: clamp(162px, 18vh, 215px) !important;
    }

    .card.logement .illustration-image {
        transform: scale(1.05) translateY(clamp(30px, 4vh, 45px));
    }
}

/* ============================================
   EXTRA LARGE (1440px+)
   ============================================ */
@media (min-width: 1440px) {
    .slider-container {
        max-width: 1440px;
    }

    .card {
        max-width: 375px;
        height: clamp(495px, 58vh, 648px);
    }

    .slider-wrapper {
        gap: clamp(27px, 3vw, 45px);
    }
}

/* =========================================================
   FOOTER — Foyer Anderlechtois
   À coller à la fin de style.css
   ========================================================= */

   .foyer-footer {
    background-color: #ffffff;
    color: #1a1a1a;
    text-align: center;
    padding: 20px 16px 24px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    box-sizing: border-box;
}

/* --- Liens légaux --- */
.foyer-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 6px;
    margin-bottom: 12px;
}

.foyer-footer__links a {
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.foyer-footer__links a:focus {
    color: #6A5ACD;
    outline: none;
}

.foyer-footer__links span {
    color: #999;
    user-select: none;
}

/* --- Adresse --- */
.foyer-footer__address {
    font-style: normal;
    color: #333;
    font-size: 13px;
    line-height: 1.7;
}

.foyer-footer__address a {
    color: #6A5ACD;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (hover: hover) {
    .dot:hover { background: rgba(255, 255, 255, 0.8); }
    .foyer-footer__links a:hover { color: #6A5ACD; }
}

/* --- Mobile : réduire les gaps sur très petit écran --- */
@media (max-width: 380px) {
    .foyer-footer {
        font-size: 12px;
        padding: 16px 12px 20px;
    }
}

