:root {
    --bg-color: #0A0A0A;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --accent-color: #D4AF37;
    --sidebar-width: 90px;
    --corner-size: 20px;
    --transition-speed: 0.6s;
    --font-main: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --container-padding: clamp(1.5rem, 5vw, 4rem);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    /* Suppression du flash bleu au tap sur mobile */
    -webkit-tap-highlight-color: transparent;
}

/* Micro-interaction aesthetic au clic */
a:active, button:active, .carousel-slide:active, .footer-item:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
}

/* --- DECORATIONS LITTÉRAIRES --- */

/* 1. Grain Texture (Papier) */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000; /* Au-dessus de tout mais sous la curtain/modal */
    opacity: 0.04; /* Très subtil */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- ORNEMENTS IMAGES --- */

.framed-image-container {
    position: relative;
    display: inline-block; /* S'adapte à la taille de l'image */
    margin-bottom: 20px;
    z-index: 5;
}

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

/* Positionnement "Flottant" (offset négatif) */
.frame-tl {
    top: -20px;
    left: -20px;
    border-width: 1px 0 0 1px; /* Haut et Gauche */
}

.frame-br {
    bottom: -20px;
    right: -20px;
    border-width: 0 1px 1px 0; /* Bas et Droite */
}

/* Petit détail carré aux pointes */
.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; }

/* Animation au survol de l'image */
.framed-image-container:hover .frame-corner {
    width: 100%; /* Le cadre se ferme presque */
    height: 100%;
    opacity: 0.8;
    top: -10px; /* Se rapproche */
    left: -10px;
    bottom: -10px;
    right: -10px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .frame-corner {
        width: 30px;
        height: 30px;
    }
    .frame-tl { top: -15px; left: -15px; }
    .frame-br { bottom: -15px; right: -15px; }
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 50%, rgba(20, 20, 20, 1) 0%, rgba(10, 10, 10, 1) 100%);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.8;
    letter-spacing: 0.02em;
    scroll-behavior: smooth;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("https://www.transparenttextures.com/patterns/asfalt-dark.png");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

/* Custom Cursor */
body {
    cursor: none;
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    mix-blend-mode: difference;
}

.custom-cursor.hovering {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

.custom-cursor.clicking {
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

@media (pointer: coarse) {
    /* Disable custom cursor on touch devices */
    body { cursor: auto; }
    .custom-cursor { display: none; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 3px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #222;
}

/* Layout */
main {
    padding: clamp(1.5rem, 4vw, 3rem) var(--container-padding);
    min-height: calc(100vh - 140px);
    transition: opacity var(--transition-speed);
    max-width: 1600px;
    margin: 0 auto;
}

/* Header */
header {
    padding: 30px 0;
    text-align: center;
    position: relative;
    z-index: 100;
}

.logo-container {
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.3s;
}

.logo-container:hover {
    opacity: 0.7;
}

/* Footer */
footer {
    padding: 30px 0;
    text-align: center;
    background: transparent;
    border: none;
    position: relative;
    z-index: 100;
}

footer p {
    display: block !important;
    opacity: 0.5;
    margin-top: 15px;
    font-size: 0.55rem;
    letter-spacing: 2px;
    color: #444;
    text-transform: uppercase;
}

.footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.footer-item {
    color: #555;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-item:hover, .footer-item.active {
    color: var(--accent-color);
}

.footer-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 1px;
}

/* Toggle Home/Back buttons based on view */
.back-nav-item {
    display: none; /* Caché par défaut (Accueil) */
}

body:not(.no-scroll) .back-nav-item {
    display: flex; /* Visible sur Poème */
}

body:not(.no-scroll) .home-nav-item {
    display: none; /* Le livre disparaît sur Poème, remplacé par la flèche */
}

/* Carousel - Aesthetic Gallery */
.carousel-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 180px);
    overflow: hidden; /* CRITIQUE : Empêche de voir les voisins */
    perspective: 1000px;
    margin-bottom: 40px;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); /* Plus rapide et fluide */
}

.carousel-slide {
    min-width: 100%; /* Force chaque slide à prendre toute la largeur */
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 20px;
    opacity: 0.3; /* Inactifs transparents */
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none; /* Inactifs non-cliquables */
}

.carousel-slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto; /* Actif cliquable */
}

/* Main Image Container */
.carousel-image {
    position: relative;
    width: auto;
    height: 65vh;
    max-height: 550px;
    aspect-ratio: 3/4;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    margin: 0 20px;
}

.carousel-slide:hover .carousel-image {
    transform: translateY(-5px) scale(1.01);
}

.carousel-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.carousel-slide:hover .carousel-image {
    transform: translateY(-5px) scale(1.01);
        0 25px 50px rgba(0,0,0,0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit tout le cadre */
    object-position: center;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block; /* Évite les ghost pixels */
}

.carousel-slide:hover .carousel-image img {
    transform: scale(1.05);
}

/* Main Image Container */
.carousel-image {
    position: relative;
    width: auto;
    height: 65vh;
    max-height: 550px;
    overflow: hidden;
        0 15px 30px rgba(0,0,0,0.3),
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 4px;
    margin: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* FLOU DEMANDÉ */
    filter: blur(12px) brightness(0.6); 
    transform: scale(1.1);
    transition: transform 1.2s ease, filter 0.5s ease;
}

.carousel-slide:hover .carousel-image img {
    transform: scale(1.15);
    /* Optionnel : réduire le flou au survol pour révéler un peu ? */
    filter: blur(10px) brightness(0.7); 
}

/* Titre DANS l'image - Version Pure */
.carousel-title {
    position: absolute;
    z-index: 10;
    width: 90%;
    margin: 0;
    /* On retire les anciens styles relatifs/wrapper */
    
    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;
}

/* Suppression complète du wrapper */
.title-ornament-wrapper { display: none; }

.carousel-slide:hover .carousel-title {
    color: var(--accent-color);
    transform: scale(1.05);
}

/* Feedback au clic (Active state scripté) */

/* Ajustement Mobile - Nettoyé */
/* @media (max-width: 768px) SUPPRIMÉ car fusionné plus bas */

.carousel-number {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 0.9rem;
    letter-spacing: 3px;
    color: var(--accent-color); /* Doré */
    opacity: 1; /* Pleine opacité pour bien voir le doré */
    z-index: 20; /* Au-dessus du flou */
    font-family: var(--font-serif);
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* Ajustement pour les dots qui doivent rester en bas */
.carousel-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
}

/* Carousel Navigation (Arrows Only) */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 15px;
    font-size: 24px;
    transition: color 0.3s;
    z-index: 100;
}

.carousel-prev { left: 30px; }
.carousel-next { right: 30px; }

.carousel-prev:hover,
.carousel-next:hover {
    color: var(--text-primary);
}

/* Poem View - FIXED Layout */
.poem-view {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    padding: 120px 40px 150px; /* Padding haut pour header, bas pour footer */
    min-height: 100vh;
}

.artwork-side {
    position: sticky;
    top: 120px;
    height: fit-content;
    align-self: start;
    width: 100%;
    /* Flex centré pour le cadre */
    display: flex;
    flex-direction: column;
    align-items: center; 
}

/* Update pour le cadre (Le wrapper remplace l'img directe pour le layout) */
.framed-image-container {
    width: auto;
    max-width: 100%;
    position: relative;
    display: inline-block;
}

/* L'image DANS le wrapper */
.framed-image-container img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: cover;
    display: block;
    cursor: zoom-in; /* Pour lightbox */
}

/* On vide la règle précédente qui ciblait l'img directement dans artwork-side */
.artwork-side > img {
    display: none; /* Sécurité si ancien HTML en cache */
}

.artwork-credit {
    font-size: 10px;
    color: #333;
    letter-spacing: 1px;
    margin-top: 15px;
    text-align: center; /* Centré sous l'image */
}

/* Right Column */
.right-column {
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

.poem-content {
    margin-bottom: 60px;
}

.poem-content h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 400;
    letter-spacing: -1px;
    margin-bottom: 15px;
    line-height: 1.1;
}

.poem-author {
    font-size: 12px;
    color: var(--accent-color);
    letter-spacing: 2px;
    margin-bottom: 50px;
    opacity: 0.7;
}

.poem-body {
    font-family: var(--font-main);
    font-size: clamp(1.1rem, 2.2vw, 1.2rem); /* Taille adaptative fluide */
    line-height: 2.2;
    color: var(--text-secondary);
    white-space: pre-line;
    font-weight: 300;
    letter-spacing: 0.5px;
    max-width: 65ch; /* Largeur de lecture optimale */
    margin-bottom: 40px; /* Espace avant les actions */
}

.text-short { font-size: 1.4rem; }
.text-long { font-size: 1rem; }

/* Actions - Clean Row */
.poem-actions-fixed {
    display: flex;
    gap: 25px; /* Plus d'espace */
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Ligne très subtile */
    margin-top: auto;
}

.share-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 10px;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    position: relative;
    z-index: 10;
}

.share-btn:hover {
    color: var(--accent-color);
    transform: translateY(-3px) scale(1.1);
}

.share-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.2;
}

/* Back Button */
.back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 1000;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    color: var(--text-primary);
    transform: translateX(-5px);
}

.back-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

/* Admin Styles */
.admin-login {
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.admin-login input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #222;
    color: white;
    padding: 15px;
    font-family: inherit;
    margin-bottom: 25px;
    outline: none;
    text-align: center;
    letter-spacing: 5px;
    transition: border-color 0.3s;
}

.admin-login input:focus {
    border-color: var(--accent-color);
}

.admin-login button, .admin-dashboard button, .poem-form button {
    background: transparent;
    color: white;
    border: 1px solid #333;
    padding: 14px 45px;
    cursor: pointer;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.7rem;
    transition: all 0.3s;
}

.admin-login button:hover, .admin-dashboard button:hover, .poem-form button:hover {
    background: var(--accent-color);
    color: black;
    border-color: var(--accent-color);
}

.admin-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.poem-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 80px;
    padding: clamp(1.5rem, 5vw, 4rem);
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-message {
    color: #ff4d4d;
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: none;
    margin-top: 4px;
}

.poem-form input, .poem-form textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.poem-form input:focus, .poem-form textarea:focus {
    border-color: var(--accent-color);
}

.admin-poem-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-poem-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.admin-poem-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-poem-item button {
    color: #ff4d4d;
    border-color: rgba(255, 77, 77, 0.2);
    padding: 8px 20px;
    font-size: 0.6rem;
}

.admin-poem-item button:hover {
    background: #ff4d4d;
    border-color: #ff4d4d;
    color: white;
}

/* Tooltip */
.tooltip {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    font-size: 11px;
    letter-spacing: 2px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    border-radius: 4px;
    backdrop-filter: blur(5px);
}

.tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Transitions - Curtain Effect */
.curtain {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: #000;
    z-index: 9999;
    transition: left 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.curtain::after {
    content: 'mouja.ink';
    font-weight: 100;
    letter-spacing: 15px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.1);
    text-transform: lowercase;
}

.curtain.visible {
    left: 0;
}

.curtain.exit {
    left: 100%;
}

/* Lightbox Base */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none; /* Bloque tout le conteneur */
    transition: opacity 0.4s ease;
    backdrop-filter: blur(20px);
}

.lightbox-caption {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-main);
    font-size: 0.9rem;
/* Lightbox Base */
.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;
}

/* Lightbox Frame & Image */
.lightbox .framed-image-container {
    position: relative;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 80vh;
    margin: 0;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

/* Caption en bas */
.lightbox-caption {
    margin-top: 20px;
    position: static;
    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;
    padding: 0 20px;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: transparent;
    border: none;
    color: var(--accent-color); /* Couleur Ornement */
    cursor: pointer;
    padding: 10px;
    opacity: 0; /* Caché au début pour l'anim */
    transform: rotate(-90deg) scale(0.8); /* Position de départ */
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 10001;
}

.lightbox.active .lightbox-close {
    opacity: 1;
    transform: rotate(0) scale(1); /* Arrivée fluide */
    transition-delay: 0.3s; /* Apparaît après l'image */
}

.lightbox-close:hover {
    transform: rotate(90deg) scale(1.2); /* Réaction au survol */
    color: #fff; /* Devient blanc au survol pour le feedback */
    text-shadow: 0 0 15px var(--accent-color); /* Glow */
}

.lightbox-close svg {
    width: 32px; /* Un peu plus grand */
    height: 32px;
    stroke-width: 1; /* Plus fin, plus élégant */
}

/* Focus Reading Mode */
.reading-mode-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reading-mode-btn:hover {
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.1);
}

.reading-mode-active .artwork-side,
.reading-mode-active header,
.reading-mode-active footer,
.reading-mode-active .back-btn,
.reading-mode-active .poem-actions-fixed,
.reading-mode-active .poem-author {
    opacity: 0;
    pointer-events: none;
}

.reading-mode-active .poem-view {
    grid-template-columns: 1fr;
    max-width: 800px;
    padding-top: 15vh;
}

.reading-mode-active .poem-body {
    color: var(--text-primary);
    font-size: 1.4rem;
}

/* Quote Card Export Template (Hidden from view) */
#quote-card-template {
    position: fixed;
    top: -5000px;
    left: -5000px;
    width: 1080px;
    height: 1920px; /* Format Story/Portrait pour mobile */
    background: #000;
    color: white;
    font-family: 'Inter', sans-serif;
    display: none;
    overflow: hidden;
}

.quote-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(25px) brightness(0.6); /* Flou prononcé + assombrissement */
    transform: scale(1.1); /* Zoom léger pour éviter les bords flous */
}

.quote-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.2); /* Voile supplémentaire léger */
    z-index: 1;
}

.quote-card-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    padding: 120px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.quote-card-text {
    font-family: var(--font-serif);
    font-size: 52px; /* Texte plus grand */
    line-height: 1.5;
    margin-bottom: 80px;
    color: #fff;
    font-style: italic;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 100%;
}

.quote-card-info {
    margin-top: auto; /* Pousse vers le bas */
    margin-bottom: 60px;
}

.quote-card-info h2 {
    font-size: 32px;
    letter-spacing: 8px;
    text-transform: uppercase;
    font-weight: 400;
    margin-bottom: 20px;
    text-shadow: 0 5px 20px rgba(0,0,0,0.8);
}

.quote-card-author {
    color: var(--accent-color);
    letter-spacing: 4px;
    font-size: 20px;
    text-shadow: 0 5px 20px rgba(0,0,0,0.8);
}

.quote-card-footer {
    position: absolute;
    bottom: 50px;
    letter-spacing: 12px;
    font-size: 16px;
    opacity: 0.6;
    text-transform: lowercase;
    text-shadow: 0 2px 10px rgba(0,0,0,1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Poem View */
@media (max-width: 1100px) {
    .poem-view { 
        grid-template-columns: 1fr;
        padding: 100px 30px 120px; /* Plus d'espace haut/bas + marge latérale */
        gap: 60px;
    }
    
    .artwork-side {
        position: relative;
        top: 0;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .right-column {
        padding-bottom: 0;
    }
    
    .poem-content h1 {
        font-size: 2.5rem;
        text-align: center; /* Titre centré sur mobile */
    }
    
    .poem-author {
        text-align: center;
        margin-bottom: 40px;
    }
    
    .poem-body {
        font-size: 1.15rem; /* Lecture confortable */
        margin: 0 auto; /* Centré si plus petit que l'écran */
        padding: 0 10px; /* Micro padding de sécurité */
    }
    
    .poem-actions-fixed {
        justify-content: center; /* Actions centrées */
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 40px;
    }

    .back-btn {
        top: 25px;
        left: 20px;
        background: rgba(0,0,0,0.5); /* Fond pour lisibilité sur image si besoin */
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 900px) {
    /* Layout Grid Radical pour Mobile - UNIQUEMENT sur l'accueil */
    body.no-scroll {
        display: grid;
        grid-template-rows: auto 1fr auto;
        height: 100dvh;
        overflow: hidden;
    }

    /* Adapter le layout quand on scrolle (page poème) */
    body:not(.no-scroll) {
        height: auto;
        overflow-y: auto;
        display: block;
    }

    body:not(.no-scroll) header {
        position: relative;
    }

    body:not(.no-scroll) main {
        height: auto;
        min-height: 100vh;
        display: block; /* Laisse le contenu couler */
        padding-bottom: 40px;
    }

    /* Le reste s'applique au carousel qui n'existe que sur home */
    header {
        padding: 15px 0;
        /* grid-row retiré car géré par body.no-scroll */
    }

    /* Footer de base (Accueil) : Invisible */
    footer {
        padding: 15px 0;
        position: fixed; 
        bottom: 0;
        left: 0;
        width: 100%;
        background: transparent;
        z-index: 1000;
        margin: 0;
    }

    /* Footer sur page Poème (Scroll) : Glassmorphism + Animation */
    body:not(.no-scroll) footer {
        background: rgba(10, 10, 10, 0.6);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        transition: transform 0.3s ease;
    }

    /* Smart Nav Logic */
    body:not(.no-scroll) footer.nav-hidden {
        transform: translateY(100%); /* Vers le bas */
    }

    /* Header & Back Button Smart Hide */
    body:not(.no-scroll) header, 
    .back-btn {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    body:not(.no-scroll) header.nav-hidden,
    .back-btn.nav-hidden {
        transform: translateY(-100%); /* Vers le haut */
        opacity: 0;
    }

    /* Main par défaut (pour tout le monde sur mobile) */
    main {
        height: 100%;
        width: 100%;
        padding: 0 var(--container-padding);
        display: flex;
        flex-direction: column;
        /* Par défaut on centre pas forcément, sauf si spécifié */
    }

    /* Spécifique Accueil : Centrage Optique par Grid */
    body.no-scroll main {
        flex: 1; /* Le main remplit l'espace entre Header et Footer */
        display: grid;
        grid-template-rows: 1fr auto 1.5fr; /* Magie du centrage haut */
        padding: 0 var(--container-padding);
        overflow: hidden;
        min-height: 0;
    }

    /* Le carousel va dans la ligne du milieu */
    body.no-scroll .carousel-container {
        grid-row: 2;
        height: auto;
        /* Je force un padding bottom pour remonter le centre visuel */
        padding-bottom: 80px;
        margin: 0;
        display: block; 
        width: 100%;
    }

    /* On garde le body en Flex pour Header/Main/Footer */
    body.no-scroll {
        display: flex; 
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
    }

    body.no-scroll header {
        flex-shrink: 0; /* Header protégé */
        padding: 15px 0;
        z-index: 50;
    }

    /* Carousel compact */
    .carousel-track {
        height: auto;
    }

    .carousel-slide {
        min-width: 100%; 
        height: auto;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    /* Image responsive intelligente - Mobile */
    .carousel-image {
        width: auto;
        height: auto;
        max-width: 85vw;
        max-height: 50vh;
        margin: 0 auto;
        flex-shrink: 1; 
        border-radius: 4px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .carousel-title {
        font-size: 1.8rem;
        margin: 0;
        position: absolute;
        width: 90%;
        color: white;
        text-shadow: 0 4px 10px rgba(0,0,0,0.8);
    }
    
    /* Force le masquage des flèches */
    .carousel-prev, .carousel-next { display: none !important; }
}
