/**
 * ============================================
 * CHRONOLOGIE MOSQUÉE - STYLES V4
 * Optimisé pour toutes les résolutions
 * ============================================
 */

@font-face {
    font-family: 'AvenirNextLTProRegular';
    font-style: normal;
    font-weight: 400;
    src: url('/wp-content/uploads/et-fonts/AvenirNextLTPro-Regular.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'AvenirNextLTProIt';
    font-style: italic;
    font-weight: 400;
    src: url('/wp-content/uploads/et-fonts/AvenirNextLTPro-It.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'AvenirNextLTProBlod';
    font-style: normal;
    font-weight: 700;
    src: url('/wp-content/uploads/et-fonts/AvenirNextLTPro-Bold.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'AvenirNextLTProDemi';
    font-style: normal;
    font-weight: 600;
    src: url('/wp-content/uploads/et-fonts/AvenirNextLTPro-Demi.otf') format('opentype');
    font-display: swap;
}

/* ============================================
   1. RESET & BASE
   ============================================ */

body {
    overflow-x: hidden;
}

/* CONTENEUR PRINCIPAL - Flexbox avec hauteur minimale */
.chronologie-fullscreen {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: visible;
    background-size: cover;
    background-position: bottom left;
    background-repeat: no-repeat;
    background-attachment: fixed;
    transition: background-image 1s ease-in-out, background-color 0.6s ease;
}

/* Fix pour Firefox */
@-moz-document url-prefix() {
    .chronologie-fullscreen {
        background-attachment: scroll;
        transition: background-image 1.5s ease-in-out;
    }
}

.chronologie-fullscreen * {
    box-sizing: border-box;
}

/* ============================================
   2. TITRE PRINCIPAL
   ============================================ */

.chronologie-header {
    position: relative;
    width: 100%;
    max-width: 1400px;
    text-align: left;
    padding: 60px 20px 10px 0px;
    margin: 0 auto;
    flex-shrink: 0;
}

.chronologie-main-title {
    margin: 0;
    line-height: 1.1;
}

.chronologie-main-title .subtitle {
    display: block;
    font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    color: #666;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-family: 'AvenirNextLTPro', Helvetica, Arial, sans-serif;
}

.chronologie-main-title .main {
    display: block;
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    color: #B01D58;
    text-transform: uppercase;
    font-family: 'AvenirNextLTPro', Helvetica, Arial, sans-serif;
    line-height: 1.1;
}

.chronologie-main-title strong {
    color: #E64C5B;
    font-family: 'AvenirNextLTPro', Helvetica, Arial, sans-serif;
    font-weight: 700;
}

/* ============================================
   3. ZONE DE CONTENU DYNAMIQUE
   ============================================ */

.chronologie-content {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 0 100px 0;
    transition: opacity 0.4s ease;
}

.chronologie-content.fade-out {
    opacity: 0;
}

.chronologie-content.fade-in {
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ============================================
   4. ITEM
   ============================================ */

#mosquee-chronologie-container .chrono-item {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(20px, 4vw, 50px) 40px;
}

.chrono-item::before {
    content: none;
}

/* ============================================
   5. TITRE SECONDAIRE
   ============================================ */

.chrono-intro {
    width: 100%;
    max-width: 1400px;
    text-align: left;
    margin: 10px 0 40px 0;
}

.chrono-subtitle-main {
    font-size: clamp(1.3rem, 2.8vw, 1.9rem);
    color: #666;
    font-weight: 300;
    margin: 0;
    line-height: 1.3;
}

.chrono-subtitle-main h2 {
    color: #666;
    font-size: inherit;
    margin: 0;
    font-weight: inherit;
}

.chrono-subtitle-main h2 span.orange {
    color: #DB8A48;
}

.chrono-subtitle-main h2 span.rouge {
    color: #E64C5B;
}

/* ============================================
   6. WRAPPER DES DEUX BLOCS
   ============================================ */

.chrono-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   7. ZONE TEXTE
   ============================================ */

.chrono-text-zone {
    position: relative;
    background: rgba(40, 40, 40, 0.95);
    color: white;
    padding: clamp(35px, 4.5vw, 60px) clamp(25px, 3.5vw, 45px) clamp(30px, 4vw, 50px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.chrono-year-badge {
    position: absolute;
    top: clamp(-25px, -1.8vw, -25px);
    left: clamp(15px, 2.5vw, 35px);
    background: #E64C5B;
    color: white;
    padding: clamp(8px, 1.2vw, 10px) clamp(10px, 1.8vw, 18px);
    font-size: clamp(1.2rem, 2.4vw, 2rem);
    font-family: 'AvenirNextLTPro', Helvetica, Arial, sans-serif;
    font-weight: 800;
    border-radius: 6px;
    box-shadow: 4px 4px 0 0 rgba(0, 0, 0, .3);
    white-space: nowrap;
    line-height: 1.1;
}

.chrono-text-content {
    line-height: 1.7;
    font-size: clamp(0.92rem, 1.35vw, 1rem);
    color: rgba(255, 255, 255, 0.95);
}

.chrono-text-content h2 {
    color: #E64C5B;
}

.chrono-text-content p {
    margin: 0 0 12px 0;
}

.chrono-text-content p:last-child {
    margin-bottom: 0;
}

.chrono-text-content h3 {
    color: #E64C5B;
    font-size: clamp(1.15rem, 1.8vw, 1.4rem);
    margin: 18px 0 10px 0;
    line-height: 1.5;
    font-style: italic;
    font-family: 'AvenirNextLTPro', Helvetica, Arial, sans-serif;
}

/* ============================================
   8. ZONE VISUELLE (bloc droite avec images)
   ============================================ */

.chrono-visual-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    min-height: 380px;
}

/* Image unique */
.chrono-single-image {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 380px;
    max-height: 500px;
}

.chrono-single-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    display: block;
}

/* Légende pour image unique */
.single-image-caption {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(230, 76, 91, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-style: italic;
    max-width: 70%;
    line-height: 1.4;
    z-index: 5;
}

/* Slider d'images - Fondu fluide */
.chrono-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.chrono-slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: pan-y pinch-zoom;
}

/* Slides en position absolute pour le fondu croisé */
.chrono-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Slide active */
.chrono-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

/* Image du slider */
.chrono-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Contrôles du slider (légende + dots) */
.slider-controls {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 10;
    gap: 15px;
}

/* Légende du slider (à gauche) */
.slider-caption {
    flex: 0 1 auto;
    background: rgba(230, 76, 91, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-style: italic;
    line-height: 1.4;
    max-width: 65%;
    margin-left: -20px;
    transition: opacity 0.3s ease; /* Transition fluide */
}

/* Si pas de légende, on cache complètement le bloc */
.slider-caption:empty,
.slider-caption[style*="display: none"] {
    display: none !important;
    padding: 0 !important;
    background: transparent !important;
    opacity: 0 !important;
}

/* Indicateurs (dots) à droite - TOUJOURS VISIBLES */
.slider-dots {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.slider-dot:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
}

.slider-dot.active {
    background: white;
    width: 12px;
    height: 12px;
    border: 1px solid #b8415b;
}

/* ============================================
   9. CRÉDIT PHOTO
   ============================================ */

.chrono-credit {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 15px auto 0;
    width: 100%;
    max-width: 1400px;
    padding: 0 20px 0 0;
}

/* ============================================
   10. NAVIGATION
   ============================================ */

.chronologie-nav {
    position: fixed;
    bottom: 50px;
    right: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transition: bottom 0.3s ease;
    background: #fff;
    padding: 10px 10px;
    border-radius: 80px;
    box-shadow: 0px 2px 7px 0px rgba(0,0,0,0.1);
}

.chrono-arrow {
    width: 40px;
    height: 40px;
    background: #B01D58;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chrono-arrow svg {
    width: 18px;
    height: 18px;
}

.chrono-arrow:hover {
    transform: scale(1.1);
    background: #9a3349;
}

.chrono-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chrono-arrow:disabled:hover {
    transform: scale(1);
}

.chrono-year-selector {
    position: relative;
}

.chrono-current-year {
    background: #333;
    color: white;
    padding: 0 20px;
    height: 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chrono-current-year:hover {
    background: #444;
}

.chrono-year-menu {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 450px;
    overflow-y: auto;
    padding: 8px;
    opacity: 1;
    min-width: 120px;
    transition: opacity 0.3s ease;
}

.chrono-year-menu.hidden {
    opacity: 0;
    pointer-events: none;
}

.year-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    color: #333;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.year-item:hover {
    background: #f5f5f5;
    color: #b8415b;
}

.year-item.active {
    background: #b8415b;
    color: white;
}

/* Scrollbar personnalisée du menu */
.chrono-year-menu::-webkit-scrollbar {
    width: 6px;
}

.chrono-year-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chrono-year-menu::-webkit-scrollbar-thumb {
    background: #b8415b;
    border-radius: 10px;
}

.chrono-year-menu::-webkit-scrollbar-thumb:hover {
    background: #9a3349;
}

/* ============================================
   11. RESPONSIVE - MACBOOK PRO (1440px - 1920px)
   ============================================ */

@media (min-width: 1440px) and (max-width: 1920px) {
    .chronologie-header {
        padding: 40px 20px 8px 0px;
    }
    
    .chronologie-main-title .subtitle {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
    
    .chronologie-main-title .main {
        font-size: 2.8rem;
    }
    
    .chronologie-content {
        padding: 0 0 90px 0;
    }
    
    .chrono-intro {
        margin: 8px 0 35px 0;
    }
    
    .chrono-subtitle-main {
        font-size: 1.7rem;
    }
    
    .chrono-text-zone {
        padding: 55px 38px 45px;
    }
    
    .chrono-year-badge {
        font-size: 1.8rem;
        padding: 10px 15px;
        top: -25px;
        left: 38px;
    }
    
    .chrono-text-content {
        font-size: 1rem;
    }
    
    .chrono-text-content h3 {
        font-size: 1.4rem;
        margin: 18px 0 10px 0;
    }
    
    .chrono-visual-zone {
        min-height: 400px;
    }
}

/* Laptop standard (1200px - 1440px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .chronologie-header {
        padding: 35px 20px 12px 40px;
    }
    
    .chrono-intro {
        margin: 12px 0 45px 0;
    }
    
    .chrono-wrapper {
        max-width: 100%;
        gap: 0;
    }
    
    .chrono-text-zone {
        padding: 60px 40px 50px;
    }
    
    .chrono-year-badge {
        font-size: 1.8rem;
        padding: 10px 15px;
    }
}

/* Tablettes et petits laptops (900px - 1199px) */
@media (max-width: 1199px) and (min-width: 900px) {
    .chronologie-header {
        padding: 40px 30px 15px 40px;
    }
    
    .chronologie-content {
        padding: 0 0 100px 0;
    }
    
    .chrono-wrapper {
        max-width: 100%;
    }
}

/* Tablettes portrait (moins de 900px) */
@media (max-width: 900px) {
    .chronologie-header {
        text-align: left;
        max-width: 100%;
        padding: 35px 20px 12px 40px;
    }
    
    .chronologie-content {
        padding: 0 20px 100px;
    }
    
    .chrono-intro {
        /*text-align: center;*/
        margin: 12px 0 35px 0;
    }
    
    .chrono-wrapper {
        grid-template-columns: 1fr;
        gap: 0px;
        max-width: 700px;
    }
    
    .chrono-visual-zone {
        min-height: 350px;
    }
    
    .chronologie-nav {
        bottom: 30px;
        right: 30px;
    }
}

/* Mobiles (moins de 700px) */
@media (max-width: 700px) {
    .chronologie-header {
        padding: 30px 20px 10px 26px;
    }
    
    .chronologie-content {
        padding: 0 15px 0;
    }
    
    #mosquee-chronologie-container .chrono-item {
        padding: 0 15px 30px;
    }
    
    .chrono-intro {
        margin: 10px 0 30px 0;
    }
    
    .chrono-text-zone {
        padding: 50px 25px 40px;
    }
    
    .chrono-year-badge {
        font-size: 1.6rem;
        padding: 8px 15px 6px;
        top: -22px;
        left: 20px;
    }
    
    .chrono-visual-zone {
        min-height: 300px;
    }
    
    /* Navigation statique sous le contenu */
    .chronologie-nav {
        position: relative;
        bottom: auto;
        right: auto;
        margin: 0 auto 20px;
        width: fit-content;
        transform: none;
    }
    
    .chrono-arrow {
        width: 40px;
        height: 40px;
    }
    
    .chrono-arrow svg {
        width: 18px;
        height: 18px;
    }
    
    .chrono-current-year {
        font-size: 1.2rem;
        height: 40px;
        padding: 0 20px;
    }
}

/* Petits mobiles (moins de 480px) */
@media (max-width: 480px) {
    .chronologie-content {
        padding: 0 10px 0;
    }
    
    .chrono-text-zone {
        padding: 40px 20px 30px;
    }
    
    .chrono-visual-zone {
        min-height: 250px;
    }
}