@font-face {
  font-family: "Diatype";
  src: url("../fonts/ABCDiatype-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

/* ========= BASE ========= */
html,
body {
  margin: 0;
  padding: 0;
  background: white;
  font-family: "Rhymes", sans-serif;
  height: 100%;
  overflow: hidden; /* bloque scroll body */
}

.header {
  font-size: 12px;
  line-height: 1;
  background: transparent;
}

.header-spacer {
  height: 0px;
}

/* ========= SCROLL CONTAINER ========= */
.scroll-wrapper {
  height: 100vh;
  width: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;
}

/* ========= CURSORS ========= */
body.cursor-up {
  cursor: n-resize;
}
body.cursor-down {
  cursor: s-resize;
}

/* ========= PROJECT LAYOUT ========= */
.project-main {
  width: 100%;
  height: auto;
}

.project-slide {
  height: 100vh;
  width: 100%;
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.project-slide iframe {
  pointer-events: none;
}

/* === FIT DESKTOP === */
.project-slide.fit-desktop-cover img {
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
}

.project-slide.fit-desktop-contain img {
  object-fit: contain !important;
  width: auto !important;
  height: 100% !important;
}

/* ========= THEME & BACKGROUND ========= */
.theme-dark .header a {
  color: white;
}
.theme-light .header a {
  color: black;
}

.bg-white {
  background-color: white;
}
.bg-black {
  background-color: black;
}

/* ========= HEADER: FORCE TEXT COLOR VIA PANEL ========= */
.header-text-white .header,
.header-text-white .header a {
  color: white !important;
}

.header-text-black .header,
.header-text-black .header a {
  color: black !important;
}

/* Fallback par thème pour le bouton Close */
.theme-dark .project-close .close-link {
  color: white;
}
.theme-light .project-close .close-link {
  color: black;
}

/* Forçage via Panel pour le bouton Close */
.header-text-white .project-close .close-link {
  color: white !important;
}
.header-text-black .project-close .close-link {
  color: black !important;
}

/* ========= CLOSE BUTTON ========= */
.project-close {
  position: fixed;
  top: 10px;
  right: 35px;
  z-index: 3001; /* au-dessus du contenu */
}

.close-link {
  font-family: "Rhymes", sans-serif;
  font-size: 12px;
  line-height: 1;
  color: inherit; /* hérite si pas surchargé */
  text-decoration: none;
  transition: opacity 0.25s ease;
}

.close-link:hover {
  opacity: 0.5;
}

/* ========= INTRO SECTION ========= */
.project-intro {
  height: 40vh; /* moins que 100vh → laisse apparaître la suite */
  scroll-snap-align: start;
  display: flex;
  align-items: flex-start;
  padding-top: 50px;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-intro::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 30vh; /* zone qui laisse entrevoir l'image suivante */
  background: transparent;
  pointer-events: none;
}

.project-intro .intro-inner {
  width: 100%;
  box-sizing: border-box;
  padding: 0 20px 10px 20px; /* cohérent avec tes overlays */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.project-intro .intro-text,
.project-intro .intro-text-long {
  max-height: 50vh; /* scroll interne si texte long */
  overflow-y: auto;
  line-height: 1.15;
  font-size: 18px;
  color: inherit; /* suit le thème */
}

/* Couleur du texte selon le fond */
.bg-black .project-intro .intro-text,
.bg-black .project-intro .intro-text-long {
  color: white;
}
.bg-white .project-intro .intro-text,
.bg-white .project-intro .intro-text-long {
  color: black;
}

/* ========= ANCIEN OVERLAY DESCRIPTION (DÉSACTIVÉ) ========= */
.project-description {
  display: none !important;
}

/* ========= NAV ========= */
.project-nav {
  position: fixed;
  bottom: 35px;
  right: 80px;
  z-index: 1990;
  display: flex;
  flex-direction: row;
  gap: 2rem;
  text-align: right;
  mix-blend-mode: difference;
}

.project-nav .nav-link {
  font-family: "Diatype", sans-serif;
  font-size: 12px;
  color: white;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.project-nav .nav-link:hover {
  opacity: 0.5;
}

/* Traits verticaux en blanc quand header_text = white */
.header-text-white .header::before,
.header-text-white .header::after {
  background: white !important;
}

/* (si tu affiches le séparateur central .header-divider) */
.header-text-white .header-divider {
  background: white !important;
}

/* Optionnel : repasse en noir si header_text = black (pour être explicite) */
.header-text-black .header::before,
.header-text-black .header::after,
.header-text-black .header-divider {
  background: black !important;
}


/* ========= FIT MOBILE ========= */
@media screen and (max-width: 768px) {
  html,
  body {
    height: auto;
    overflow: auto; /* rétablit le scroll naturel */
    font-size: 14px;
  }

  /* ===== HEADER MOBILE ===== */
  .header {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 0px;
    font-size: 14px;
    background: white;
  }

  /* Fond noir si texte blanc choisi dans Kirby */
  .header-text-white .header {
    background: black;
  }

  /* Ligne sous les filtres en blanc si fond noir */
  .header-text-white .header-right {
    border-top: 1px solid white;
  }

  /* on supprime le trait vertical gauche */
  .header::before {
    content: none;
  }

  /* on réutilise ::after pour la ligne horizontale avec 15px de marge */
  .header::after {
    content: "";
    display: block; /* au cas où il était masqué */
    position: absolute;
    top: 32px; /* reset l'ancien top */
    width: auto; /* reset l'ancien width */
    left: 15px;
    right: 15px;
    bottom: 0;
    height: 1px;
    background: black;
    pointer-events: none;
  }

  /* Si fond noir → ligne horizontale en blanc */
  .header-text-white .header::after {
    background: white;
  }

  .project-close {
    top: 10px;
    right: 15px;
  }
  .project-close a {
    font-size: 14px;
  }

  /* Scroll naturel, plus de snap */
  .scroll-wrapper {
    height: auto;
    overflow: visible;
    scroll-snap-type: none;
  }

  .project-slide {
    height: auto; /* plus de 100vh */
    scroll-snap-align: none; /* neutralise le snap */
    display: block;
    overflow: visible;
    padding: 0 15px; /* marge latérale demandée */
    box-sizing: border-box;
    margin-bottom: 10px; /* gap entre sections */
  }

  /* Images/vidéos largeur max container, hauteur naturelle, avec gap */
  .project-slide img,
  .project-slide video {
    max-width: 100%;
    width: auto; /* ne pas forcer à 100% si l’original est plus petit */
    height: auto;
    object-fit: contain;
    display: block;
    margin-bottom: 10px; /* gap de 10px entre médias */
  }

  /* Neutralise d’éventuelles règles “fit-mobile-*” héritées */
  .project-slide.fit-mobile-cover img,
  .project-slide.fit-mobile-contain img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
  }

  /* Intro mobile */
  .project-intro {
    height: auto;
    padding: 27px 15px 15px 15px; /* même marge latérale */
    align-items: flex-start;
  }
  .project-intro .intro-inner {
    padding: 0;
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .project-intro .intro-text,
  .project-intro .intro-text-long {
    font-size: 14px;
    padding-right: 6px; /* confort scroll iOS */
  }

  /* Nav mobile */
  .project-nav .nav-link {
    font-size: 14px;
  }
  .project-nav {
    position: fixed;
    bottom: 35px;
    right: 25px;
  }
}
