/* ============================================
   RÉALISATIONS — CARROUSEL INFINI + MODAL CINÉMA
   ============================================ */

.subsection-intro {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    margin: -8px 0 40px;
    letter-spacing: 0.02em;
}

/* ============================================
   CARROUSEL
   ============================================ */

.realisations-section { padding-bottom: 80px; }

.carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* Flèches */
.carousel-arrow {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.carousel-arrow svg { width: 22px; height: 22px; }

.carousel-arrow:hover {
    background: rgba(255, 107, 139, 0.15);
    border-color: rgba(255, 107, 139, 0.4);
    transform: scale(1.08);
}

.carousel-arrow:focus-visible { outline: 2px solid #ff6b8b; outline-offset: 3px; }

/* Fenêtre du carrousel */
.carousel-container {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

/* Piste */
.carousel-track {
    display: flex;
    gap: 16px;
    will-change: transform;
    /* La transition est pilotée en JS */
}

/* Item */
.carousel-item {
    flex: 0 0 calc((100% - 32px) / 3); /* 3 items visibles */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    aspect-ratio: 16 / 9;
    outline: none;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.4s ease;
}

/* Overlay play */
.carousel-item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.carousel-play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 107, 139, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    padding-left: 4px;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 139, 0.5);
}

.carousel-item:hover img,
.carousel-item:focus-visible img {
    transform: scale(1.05);
    filter: brightness(0.6);
}

.carousel-item:hover .carousel-item-overlay,
.carousel-item:focus-visible .carousel-item-overlay {
    background: rgba(0, 0, 0, 0.25);
}

.carousel-item:hover .carousel-play-btn,
.carousel-item:focus-visible .carousel-play-btn {
    opacity: 1;
    transform: scale(1);
}

.carousel-item:focus-visible { outline: 2px solid #ff6b8b; outline-offset: 3px; }

.carousel-item.is-active {
    border-color: rgba(255, 107, 139, 0.35);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.carousel-item:not(.is-active) { opacity: 0.7; }
.carousel-item:not(.is-active):hover { opacity: 1; }

/* Points indicateurs */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    transition: background 0.25s ease, width 0.25s ease, border-radius 0.25s ease;
    padding: 0;
}

.indicator-dot.active {
    background: #ff6b8b;
    width: 22px;
    border-radius: 4px;
}

.indicator-dot:hover { background: rgba(255, 255, 255, 0.5); }
.indicator-dot:focus-visible { outline: 2px solid #ff6b8b; outline-offset: 3px; }

/* Infos projet + compteur */
.carousel-project-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding: 0 4px;
    min-height: 28px;
}

.carousel-info-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.carousel-info-cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ff6b8b;
}

.carousel-info-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.carousel-info-year {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
}

.carousel-counter {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ============================================
   MODAL CINÉMA
   ============================================ */

.cinema-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cinema-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.cinema-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

.cinema-container {
    position: relative;
    width: 100%;
    max-width: 960px;
    z-index: 1;
    transform: scale(0.93) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cinema-modal.is-open .cinema-container {
    transform: scale(1) translateY(0);
}

.cinema-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 0 2px;
}

.cinema-meta { display: flex; flex-direction: column; gap: 3px; }

.cinema-cat {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ff6b8b;
}

.cinema-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.cinema-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cinema-close:hover {
    background: rgba(255, 107, 139, 0.2);
    border-color: rgba(255, 107, 139, 0.4);
    color: #fff;
}

.cinema-close:focus-visible { outline: 2px solid #ff6b8b; outline-offset: 3px; }

/* Vidéo 16/9 strict */
.cinema-video-wrapper {
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
}

.cinema-video-ratio {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
}

.cinema-video-ratio iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
    display: block;
}

.cinema-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 0 2px;
}

.cinema-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.cinema-year {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.22);
    font-weight: 600;
    white-space: nowrap;
    padding-top: 2px;
}

/* Flèches modal */
.cinema-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(10px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.cinema-prev { left:  -70px; }
.cinema-next { right: -70px; }

.cinema-arrow:hover {
    background: rgba(255, 107, 139, 0.25);
    border-color: rgba(255, 107, 139, 0.5);
    transform: translateY(10px) scale(1.08);
}

.cinema-arrow:focus-visible { outline: 2px solid #ff6b8b; outline-offset: 3px; }

/* Plus de disabled sur les flèches modal (carrousel infini) */

/* Compteur modal */
.cinema-modal > .cinema-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.08em;
    pointer-events: none;
    z-index: 1;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1160px) {
    .cinema-prev { left:  -56px; }
    .cinema-next { right: -56px; }
}

@media (max-width: 1040px) {
    .cinema-prev { left:  8px; }
    .cinema-next { right: 8px; }
    .cinema-arrow { background: rgba(0,0,0,0.55); border-color: rgba(255,255,255,0.1); }
}

@media (max-width: 900px) {
    .carousel-item { flex: 0 0 calc((100% - 16px) / 2); }
    .cinema-modal { padding: 16px; }
    .cinema-container { max-width: 100%; }
}

@media (max-width: 600px) {
    .carousel-item { flex: 0 0 100%; }
    .carousel-wrapper { gap: 8px; }
    .carousel-arrow { width: 40px; height: 40px; }
    .cinema-modal { padding: 12px; align-items: flex-end; }
    .cinema-title { font-size: 1.05rem; }
    .cinema-footer { flex-direction: column; gap: 4px; }
    .cinema-prev { left: 4px; }
    .cinema-next { right: 4px; }
    .cinema-arrow { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-track,
    .carousel-item,
    .carousel-item img,
    .carousel-play-btn,
    .cinema-modal,
    .cinema-container { transition: none !important; }
}
