@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

/* ============================================
   RESET & BASE
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Bebas Neue', cursive;
    background: rgb(255, 255, 255);
    line-height: 1.5;
    font-size: 16px;
    overflow-x: hidden;
}

/* ============================================
   NAVIGATION — mobile par défaut (en haut)
   ============================================ */

.topnav {
    background: transparent;
    border: 10px;
    padding: 10px 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topnav a {
    text-decoration: none;
    color: rgb(179, 181, 182);
    padding: 10px 16px;
    display: inline-block;
    font-weight: bold;
    font-family: 'Bebas Neue', cursive;
    font-size: 18px;
    transition: background 0.2s ease-in, color 0.2s ease-in;
}

.topnav a:hover,
.topnav a.current {
    color: rgb(0, 0, 0);
}

.navlink {
    color: rgb(105, 44, 44);
    text-decoration: none;
}

/* Nav sur les pages projet : transparente, non-sticky, ne cache pas le carousel */
.topnav--project {
    position: relative;
    background: transparent !important;
}

/* ============================================
   CONTENU PRINCIPAL — mobile
   ============================================ */

main, .main-content {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 5px;
}

h1, h2, h3, p {
    width: 100%;
    max-width: 900px;
    padding-left: 5px;
    padding-right: 0;
    margin-left: 5px;
}

h1 {
    color: rgb(168, 168, 168);
    background-color: rgb(255, 255, 255);
    font-family: 'Bebas Neue', cursive;
    font-size: 36px;
    margin: 0 0 16px 0;
    padding-left: 0;
    margin-left: 5px;
}

h2, h3, p {
    padding-left: 0;
    font-family: 'Bebas Neue', cursive;
    margin-left: 5px;
}

p {
    font-family: 'Bebas Neue', cursive;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    margin-left: 5px;
}

/* ============================================
   IMAGES DE LA PAGE INDEX — mobile
   ============================================ */

.conteneur {
    text-align: center;
    margin: 16px ;
}

.conteneur img {
    width: 100%;
    max-width: 500px;
    height: auto;
}

/* ============================================
   PAGE TRAVAUX — grille de projets mobile
   ============================================ */

.project {
    position: relative;
    display: block;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 30px auto;
    text-decoration: none;
    color: inherit;
    align-self: center;
}

.project img {
    width: 100%;
    height: auto;
    display: block;
}

img {
    width: 100%;
    height: auto;
}

/* Les images dans le carousel ne doivent pas être en width 100% */
.track img {
    width: auto !important;
    height: 600px;
    flex-shrink: 0;
    margin-right: 15px;
    object-fit: cover;
}

/* Overlay au hover (reste pour desktop, discret sur mobile) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.project:hover .overlay {
    opacity: 1;
}

/* Sur mobile : overlay toujours visible en bas de l'image */
@media (max-width: 767px) {
    .overlay {
        opacity: 1;
        justify-content: flex-end;
        padding-bottom: 12px;
        background: linear-gradient(to top, rgba(255,255,255,0.7) 0%, transparent 60%);
    }

    .track img,
    .landscape,
    .portrait {
        height: 220px;
    }
}

.overlay p {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: black;
    font-family: 'Bebas Neue', cursive;
}

.dot {
    width: 14px;
    height: 14px;
    background: red;
    border-radius: 50%;
}

/* ============================================
   MARQUEE / CAROUSEL
   ============================================ */

.marquee {
    width: calc(100vw);
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: hidden;
    background: white;
}

.track {
    display: flex;
    width: max-content;
    animation: scroll 20s linear infinite;
    animation-play-state: paused;
}

.track img {
    width: auto;
    height: 220px; /* réduit sur mobile */
    flex-shrink: 0;
    margin-right: 10px;
    object-fit: cover;
}

.track:hover {
    animation-play-state: running;
    cursor: pointer;
}

@keyframes scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.landscape, .portrait {
    width: auto;
    height: 220px;
    object-fit: cover;
}

/* ============================================
   DIVERS
   ============================================ */

.circle {
    width: 60px;
    height: 60px;
    background: red;
    border-radius: 50%;
}

.zoom {
    transition: all 0.2s ease-in-out;
    width: 100%;
}

.active {
    background-color: rgb(255, 255, 255);
    color: white;
    padding: 10px;
    text-decoration: none;
}

.active2 {
    transform: scale(1.5) rotate(180deg);
}

.centered {
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   TABLETTE — 768px et plus
   ============================================ */

@media (min-width: 768px) {
    body {
        padding: 20px 40px;
    }

    h1 {
        font-size: 52px;
        padding-left: 40px;
    }

    h2, h3, p {
        padding-left: 40px;
    }

    .topnav {
        justify-content: flex-start;
        padding: 10px 20px;
    }

    .project {
        margin-bottom: 50px;
    }

    .track img,
    .landscape,
    .portrait {
        height: 400px;
    }

    main, .main-content {
        padding: 30px 40px;
    }

    h1, h2, h3, p {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ============================================
   DESKTOP — 1200px et plus
   ============================================ */

@media (min-width: 1200px) {
    body {
        margin-left: 200px;
        padding: 30px 50px 0px;
    }

    h1 {
        padding-left: 210px;
        font-size: 64px;
    }

    h2, h3, p {
        padding-left: 20px;
    }

    /* Nav verticale à gauche */
    .topnav {
        position: fixed;
        top: 0;
        left: 0;
        width: 200px;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 20px;
        background: transparent;
    }

    .topnav a {
        display: block;
        padding: 10px 20px;
        font-size: 20px;
    }

    .project {
        width: 100%;
        max-width: 900px;
        margin: 0 auto 60px auto;
    }

    .marquee {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        left: 0;
    }

    .conteneur img {
        width: 500px;
    }

    .track img,
    .landscape,
    .portrait {
        height: 600px;
    }
}
