  /* BASE */

  * {
    box-sizing: border-box;
  }

  html,
  body {
    margin: 0;
    padding: 0;
  }

  body {
    background: #fff;
    color: #000;
    font-family: "IBM Plex Mono", monospace;
    font-weight: 400;
  }

  /* HEADER IDENTIQUE Ã€ INFOS */

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 30;

    padding: 12px 25px;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: center;

    background: #fff;

    font-size: 20px;
    font-weight: 400;
    line-height: 1.2;
  }

  .site-header a {
  color: inherit;
  text-decoration: none;

  width: fit-content;
  justify-self: start;
}

  .site-header a:nth-child(2) {
    text-align: left;
  }

  .site-header a:nth-child(3) {
    text-align: right;
    justify-self: end;
  }

  /* CONTENU DE LA PAGE */


/* CONTENU CASE STUDY */

.case-main {
  height: 100svh;
  padding: 48px 25px 0px;

  display: flex;
  flex-direction: column;

  overflow: hidden;
}


  /* MOBILE */

  @media (max-width: 900px) {
    .site-header {
      padding: 12px 15px;
      gap: 8px;
      font-size: 13px;
    }

    .case-main {
      padding: 60px 15px 15px;
    }
  }


/* GALERIE HORIZONTALE */

.case-gallery {
  width: 100%;

  /* Hauteur adaptÃ©e Ã  l'Ã©cran, limitÃ©e pour
     qu'un visuel 16:9 ne dÃ©passe pas le site */
position: relative;


height: min(
  calc(100svh - 96px),
  max(800px, calc((100vw - 50px) * 0.75))
);



  flex-shrink: 0;
  overflow: hidden;
}

.case-gallery-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;

position: relative;
transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);

  gap: 10px;
  height: 100%;
  width: max-content;
}

/* IMAGES DE FORMATS DIFFÃ‰RENTS */


.case-slide {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  margin: 0;
  overflow: hidden;
}

.case-slide img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
}


/* BLOCS TEMPORAIRES */

.case-placeholder {
  width: 100%;
  height: 100%;

  display: flex;
  justify-content: center;
  align-items: center;

  color: white;
  font-size: 20px;
}

/* BARRE INFÃ‰RIEURE */

.case-caption {
  margin-top: auto;

  min-height: 48px;
  padding: 12px 0;

  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
}


/* NAVIGATION INVISIBLE DE LA GALERIE */

.case-nav {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;

  z-index: 5;

  background: transparent;
  border: none;
  padding: 0;

  cursor: pointer;
}

.case-nav-prev {
  left: 0;
  cursor: w-resize;
}

.case-nav-next {
  right: 0;
  cursor: e-resize;
}

/* AccessibilitÃ© : rÃ©duire les animations */

@media (prefers-reduced-motion: reduce) {
  .case-gallery-track {
    transition: none;
  }
}


/* PANNEAU DÃ‰TAILS */

.case-details-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 40;

  padding: 0 25px;

  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  transform: translateY(calc(100% - 48px));
  transition: transform 550ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* BANDEAU CESARI / DÃ‰TAILS */

.case-details-toggle {
  width: 100%;
  height: 48px;

  padding: 12px 0;
  border: none;
  background: transparent;
  color: inherit;

  display: flex;
  justify-content: space-between;
  align-items: center;

  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;

  text-align: left;
  cursor: pointer;
}

.case-details-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.case-details-arrow {
  display: inline-block;
  transform: rotate(180deg); /* Fermé : flèche vers le haut (ouvrir). */
  transition: transform 350ms ease;
}

/* CONTENU INTERNE SUR 9 COLONNES */

.case-details-content {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: 10px;
  align-items: start;

  padding: 25px 0;
  max-height: calc(70svh - 48px);
  overflow-y: hidden;
}

/* SERVICES : COLONNES 4 ET 5 */

.case-details-services {
  grid-column: 4 / span 2;

  font-size: 15px;
  font-weight: 300;
  line-height: 1.25;
}


/* PUCES DES PRESTATIONS */

.service-bullet {
  display: inline-block;
  font-size: 1.5em;
  line-height: 0;
  vertical-align: -0.08em;
}


/* DESCRIPTION : COLONNES 6 Ã€ 9 */


.case-details-description {
  grid-column: 6 / span 4;

  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;

  /* Seule la description peut défiler */
  max-height: calc(70svh - 98px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}


/* MASQUER LA BARRE DE SCROLL DE LA DESCRIPTION */

.case-details-description {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.case-details-description::-webkit-scrollbar {
  display: none;
}



.case-details-services p,
.case-details-description p {
  margin: 0;
}

/* Ã‰TAT OUVERT */

.case-details-panel.is-open {
  transform: translateY(0);
}

.case-details-panel.is-open .case-details-arrow {
  transform: rotate(0deg); /* Ouvert : flèche vers le bas (refermer). */
}

/* VERSION MOBILE */

@media (max-width: 900px) {
  .case-details-panel {
    padding: 0 15px;
  }

  .case-details-toggle {
    font-size: 13px;
  }

  .case-details-content {
    grid-template-columns: 1fr;
    row-gap: 25px;
    padding: 20px 0;
  }

  .case-details-services,
  .case-details-description {
    grid-column: 1;
  }

  .case-details-services {
  font-size: 19px;
  line-height: 1.35;
}

.case-details-description {
  font-size: 21px;
  line-height: 1.35;
}

/* Sur mobile, le panneau entier reste défilable */

.case-details-content {
  overflow-y: auto;
}

.case-details-description {
  max-height: none;
  overflow-y: visible;
}

}

/* ACCESSIBILITÃ‰ */

@media (prefers-reduced-motion: reduce) {
  .case-details-panel,
  .case-details-arrow {
    transition: none;
  }
}

/* VERSION MOBILE — CASE STUDIES */

@media (max-width: 900px) {

  /* HEADER IDENTIQUE À L'ACCUEIL MOBILE */

 
.site-header {
  height: 96px;
  padding: 12px 20px;

  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 6px;

  font-size: clamp(22px, 6.9vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.065em;
}

/* NOM SUR DEUX LIGNES */

.site-header a:first-child span {
  display: block;
}

/* MASQUER PROJETS */

.site-header > a:nth-child(2) {
  display: none;
}


  /* Masque le lien Projets */

  .site-header a:nth-child(2) {
    display: none;
  }

  /* CONTENU DE LA PAGE */

  .case-main {
    height: auto;
    min-height: 100svh;

    padding: 76px 20px 80px;

    display: block;
    overflow: visible;
  }

  /* GALERIE VERTICALE */

  .case-gallery {
    height: auto;
    overflow: visible;
  }

  .case-gallery-track {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    gap: 20px;

    width: 100%;
    height: auto;

    transform: none !important;
    transition: none;
  }

  /* UNE IMAGE PAR LIGNE */


.case-slide {
  flex: none;
  width: 100%;
  height: auto;
}

.case-slide img {
  width: 100%;
  height: auto;
}



/* IMAGES RÉELLES — GALERIE */

.case-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}


  /* Désactive les zones de clic du carrousel */

  .case-nav {
    display: none;
  }

/* BANDEAU DÉTAILS — IDENTIQUE AU HEADER MOBILE */

.case-details-panel {
  padding: 0 20px;
  transform: translateY(calc(100% - 72px));
}

.case-details-toggle {
  height: 72px;
  padding: 16px 0;

  font-size: clamp(22px, 6.9vw, 28px);
  letter-spacing: -0.065em;
  line-height: 1.2;
}

}

/* ===============================================================
   CARROUSEL DES CASE STUDIES — PLEINE LARGEUR DESKTOP
   Partage par les projets classiques et les lettres Pareidotype.
   - Premier visuel : marge gauche de 25 px.
   - Entre les visuels : ils restent visibles jusqu'au bord de l'écran.
   - Dernier visuel : marge droite de 25 px.
   - Mobile : la galerie verticale existante est inchangée.
   =============================================================== */
@media (min-width: 901px) {
  .case-main > .case-gallery {
    width: calc(100% + 50px);
    margin-left: -25px;
  }

  .case-main > .case-gallery > .case-gallery-track {
    padding-left: 25px;
    padding-right: 25px;
  }
}


/* GALERIE MIXTE — MP4/WebM dans les case studies, en gardant les proportions. */
.case-slide video {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
}
@media (max-width: 900px) {
  .case-slide video {
    width: 100%;
    height: auto;
    max-width: 100%;
  }
}

/* MOBILE — MASQUER "DÉTAILS", GARDER LA FLÈCHE */

@media (max-width: 900px) {

  .case-details-label {
    font-size: 0;
    gap: 0;
    flex-shrink: 0;
  }

  .case-details-arrow {
    font-size: clamp(22px, 6.9vw, 28px);
  }

}
.case-details-panel.is-open .case-details-content {
  cursor: pointer;
}


/* GRANDS ÉCRANS — le bandeau titre / Détails suit la même
   progression typographique que le header (20 → 28 px de 1440 à 2560).
   Ajuster aussi sa hauteur visible pour éviter le rognage du texte.
   Les valeurs classiques et la version mobile restent inchangées. */
@media (min-width: 1441px) {
  /* La galerie et les neuf colonnes du panneau gardent la même gouttière. */
  body {
    --case-gutter: clamp(10px, calc(0.7143vw - 0.286px), 18px);
  }

  .site-header {
    gap: var(--case-gutter);
  }

  .case-gallery-track {
    gap: var(--case-gutter);
  }

  .case-details-content {
    column-gap: var(--case-gutter);
  }

  .site-header,
  .case-caption,
  .case-details-toggle {
    font-size: clamp(20px, calc(0.7143vw + 9.714px), 28px);
  }

  .case-details-panel {
    --case-bar-height: clamp(48px, calc(1.4286vw + 27.43px), 64px);
    transform: translateY(calc(100% - var(--case-bar-height)));
  }

  .case-details-panel.is-open {
    transform: translateY(0);
  }

  .case-details-toggle {
    height: var(--case-bar-height);
  }

  .case-details-content {
    max-height: calc(70svh - var(--case-bar-height));
  }

  .case-details-description {
    max-height: calc(70svh - var(--case-bar-height) - 50px);
  }
}

/* La zone transparente ne doit afficher une flèche que lorsqu'une
   nouvelle position du carrousel est réellement accessible. */
.case-nav[hidden] {
  display: none !important;
}


/* SAFARI iPHONE — stabiliser header / bandeau Détails durant le scroll.
   WebKit iOS peut décaler les éléments fixed avec la barre d'adresse.
   Un scroll interne garde la page racine immobile, sans toucher aux autres
   navigateurs ni à la galerie horizontale sur ordinateur. La classe est
   posée uniquement par return-intro.js sur Safari iPhone mobile. */
@media (max-width: 900px) {
  body.solene-ios-case-scroll:not(.solene-case-returning) {
    height: 100svh;
    overflow: hidden;
  }

  body.solene-ios-case-scroll:not(.solene-case-returning) > .case-main {
    height: 100svh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  /* Au clic sur SV, le retour animé reprend le scroll du document.
     L'introduction est ajoutée avant le header, et la position de galerie
     est transférée dans window.scrollY dans la même frame. */
  body.solene-ios-case-scroll.solene-case-returning {
    height: auto;
    overflow: visible;
  }

  body.solene-ios-case-scroll.solene-case-returning > .case-main {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }
}
