/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #fefefe;
    --color-text: #1a1a1a;
    --color-text-light: #666;
    --color-accent: #c9a87c;
    --color-border: #e8e8e8;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 16px;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(254, 254, 254, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.nav-brand .nav-logo {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.nav-brand .logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text-light);
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-text);
}

.sound-toggle {
    background: none;
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: var(--color-border);
}

.sound-icon {
    font-size: 1rem;
}

/* Music selector */
.music-selector {
    margin-right: var(--spacing-sm);
}

.music-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-bg);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.music-selector select:hover {
    border-color: var(--color-text);
}

.music-selector select:focus {
    border-color: var(--color-accent);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xl) var(--spacing-md);
    padding-top: calc(var(--spacing-xl) + 60px);
    gap: var(--spacing-lg);
    position: relative;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h1 {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.hero-content h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
    font-style: italic;
}

.hero-text {
    font-size: 1.125rem;
    color: var(--color-text-light);
    line-height: 1.8;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

/* Bouton scroll down */
.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: transparent;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-text-light);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-down:hover {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

.scroll-down span {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Sections */
.section {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.section-header {
    margin-bottom: var(--spacing-md);
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.section-header.sub-header {
    margin-top: var(--spacing-lg);
}

.section-intro {
    text-align: center;
    color: var(--color-text-light);
    font-style: italic;
}

/* Bouton next section */
.next-section {
    margin-top: auto;
    padding: var(--spacing-md);
    background: transparent;
    border: 2px solid var(--color-border);
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text-light);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    align-self: center;
}

.next-section:hover {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

.next-section .arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.next-section:hover .arrow {
    transform: translateY(3px);
}

/* Galeries */
.gallery {
    display: grid;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item.large {
    aspect-ratio: 4/5;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.gallery-item::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 0.7;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.8);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    z-index: 2001;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image-container {
    position: relative;
    width: 95vw;
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
}

.lightbox img {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

/* Zoom controls */
.zoom-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    z-index: 2002;
}

.zoom-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: white;
}

.zoom-btn.zoom-reset {
    font-size: 1.2rem;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2002;
}

.lightbox-close:hover {
    background: white;
    color: black;
    border-color: white;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2002;
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.3);
    border-color: white;
}

.lightbox-caption {
    color: white;
    font-family: var(--font-sans);
    font-size: 1.125rem;
    margin-top: var(--spacing-sm);
    text-align: center;
}

.lightbox-section {
    color: var(--color-accent);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: var(--spacing-xs);
}

.lightbox-counter {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    margin-top: var(--spacing-sm);
}

/* Carousel */
.carousel {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto var(--spacing-lg);
}

.carousel-container {
    display: flex;
    flex-direction: column;
    position: relative;
}

.carousel-viewport {
    overflow: hidden;
    border-radius: 4px;
    position: relative;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
    opacity: 0.6;
    transform: scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide.active {
    opacity: 1;
    transform: scale(1);
}

.carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(254, 254, 254, 0.95);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--color-text);
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: auto;
    right: 60px;
}

.carousel-btn.next {
    right: -25px;
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.carousel-btn:disabled:hover {
    background: rgba(254, 254, 254, 0.95);
    color: var(--color-text);
    border-color: var(--color-border);
    transform: translateY(-50%);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot:hover {
    border-color: var(--color-text);
    background: rgba(26, 26, 26, 0.1);
}

.carousel-dot.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    transform: scale(1.2);
}

.carousel-caption {
    text-align: center;
    margin-top: var(--spacing-sm);
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* Responsive Carousel */
@media (max-width: 1024px) {
    .carousel-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .carousel-btn.prev {
        left: 10px;
    }
    
    .carousel-btn.next {
        right: 10px;
    }
    
    .carousel-slide img {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .carousel {
        margin-bottom: var(--spacing-sm);
    }
    
    .carousel-viewport {
        border-radius: 0;
    }
    
    .carousel-slide img {
        max-height: 350px;
        border-radius: 0;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        background: rgba(254, 254, 254, 0.9);
    }
    
    .carousel-btn.prev {
        left: 5px;
    }
    
    .carousel-btn.next {
        right: 5px;
    }
    
    .carousel-dots {
        margin-top: var(--spacing-xs);
        gap: 8px;
    }
    
    .carousel-dot {
        width: 8px;
        height: 8px;
    }
    
    .carousel-caption {
        font-size: 0.9rem;
        margin-top: var(--spacing-xs);
    }
}

@media (max-width: 480px) {
    .carousel-slide img {
        max-height: 250px;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* Responsive lightbox */
@media (max-width: 768px) {
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .zoom-controls {
        margin-top: 15px;
    }
    
    .zoom-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* Sections texte */
.text-section {
    max-width: 800px;
}

.text-section h2 {
    margin-bottom: var(--spacing-lg);
}

.poetic-text {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    line-height: 2;
    text-align: center;
}

.histoire-content {
    font-size: 0.95rem;
    line-height: 1.7;
    column-count: 2;
    column-gap: 3rem;
    column-rule: 1px solid var(--color-border);
    padding: var(--spacing-md);
    background: rgba(249, 248, 247, 0.5);
    border-radius: 8px;
}

.histoire-content h4 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 400;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    color: var(--color-accent);
    column-span: all;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-sm);
}

.histoire-content p {
    margin-bottom: var(--spacing-sm);
    text-align: justify;
}

.histoire-content ul {
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-sm);
}

.histoire-content li {
    margin-bottom: var(--spacing-xs);
    break-inside: avoid;
}

.histoire-content .conclusion {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-style: italic;
    text-align: center;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--color-accent);
    column-span: all;
}

@media (max-width: 768px) {
    .histoire-content {
        column-count: 1;
    }
}

/* Style carte pour les galleries nombreuses */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-sm);
}

.gallery-grid .gallery-item {
    aspect-ratio: 1;
    break-inside: avoid;
}

.gallery-grid.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .gallery-grid.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Footer */
.footer {
    background: var(--color-text);
    color: var(--color-bg);
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: var(--spacing-sm);
}

.footer .email {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.footer .atelier {
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
}

.footer .copyright {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: var(--spacing-lg);
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .lightbox-prev {
        left: -70px;
    }
    
    .lightbox-next {
        right: -70px;
    }
}

@media (max-width: 768px) {
    /* Navigation adaptative - layout compact */
    .nav {
        flex-wrap: nowrap;
        padding: var(--spacing-xs) var(--spacing-sm);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-brand {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
    }
    
    .nav-brand .logo {
        font-size: 1.2rem;
    }
    
    .nav-brand .nav-logo {
        height: 28px;
    }
    
    .nav-links {
        display: flex;
        gap: var(--spacing-xs);
        flex-wrap: nowrap;
        margin: 0 var(--spacing-xs);
        overflow-x: visible;
    }
    
    .nav-links a {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        background: transparent;
        border-radius: 0;
        white-space: nowrap;
        flex-shrink: 0;
        border-bottom: 2px solid transparent;
    }
    
    .nav-links a:hover {
        border-bottom-color: var(--color-accent);
    }
    
    .music-selector {
        flex-shrink: 0;
        margin-right: 0;
    }
    
    .music-selector select {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .sound-toggle {
        flex-shrink: 0;
        padding: 0.3rem;
        width: 32px;
        height: 32px;
    }
    
    /* Images en vignettes côte-à-côte sur mobile */
    .gallery {
        gap: 2px;
        margin-bottom: var(--spacing-sm);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }
    
    .gallery-item {
        max-height: 180px;
        border-radius: 0;
    }
    
    .gallery-item.large {
        max-height: 180px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: 80px var(--spacing-xs) var(--spacing-sm) var(--spacing-xs);
        min-height: auto;
        gap: var(--spacing-xs);
    }
    
    .section-header {
        margin-bottom: var(--spacing-xs);
    }
    
    /* Hero en mobile */
    .hero {
        padding-top: 100px;
        min-height: auto;
    }
    
    .scroll-down {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }
    
    .gallery-item,
    .gallery-item.large {
        max-height: 150px;
        border-radius: 0;
    }
    
    .gallery {
        gap: 2px;
    }
    
    .nav-links {
        display: none; /* Cacher la navigation sur très petits écrans */
    }
}

/* Scroll animations */
.section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
