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

:root {
    --img-max-h: 60vh;
}

html,
body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #000;
    background-color: #fff;
}


/* --- POLICES --- */

/* --- HEADER --- */
.header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #fff;
    z-index: 120;
}

.logo {
    font-weight: normal;
}

.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav a,
.menu-trigger {
    text-decoration: none;
    color: #000;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.menu-trigger:hover,
.nav a:hover {
    opacity: 0.6;
}

/* --- OVERLAY MENU --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 110;
    padding: 3.5rem 2rem 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;

}

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

.overlay-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.col-1 p, .col-2 p, .col-3 p {
    margin-bottom: 1rem;
    margin: 0 0 1rem 0;
}

.col-1 a, .col-2 a, .col-3 a {
    color: #000;
    text-decoration: underline;
}

.title-info {
    display: block;
    font-weight: bold;
    margin: 1.5rem 0 0 0;

}



/* --- MAIN CONTENT --- */
.main-content {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero-text {
    width: 100%;
    font-size: 12px;
    margin-bottom: 2rem;
    text-align: justify;
}

/* --- SLIDER CONTAINER --- */
.slider-container {
    position: relative;
    flex: 0 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
}

.slider-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    width: 100%;
}

.slider-wrapper::-webkit-scrollbar {
    display: none;
}

.slide {
    flex: 0 0 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    width: 100%;
}

.slide.active {
    display: block;
    opacity: 1;
}

.slide figure {
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.slide img {
    max-width: 100%;
    max-height: var(--img-max-h);
    width: auto;
    height: auto;
    display: block;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.slide figcaption {
    margin-top: 1rem;
    text-align: center;
}

.slide figcaption .project-name {
    display: block;
    color: #000;
}

.slide figcaption .details {
    display: block;
    color: #888;
}



.project-name{
    font-weight: bold;
}

.details {
    color: grey;
}

/* Zones cliquables */
.click-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 10;
}

.left-zone {
    left: 0;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23000" stroke="%23fff" stroke-width="1.5" d="M15 18l-6-6 6-6"/></svg>') 12 12, w-resize;
}

.right-zone {
    right: 0;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23000" stroke="%23fff" stroke-width="1.5" d="M9 18l6-6-6-6"/></svg>') 12 12, e-resize;
}

@supports not (cursor: url('data:image/svg+xml')) {
    .left-zone {
        cursor: w-resize;
    }
    .right-zone {
        cursor: e-resize;
    }
}

/* --- OVERVIEW PANEL --- */
#overviewPanel {
    padding: 0 !important;
}

#overviewPanel .overlay-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    overflow-y: auto;
    align-content: start; /* Important pour la grille */
}

#overviewPanel .overlay-content .overview-item {
    margin: 0;
    width: 100%;
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    background-color: #f0f0f0; /* Aide visuelle pendant le chargement */
}

#overviewPanel .overlay-content .overview-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.overlay-content .title-info:first-child {
    margin-top: 0;
}

#overviewPanel .overview-link {
    display: block;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#overviewPanel .overview-link:hover figure {
    opacity: 0.85;
    transform: scale(0.98);
}

#overviewPanel .overview-link figure {
    transition: opacity 0.2s ease, transform 0.2s ease;
}


@media (max-width: 1100px) {
    #overviewPanel .overlay-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    #overviewPanel .overlay-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 1.25rem;
    }
}


/* --- FOOTER --- */
.footer {
    flex: 0 0 auto;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
}

.image-counter {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* --- RESPONSIVE --- */
@media (max-width: 760px) {
    :root {
        --img-max-h: 58vh;
    }

    .header {
        padding: 1rem 1.25rem;
    }

    .nav {
        gap: 1rem;
    }

    .overlay {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .overlay-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-bottom: 2rem;
        padding-top: 2rem;
    }

    .main-content {
        padding: 0 1.25rem;
    }

    .hero-text {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 1.25rem;
    }

    .footer {
        padding: 1rem 1.25rem;
    }
}

@media (max-height: 620px) {
    .hero-text {
        display: none;
    }
}

.slide img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    pointer-events: auto;
}

@media (hover: none) {
    .slide img {
        -webkit-touch-callout: none;
    }
}