/* Stylesheet for Composition page — Oriane Droubay */

body.compo-light-theme {
    background-color: #FFFFFF;
    color: #101010;
}

/* Header Adjustments - Frosted Glass White Blur */
body.compo-dark-theme .site-header {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Page Layout Wrappers */
.compo-page-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #FFFFFF;
    overflow: hidden;
}

.compo-layout-container {
    position: relative;
    width: 1728px;
    height: 850px;
    margin: 0 auto;
    background: #FFFFFF;
}

/* Diapositives (Slides) */
.slide {
    position: absolute;
    top: 20px;
    height: 540.18px;
    container-type: inline-size;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    /* Smooth transitions for moving between states */
    transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1), width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Three Carousel State Positions */
/* --- Slide 0: Shooting Fleuri (Portrait, W_center = 394.33px, W_side = 300px) --- */
.slide-shooting.state-left {
    left: 95.66px;
    width: 300px;
    z-index: 2;
}
.slide-shooting.state-center {
    left: 656.27px;
    width: 394.33px;
    z-index: 5;
    cursor: default;
}
.slide-shooting.state-right {
    left: 1311.43px;
    width: 300px;
    z-index: 2;
}

/* --- Slide 1: Compo 02 (Landscape, W_center = 812.6px, W_side = 406.3px) --- */
.slide-compo02.state-left {
    left: -10.64px;
    width: 406.3px;
    z-index: 2;
}
.slide-compo02.state-center {
    left: 447.14px;
    width: 812.6px;
    z-index: 5;
    cursor: default;
}
.slide-compo02.state-right {
    left: 1311.43px;
    width: 406.3px;
    z-index: 2;
}

/* --- Slide 2: Compo 01 (Landscape, W_center = 864.07px, W_side = 432.04px) --- */
.slide-compo01.state-left {
    left: -36.38px;
    width: 432.04px;
    z-index: 2;
}
.slide-compo01.state-center {
    left: 421.4px;
    width: 864.07px;
    z-index: 5;
    cursor: default;
}
.slide-compo01.state-right {
    left: 1311.43px;
    width: 432.04px;
    z-index: 2;
}

/* Slide Before/After Images */
.slide-image {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* After image (background layer) takes 100% of current slide width */
.image-after {
    width: 100%;
}

/* Before image wrapper (clipped overlay) */
.slide-before-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    overflow: hidden;
    width: var(--slider-pos, 50%);
    pointer-events: none;
}

/* Before image width uses container query width (cqw) to stay fixed size during animations */
.image-before {
    width: 100cqw;
}

/* Vertical Slider Handle Bar — Glassmorphism */
.slide-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    left: var(--slider-pos, 50%);
    margin-left: -2px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.88) 30%,
        rgba(255, 255, 255, 0.88) 70%,
        rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    border-left: 1px solid rgba(255, 255, 255, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.7), 0 0 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    cursor: ew-resize;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.slide.state-center .slide-bar {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* when appearing: show visibility instantly, then fade opacity */
    transition: opacity 0.4s ease, visibility 0s linear 0s;
}

/* Custom Drag Handle using arrow-slider-base.webp (restored original base version) */
.slide-bar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%) scale(1);
    background-image: url('../08-Composition/arrow-slider-base.webp');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 12;
    transition: transform 0.2s ease;
}

.slide.dragging .slide-bar::after {
    transform: translate(-50%, -50%) scale(1.15);
}

/* Stationary Side Gradients */
.gradient-overlay {
    position: absolute;
    height: 543px;
    pointer-events: none;
    z-index: 8;
}

.gradient-left {
    width: 355px;
    left: -6px;
    top: 19px;
    background: linear-gradient(90deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
}

.gradient-right {
    width: 355px;
    left: 1373px;
    top: 20px;
    background: linear-gradient(270deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    width: 64px;
    height: 64px;
    top: 258px; /* Centered relative to 540.18px height slides */
    z-index: 15;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(245, 245, 245, 0.25) 100%); /* Slightly more opaque glassmorphism */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4); /* Frosted glass border reflection */
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.nav-arrow img {
    width: 26px; /* Larger arrow chevrons */
    height: 26px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* White chevron */
    transition: transform 0.2s ease;
}

.arrow-left {
    left: 326px; /* Positioned on the left slide, closer to the center composition */
}

.arrow-right {
    left: 1338px; /* Positioned on the right slide, closer to the center composition */
    transform: rotate(180deg);
}

.nav-arrow:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(245, 245, 245, 0.45) 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.arrow-left:hover {
    transform: scale(1.08);
}

.arrow-right:hover {
    transform: rotate(180deg) scale(1.08);
}

.nav-arrow:hover img {
    transform: translateX(-2px);
}

.compo-descriptif-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 25px 17px;
    position: absolute;
    width: 1064px;
    height: 158px;
    left: 334px;
    top: 630px;
    background-image: url('../08-Composition/hero/Descriptif.webp');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    box-sizing: border-box;
    z-index: 10;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.compo-descriptif-container:hover {
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.08);
}

.compo-descriptif-text {
    width: 1030px;
    height: 110px;
    font-family: 'Source Code Pro', monospace;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 18px;
    color: #101010;
    text-align: left;
    margin: 0;
    white-space: pre-line;
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
}

/* Down arrow button container */
.compo-bouton-tout-voir {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0px;
    width: 22px;
    height: 13px;
    flex: none;
    order: 1;
    flex-grow: 0;
    transition: transform 0.3s ease;
}

.compo-descriptif-container:hover .compo-bouton-tout-voir {
    transform: translateY(-4px);
}

.compo-fluent-arrow {
    margin: 0 auto;
    width: 22px;
    height: 13px;
    transform: rotate(180deg);
    display: block;
}

.compo-fluent-arrow img {
    width: 100%;
    height: 100%;
    display: block;
    filter: brightness(0); /* Pure black arrow */
}

/* Footer Styles - White Background */
body.compo-dark-theme .site-footer {
    background-color: #FFFFFF !important;
    color: #101010 !important;
    max-width: 100% !important;
    padding: 70px 41px 70px !important;
}

/* Before/After Badges */
.slide-label {
    position: absolute;
    top: 24px;
    padding: 6px 14px;
    background: rgba(13, 13, 13, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    font-family: 'Source Code Pro', monospace;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 30px;
    pointer-events: none;
    z-index: 9;
    user-select: none;
    transition: opacity 0.3s ease;
}

.label-before {
    left: 24px;
}

.label-after {
    right: 24px;
    z-index: 4; /* Behind the before wrapper but in front of after image */
}

/* Hide labels when actively dragging for a clean comparison */
.slide.dragging .slide-label {
    opacity: 0 !important;
}

/* Inactive side slides have faded badges */
.slide.state-left .slide-label,
.slide.state-right .slide-label {
    opacity: 0.4;
}

.compo-drag-hint {
    position: absolute;
    left: 853.44px; /* Centered exactly on the slider handle */
    top: 290.09px;  /* Centered exactly on the slider handle */
    z-index: 25;
    pointer-events: none;
    user-select: none;
    transform: scale(1);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.compo-drag-hint.hidden {
    opacity: 0 !important;
    transform: scale(0.8);
}

.compo-drag-hint img {
    display: block;
    width: 75px; /* Larger click icon */
    height: auto;
    /* Translate the image so that the fingertip (at 30.7% width, 21.3% height) is at the center */
    transform: translate(-30.7%, -21.3%);
    transform-origin: 30.7% 21.3%;
    animation: handClick 1.6s infinite ease-in-out;
}

.compo-drag-hint .click-wave {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    margin-left: -25px;
    margin-top: -25px;
    border: 2px solid #101010;
    border-radius: 50%;
    pointer-events: none;
    transform: scale(0);
    opacity: 0;
    animation: clickWave 1.6s infinite cubic-bezier(0.1, 0.8, 0.3, 1);
}

@keyframes handClick {
    0%, 100% {
        transform: translate(-30.7%, -21.3%) scale(1);
    }
    30% {
        transform: translate(-30.7%, -21.3%) scale(1);
    }
    40% {
        transform: translate(-30.7%, -21.3%) scale(0.8); /* Press down */
    }
    50% {
        transform: translate(-30.7%, -21.3%) scale(1.05); /* Rebound */
    }
    60% {
        transform: translate(-30.7%, -21.3%) scale(1);
    }
}

@keyframes clickWave {
    0%, 35% {
        transform: scale(0);
        opacity: 0;
    }
    40% {
        transform: scale(0.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Carousel Pagination Dots */
.compo-pagination {
    position: absolute;
    left: 50%;
    top: 590px;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 12px;
    z-index: 20;
}

.compo-pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(16, 16, 16, 0.25);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.compo-pagination-dot:hover {
    background-color: rgba(16, 16, 16, 0.55);
}

.compo-pagination-dot.active {
    background-color: #101010;
    transform: scale(1.25);
}

/* DYNAMIC RESPONSIVE SCALING */
@media (max-width: 1728px) {
    .compo-page-wrapper {
        height: calc(850px * (100vw / 1728));
        overflow-x: hidden;
    }
    
    .compo-layout-container {
        transform: scale(calc(100vw / 1728));
        transform-origin: top left;
        margin: 0;
    }
}
