/* Variables CSS */
:root {
    --color-primary: #2c3e50;
    --color-secondary: #8b7355;
    --color-accent: #d4af37;
    --color-text: #333;
    --color-text-light: #666;
    --color-bg: #ffffff;
    --color-bg-light: #f8f9fa;
    --color-border: #dee2e6;
    --font-primary: 'Georgia', serif;
    --font-secondary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-secondary);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: normal;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-secondary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand h1 {
    font-size: 1.8rem;
    margin: 0;
    color: var(--color-primary);
}

.nav-brand .subtitle {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-style: italic;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--color-text);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--color-primary);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    position: relative;
    height: 70vh;
    overflow: hidden;
    background: var(--color-bg-light);
}

.hero-slider {
    position: relative;
    height: 100%;
}

.hero-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: slideShow 9s infinite;
}

.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: 3s; }
.hero-slide:nth-child(3) { animation-delay: 6s; }

@keyframes slideShow {
    0%, 33.33% { opacity: 1; }
    33.34%, 100% { opacity: 0; }
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 3rem 2rem 2rem;
    text-align: center;
}

.hero-content h2 {
    color: white;
    margin-bottom: 0.5rem;
}

.hero-content .year {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Gallery Section */
.gallery {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-primary);
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--color-accent);
    margin: 1rem auto 0;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 25px;
    font-size: 0.95rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.gallery-grid {
    column-count: 4;
    column-gap: 1.5rem;
    margin: 0 auto;
}

@supports (display: grid) {
    .gallery-grid.masonry-fallback {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    background: var(--color-bg-light);
    break-inside: avoid;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 100%;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

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

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3,
.gallery-overlay h4 {
    color: white;
    margin-bottom: 0.3rem;
}

.gallery-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.sold-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.sold-badge.large {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* Artwork Detail */
.artwork-detail {
    padding: 3rem 0;
}

.artwork-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.artwork-image {
    position: relative;
}

.artwork-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.artwork-info h2 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.artwork-meta {
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.meta-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-item strong {
    color: var(--color-primary);
    margin-right: 0.5rem;
}

.artwork-description {
    margin-bottom: 2rem;
}

.artwork-description h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.artwork-actions {
    margin-top: 2rem;
}

/* Biography */
.biography {
    padding: 3rem 0;
}

.bio-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
}

.bio-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.bio-text h3 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.bio-text .content {
    line-height: 1.8;
    color: var(--color-text);
}

/* Related Artworks */
.related-artworks {
    padding: 3rem 0;
    background: var(--color-bg-light);
}

.gallery-grid.small {
    column-count: 4;
    column-gap: 1rem;
}

.gallery-grid.small .gallery-item {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--color-bg-light);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg);
}

/* Footer */
footer {
    background: var(--color-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
}

.footer-info h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.footer-info p {
    opacity: 0.9;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: white;
    opacity: 0.9;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.8;
}

/* Utilities */
.no-content {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-light);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid {
        column-count: 3;
    }
    
    .gallery-grid.small {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
    }
    
    .gallery-grid.small {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--color-bg);
        width: 100%;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero {
        height: 50vh;
    }
    
    .gallery-grid {
        column-count: 2;
        column-gap: 1rem;
    }
    
    .artwork-layout,
    .bio-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .gallery-grid {
        column-count: 1;
    }
    
    .gallery-grid.small {
        column-count: 1;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}