/* Specific styles for the BD (Illustrations) page */

/* Mobile collage is hidden on desktop by default */
.bd-mobile-collage {
    display: none;
}

.bd-project-container {
    max-width: 1434px;
    margin: 10px auto 100px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 90px;
}

/* SECTION 1: FIGMA PRECISE HIERARCHY */
.illustration-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0px;
    gap: 56px;
    width: 1434px;
    height: 902px;
    align-self: stretch;
    flex-shrink: 0;
    margin: 0 auto;
    overflow: visible;
    flex: none;
    order: 0;
    flex-grow: 0;
}

.illustration {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0px;
    gap: 41px;
    width: 1434px;
    height: 902px;
    flex-shrink: 0;
    flex: none;
    order: 0;
    flex-grow: 0;
}

.hover-illustration {
    position: relative;
    width: 1510px;
    height: 893.03px;
    background: transparent;
    flex-shrink: 0;
    flex: none;
    order: 0;
    flex-grow: 0;
}

.illustrations {
    position: absolute;
    width: 1411px;
    height: 1416px;
    left: 80.09px;
    top: -10px;
}

/* BD1-1 */
.bd1-1 {
    position: absolute;
    width: 669px;
    height: 485px;
    left: 51.5px;
    top: -7px;
    background-image: url('../01-Illustrations/header/BD1.webp');
    background-size: 95% 95%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    overflow: hidden;
}

/* BD1-2 */
.bd1-2 {
    position: absolute;
    width: 617px;
    height: 442px;
    left: -34.5px;
    top: 467px;
    background-image: url('../01-Illustrations/header/BD2.webp');
    background-size: 95% 95%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    overflow: hidden;
}

/* BD2-1 */
.bd2-1 {
    position: absolute;
    width: 637px;
    height: 588px;
    left: 720.5px;
    top: 0px;
    background-image: url('../01-Illustrations/header/BD3.webp');
    background-size: 95% 95%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    overflow: hidden;
}

/* BD2-2 */
.bd2-2 {
    position: absolute;
    width: 636px;
    height: 324px;
    left: 775.5px;
    top: 588px;
    background-image: url('../01-Illustrations/header/BD4.webp');
    background-size: 95% 95%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    overflow: hidden;
}

.bd1-1:hover, .bd1-2:hover, .bd2-1:hover, .bd2-2:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(16, 16, 16, 0.12);
    z-index: 10;
}

/* Introduction */
.introduction {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0px;
    gap: 10px;
    position: absolute;
    width: 430px;
    height: 190px;
    left: 548.09px;
    top: 430px;
}

/* Frame 28 */
.frame-28 {
    position: absolute;
    width: 480px;
    height: 230px;
    left: 522px;
    top: 579px;
    z-index: 20;
}

/* Descriptif-illustration 1 */
.descriptif-illustration-1 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../01-Illustrations/header/Descriptif-illustration-1.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Descriptif */
.descriptif {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.descriptif-text {
    width: 397px;
    height: 158px;

    /* Description */
    font-family: 'Source Code Pro';
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 18px;
    color: #101010;
    text-align: left;

    /* Inside auto layout */
    flex: none;
    order: 0;
    flex-grow: 0;
}

/* BOUTON TOUT VOIR */
.bouton-tout-voir {
    /* Auto layout */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0px;
    gap: 113px;

    width: 22px;
    height: 13px;

    /* Inside auto layout */
    flex: none;
    order: 1;
    flex-grow: 0;
}

/* Line 1 */
.line-1 {
    margin: 0 auto;
    display: none;
    width: 84.53px;
    height: 0.12px;

    border: 1px solid #101010;
    transform: rotate(0.08deg);

    /* Inside auto layout */
    flex: none;
    order: 0;
    flex-grow: 0;
}

/* fluent:ios-arrow-24-regular */
.fluent-ios-arrow-24-regular {
    margin: 0 auto;
    width: 22px;
    height: 13px;

    transform: rotate(0deg);

    /* Inside auto layout */
    flex: none;
    order: 1;
    flex-grow: 0;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.fluent-ios-arrow-24-regular img {
    width: 22px;
    height: 13px;
    display: block;
}

/* Vector */
.fluent-ios-arrow-24-regular .vector {
    position: absolute;
    left: 6.69%;
    right: 12.5%;
    top: 6.79%;
    bottom: 2.25%;

    background: #101010;
    border: 1px solid #101010;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.descriptif:hover .fluent-ios-arrow-24-regular {
    transform: translateY(8px) rotate(0deg);
    filter: invert(53%) sepia(0%) saturate(0%) brightness(90%) contrast(85%);
}.bd-selection-section {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Reduced gap from 35px */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background-image: url('../01-Illustrations/fond-sélection.webp'); /* Set background image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 60px 0 20px; /* Reduced bottom padding from 70px to 20px to offset the increased carousel bottom padding */
    overflow: hidden;
}

.bd-selection-section .bd-section-title {
    max-width: 1430px;
    margin: 0 auto;
    width: 100%;
    padding: 0 40px;
    color: #101010;
}

.bd-selection-carousel {
    display: flex;
    width: 100%;
    overflow-x: auto;
    position: relative;
    padding: 95px 0 110px; /* Increased bottom padding to 110px to accommodate hovered card shadow without vertical clipping */
    margin-top: -85px; /* Pull the carousel up to sit right under the title */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.bd-selection-carousel::-webkit-scrollbar {
    display: none;
}

.bd-selection-track {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: max-content;
    margin: 0 auto;
    padding: 20px 250px; /* Increased left/right padding to 250px for more spacing at the ends of the selection */
}

.bd-selection-card {
    width: auto; /* Dynamically sizes to fit the image's aspect ratio */
    height: 550px; /* Enlarged from 450px */
    flex-shrink: 0;
    position: relative;
    border-radius: 6px;
    background: #FFFFFF;
    border: 1px solid rgba(16, 16, 16, 0.08);
    box-shadow: 0 10px 30px rgba(16, 16, 16, 0.06);
    padding: 10px; /* Perfectly uniform white border frame on all sides */
    box-sizing: border-box; /* Explicit border-box layout */
    margin-left: -260px; /* Increased overlap for tighter cards */
    display: flex; /* Flex layout to reliably center the illustration inside the padding */
    justify-content: center;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    z-index: 1;
}

.bd-selection-card:first-child {
    margin-left: 0;
}

.bd-selection-card img {
    height: 100%; /* Take up exact inner vertical height inside the padding */
    width: auto;  /* Width auto-adjusts based on aspect-ratio */
    object-fit: contain; /* Guarantee no cropping of any pixel */
    border: 1px solid rgba(16, 16, 16, 0.06); /* Inset outline for the art print */
    border-radius: 2px;
    display: block;
}

/* Sibling shift animation when hovering a card (spreads open the deck) */
.bd-selection-track:has(.bd-selection-card:hover) .bd-selection-card {
    transform: translateX(-300px); /* Shift wider to accommodate tighter cards */
}

.bd-selection-track:has(.bd-selection-card:hover) .bd-selection-card:hover {
    z-index: 10;
    transform: scale(1.2) translateY(-30px) translateX(0); /* Zoom and lift */
    box-shadow: 0 28px 56px rgba(16, 16, 16, 0.18);
    border-color: rgba(16, 16, 16, 0.2);
}

.bd-selection-track:has(.bd-selection-card:hover) .bd-selection-card:hover ~ .bd-selection-card {
    transform: translateX(300px); /* Shift wider to accommodate tighter cards */
}

.bd-selection-caption {
    display: none !important;
}

/* SECTION 3 : LES AUTRES ILLUSTRATIONS */
.bd-others-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.bd-others-title {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    text-align: center;
    color: #101010;
    margin-bottom: 10px;
}

.bd-others-grid {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    width: 100%;
    height: 650px;
    border-radius: 8px;
    overflow: hidden;
    gap: 0;
}

/* Cards for secondary illustrations */
.bd-other-card {
    position: relative;
    width: 478px;
    height: 650px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    cursor: pointer;
}

.bd-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
    z-index: 1;
}

.bd-other-card:hover .bd-card-bg {
    transform: scale(1.04);
    filter: brightness(0.9);
}

.bd-card-caption {
    position: absolute;
    top: 23px;
    right: 27px;
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    color: #101010;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #101010;
    padding: 4px 10px;
    border-radius: 2px;
    transition: background 0.3s ease, color 0.3s ease;
}

.bd-other-card:hover .bd-card-caption {
    background: #101010;
    color: #FFFFFF;
}

/* RESPONSIVE DESIGN & ADAPTATIONS */
@media (max-width: 1440px) {
    .illustration {
        transform: scale(0.9);
        transform-origin: top center;
        margin-bottom: -90px;
    }
}

@media (max-width: 1280px) {
    .illustration {
        transform: scale(0.8);
        transform-origin: top center;
        margin-bottom: -180px;
    }
    .bd-others-grid {
        height: 550px;
    }
    .bd-other-card {
        height: 550px;
    }
}

@media (max-width: 1080px) {
    .illustration {
        transform: scale(0.68);
        transform-origin: top center;
        margin-bottom: -280px;
    }
}

/* Mobile-friendly version (completely stacked layout) */
@media (max-width: 992px) {
    .illustration-header {
        height: auto;
        display: block;
    }
    
    .illustration {
        display: none; /* Hide absolute grid on mobile to avoid overflow */
    }

    /* Beautiful alternative grid for smaller viewports */
    .bd-mobile-collage {
        display: flex;
        flex-direction: column;
        gap: 30px;
        width: 100%;
        margin-bottom: 20px;
    }

    .bd-mobile-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        width: 100%;
    }

    .bd-mobile-img {
        width: 100%;
        aspect-ratio: 4/3;
        border-radius: 6px;
        overflow: hidden;
        border: 1px solid rgba(16, 16, 16, 0.08);
        background-repeat: no-repeat;
        background-size: 95% 95%;
        background-position: center;
        background-color: #ffffff;
    }

    .bd-mobile-grid .bd-mobile-img:nth-child(1) {
        background-image: url('../01-Illustrations/header/BD1.webp');
    }

    .bd-mobile-grid .bd-mobile-img:nth-child(2) {
        background-image: url('../01-Illustrations/header/BD2.webp');
    }

    .bd-mobile-grid .bd-mobile-img:nth-child(3) {
        background-image: url('../01-Illustrations/header/BD3.webp');
    }

    .bd-mobile-grid .bd-mobile-img:nth-child(4) {
        background-image: url('../01-Illustrations/header/BD4.webp');
    }

    .bd-mobile-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .bd-mobile-card {
        width: 100%;
        background: #FFFFFF;
        border: 1px solid #101010;
        padding: 24px 20px;
        text-align: center;
        border-radius: 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    /* Stack others grid vertically */
    .bd-others-grid {
        flex-direction: column;
        height: auto;
        border-radius: 8px;
        overflow: hidden;
    }

    .bd-other-card {
        width: 100%;
        height: 380px;
        border-bottom: 1px solid rgba(16, 16, 16, 0.08);
    }

    .bd-other-card:last-child {
        border-bottom: none;
    }
}

@media (max-width: 576px) {
    .bd-project-container {
        padding: 0px 16px;
        gap: 60px;
        margin-top: 20px;
        margin-bottom: 60px;
    }

    .bd-mobile-card {
        padding: 20px 16px;
    }

    .bd-mobile-grid {
        grid-template-columns: 1fr;
    }
    
    .bd-section-title, .bd-others-title {
        font-size: 24px;
        line-height: 30px;
        margin-bottom: 20px;
    }

    .bd-selection-carousel {
        padding: 40px 0 60px; 
        margin-top: -30px; 
    }

    .bd-selection-track {
        padding: 10px 40px; 
    }

    .bd-selection-card {
        width: auto; 
        height: 220px; 
        margin-left: -100px; /* Tighter overlap on mobile */
        padding: 6px; 
    }

    .bd-selection-track:has(.bd-selection-card:hover) .bd-selection-card {
        transform: translateX(-120px);
    }
    .bd-selection-track:has(.bd-selection-card:hover) .bd-selection-card:hover {
        transform: scale(1.15) translateY(-10px) translateX(0);
    }
    .bd-selection-track:has(.bd-selection-card:hover) .bd-selection-card:hover ~ .bd-selection-card {
        transform: translateX(120px);
    }

    
    .bd-other-card {
        height: 300px;
    }

    .bd-card-caption {
        font-size: 14px;
        top: 15px;
        right: 15px;
        padding: 4px 8px;
    }
}
