/* ══════════════════════════════════════════════════════════════
   PROTOTYPE RESPONSIVE — CERTA+85
   - Horizontal / Landscape : certa85_com_H.pdf (21 planches),
     1 page visible à la fois, pleine hauteur (100dvh),
     bords blancs, écart de 15px entre les pages au scroll.
   - Vertical / Portrait : certa85_com_V.pdf (41 pages),
     onepage continu, visuel adapté à la largeur de l'écran,
     écart de 15px entre les pages.
   - Texte sélectionnable conservant 100% de la mise en page.
   - Hyperliens fidèles sur les icônes (Instagram, YouTube, etc.).
   - Aucun numéro de page affiché (suivi désactivé).
   ══════════════════════════════════════════════════════════════ */

.v-responsive {
  background: #ffffff;
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  width: 100%;
}

/* ────────── HORIZONTAL / LANDSCAPE ────────── */
@media (orientation: landscape) and (min-aspect-ratio: 1/1) {
  .v-responsive .resp-landscape {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    gap: 15px;
    padding-top: 10px;
    padding-bottom: 24px;
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
  }
  .v-responsive .resp-portrait {
    display: none;
  }

  .v-responsive .resp-h-slide {
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    width: 100%;
    max-width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    scroll-margin: 10px 0;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }

  .v-responsive .resp-h-page-wrap {
    position: relative;
    aspect-ratio: 1190.55 / 841.89;
    height: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    max-width: 100%;
    width: min(100%, calc((100vh - 20px) * (1190.55 / 841.89)));
    width: min(100%, calc((100dvh - 20px) * (1190.55 / 841.89)));
    background: #ffffff;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.04);
    container-type: size;
  }

  .v-responsive .resp-h-page-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
  }

  .v-responsive .resp-h-page-wrap .pdf-text-span {
    font-size: calc(var(--fs) * 1cqh);
  }
}

/* ────────── VERTICAL / PORTRAIT ────────── */
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  html, body {
    overflow-x: hidden !important;
    overscroll-behavior-x: none !important;
    touch-action: pan-y pinch-zoom !important;
  }

  .v-responsive {
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y pinch-zoom;
    width: 100%;
    max-width: 100vw;
  }

  .v-responsive .resp-landscape {
    display: none;
  }

  .v-responsive .resp-portrait {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    width: 100%;
    max-width: 100vw;
    gap: 15px;
    padding-bottom: 5rem;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y pinch-zoom;
  }

  .v-responsive .resp-v-slide {
    width: 100%;
    max-width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    position: relative;
    touch-action: pan-y pinch-zoom;
  }

  .v-responsive .resp-v-page-wrap {
    position: relative;
    aspect-ratio: 595.276 / 841.89;
    width: 100%;
    max-width: 100vw;
    height: auto;
    background: #ffffff;
    container-type: inline-size;
    touch-action: pan-y pinch-zoom;
    transform-origin: center center;
    will-change: transform;
    transition: box-shadow 0.2s ease;
  }

  .v-responsive .resp-v-page-wrap.is-zoomed {
    z-index: 60;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  }

  .v-responsive .resp-v-page-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
  }

  .v-responsive .resp-v-page-wrap .pdf-text-span {
    font-size: calc(var(--fs) * 1.41427cqi);
  }
}

/* ────────── TEXT LAYER SÉLECTIONNABLE ────────── */
.pdf-text-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  line-height: 1.15;
  font-family: var(--f-text);
  z-index: 5;
}

.pdf-text-span {
  position: absolute;
  color: transparent;
  white-space: pre;
  cursor: text;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  transform-origin: 0 0;
}

.pdf-text-span::selection {
  background: rgba(0, 0, 85, 0.28);
  color: transparent;
}

/* ────────── HYPERLIENS DANS LES ICÔNES ────────── */
.resp-hotspot {
  position: absolute;
  display: block;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
  text-decoration: none;
  outline: none;
}

.resp-hotspot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 4px;
  border: 1.5px solid transparent;
  background: transparent;
  transition: all 0.18s var(--eo);
}

.resp-hotspot:hover::after,
.resp-hotspot:focus-visible::after {
  border-color: var(--ultra);
  background: rgba(0, 0, 85, 0.08);
  box-shadow: 0 0 14px rgba(0, 0, 85, 0.22);
}

.resp-hotspot:active::after {
  background: rgba(0, 0, 85, 0.18);
  transform: scale(0.96);
}

.resp-hotspot[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 9px;
  background: rgba(0, 0, 85, 0.94);
  color: #ffffff;
  font-family: var(--f-disp);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s var(--eo), transform 0.18s var(--eo);
  z-index: 30;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.resp-hotspot:hover::before,
.resp-hotspot:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
