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

body {
    font-family: 'Mulish', Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700; /* Plus gras pour le titre principal */
}

header h3 {
    color: #666;
    font-size: 1.2rem;
    font-weight: 300; /* Plus léger pour le sous-titre */
}

nav ul {
    list-style: none;
    display: flex;
    background: #333;
    padding: 1rem;
    justify-content: center;
}

nav li {
    margin-right: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

header {
    text-align: center;
    padding: 2rem 0 1rem 0;
    margin-bottom: 20px; /* Ajoute 20px d'espace sous le header */
}

header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header h2 {
    color: #666;
    font-size: 1.2rem;
    font-weight: normal;
}

nav a.active {
    background: #555;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

main {
    padding: 2rem;
}

#gallery-grid {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.optimal-row {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
}

.optimal-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.optimal-item:hover {
    transform: scale(1.02);
    z-index: 10;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 15px;
}

.optimal-item:hover .overlay {
    opacity: 1;
}

.overlay span {
    font-weight: 600;
    text-align: center;
    margin-bottom: 5px;
}

.overlay p {
    font-size: 0.85rem;
    text-align: center;
    margin: 0;
    opacity: 0.9;
}

.spectacle-info {
    margin-top: 8px;
}

.spectacle-info span {
    display: block;
    font-size: 0.8em;
    margin: 2px 0;
}

@media (max-width: 768px) {

   nav ul {
        flex-direction: column;
        align-items: center;
        padding: 0.5rem;
    }
    
    nav li {
        margin-right: 0;
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
    }
    
    nav li:last-child {
        margin-bottom: 0;
    }
    
    nav a {
        display: block;
        padding: 0.8rem;
        width: 100%;
    }
    
    nav a.active {
        padding: 0.8rem;
    }

    .optimal-row {
        flex-wrap: wrap;
        height: auto !important;
    }
    .optimal-item {
        width: calc(50% - 5px) !important;
        height: 150px !important;
        margin-right: 10px !important;
        margin-bottom: 10px;
    }
    .optimal-item:nth-child(2n) {
        margin-right: 0 !important;
    }
}

@media (max-width: 480px) {

   nav ul {
        flex-direction: column;
        align-items: center;
        padding: 0.5rem;
    }
    
    nav li {
        margin-right: 0;
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
    }
    
    nav li:last-child {
        margin-bottom: 0;
    }
    
    nav a {
        display: block;
        padding: 0.8rem;
        width: 100%;
    }
    
    nav a.active {
        padding: 0.8rem;
    }

    .optimal-item {
        width: 100% !important;
        height: 200px !important;
        margin-right: 0 !important;
    }
}

.optimal-row {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
}

/* Style spécifique pour les dernières lignes incomplètes */
.optimal-row:last-child {
    justify-content: flex-start; /* ou center pour centrer */
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 18px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Vue détaillée */

/* Bouton retour */
.back-button {
    margin-bottom: 20px;
}

.back-button button {
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.back-button button:hover {
    background-color: #555;
}

/* Vue détail */
.detail-view {
    text-align: center;
    padding: 20px;
}

#detail-image {
    max-width: 500px;
    max-height: 500px;
    width: auto;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#detail-description {
    margin-top: 20px;
    font-size: 18px;
    color: #333;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-content p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
    letter-spacing: 0.5px;
}



main {
    flex: 1;
}

/* Style responsive pour mobile */
@media (max-width: 768px) {
    footer {
        padding: 1.5rem 1rem;
        margin-top: 2rem;
    }
    
    .footer-content p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
}