html,
body {
    margin: 0;
    padding: 0;
    height: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1738a6;
    color: white;
    scroll-behavior: smooth;
    overflow-x: hidden;
    height: 100%;
}

.grid-evenements .card {
    background-color: #3D17A6;
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: flex-start;
    min-height: 180px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 16px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

#nous .card {
    background-color: #8aa3c4;
}

.grid-activites .card {
    background-color: #1780A6;
}

.grid-activites .card button {
    width: 100%;
    margin: 20px 0 0 0;
    background-color: #404040;
    border: none;
    padding: 10px;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease-in-out;
    display: block;
    box-sizing: border-box;
}

.card {
    background-color: rgba(90, 138, 161, 0.08);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* En-tête */
header {
    position: relative;
    padding: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    background-color: #121212;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.header-left {
    flex: 0 0 auto;
}

.header-center {
    flex: 1 1 0;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.header-right {
    flex: 0 0 auto;
    width: 240px;
    height: 1px;
}

#logo {
    display: flex;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #f1f1f1;
    margin: 0;
}

#logo img {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    border-radius: 50px;
}

a {
    text-decoration: none;
    color: #f1f1f1;
    font-weight: bold;
    transition: color 0.3s;
}

button {
    width: 80%;
    margin: auto auto 30px auto;
    background-color: #404040;
    border: none;
    padding: 10px;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease-in-out;
    display: block;
}

header a {
    vertical-align: middle;
    text-decoration: none;
    color: #f1f1f1;
    font-weight: bold;
    transition: color 0.3s;
}

header a:hover {
    color: #ffffff;
}

header img {
    width: 50px;
    height: 50px;
    vertical-align: middle;
    margin-right: 40px;
}

/* Pied de page */
footer {
    width: 100%;
    padding: 10px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    background-color: #121212;
    color: #ccc;
    margin-top: 50px;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.2);
    text-align: center;
}

header {
    justify-content: flex-start;
}

h1,
h2 {
    text-align: center;
    color: #ffffff;
    margin-top: 40px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
}

.header-center h1 {
    margin-top: 20px;
    font-size: 1.5em;
}

main,
section {
    flex: 1 0 auto;
}

section {
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    transform: translateY(30px);
}

.card-nous .nous-texte p {
    padding-left: 50px;
    padding-right: 40px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

section p {
    color: #f0f0f0;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.grid-activites {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: stretch;
    width: 100%;
    margin: 0 auto;
}

#nous {
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
    padding-left: 0;
    padding-right: 0;
}

.grid-evenements .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.card p {
    margin: 0;
}

/* Responsive général */
@media (max-width: 768px) {

    header,
    footer {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    section {
        margin: 10px;
        padding: 15px;
    }
}

/* Sticky footer */
html,
body {
    height: 100%;
}

footer {
    margin-top: auto;
}

.section-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.grid .card img,
.grid-activites .card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s;
}

@media (max-width: 768px) {
    .grid .card {
        width: 45%;
    }
}

@media (max-width: 500px) {
    .grid .card {
        width: 90%;
    }
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.card-nous {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    gap: 20px;
    padding: 0;
}

.card-nous .nous-img img {
    width: auto;
    max-width: 350px;
    min-width: 120px;
    height: auto;
    max-height: 60vw;
    object-fit: contain;
    display: block;
    margin: 0;
    border-radius: 12px;
    background: #fff;
}

@media (max-width: 900px) {
    .card-nous {
        flex-direction: column;
        gap: 10px;
        min-height: unset;
    }
    .card-nous .nous-img {
        width: auto;
        margin: 0 auto 8px auto;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .card-nous .nous-img img {
        width: auto;
        max-width: 90vw;
        min-width: 80px;
        height: auto;
        max-height: 45vw;
        margin: 0;
    }
}

@media (max-width: 600px) {
    .card-nous .nous-img img {
        max-width: 98²²vw;
        max-height: 50vw;
    }
}

.card-nous .nous-texte {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card-nous .nous-img {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    width: auto;
    height: auto;
}

#nous {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grid-evenements {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    align-items: stretch;
    width: 100%;
    margin: 0 auto;
}



.grid-evenements .card img {
    width: 100%;
    max-width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    display: block;
}

#contact {
    width: 95%;
    margin: 40px auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#contact h2 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 2em;
    animation: fadeInUp 1s forwards;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.contact-form label {
    font-weight: bold;
    color: #ffffff;
}

.contact-form input,
.contact-form textarea {
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-size: 1em;
    resize: vertical;
    background-color: #e0e0e0;
    color: #000;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.contact-form button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background-color: #121212;
    color: #fff;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-form button:hover {
    background-color: #2c2c2c;
}

@media (max-width: 900px) {
    #contact {
        max-width: 98vw;
        padding: 15px;
    }

    .contact-form {
        max-width: 98vw;
        padding: 0;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    #contact {
        width: 100vw;
        padding: 8px 2vw;
        margin: 10px 0;
        margin-left: 4px;
        box-sizing: border-box;
    }

    .contact-form {
        max-width: 100vw;
        padding: 0;
        gap: 10px;
    }

    .contact-form label {
        font-size: 1em;
    }

    .contact-form input,
    .contact-form textarea {
        font-size: 1em;
        padding: 8px;
    }

    .contact-form button {
        width: 100%;
        font-size: 1em;
        padding: 10px 0;
    }
}

@media (max-width: 400px) {
    #contact {
        padding: 4px 1vw;
    }

    .contact-form label {
        font-size: 0.95em;
    }

    .contact-form input,
    .contact-form textarea {
        font-size: 0.95em;
        padding: 6px;
    }

    .contact-form button {
        font-size: 0.95em;
        padding: 8px 0;
    }
}

.popup-carousel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.carousel-content {
    cursor: default;
    border-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.carousel-images {
    padding: 20px 20px 0px 20px;
    display: flex;
    border-radius: 20px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #1f1f1f;
}

.carousel-content img {
    display: block;
    max-width: 90vw;
    max-height: 60vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
    object-fit: contain;
}

.carousel-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 0px;
}

.carousel-controls button {
    font-size: 1.5em;
    padding: 5px 15px;
    border: none;
    background: #4e4e4e;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

.popup-description {
    position: static;
    top: unset;
    left: unset;
    transform: none;
    background: #c9c8c8;
    min-width: 0;
    max-width: 70%;
    width: 100%;
    border-radius: 12px;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    box-shadow: none;
    padding: 0;
    overflow-y: auto;
    max-height: 120px;
    margin-bottom: 0;
}

.description-content {
    padding: 16px 18px;
    color: #222;
    font-size: 1.1em;
    text-align: left;
    border-radius: 10px;
    word-break: break-word;
    overflow-y: auto;
    max-height: 110px;
    width: 100%;
}

@media (max-width: 900px) {
    .popup-carousel {
        align-items: flex-start;
        padding-top: 30px;
    }

    .carousel-content {
        max-width: 95vw;
        max-height: 90vh;
        padding: 10px;
    }

    .carousel-images {
        padding: 10px 5px 0 5px;
    }

    .carousel-content img {
        max-width: 98vw;
        max-height: 40vh;
    }

    .popup-description {
        max-width: 95vw;
        font-size: 1em;
        padding: 0;
    }

    .description-content {
        font-size: 1em;
        padding: 10px 8px;
        max-height: 80px;
    }
}

@media (max-width: 600px) {
    .carousel-content {
        max-width: 100vw;
        padding: 0;
    }

    .carousel-content img {
        max-width: 99vw;
        max-height: 30vh;
    }

    .popup-description {
        max-width: 99vw;
        font-size: 0.95em;
        padding: 0;
    }

    .description-content {
        font-size: 0.95em;
        padding: 8px 4px;
        max-height: 100px;
    }

    .carousel-controls button {
        font-size: 1.2em;
        padding: 4px 10px;
    }
}

strong,
b {
    display: inline;
}

@media (max-width: 1200px) {
    .grid-evenements {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-activites {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 15px 5px;
    }

    .header-center {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .header-center h1 {
        margin: 10px 0 0 0;
        font-size: 1.1em;
    }

    .header-left {
        justify-content: center;
        width: 100%;
        margin-bottom: 5px;
    }

    #logo {
        justify-content: center;
        font-size: 1.2em;
    }

    header img,
    #logo img {
        margin-right: 10px;
        width: 40px;
        height: 40px;
    }

    .header-right {
        display: none;
    }

    .grid-evenements {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-activites {
        grid-template-columns: 1fr;
    }

    .card-nous {
        flex-direction: column;
        gap: 10px;
        min-height: unset;
    }

    .card-nous .nous-img,
    .card-nous .nous-img img {
        width: 100%;
        height: auto;
        max-width: 350px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    header {
        padding: 10px 2px;
    }

    .header-center h1 {
        font-size: 1em;
    }

    #logo {
        font-size: 1em;
    }

    header img,
    #logo img {
        width: 32px;
        height: 32px;
    }

    .grid-evenements,
    .grid-activites {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    section {
        padding: 10px;
        margin: 5px;
    }

    .card-nous {
        flex-direction: column;
        padding: 10px;
    }

    .card-nous .nous-img,
    .card-nous .nous-img img {
        width: 100%;
        height: auto;
        max-width: 250px;
    }

    h1,
    h2 {
        font-size: 1.2em;
        margin-top: 20px;
    }

    .carousel-content img {
        max-width: 95vw;
        max-height: 40vh;
    }

    .popup-description {
        min-width: 150px;
        font-size: 0.95em;
        padding: 0;
    }
}

@media (max-width: 400px) {

    h1,
    h2 {
        font-size: 1em;
    }

    .card-nous .nous-img,
    .card-nous .nous-img img {
        max-width: 150px;
    }
}