/*--------------------------------------------------------------*/
/* BOUTON CV (centré dans le footer) */
#bottom-nav .cv-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font-family: inherit;
}

/*--------------------------------------------------------------*/
/* LECTEUR CV */
html.cv-open {
  overflow: hidden;
}

#cv-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  will-change: auto;
  transition: none;
}

#cv-viewer.active { display: block; }
#cv-viewer.ready { cursor: grab; }
#cv-viewer.ready.dragging { cursor: grabbing; }

.cv-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 50%;
}

.cv-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2vw;
}

.cv-sheet {
  flex: none;
  opacity: 0;
}

.cv-sheet.landed { opacity: 1; }

/* 95vh à l'ouverture. --ar (ratio largeur/hauteur) est posée en JS une fois l'image chargée */
.cv-sheet img {
  display: block;
  width: auto;
  height: 95vh;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: opacity 0.2s ease;
}

/* fondu pendant le changement de langue */
.cv-sheet img.swapping { opacity: 0; }

/*--------------------------------------------------------------*/
/* CROIX DE FERMETURE (blanc + blend difference) */
#cv-close {
  position: fixed;
  top: 50%;
  right: 1vw;
  transform: translateY(-50%);
  z-index: 210;
  width: 2.2vw;
  height: 2.2vw;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  background: none;
  border: 0;
  color: white;
  mix-blend-mode: difference;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  will-change: auto;
}

#cv-close.visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s;
}

#cv-close svg {
  display: block;
  width: 100%;
  height: 100%;
}

/*--------------------------------------------------------------*/
/* FLOU 10px (même durée/ease que le reste du site, cf. body > *) */
body.blur-cv > *:not(#cv-viewer):not(#cv-close):not(.popup):not(#book-cursor) {
  filter: blur(10px);
}

/*--------------------------------------------------------------*/
/* MOBILE PORTRAIT : les deux images s'empilent */
@media screen and (max-width: 844px) {
  #cv-close {
    right: 2vw; /* = padding du footer en mobile */
    width: 8vw;
    height: 8vw;
  }
}

@media screen and (max-width: 844px) and (orientation: portrait) {
  .cv-group {
    flex-direction: column;
    gap: 3vh;
  }

  .cv-sheet img {
    height: min(38vh, calc(90vw / var(--ar, 1.3)));
  }
}
