@font-face {
    font-family: "Instrument";
    src: url(src/typo/InstrumentSerif-Italic.ttf);
    font-style: italic;
}

@font-face {
    font-family: "Instrument";
    src: url(src/typo/InstrumentSerif-Regular.ttf);
    font-style: normal;
}


body {
    display: flex;

    font-family: "Instrument", serif;
    background-color: #F8F3E1;
    color: #333;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 35px;
    height: 35px;
    background-color: #F8F3E1;
    border: 1px solid #333;
    cursor: pointer;
    z-index: 2000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.menu-toggle span {
    width: 18px;
    height: 1px;
    background-color: #333;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    /* rotate and drop down to meet third bar */
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    /* rotate and lift up to meet first bar */
    transform: translateY(-7px) rotate(-45deg);
}

/* MENU NAVIGATION - TITRE */

.left-side {
    background-color: #F8F3E1;
    overflow-y: auto;
    width: 15%;
    padding: 20px;
    border-right: 1px solid #ccc;
    height: 100vh;
    box-sizing: border-box;
}

#title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#links {
    display: flex;
    flex-direction: row;
    gap: 2em;

    font-size: 0.8em;
    margin-bottom: 4em;
}

#propos, #contacts {
    transition: all 0.3s ease;
    cursor: pointer;
}

#propos:hover {
    color: white;
    background-color: black;
}

#contacts:hover {
    color: white;
    background-color: black;
}

h1 {
    font-size: 2em;
    margin-bottom: 0;
}

a {
    text-decoration: none;
    color: black;
}


/* MENU NAVIGATION - NAVIGATION */

.nav {
    display: flex;
    flex-direction: column;
    
    padding-bottom: 6em;
}

.cat {
    display: flex;
    flex-direction: column;
    margin-left: 0.4em;
}

h4:hover{
    text-decoration: underline dotted;
    cursor: pointer;
}

h3 {
    font-size: 1.3em;
    border-top: 1px black solid;
    border-bottom: 1px black solid;
    padding: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

h3:hover {
    color: white;
    background-color: black;
}

h4 {
    font-size: 1.2em;
    margin-bottom: 0;
    margin-top: 0;
}



/* VUE PRINCIPALE */ 

.right-side {
    overflow-y: auto;
    flex: 1;
    height: 100vh;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

#home {
    object-fit: cover;
    width: 100%;
    height: 100vh;
    display: block;
}




/* PROJETS && GALERIE*/

.project-page, .gallery-page {
    padding: 2em;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.btn-retour {
    font-family: "Instrument", serif;
    font-size: 1em;
    background: none;
    border: 1px solid #333;
    padding: 5px 10px;
    cursor: pointer;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.btn-retour:hover {
    background-color: black;
    color: white;
}

/* PROJET */

.project-content {
    max-width: 1000px;
    margin: 0 auto;
}

.project-content h2 {
    font-size: 2em;
    margin-bottom: 40px;
    text-align: center;
}

.project-image {
    margin: 40px 0;
}

.project-image img {
    max-width: 80%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.legende {
    font-style: italic;
    font-size: 1em;
    margin-top: 15px;
    text-align: center;
    color: #666;
}

.project-description {
    margin: 40px 0;
}

.project-description p {
    font-size: 1.3em;
    line-height: 1.6;
    text-align: justify;
}

.project-link {
    text-align: center;
    margin-top: 50px;
}

.project-link a {
    font-size: 1.3em;
    color: #333;
    text-decoration: none;
    border: 1px solid #333;
    padding: 5px 10px;
    display: inline-block;
    transition: all 0.3s ease;
}

.project-link a:hover {
    background-color: black;
    color: white;
}

.project-medias {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 40px 0;
}

.carousel-container {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-item {
    min-width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.carousel-item img,
.carousel-item video {
    max-width: 80%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.carousel-item video {
    max-height: 70vh;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 1.5em;
    z-index: 10;
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.media-item {
    width: 100%;
    text-align: center;
}

.media-item img,
.media-item video {
    max-width: 80%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.media-item video {
    max-height: 70vh;
}

/* Container responsive pour vidéos YouTube/Vimeo */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.legende {
    font-style: italic;
    font-size: 1em;
    margin-top: 8px;
    text-align: center;
    color: #666;
}

/* Style pour les galeries d'images multiples */
@media (min-width: 768px) {
    .project-medias.grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .project-medias.grid .media-item {
        width: 100%;
    }
}

/* Galerie améliorée */

.gallery-item {
    border: 1px solid #333;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.gallery-item h3 {
    font-size: 1.5em;
    border: none;
    padding: 15px;
    margin: 0;
    text-align: center;
}


/* BOUTON DE CHANGEMENT DE FOND */
#background-toggle {
    position: absolute;
    right: 30px;
    bottom: 30px;
    width: 60px;
    height: 60px;
    background-color: white;
    border: 2px solid #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: move;
    z-index: 1000;
    transition: all 0.3s ease;
    user-select: none;
}


/* MODALES */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    
}

.modal-content {
    background-color: #F8F3E1;
    padding: 30px;
    border: 1px solid #333;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

.modal-content h3 {
    font-size: 2em;
    margin-top: 0;
    border: none;
    padding: 0;
    margin-bottom: 30px;
}

.modal-text {
    font-size: 1.3em;
    line-height: 1.2;
}

.modal-text p {
    margin-bottom: 10px;
}

.modal-text a {
    color: #333;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.modal-text a:hover {
    background-color: black;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-20px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* BOUTON IMAGE SIMPLE */

#bouton-image {
    position: fixed;
    top: 2em;
    right: 2em;
    width: 8em;
    height: 8em;
    background-color: transparent; 
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    user-select: none;
}

#bouton-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* ============================================
   RESPONSIVE DESIGN - TABLET (max-width: 1500px)
   ============================================ */

@media (max-width: 1500px) {
    .left-side {
        width: 20%;
    }

    .right-side {
        width: 80%;
    }
}

/* ============================================
   RESPONSIVE DESIGN - TABLET (768px - 1024px)
   ============================================ */

@media (max-width: 1024px) {
    .left-side {
        width: 30%;
    }

    .right-side {
        width: 70%;
    }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE (under 768px)
   ============================================ */

@media (max-width: 768px) {
    /* Show hamburger menu */
    .menu-toggle {
        display: flex;
    }

    body {
        height: 100vh;
        overflow: hidden;
    }

    /* Adapt left sidebar as slide-out menu */
    .left-side {
        position: fixed;
        left: 0;
        top: 0;
        width: 75%;
        max-width: 300px;
        height: 100vh;
        border-right: 1px solid #ccc;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1999;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        padding-top: 60px;
    }

    .left-side.open {
        transform: translateX(0);
    }

    /* Full-width right side content */
    .right-side {
        width: 100%;
        height: 100vh;
        overflow-y: auto;
    }

    /* Title adjustments */
    #title {
        padding: 0;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 10px;
    }

    #links {
        gap: 1em;
        font-size: 0.7em;
    }

    /* Navigation adjustments */
    .nav {
        padding-bottom: 2em;
    }

    .cat {
        margin-left: 0;
    }

    h3 {
        font-size: 1.1em;
        padding: 8px;
    }

    h4 {
        font-size: 1em;
    }

    /* Adjust image display */
    #home {
        height: 100%;
        object-fit: cover;
    }

    /* Adjust button styling */
    #bouton-image {
        width: 5em;
        height: 5em;
        top: 30px;
        right: 1.5em;
    }

    /* Project page adjustments */
    .project-page, .gallery-page {
        padding: 1.5em 1em;
    }

    .project-content h2 {
        font-size: 1.5em;
    }

    .project-description p {
        font-size: 1em;
    }

    .legende {
        font-size: 0.9em;
    }

    .project-link a {
        font-size: 1em;
    }

    /* Gallery grid adjustments */
    .gallery-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gallery-item {
        min-height: 200px;
    }

    .gallery-item img {
        height: 150px;
    }

    .gallery-item h3 {
        font-size: 1em;
        padding: 10px;
    }

    /* Modal adjustments */
    .modal-content {
        max-width: 90%;
        max-height: 90vh;
        padding: 20px;
    }

    .modal-content h3 {
        font-size: 1.5em;
    }

    .modal-text {
        font-size: 1em;
    }

    /* Video container adjustments */
    .media-item video {
        max-height: 50vh;
    }

    .project-medias {
        gap: 30px;
    }
}

/* ============================================
   RESPONSIVE DESIGN - SMALL PHONES (under 480px)
   ============================================ */

@media (max-width: 480px) {
    .left-side {
        width: 85%;
        max-width: 280px;
    }

    h1 {
        font-size: 1.2em;
    }

    #links {
        flex-direction: column;
        gap: 0.5em;
        font-size: 0.6em;
    }

    h3 {
        font-size: 1em;
        padding: 6px;
    }

    h4 {
        font-size: 0.9em;
    }

    #bouton-image {
        width: 4em;
        height: 4em;
        top: 20px;
        right: 1em;
    }

    .project-page, .gallery-page {
        padding: 1em;
    }

    .project-content h2 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }

    .project-description p {
        font-size: 0.95em;
        line-height: 1.5;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        min-height: 180px;
    }

    .gallery-item img {
        height: 120px;
    }

    .modal-content {
        max-width: 95%;
        padding: 15px;
    }

    .modal-content h3 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }

    .modal-text {
        font-size: 0.95em;
        line-height: 1.4;
    }

    .modal-text p {
        margin-bottom: 8px;
    }

    .btn-retour {
        font-size: 0.9em;
        padding: 4px 8px;
        margin-top: 50px;
        margin-left: 5px;
    }

    .right-side {
        padding-top: 0;
    }

    #home {
        height: calc(100vh + 50px);
    }
}



