*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Thin */
@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
}

@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-ThinItalic.ttf') format('truetype');
    font-weight: 100;
    font-style: italic;
}

/* Light */
@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-LightItalic.ttf') format('truetype');
    font-weight: 300;
    font-style: italic;
}

/* Regular */
@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* Medium */
@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

/* SemiBold */
@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

/* Bold */
@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* ExtraBold */
@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

/* Black */
@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTight-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

/* Styles généraux */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

body {
    font-family: 'Inter Tight', sans-serif;
    font-weight: 400;
    background-color: #ffffff;
    color: #3F3F3F;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

body.no-scroll {
    overflow: hidden;
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Styles communs pour le menu de navigation */
nav {
    background-color: #fff;
    font-size: 14px;
    line-height: 1.2;
    z-index: 1100;
}

nav a {
    display: block;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    color: #8D8D8D;
    font-weight: 400;
    margin: 8px 0; /* Ajouté pour restaurer le menu PC */
}

nav a.active,
nav a.no-hover {
    color: #3F3F3F;
}

nav a:not(.active):not(.no-hover):hover,
nav a.no-hover:hover {
    color: #3F3F3F;
}

nav a:not(.active):not(.no-hover) {
    color: #909090;
}

nav a.no-hover {
    margin-bottom: 25px;
}

body.home nav a {
    color: #3F3F3F;
}

body.home nav a:hover {
    color: #3F3F3F;
}


/* Styles généraux pour le contenu */
.content {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
}

.content h2 {
    font-size: 1em;
    font-weight: 500;
    margin: 0 0 0.5em;
    line-height: 1.2;
}

.content p {
    margin: 0 0 1em;
    line-height: 1.2;
    font-weight: 400;
}

body.selected-works .content {
    padding: 0;
}

.artwork {
    position: relative;
}

.artwork-item {
    float: left;
    margin-bottom: 50px;
    box-sizing: border-box;
}

.artwork-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.artwork::after {
    content: "";
    display: table;
    clear: both;
}

/* Styles pour l'overlay en plein écran */
.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1000;
}

.fullscreen-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container {
    display: flex;
    flex-direction: column;
    position: relative;
    align-items: flex-end;
    max-width: calc(90vw - 320px);
    max-height: 90vh;
}

.fullscreen-overlay img {
    max-width: 100%;
    max-height: 90vh;
    height: auto;
}

.fullscreen-details {
    margin-top: 15px;
    width: 100%;
    max-width: 600px;
    padding: 10px;
    position: absolute;
    left: 100%;
    bottom: 0;
    padding-left: 20px;
    color: #3F3F3F;
    font-size: 0.85em;
    background-color: white;
}

.fullscreen-details h1 {
    font-size: 12px;
    margin: 0 0 5px;
    font-weight: 700;
}

.fullscreen-details p {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    margin: 0;
}

@media (max-width: 1024px) {
    .image-container {
        max-width: 90vw;
        align-items: center;
    }

    .fullscreen-details {
        position: static;
        padding-left: 0;
        padding-top: 10px;
    }
}

/* Styles pour la bande de tri */
.sorting-bar {
    background-color: #fff;
    font-size: 12px;
    line-height: 1.2;
    padding: 25px 25px 0 25px; /* Même padding que le menu de navigation */
}

.sorting-options {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sorting-options li {
    margin-right: 20px;
    cursor: pointer;
    font-weight: 400;
    color: #8D8D8D;
    transition: color 0.3s;
}

.sorting-options li.active,
.sorting-options li:hover {
    color: #3F3F3F;
}

.artwork-item.hidden {
    display: none;
}


/* Styles pour le formulaire de contact */
.contact-form {
    max-width: 600px;
    margin-top: 20px;
}

.contact-form .form-group {
    margin-bottom: 15px;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 400;
    color: #3F3F3F;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    font-family: 'Inter Tight', sans-serif;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #3F3F3F;
    box-sizing: border-box;
}

.contact-form textarea {
    height: 100px;
    resize: vertical;
}

.contact-form button {
    padding: 10px 20px;
    font-size: 14px;
    font-family: 'Inter Tight', sans-serif;
    background-color: #3F3F3F;
    color: #fff;
    border: none;
    cursor: pointer;
}

.contact-form button:hover {
    background-color: #5f5f5f;
}

/* Styles pour les messages d'erreur */
.error-messages {
    background-color: #ffe5e5;
    color: #d8000c;
    padding: 10px;
    margin-bottom: 20px;
}

.error-messages p {
    margin: 0;
}

/* Styles pour le message de succès */
.success-message {
    background-color: #e5ffe5;
    color: #4f8a10;
    padding: 10px;
    margin-bottom: 20px;
}

.success-message p {
    margin: 0;
}

/* Styles pour l'icône Instagram */
.social-media {
    margin-top: 40px;
}

.social-media a {
    display: inline-block;
}

.instagram-icon {
    width: 32px; /* Ajustez la taille selon vos préférences */
    height: 32px;
}


/* Styles pour la version PC */
@media (min-width: 769px) {
    /* Styles spécifiques pour le menu sur PC */
    nav {
        width: 220px;
        padding: 25px 20px 25px 25px;
        position: fixed;
        height: 100%;
        background-color: #fff;
        font-size: 14px;
        line-height: 1.2;
        z-index: 1100;
    }

    /* Supprimer la marge supérieure du lien "Fanny Malicet" */
    nav a.logo.no-hover {
        margin-top: 0; /* Élimine les 8px de marge-top définis globalement */
        margin-bottom: 25px; /* Maintient la marge inférieure */
        padding-top: 0; /* Assure qu'il n'y a pas de padding supplémentaire */
        padding-bottom: 0; /* Assure qu'il n'y a pas de padding supplémentaire */
        line-height: 1; /* Réduit le line-height pour minimiser l'espace vertical */
    }

    .content {
        margin-left: 220px;
        padding-top: 0;
    }

    .artwork {
        /* Retirer les styles CSS Grid pour les écrans larges */
        display: block;
        padding: 0 25px;
    }

    .artwork-item {
        width: 350px; /* Largeur fixe pour Masonry */
        margin-left: 20px;
        margin-bottom: 50px;
        padding: 0 5px; /* Restauré pour le PC */
    }

    .artwork-sizer {
        display: none; /* Pas nécessaire sur PC */
    }
    
    .hamburger {
        display: none;
    }

    body.home .main-container {
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Centrer verticalement */
        align-items: center;
        width: 100%;
        margin-left: 0;
        padding-top: 25px; /* Alignement avec le nav */
        padding-bottom: 25px; /* Marge inférieure égale */
        box-sizing: border-box;
        height: 100vh; /* Occupation totale de la hauteur de la fenêtre */
        overflow: hidden; /* Empêche le défilement global */
    }

    /* Ajuster la section de l'image pour qu'elle ne dépasse pas */
    body.home .image-container {
        display: flex;
        flex-direction: column;
        align-items: center; /* Centre horizontalement les éléments */
        width: 80vw;          /* Limite la largeur maximale */
        flex-grow: 1;         /* Prend l'espace disponible */
        margin: 0 auto;       /* Centre le conteneur dans son parent */
        padding: 0;            /* Supprime le padding vertical */
        box-sizing: border-box;
        position: relative;
    }

    /* Ajuster l'image pour qu'elle s'adapte sans dépasser */
    body.home .image-container img {
        display: block;
        max-width: 100%;      /* Empêche l'image de dépasser la largeur du conteneur */
        height: auto;         /* Maintient les proportions de l'image */
        margin: 0 auto;       /* Centre l'image horizontalement */
    }

    /* Ajuster les détails de l'image */
    body.home .fullscreen-details {
        position: static;             /* Supprime le positionnement absolu */
        width: 100%;                  /* Utilise toute la largeur disponible */
        max-width: none;              /* Supprime la limite de largeur */
        text-align: center;           /* Centre le texte */
        padding-left: 0;              /* Supprime le padding à gauche */
        margin-top: 15px;             /* Ajoute un espace au-dessus des détails */
        padding-bottom: 10px;
        background-color: transparent;/* Supprime le fond blanc */
        box-sizing: border-box;
    }

    /* Centrer le contenu de .content */
    body.home .content {
        margin-left: 0; /* Assure qu'il n'y a pas de décalage */
    }

    .sorting-bar {
        position: fixed;
        top: 0;
        left: 270px; /* Démarre à 270px de la bordure gauche */
        width: calc(100% - 270px); /* Occupe le reste de la largeur */
        padding: 25px 25px 0 0; /* Ajuster le padding */
        background-color: #fff;
        z-index: 1000; /* Assurez-vous que le menu de navigation est au-dessus */
    }

    body.about-page .content,
    body.contact-page .content {
        padding-right: 270px;
        padding-left: 50px;
    }


}

/* Styles pour la version mobile */
@media (max-width: 768px) {
    /* Menu en haut */
    nav {
        width: 100%;
        position: relative;
        padding: 10px 15px; /* Ajustez le padding si nécessaire */
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        height: auto;
        z-index: 1100;
    }

    /* Réinitialiser la marge du logo */
    nav a.no-hover {
        margin-bottom: 0;
    }

    /* Ajuster les styles du logo */
    nav a.logo {
        font-size: 14px; /* Ajustez la taille de la police si nécessaire */
        line-height: 1; /* Assure un alignement vertical précis */
        padding: 0; /* Réinitialise le padding */
        margin: 0; /* Réinitialise les marges */
    }

    /* Styles de l'icône hamburger */
    .hamburger {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
    }

    .hamburger span {
        display: block;
        width: 20px; /* Réduit la largeur */
        height: 2px; /* Réduit la hauteur */
        margin: 3px 0; /* Ajuste la marge entre les barres */
        background-color: #333;
        transition: 0.4s;
    }

    /* Styles pour les liens du menu déroulant */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 50px; /* Ajustez selon la hauteur du nav */
        right: 10px;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        padding: 10px;
        border-radius: 5px;
    }

    .nav-links a {
        margin: 10px 0;
        font-size: 14px;
        color: #3F3F3F; /* Assure la cohérence des couleurs */
    }

    /* Afficher le menu déroulant lorsque le nav a la classe 'active' */
    nav.active .nav-links {
        display: flex;
    }



    nav a {
        margin: 5px;
        font-size: 14px;
        flex: none;
    }

    /* Supprimer la marge à gauche */
    .main-container,
    .content,
    body.selected-works .content {
        margin-left: 0;
        padding: 0;
    }

    body.about-page .content,
    body.contact-page .content {
        margin-top: 20px;
        padding: 20px; /* Ajustez selon vos besoins */
    }

    /* Styles pour la grille sur mobile utilisant CSS Grid */
    .artwork {
        column-count: 3;
        column-gap: 10px;
        padding: 10px;
    }

    .artwork-item {
        display: inline-block;
        width: 100%;
        margin-bottom: 10px;
    }

    .artwork-item img {
        width: 100%;
        height: auto;
        display: block;
        cursor: pointer;
    }

    
    .image-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px;
        text-align: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }
    

    .image-container img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
    }

    .fullscreen-details {
        width: 100%;
        text-align: center; /* Centre le texte */
        padding: 10px;
    }

    .artwork-sizer,
    .gutter-sizer {
        display: none; /* Masquer les sizers en mobile */
    }

    .sorting-bar {
        margin-left: 0;
        padding: 10px 15px;
    }

}
