:root {
    --primary-text-color: #2c3e50;
    --secondary-text-color: #7f8c8d;
    --background-color: #ecf0f1;
    --accent-color: #c0392b;
    --card-background: #ffffff;
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--background-color);
    color: var(--primary-text-color);
    line-height: 1.7;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: var(--primary-text-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    height: 65px;
    transition: height 0.3s ease, padding 0.3s ease;
}

.nav-brand {
    text-decoration: none;
}

.nav-brand img {
    height: 70px;
    width: auto;
    display: block;
    transition: height 0.3s ease;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li a {
    padding: 0 1rem;
    text-decoration: none;
    color: #bdc3c7;
    font-weight: 700;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: var(--accent-color);
}

section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6rem 2rem 2rem 2rem;
}

section.bg-light {
    background-color: var(--background-color);
}

section.bg-dark {
    background-color: var(--card-background);
}

.section-content {
    max-width: 800px;
    text-align: center;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

p {
    text-align: justify;
    hyphens: auto;
}

.section-content p {
    text-align: center;
}

#accueil .layout-text p {
    margin-bottom: 1.5rem;
}

.layout-split {
    display: flex;
    align-items: center;
    gap: 3rem;
    width: 100%;
    max-width: 1200px;
}

.layout-image, .layout-text {
    flex: 1;
}

.troupe-photo img, .histoire-photo img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.layout-text {
    text-align: left;
}
.layout-text ul {
    padding-left: 20px;
    text-align: left;
}


.saison-preview {
    display: flex;
    align-items: center;
    gap: 3rem;
    width: 100%;
    max-width: 1200px;
    flex-direction: row;
}

.saison-preview-text {
    flex: 1;
    text-align: left;
}

.saison-preview-poster-desktop {
    flex: 1;
}

.saison-preview-poster-desktop img {
    width: 70%;
    display: block;
    margin: 0 auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.saison-preview-poster-mobile {
    display: none;
}


.button-group {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 5px;
    border: none;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-top: 1rem;
}

.cta-button:hover {
    transform: scale(1.05);
}

.cta-button.reservation {
    background-color: #27ae60;
}

.cta-button.reservation:hover {
    background-color: #229954;
}

.map-container {
    margin-top: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
}

.contact-profile {
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    width: 250px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid #ddd;
}

.contact-profile h3 {
    margin-bottom: 0.25rem;
    font-size: 1.2rem;
    color: var(--primary-text-color);
}

.contact-role {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
    text-align: center;
}

.contact-email {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    overflow-wrap: break-word;
    word-break: break-word;
}


#anciennes-pieces {
    min-height: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
    transition: all 0.7s ease-in-out;
}

#anciennes-pieces.visible {
    min-height: auto;
    max-height: 10000px;
    opacity: 1;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

#anciennes-pieces h2 {
    color: var(--primary-text-color);
}

#anciennes-pieces .repertoire-table {
    margin-top: 2rem;
}

.repertoire-table {
    width: 100%;
    max-width: 800px;
    border-collapse: collapse;
    margin: 2rem auto 0;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: left;
}

.repertoire-table th, .repertoire-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.repertoire-table th {
    background-color: var(--primary-text-color);
    color: white;
    font-weight: 700;
}

.repertoire-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.page-content {
    padding: 8rem 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    background-color: var(--background-color);
    min-height: 100vh;
}


.play-showcase {
    background-color: var(--card-background);
    width: 100%;
    max-width: 1000px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.showcase-header {
    text-align: center;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.showcase-header h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
}

.showcase-header h2 {
    font-size: 1.5rem;
    color: var(--secondary-text-color);
    font-weight: 400;
}

.showcase-content {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.showcase-left {
    flex: 2;
}

.showcase-left h2.mise-en-scene {
    font-size: 1.5rem;
    color: var(--primary-text-color);
    font-weight: 700;
    margin-bottom: 2rem;
}

.showcase-poster-desktop {
    flex: 1;
    display: flex;
    justify-content: center;
    margin-top: 11.5rem; 
}

.showcase-poster-desktop img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.showcase-poster-mobile {
    display: none;
}

.showcase-left h3 {
    font-size: 1.4rem;
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.distribution-list {
    list-style: none;
    padding-left: 0;
}

.distribution-list li {
    margin-bottom: 0.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.gallery-item {
    display: block;
    border-radius: 5px;
    overflow: hidden;
    width: 100%;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.filter-controls {
    margin: 2rem 0 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#searchInput, #decadeFilter {
    padding: 10px 15px;
    border-radius: 50px;
    border: 1px solid #ddd;
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    color: var(--primary-text-color);
}

#searchInput {
    min-width: 250px;
}

#decadeFilter {
    background-color: white;
    cursor: pointer;
}

#filterMessage {
    margin-top: 1.5rem;
    font-style: italic;
    color: var(--secondary-text-color);
}

.play-card.hidden {
    display: none;
}


.repertoire-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    width: 100%;
    margin-top: 2rem;
}

.play-card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.play-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.play-card:hover {
    transform: translateY(0);
}

.play-card img {
    width: 100%;
    height: auto;
    display: block;
}

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

.play-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.play-meta {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    text-align: left;
    flex-grow: 1;
}

.info-button {
    display: inline-block;
    background-color: var(--secondary-text-color);
    color: white;
    text-align: center;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.info-button:hover {
    background-color: var(--accent-color);
}


.play-info .play-list {
    list-style-position: inside;
    padding-left: 0;
    margin-top: 0.5rem;
    font-size: 1rem; 
    color: var(--primary-text-color); 
    text-align: left;
}

.hamburger {
    display: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: white;
    transition: all 0.3s ease-in-out;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--card-background);
    padding: 2.5rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    position: relative;
    width: 100%;
    max-width: 600px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: sticky;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: black (--secondary-text-color);
    cursor: pointer;
    float: right; 
    z-index: 10; 
}

.modal-content h2 {
    margin-top: 0;
    color: var(--primary-text-color);
}

.reservation-table {
    width: 100%;
    margin-top: 1.5rem;
    border-collapse: collapse;
    table-layout: fixed;
}

.reservation-table th, .reservation-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}

.reservation-table th {
    font-weight: 700;
}

.reservation-table th:nth-child(1), .reservation-table td:nth-child(1) {
    width: 55%;
    text-align: left;
}

.reservation-table th:nth-child(2), .reservation-table td:nth-child(2) {
    width: 45%;
    text-align: right;
}


#alert-modal .modal-content {
    max-width: 500px; 
    text-align: center;
}

#alert-modal p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}


.reservation-table th:nth-child(2) {
    text-align: center;
}
.reservation-table .info-button {
    margin: 0;
    width: 100%;
    padding: 12px 10px;
    font-size: 1rem;
    background-color: var(--secondary-text-color);
    white-space: normal;
    line-height: 1.2;
    height: auto;
}

.reservation-table .info-button:hover {
    background-color: var(--accent-color);
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    h1 { font-size: 2.2rem; }
    h2 { font-size: 2rem; }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-links.active {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        position: fixed;
        top: 65px;
        right: 0;
        width: 100%;
        height: calc(100vh - 65px);
        background-color: var(--primary-text-color);
    }

    .nav-links.active a {
        font-size: 1.5rem;
    }

    .layout-split {
        flex-direction: column;
        text-align: center;
    }
    
    #accueil .layout-split,
    #histoire .layout-split {
        flex-direction: column-reverse;
    }
    
    .showcase-content {
        flex-direction: column;
    }

    .saison-preview {
        flex-direction: column;
    }

    .saison-preview-poster-desktop {
        display: none;
    }

    .saison-preview-poster-mobile {
        display: block;
        margin: 2rem auto;
        text-align: center;
    }

    .saison-preview-poster-mobile img {
        width: 70%;
        border-radius: 8px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    
    .showcase-poster-desktop {
        display: none;
    }

    .showcase-poster-mobile {
        display: block;
        margin: 2.5rem auto;
        text-align: center;
    }

    .showcase-poster-mobile img {
        width: 70%;
        border-radius: 8px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .repertoire-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    p {
        text-align: left;
    }

    .section-content p, .layout-text p, .saison-preview-text p {
        text-align: center;
    }
}


footer {
    background-color: var(--primary-text-color);
    color: #bdc3c7;
    padding: 2.5rem 5%;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

footer p {
    font-size: 0.9rem;
    text-align: center;
}

.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox-image {
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    color: var(--accent-color);
}

.lightbox-close {
    top: 20px;
    right: 30px;
    font-size: 45px;
}

.lightbox-prev, .lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 35px;
    padding: 10px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}