/* ===================================
   Rose&Fly — Images Homepage Front
   v4.0.0
   =================================== */

/* ---- MODE FIXE : Layout grille ---- */
.rosefly-home-wrapper {
    width: 95%;
    max-width: 1200px;
    margin: 1rem auto;
    box-sizing: border-box;
}

.rosefly-home-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    align-items: stretch;
}

.rosefly-home-container a {
    display: block;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.rosefly-home-container a:hover {
    opacity: 0.9;
}

/* Grande image */
.rosefly-home-container > a.big {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    max-height: 350px;
    contain: layout style;
}

.rosefly-home-container > a.big img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 250px;
}

/* Petites images */
.rosefly-home-container > .small-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.rosefly-home-container > .small-container a.small {
    position: relative;
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
    min-height: 0;
    contain: layout style;
}

.rosefly-home-container > .small-container a.small img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- MODE CARROUSEL ---- */
.rosefly-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #f5f5f5;
    contain: layout style;
    height: 250px;
}

.rosefly-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

.rosefly-carousel-slide {
    min-width: 100%;
    position: relative;
}

.rosefly-carousel-slide a,
.rosefly-carousel-slide > picture,
.rosefly-carousel-slide > picture > img {
    display: block;
    width: 100%;
}

.rosefly-carousel-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(.4, 0, .2, 1);
}

.rosefly-carousel-img:hover {
    transform: scale(1.04);
}

/* Navigation */
.rosefly-carousel-prev,
.rosefly-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgb(197 123 144);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.rosefly-carousel-prev:hover,
.rosefly-carousel-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.rosefly-carousel-prev { left: 20px; }
.rosefly-carousel-next { right: 20px; }

/* Dots */
.rosefly-carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.rosefly-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.rosefly-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.rosefly-carousel-dot.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.3);
}

/* ---- RESPONSIVE MOBILE ≤ 768px ---- */
@media (max-width: 768px) {
    .rosefly-home-wrapper {
        width: 100%;
        padding: 0 12px;
        margin: 1rem auto;
    }

    .rosefly-home-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rosefly-home-container > a.big {
        border-radius: 6px;
        max-height: 250px;
    }

    .rosefly-home-container > a.big img {
        height: 250px;
        width: 100%;
        object-fit: cover;
    }

    .rosefly-home-container > .small-container {
        flex-direction: row;
        height: auto;
        gap: 12px;
    }

    .rosefly-home-container > .small-container a.small {
        border-radius: 6px;
        aspect-ratio: auto;
        height: 250px;
    }

    .rosefly-home-container > .small-container a.small img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 250px;
        object-fit: cover;
    }

    /* Carrousel mobile */
    .rosefly-carousel-prev,
    .rosefly-carousel-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .rosefly-carousel-prev { left: 10px; }
    .rosefly-carousel-next { right: 10px; }

    .rosefly-carousel-dots {
        bottom: 10px;
        gap: 8px;
    }

    .rosefly-carousel-dot {
        width: 10px;
        height: 10px;
    }

    .rosefly-carousel-img {
        height: 250px;
        max-height: 250px;
        object-fit: cover;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .rosefly-carousel-prev,
    .rosefly-carousel-next {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .rosefly-carousel-img {
        height: 250px;
        max-height: 250px;
    }

    .rosefly-home-container > a.big {
        max-height: 250px;
    }
}

/* ---- DESKTOP ≥ 1024px ---- */
@media (min-width: 1024px) {
    .rosefly-home-container > a.big {
        max-height: 60vh;
    }

    .rosefly-home-container > a.big img {
        height: 100%;
        max-height: none;
    }

    .rosefly-carousel-img {
        max-height: 60vh;
    }
}

/* ---- ACCESSIBILITÉ ---- */
.rosefly-carousel-prev:focus,
.rosefly-carousel-next:focus,
.rosefly-carousel-dot:focus {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .rosefly-carousel-track {
        transition: none;
    }

    .rosefly-home-container a,
    .rosefly-carousel-prev,
    .rosefly-carousel-next,
    .rosefly-carousel-dot,
    .rosefly-carousel-img {
        transition: none;
    }
}
