:root {
    --bg-color: #fdfbf7;
    --text-color: #2c3e50;
    --accent-color: #5c7cfa;
    --accent-hover: #4c6ef5;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Georgia, serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 2rem 1rem;
}

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

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: #1a252f;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
    font-style: italic;
}

/* Filtres */
.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

/* Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-item.hidden {
    display: none;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.03);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -10px rgba(0,0,0,0.1);
}

.img-wrapper {
    width: 100%;
    height: 260px;
    overflow: hidden;
    background-color: #f1f3f5;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .img-wrapper img {
    transform: scale(1.04);
}

.card-info {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.category-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #95a5a6;
    margin-bottom: 0.4rem;
}

.card-info h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: #2c3e50;
}

.card-desc-preview {
    font-size: 0.9rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
    .lightbox-content {
        flex-direction: row;
    }
}

.lightbox-img-container {
    flex: 1.5;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 60vh;
}

@media (min-width: 768px) {
    .lightbox-img-container {
        max-height: 85vh;
    }
}

.lightbox-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-details {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.8rem;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-title {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: #1a252f;
}

.lightbox-category {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.lightbox-desc {
    font-size: 1rem;
    color: #4a5568;
    white-space: pre-wrap;
}

.empty-msg {
    text-align: center;
    grid-column: 1 / -1;
    color: #888;
    font-style: italic;
    padding: 3rem;
}
