/* ═══════════════════════════════════════════
   IAKAI — Galerie dynamique
   ═══════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --noir-profond: #0a0806;
    --brun-ombre: #1a140e;
    --ocre-sombre: #3d2f1e;
    --ocre-dore: #8b6914;
    --or-lumiere: #c4a035;
    --blanc-lumiere: #e8e4dc;
    --gris-clair: #9a958c;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--noir-profond);
    color: var(--blanc-lumiere);
    font-family: 'Cormorant Garamond', Georgia, serif;
    overflow-x: hidden;
}

/* ─── Arc-en-ciel animé ─── */

.rainbow-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(255, 0, 0, 0.03),
        rgba(255, 165, 0, 0.03),
        rgba(255, 255, 0, 0.03),
        rgba(0, 128, 0, 0.03),
        rgba(0, 0, 255, 0.03),
        rgba(75, 0, 130, 0.03),
        rgba(238, 130, 238, 0.03),
        rgba(255, 0, 0, 0.03)
    );
    animation: rainbowRotate 30s linear infinite;
}

@keyframes rainbowRotate {
    to { transform: rotate(360deg); }
}

/* ─── Container ─── */

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ─── Titre ─── */

.site-header {
    text-align: center;
    margin-bottom: 3rem;
}

.site-title {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 0.5em;
    color: var(--blanc-lumiere);
    text-shadow: 0 0 40px rgba(196, 160, 53, 0.15);
}

/* ─── Galerie grille ─── */

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1100px;
}

.gallery.cols-1 {
    grid-template-columns: 1fr;
    max-width: 500px;
}

.gallery.cols-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 750px;
}

/* ─── Carte image ─── */

.artwork-card {
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    background: var(--brun-ombre);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: fadeInUp 0.6s ease both;
}

.artwork-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(196, 160, 53, 0.15);
}

.artwork-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Image large (pleine ligne) ─── */

.artwork-card.wide {
    grid-column: 1 / -1;
}

.artwork-card.wide img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

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

/* ─── Lightbox ─── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10, 8, 6, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

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

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--blanc-lumiere);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--or-lumiere);
}

/* ─── Contact ─── */

.contact-section {
    margin-top: 4rem;
    text-align: center;
}

.contact-toggle {
    background: none;
    border: 1px solid var(--gris-clair);
    color: var(--gris-clair);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    letter-spacing: 0.3em;
    padding: 0.8em 2.5rem;
    cursor: pointer;
    transition: all 0.4s ease;
}

.contact-toggle:hover {
    border-color: var(--or-lumiere);
    color: var(--or-lumiere);
    box-shadow: 0 0 30px rgba(196, 160, 53, 0.15);
}

.contact-form {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.4s ease;
    opacity: 0;
}

.contact-form.open {
    max-height: 100px;
    opacity: 1;
    margin-top: 1.5rem;
}

.email-link {
    color: var(--or-lumiere);
    text-decoration: none;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    transition: text-shadow 0.3s ease;
}

.email-link:hover {
    text-shadow: 0 0 20px rgba(196, 160, 53, 0.5);
}

/* ─── Message vide ─── */

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gris-clair);
    font-size: 1.2rem;
    font-style: italic;
    letter-spacing: 0.1em;
}

/* ─── Responsive ─── */

@media (max-width: 1000px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .gallery.cols-1 {
        grid-template-columns: 1fr;
    }

    /* wide reste sur toute la ligne en tablette aussi */
    .artwork-card.wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 2rem 1rem;
    }

    .site-title {
        font-size: 2rem;
        letter-spacing: 0.3em;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .gallery.cols-1,
    .gallery.cols-2 {
        max-width: 100%;
    }

    .artwork-card.wide img {
        max-height: 300px;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }
}
