/* ========================================================= */
/* 0️⃣ SÉCURITÉ FIXED POSITION                                */
/* (évite bugs si un parent a transform/filter)               */
/* ========================================================= */

html,
body {
  transform: none;
  filter: none;
}

#content,
#page-wrapper,
#page-container {
  transform: none;
  filter: none;
}

/* Background radial */
#radial-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 0.1s ease-in-out;
}



/* ========================================================= */
/* 1️⃣ PRÉLOADER                                              */
/* ========================================================= */

/* Styles pour le wrapper du préchargeur */
body.light-mode #preloader-wrapper,
body.dark-mode #preloader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* PRÉLOADER GLOBAL */
#preloader-wrapper {
  pointer-events: none;
}

#preloader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}



/* ========================================================= */
/* 2️⃣ DIVIDER / FULL-BLEED FIX (iOS + margins)               */
/* ========================================================= */

/* 0) Si un parent du divider est en 100vw → ça décale sur iOS */
.full-bleed,
.hero,
.section,
.menu,
.whatever-holds-the-divider {
  width: 100%;           /* remplace 100vw */
  max-width: 100%;
  box-sizing: border-box;
}

/* 2) Garde des marges symétriques sur mobile (et notch) */
@media (max-width: 600px) {
  .divider-wrap { 
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .divider svg {
    width: 100%;
    max-width: 400px;    /* ou ce que tu veux */
    height: auto;
  }
}

/* 3) Si tu DOIS absolument garder un parent en 100vw (ex: fond full-bleed),
   centre-le correctement dans la page : */
.keep-100vw {
  width: 100vw;
  margin-left: calc((100% - 100vw) / 2);
  margin-right: calc((100% - 100vw) / 2);
}



/* ========================================================= */
/* 3️⃣ CONTENT FADE-IN                                        */
/* ========================================================= */

/* Style pour le contenu principal avec effet de fondu */
#content {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

#content.visible {
  visibility: visible;
  opacity: 1;
}

.size02 {
  height: 100%;
}



/* ========================================================= */
/* 4️⃣ CURSEURS GLOBAUX                                       */
/* ========================================================= */

/* Common Styles */
body {
  cursor: url('../assets/CURSOR_default.webp') 8 8, auto;
}

/* Correction pour les curseurs des liens */
a:link,
a:visited {
  cursor: url('../assets/CURSOR_link.webp') 8 8, auto !important;
}

input[type="radio"],
input[type="checkbox"] {
  cursor: url('../assets/CURSOR_link.webp') 8 8, auto !important;
}



/* ========================================================= */
/* 5️⃣ SCROLLBAR (Webkit)                                     */
/* ========================================================= */

/* Styles for the scrollbar */
::-webkit-scrollbar {
  width: 14px;
  height: 0px;
  color: #FFEEAF;
}

::-webkit-scrollbar-thumb {
  background-image: radial-gradient(closest-corner ellipse at center, #90771B, #FFF5CF);
  border: 1px none #AC9232;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background-image: radial-gradient(closest-corner ellipse at center, #FFF5CF, #90771B);
}

::-webkit-scrollbar-thumb:active {
  background-image: radial-gradient(closest-corner ellipse at center, #FFF5CF, #90771B);
}

::-webkit-scrollbar-track {
  background: #FAEBB3;
  border: 1px solid #FFEEAF;
  border-radius: 0px;
}

::-webkit-scrollbar-track:hover {
  background: #FFEEAF;
}

::-webkit-scrollbar-track:active {
  background: #FFEEAF;
}

::-webkit-scrollbar-corner {
  background: #FFEEAF;
}



/* ========================================================= */
/* 6️⃣ TABBED CONTENT (DESKTOP RULES)                          */
/* ========================================================= */

@media all and (min-width: 800px) {
  .item.active .item-content {
    padding-top: 0;
  }

  .tabs-side .tabs li {
    margin-bottom: 2px;
  }
}

@media all and (min-width: 800px) {
  .tabbed-content .tabs {
    display: block;
  }

  .tabbed-content .tabs li {
    display: inline-block;
  }

  .tabbed-content .tabs li a {
    display: block;
  }

  .tabbed-content .item {
    min-height: 0;
  }

  .tabbed-content .item::before {
    display: none;
  }

  .tabbed-content.tabs-side .tabs {
    width: 150px;
    float: left;
  }

  .tabbed-content.tabs-side .tabs li {
    display: block;
  }

  .tabbed-content.tabs-side .item {
    margin-left: 150px;
  }
}



/* ========================================================= */
/* 7️⃣ RESPONSIVE PORTRAIT / LANDSCAPE SWITCH                 */
/* ========================================================= */

/* Hide one of the contents by default */
#landscape-content {
  display: none;
}
#portrait-content {
  display: none;
}

@media (max-aspect-ratio: 8/5) {
  #landscape-content {
    display: none;
  }
  #portrait-content {
    display: block;
  }
}

@media (min-aspect-ratio: 8/5) {
  #landscape-content {
    display: block;
  }
  #portrait-content {
    display: none;
  }
}

/* Specific image dimensions */
.landscape-image {
  width: 50%;
  height: auto;
}

.portrait-image {
  width: 80%;
  max-width: 300px; /* Set a max-width to control size */
  height: auto;
  margin-top: -1%;
}



/* ========================================================= */
/* 8️⃣ AUTO DARK (prefers-color-scheme)                       */
/* ========================================================= */

/* Utilisation de prefers-color-scheme */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #000000;
    color: #ffffff;
  }
}



/* ========================================================= */
/* 9️⃣ ALIGN UTILITIES                                        */
/* ========================================================= */

/* Définir les classes d'alignement pour le texte */
.align-left {
  text-align: left !important;
}

.align-center {
  text-align: center !important;
}

.align-right {
  text-align: right !important;
}

/* Pour que les images se comportent comme du texte */
.align-left img,
.align-center img,
.align-right img {
  display: inline-block !important;
  vertical-align: middle !important; /* Pour aligner verticalement les images avec le texte */
  max-width: 100% !important; /* Pour s'assurer que les images ne dépassent pas la largeur du conteneur */
}

/* Assurer que l'image est centrée */
.div-block.div-center img {
  display: block !important;  /* Assurer que l'image est un bloc */
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 100% !important;
  position: relative !important;  /* Pour s'assurer que l'image respecte la position de la div */
  transform: none !important;  /* Supprimer toute transformation qui pourrait la décaler */
}



/* ========================================================= */
/* 🔟 PETITS AJUSTEMENTS (mobile)                             */
/* ========================================================= */

/* En option : centrage du texte sur très petit écran */
@media (max-width: 600px) {
  .serie-description {
    text-align: center;
  }
}



/* ========================================================= */
/* 1️⃣1️⃣ ARTWORK FULLPAGE MODE                                */
/* ========================================================= */

/* Spécifique à la page œuvre en mode grand format */
body.artwork-fullpage .serie {
  flex-direction: column;
  align-items: center;
}

body.artwork-fullpage .serie-video {
  width: 90vw;
  max-width: 960px;
  aspect-ratio: 1 / 1;
}

body.artwork-fullpage .canvas.large {
  width: 90vw;
  max-width: 960px;
  height: auto;
}



/* ========================================================= */
/* 1️⃣2️⃣ VERSION MOBILE — NAVIGATION                          */
/* ========================================================= */

/* VERSION MOBILE */

/* MOBILE ONLY NAVIGATION */
/* ---- MOBILE HEADER, NAVIGATION & MASQUAGE ---- */
@media (max-width: 900px) {

  /* 1. Le header mobile (logo + bouton) */
  .mobile-header { display: block !important; }

  /* 2. Bouton menu mobile uniquement (PAS le menu !) */
  .mobile-only { display: block !important; }

  /* 3. Masquer tous les éléments d’entête desktop et nav desktop en mobile */
  .moon-container,
  .overlay-text,
  .tabbed-content .tabs,
  nav.tabs,
  .tabbed-content nav,
  .tusseau-header-logo-container .overlay-text,
  .header-image.landscape-image + .overlay-text,
  .tusseau-header-logo-container .overlay-text.transition {
    display: none !important;
  }

  @media (max-width: 900px) {
    .tusseau-header-logo-container {
      width: 100% !important;
      text-align: center !important;
      max-width: 100vw !important;
    }
    .tusseau-header-logo-container .mobile-header-logo {
      width: 100vw !important;     /* Ou 100vw si tu veux vraiment max */
      max-width: none !important;
      min-width: 0 !important;
      height: auto !important;
      display: block !important;
      margin: 0 auto 16px auto !important;
    }
  }

  /* 5. Le menu mobile : NE PAS le rendre visible ici ! 
        Il DOIT rester caché (display:none) tant que JS ne l’ouvre pas ! 
        Juste lui donner son style général quand il est visible. */
  #mobile-menu {
    /* display: block;   <-- surtout PAS !! */
    position: fixed;
    z-index: 10000;
    left: 0; right: 0; top: 0; bottom: 0;
    background: radial-gradient(circle at 50% 40%, #fffbe6 0%, #f5ebd5 100%);
    color: #90771B;
    text-align: center;
    padding-top: 3.5rem;
    font-family: 'Work Sans', Arial, Helvetica, sans-serif;
    font-weight: 500;
    font-size: 1.18em;
    letter-spacing: 0.13em;
    overflow-y: auto;
  }

  #mobile-menu ul { list-style: none; padding: 0 0 1em 0; margin: 0; }
  #mobile-menu ul li { margin: 0.7em 0; }  /* <-- adapte si tu veux régler la distance de l'espace entre chaque titre */

  #mobile-menu ul .separator {
    border-bottom: 2px solid #90771B;
    margin: 1em auto;
    width: 60%;
    height: 0;
    list-style: none;
  }

  @media (max-width: 900px) {
    #close-mobile-menu {
      color: #90771B;
      font-family: 'Work Sans', Arial, Helvetica, sans-serif;
      font-size: 1.2em;
      font-weight: 200;
      letter-spacing: 0.08em;
      border: none;
      background: none;
      margin: 2rem auto 2rem auto;
      display: block;
      cursor: pointer;
      transition: color 0.18s;
    }
  }

  /* ---- Version desktop : cache tout ce qui est mobile ---- */
  @media (min-width: 901px) {
    .mobile-header, .mobile-only { display: none !important; }
  }
  @media (max-width: 900px) {
    .desktop-header { display: none !important; }
  }
  @media (min-width: 901px) {
    .desktop-header { display: block !important; }
  }

  @media (max-width: 900px) {
    .mobile-header { display: block !important; }
  }
  @media (min-width: 901px) {
    .mobile-header { display: none !important; }
  }

  @media (max-width: 900px) {
    #mobile-menu-button {
      width: 100%;
      text-align: center; /* Pour les anciens navigateurs, mais normalement display:block;margin:auto suffit */
    }
    #sommaire-img {
      display: block;
      margin: 0 auto;
      width: 90vw;
      max-width: 600px;
    }
  }

  @media (max-width: 800px) {
    .mobile-header-logo {
      width: 80% !important;      /* Mets ici 10%, 20%, 50%, 80%... ce que tu veux */
      max-width: none !important; /* AUCUNE limite max imposée */
      min-width: 0 !important;    /* Optionnel : autorise la réduction maximale */
      height: auto !important;
      display: block;
      margin: 0 auto 16px auto;
    }
  }

  @media (max-width: 900px) {
    /* Cacher la scrollbar verticale dans le menu mobile */
    #mobile-menu {
      scrollbar-width: none;     /* Firefox */
      -ms-overflow-style: none;  /* IE & Edge */
    }
    #mobile-menu::-webkit-scrollbar {
      display: none;             /* Chrome, Safari, Opera */
      width: 0;
      background: transparent;
    }
  }

  @media (max-width: 900px) {
    html, body {
      overflow-y: scroll;
      scrollbar-width: none;     /* Firefox */
      -ms-overflow-style: none;  /* IE & Edge */
    }
    html::-webkit-scrollbar,
    body::-webkit-scrollbar {
      display: none;
      width: 0;
      background: transparent;
    }
  }
}

/* ✅ Desktop : on force le masquage de tout ce qui est mobile */
@media (min-width: 901px) {
  .mobile-header,
  .mobile-only,
  .mobile-header-logo {
    display: none !important;
  }

  .desktop-header {
    display: block !important;
  }
}

/* ✅ Mobile : on force le masquage du desktop */
@media (max-width: 900px) {
  .desktop-header {
    display: none !important;
  }

  .mobile-header,
  .mobile-only {
    display: block !important;
  }
}