:root {
    /* Palette de couleurs "Premium" - Dark Mode */
    --bg-color: #0f1115;
    /* Très sombre, presque noir */
    --card-bg: #1c1e24;
    /* Gris foncé pour les cartes */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #3b82f6;
    /* Un bleu vibrant mais doux */
    --overlay: rgba(0, 0, 0, 0.9);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
    padding-bottom: 100px;
    /* Space for FAB */
}

h1 {
    text-align: center;
    font-family: "Lexend Giga", serif;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 40px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* GALLERY LAYOUT - Grid for Reading Order (Row by Row) */
#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #gallery {
        gap: 15px;
    }
}

/* ITEM CARD */
.photo-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    transform: translateZ(0);
    /* Hardware acceleration */
}

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Crop to square without distortion */
    display: block;
    transition: transform 0.5s ease;
}

/* META DATA */
.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.date-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: "Doto", sans-serif;
    transition: background 0.3s ease, color 0.3s ease;
}

.photo-card:hover .date-badge {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* MODAL */
#modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay);
    display: none;
    /* Flex when active */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

#modal.active {
    display: flex;
    opacity: 1;
}

#modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#modal.active img {
    transform: scale(1);
}

#modal-date {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    z-index: 1002;
    padding: 8px 12px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.2s;
}

.close-btn:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

/* FAB (Floating Action Button) */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--accent);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 900;
    -webkit-tap-highlight-color: transparent;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.fab svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

/* FOOTER */
footer {
    text-align: center;
    padding: 60px 20px;
    margin-top: 40px;
    color: var(--text-secondary);
    font-family: "Funnel Sans", sans-serif;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.footer-content p {
    margin: 0;
    font-weight: 300;
    opacity: 0.7;
}

.footer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 5px 10px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    border-radius: 20px;
}

.footer-link:hover {
    color: #fff;
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}