/* ==========================================
   GALERIE PHOTOGRAPHIQUE PROFESSIONNELLE
   Design: Archives documentaires élégantes
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@300;400;600;700&family=DM+Sans:wght@400;500;700&display=swap');

:root {
    --color-primary: #2c2419;
    --color-secondary: #8B6F47;
    --color-accent: #D4825C;
    --color-bg: #FAF8F5;
    --color-surface: #FFFFFF;
    --color-text: #1a1410;
    --color-text-light: #6B5537;
    --color-border: #E5DFD6;
    
    --font-display: 'Crimson Pro', serif;
    --font-body: 'DM Sans', sans-serif;
    
    --shadow-soft: 0 2px 20px rgba(44, 36, 25, 0.08);
    --shadow-medium: 0 8px 40px rgba(44, 36, 25, 0.12);
    --shadow-strong: 0 20px 60px rgba(44, 36, 25, 0.2);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   GALERIE GRID - Disposition moderne
   ========================================== */

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.gallery-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease-out;
}

.gallery-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.gallery-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-light);
    font-weight: 400;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.photo-card {
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-smooth);
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out backwards;
}

.photo-card:nth-child(1) { animation-delay: 0.1s; }
.photo-card:nth-child(2) { animation-delay: 0.15s; }
.photo-card:nth-child(3) { animation-delay: 0.2s; }
.photo-card:nth-child(4) { animation-delay: 0.25s; }
.photo-card:nth-child(5) { animation-delay: 0.3s; }
.photo-card:nth-child(6) { animation-delay: 0.35s; }

.photo-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-strong);
}

.photo-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-smooth);
}

.photo-card:hover .photo-card-image {
    transform: scale(1.05);
}

.photo-card-info {
    padding: 1.5rem;
}

.photo-card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.photo-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.photo-card-description {
    font-size: 0.9375rem;
    color: var(--color-text);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================
   LIGHTBOX MODAL - Vue détaillée
   ========================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 20, 16, 0.95);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    background: var(--color-surface);
    border-radius: 16px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 0;
    box-shadow: var(--shadow-strong);
    transform: scale(0.9);
    transition: transform var(--transition-smooth);
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image-container {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
}

.lightbox-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 80vh;
}

.lightbox-info {
    padding: 3rem;
    overflow-y: auto;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-primary);
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-fast);
    z-index: 10;
}

.lightbox-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: white;
}

.lightbox-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.lightbox-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.lightbox-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lightbox-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
    font-weight: 600;
}

.lightbox-meta-value {
    font-size: 1rem;
    color: var(--color-text);
    font-weight: 500;
}

.lightbox-description {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 2.5rem;
}

/* ==========================================
   FORMULAIRE D'IDENTIFICATION
   ========================================== */

.identification-section {
    background: var(--color-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.identification-section h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.identification-intro {
    font-size: 0.9375rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.identification-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    padding: 0.875rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    background: var(--color-surface);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    background: var(--color-secondary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-submit:active {
    transform: translateY(0);
}

/* ==========================================
   IDENTIFICATIONS EXISTANTES
   ========================================== */

.identifications-list {
    margin-top: 2rem;
}

.identifications-list h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.identification-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.identification-item-name {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.identification-item-info {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* ==========================================
   NAVIGATION LIGHTBOX
   ========================================== */

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-primary);
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-fast);
    z-index: 10;
}

.lightbox-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-prev {
    left: 1.5rem;
}

.lightbox-nav-next {
    right: 1.5rem;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

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

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

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .lightbox-content {
        grid-template-columns: 1fr;
    }
    
    .lightbox-image-container {
        min-height: 300px;
    }
    
    .lightbox-info {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }
    
    .lightbox-overlay {
        padding: 1rem;
    }
    
    .lightbox-content {
        border-radius: 12px;
    }
    
    .lightbox-info {
        padding: 1.5rem;
    }
    
    .lightbox-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-card-info {
        padding: 1rem;
    }
}

/* ==========================================
   UTILITAIRES
   ========================================== */

.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.success-message {
    background: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.error-message {
    background: #ef4444;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-out;
}
