/* STYLE ADDONS - VERSION FINALE REPAIRED (ALL FEATURES) */

/* Pas de sélection de texte ni curseur d'écriture */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
}

/* Curseur pointer sur les vrais éléments cliquables */
a, button, .logo-container, .footer-item {
    cursor: pointer !important;
}

/* Carousel : curseur par défaut partout, sauf sur l'image elle-même */
.carousel-slide, .carousel-track, .carousel-container {
    cursor: default !important;
}

/* Cur seur pointer UNIQUEMENT sur l'img et le texte cliquables */
.carousel-image img, 
.carousel-title, 
.carousel-number {
    cursor: pointer !important;
}

/* Curseur texte UNIQUEMENT sur les champs de formulaire */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text !important;
}

/* --- LOGO GÉOMÉTRIQUE ART DÉCO --- */
header {
    pointer-events: none;
}

.logo-container {
    pointer-events: auto;
    cursor: pointer;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center; /* Centrage Horizontal aussi */
    height: 50px;
}

.logo-icon {
    width: 40px; /* Taille augmentée */
    height: 40px;
    color: #D4AF37; /* OR VIF */
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.5));
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.geo-frame {
    fill: transparent;
    transition: all 0.4s ease;
}

.geo-wave {
    stroke-dasharray: 40;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.6s ease;
}

/* Effet Survol */
.logo-container:hover .logo-icon {
    transform: rotate(45deg);
    color: #FFD700;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

.logo-container:hover .geo-frame {
    fill: rgba(212, 175, 55, 0.1);
}

/* TYPO LOGO CORRIGÉE (Inter, Fine, Espacée) */
.logo-text {
    font-family: var(--font-main);
    font-weight: 200;
    letter-spacing: 6px;
    font-size: 1.2rem;
    color: #fff;
    opacity: 0.9;
    text-transform: lowercase;
    transition: all 0.3s ease;
    padding-top: 3px; /* Ajustement optique vertical */
}

.logo-container:hover .logo-text {
    color: #D4AF37;
    letter-spacing: 7px;
}

/* Mobile */
@media (max-width: 768px) {
    .logo-wrapper { gap: 10px; height: 40px; }
    .logo-icon { width: 34px; height: 34px; }
    .logo-text { font-size: 1rem; letter-spacing: 4px; }
}

/* --- ORNEMENTS & CADRES --- */
.framed-image-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    z-index: 5;
}

.frame-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    border-color: var(--accent-color);
    border-style: solid;
    pointer-events: none;
    opacity: 0.5;
    transition: all 0.4s ease;
}

.frame-tl { top: -20px; left: -20px; border-width: 1px 0 0 1px; }
.frame-br { bottom: -20px; right: -20px; border-width: 0 1px 1px 0; }

.frame-corner::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-color);
}
.frame-tl::after { top: -2px; left: -2px; }
.frame-br::after { bottom: -2px; right: -2px; }

.framed-image-container:hover .frame-corner {
    width: 100%; height: 100%; opacity: 0.8;
    top: -10px; left: -10px; bottom: -10px; right: -10px;
}

/* --- LIGHTBOX (MINIMALISTE) --- */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.96);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(20px);
}

.lightbox.active { opacity: 1; pointer-events: auto; }

/* ANIMATION LIGHTBOX MANUELLE (Transition) */
.lightbox .framed-image-container {
    position: relative;
    width: auto; height: auto;
    max-width: 90vw; max-height: 80vh;
    margin: 0; 
    pointer-events: inherit;
    display: flex; justify-content: center; align-items: center;
    transform: scale(0.8);
    opacity: 1; 
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox .framed-image-container.zoom-in {
    transform: scale(1) !important;
}

.lightbox .framed-image-container img {
    display: block; width: auto; height: auto;
    max-width: 100%; max-height: 85vh; 
    object-fit: contain;
    box-shadow: none !important; 
    transform: none !important;
    cursor: default;
    opacity: 1 !important; visibility: visible !important;
    z-index: 10;
}

/* Pas d'ornements dans la Lightbox */
.lightbox .frame-corner { display: none !important; }

/* Légende Proche */
.lightbox-caption {
    margin-top: 10px !important;
    width: 100%; text-align: center;
    color: var(--accent-color);
    font-family: var(--font-main);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,1);
    pointer-events: none;
    opacity: 0.8 !important;
}

.lightbox-close {
    position: absolute; top: 30px; right: 30px;
    background: transparent; border: none;
    color: var(--accent-color);
    cursor: pointer; padding: 10px;
    opacity: 0; transform: rotate(-90deg) scale(0.8);
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 20001;
}

.lightbox.active .lightbox-close {
    opacity: 1; transform: rotate(0) scale(1);
    transition-delay: 0.3s;
}

.lightbox-close:hover {
    transform: rotate(90deg) scale(1.2);
    color: #fff;
    text-shadow: 0 0 15px var(--accent-color);
}

.lightbox-close svg { width: 32px; height: 32px; stroke-width: 1; }

/* --- ACTIONS POÈME CENTRÉES --- */
.poem-actions-fixed {
    display: flex !important;
    justify-content: center !important;
    gap: 30px !important;
    width: 100% !important;
    margin-top: 20px !important; 
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important; 
}

/* --- RÉSONANCE (LIKE) --- */
.resonate-btn {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important; 
    height: auto !important;
    padding: 10px !important;
    margin: 0 !important;
    border: none !important;
    overflow: visible !important;
}

.resonate-btn svg {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    z-index: 2 !important;
    display: block !important;
}

.resonate-btn.resonating svg {
    fill: var(--accent-color) !important;
    color: var(--accent-color) !important;
    transform: scale(1.2) !important;
    animation: heartbeat 0.3s ease-out;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.resonate-btn:focus, .share-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.like-count {
    position: absolute !important;
    bottom: -8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    white-space: nowrap !important;
    font-size: 0.65rem !important;
    color: var(--accent-color) !important;
    pointer-events: none !important;
    text-align: center !important;
}

.ripple-effect {
    position: fixed;
    width: 20px; height: 20px;
    background: transparent;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: none;
    z-index: 9999;
    animation: rippleExpand 0.8s ease-out forwards;
}

@keyframes rippleExpand {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; border-width: 2px; }
    100% { transform: translate(-50%, -50%) scale(4); opacity: 0; border-width: 0px; }
}

/* --- NAVBAR & FOOTER --- */
footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 15px 0 !important;
    border-top: none !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

footer.nav-hidden {
    transform: translateY(200%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
}

.footer-nav {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

footer p {
    display: block !important;
    margin-top: 10px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    font-weight: 300 !important;
    font-size: 0.6rem !important;
}

.footer-item {
    color: rgba(255, 255, 255, 0.5) !important;
    transition: color 0.3s ease;
}

.footer-item.active {
    color: var(--accent-color) !important;
}

.back-nav-item.active {
    color: rgba(255, 255, 255, 0.5) !important;
}

.footer-item:active {
    color: var(--accent-color) !important;
    transform: scale(0.9) !important;
}

/* --- ACCUEIL (Updated: Numéro au-dessus) --- */

/* Fix Desktop : Centrage vertical parfait */
@media (min-width: 1101px) {
    .carousel-container {
        display: flex !important;
        align-items: center !important; /* Centre verticalement */
        justify-content: center !important;
        height: calc(100vh - 140px) !important; /* Hauteur moins header/footer */
        top: 70px !important; /* Espace header */
        padding-bottom: 70px !important; /* Espace footer */
    }
    
    .carousel-image {
        max-height: 68vh !important; /* Images plus grandes */
        max-width: 75vw !important; /* Limite largeur pour garder proportions */
        margin-top: 0 !important; /* Centré par le parent */
    }
    
    /* Centrage et couleur - FORCÉ */
    .carousel-slide .carousel-title {
        transform: translate(-50%, -50%) !important;
        left: 50% !important;
        top: 55% !important;
        color: #fff !important;
        transition: color 0.3s ease !important;
    }
    
    .carousel-image:hover .carousel-title {
        color: var(--accent-color) !important;
        transform: translate(-50%, -50%) !important;
        left: 50% !important;
        top: 55% !important;
    }
    
    /* Animation image UNIQUEMENT au survol de l'image, pas du slide */
    .carousel-image img {
        transition: transform 0.6s ease, filter 0.3s ease !important;
    }
    
    .carousel-image:hover img {
        transform: scale(1.05) !important;
        filter: blur(8px) brightness(0.7) !important;
    }
    
    /* Flèches : toujours visibles et cliquables */
    .carousel-prev, .carousel-next {
        z-index: 1000 !important;
        pointer-events: auto !important;
    }
}

.carousel-slide.clicked .carousel-image img {
    transform: scale(1.2) !important;
    filter: blur(8px) brightness(0.5) !important;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.carousel-title {
    position: absolute; 
    z-index: 10; 
    width: 90%; 
    margin: 0;
    
    /* Centrage Absolu */
    top: 55%; 
    left: 50%;
    transform: translate(-50%, -50%);
    
    font-family: var(--font-serif); 
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 2px; 
    color: #fff;
    font-style: italic; 
    text-align: center;
    text-shadow: 0 5px 20px rgba(0,0,0,0.8);
    pointer-events: none; 
    transition: all 0.5s ease;
}

.carousel-number {
    position: absolute;
    z-index: 12;
    top: 40% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    
    font-family: var(--font-main);
    font-weight: 200;
    font-size: 1.1rem !important;
    letter-spacing: 4px;
    color: var(--accent-color);
    text-transform: uppercase;
    opacity: 0.8;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    pointer-events: none;
    transition: all 0.5s ease;
}

/* Mobile : comportement normal (déjà parfait) */
@media (max-width: 1100px) {
    .carousel-slide:hover .carousel-title { 
        color: var(--accent-color); 
    }
}

/* --- SCROLL ACCUEIL LOCK --- */
body.no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
    position: fixed; width: 100%;
}

.carousel-container {
    height: 100vh !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    /* Remontée du carrousel */
    top: -30px; 
    left: 0; z-index: 1;
    padding-bottom: 140px !important; 
    padding-top: 0 !important;
}

/* --- SUPPRESSION TOTALE PARASITES --- */
#quote-card-template {
    display: none !important;
    visibility: hidden !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -9999 !important;
    opacity: 0 !important;
}

/* --- TRANSITION RÊVE --- */
.curtain {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
    z-index: 9999; pointer-events: none;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; align-items: center; justify-content: center;
}

.curtain.visible {
    background: rgba(0, 0, 0, 1);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    pointer-events: all;
}

.curtain.exit {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
    pointer-events: none;
}

.curtain::after { display: none !important; }

/* --- RESPONSIVE MOBILE FIX --- */
@media (max-width: 1100px) {
    /* Accueil : Pas de flèches */
    .carousel-prev, .carousel-next { display: none !important; }
    
    .carousel-image {
        width: auto; height: auto;
        max-width: 85vw; max-height: 50vh;
        margin: 0 auto; flex-shrink: 1;
        display: flex; justify-content: center; align-items: center;
    }

    .carousel-title {
        font-size: 1.8rem;
        position: absolute;
        width: 90%;
        color: white;
        text-shadow: 0 4px 10px rgba(0,0,0,0.8);
        /* Fix mobile : titre ne bouge pas au touch */
        transform: translate(-50%, -50%) !important;
        left: 50% !important;
        top: 55% !important;
        transition: none !important;
    }
    
    /* Désactiver les animations de titre sur mobile */
    .carousel-slide:active .carousel-title,
    .carousel-slide:hover .carousel-title,
    .carousel-image:active .carousel-title,
    .carousel-image:hover .carousel-title {
        transform: translate(-50%, -50%) !important;
        left: 50% !important;
        top: 55% !important;
        color: #fff !important;
    }

    /* Poème View : Layout Colonne Simple */
    .poem-view {
        display: block !important;
        padding: 80px 25px 120px !important; /* Padding top réduit pour remonter l'image */
        height: auto !important;
        overflow-y: visible !important;
    }

    .artwork-side {
        position: relative !important;
        top: -20px !important; /* Remonte l'image de 20px */
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        margin-bottom: 20px !important; /* Marge réduite */
        display: flex !important;
        justify-content: center !important;
        background: transparent !important;
    }

    .framed-image-container {
        display: inline-block !important;
        max-width: 100% !important;
        width: auto !important;
    }

    .framed-image-container img {
        max-height: 60vh !important;
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
        height: auto !important;
        mask-image: none !important;
        -webkit-mask-image: none !important;
    }
    
    .artwork-side .frame-corner {
        display: block !important;
    }

    .right-column {
        width: 100% !important;
        padding: 0 !important;
        display: block !important;
    }
    
    .poem-content h1 {
        text-align: center !important;
        font-size: 2.2rem !important;
        margin-bottom: 20px !important;
        width: 100% !important;
    }
    
    .poem-body {
        font-size: 1.15rem !important;
        padding: 0 5px !important;
        text-align: center !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .poem-author {
        text-align: center !important;
        width: 100% !important;
        margin-top: 30px !important;
        margin-bottom: 0 !important;
        color: var(--accent-color) !important;
        opacity: 0.7 !important;
    }
    
    .artwork-credit {
        display: block !important;
        text-align: center !important;
        margin-top: 15px !important;
        color: #666 !important;
    }
}

/* CENTRAGE GLOBAL POÈME (Desktop inclus) */
.poem-content h1, 
.poem-body, 
.poem-author {
    text-align: center !important;
}

.poem-author {
    margin-top: 30px !important;
    margin-bottom: 0 !important;
    color: var(--accent-color) !important;
    opacity: 0.7 !important;
    font-size: 0.85rem !important;
    letter-spacing: 2px !important;
}

/* Desktop : Centrage vertical du texte par rapport à l'image */
@media (min-width: 1101px) {
    .poem-view {
        display: flex !important;
        align-items: center !important; /* Centre verticalement */
        justify-content: center !important;
        min-height: calc(100vh - 200px) !important;
        padding: 80px 60px !important;
    }
    
    .artwork-side {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .right-column {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important; /* Centre le contenu texte */
        height: 100% !important;
    }
}
