/* ==========================================================================
   Restaurant Le Lien - Visionneuse PDF (js/pdf-viewer.js)
   ========================================================================== */

.pdfv {
  background: var(--white);
  border: 1px solid var(--line);
  outline: none;
}

/* --------------------------------------------------------------------------
   Barre d'outils
   -------------------------------------------------------------------------- */
.pdfv__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky;
  /* L'en-tête du site est fixe et mesure 72 px une fois compacté (.is-solid) :
     sans ce décalage, la barre d'outils passerait dessous et serait masquée. */
  top: 72px;
  z-index: 3;
}
.pdfv__pages,
.pdfv__zoom { display: flex; align-items: center; gap: 6px; }

.pdfv__nav {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--charcoal);
  font-size: 17px;
  line-height: 1;
  border-radius: 3px;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.pdfv__nav:hover { border-color: var(--taupe); color: var(--taupe); }
.pdfv__nav:active { background: var(--beige); }

.pdfv__count {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--grey);
  min-width: 62px;
  text-align: center;
}
.pdfv__count b { color: var(--ink); font-weight: 500; }

.pdfv__reset {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--grey);
  border: 1px solid transparent;
  padding: 8px 10px;
  border-radius: 3px;
  min-width: 66px;
}
.pdfv__reset.is-on { color: var(--taupe); border-color: var(--taupe); }

.pdfv__dl {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 9px 16px;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.pdfv__dl:hover { background: var(--taupe); border-color: var(--taupe); }
.pdfv__dl-ico { display: none; }

/* --------------------------------------------------------------------------
   Zone de lecture
   -------------------------------------------------------------------------- */
.pdfv__view {
  position: relative;
  height: min(78vh, 900px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #efeae0;
  /* le navigateur gère le défilement à un doigt, le script gère le pincement */
  touch-action: pan-x pan-y;
}

.pdfv__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
  width: max-content;
  min-width: 100%;
}

.pdfv__page {
  position: relative;
  background: var(--white);
  box-shadow: 0 6px 22px -12px rgba(20, 22, 24, .45);
  flex: none;
}
.pdfv__page canvas { display: block; width: 100%; height: 100%; }
.pdfv__page:not(.is-ready)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #f4f0e8 30%, #fbf9f5 50%, #f4f0e8 70%);
  background-size: 200% 100%;
  animation: pdfv-shimmer 1.4s linear infinite;
}
@keyframes pdfv-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.pdfv__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--grey);
  text-align: center;
  padding: 20px;
}
.pdfv__loading a { color: var(--taupe); text-decoration: underline; }

.pdfv__hint {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--grey);
  text-align: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 700px) {
  /* Tout tient sur une seule ligne : sur un écran de 390 px, une barre sur deux
     lignes mangerait un quart de la hauteur utile pour lire la carte. */
  .pdfv__bar { padding: 8px; gap: 8px; flex-wrap: nowrap; }
  .pdfv__pages, .pdfv__zoom { gap: 4px; }
  .pdfv__nav { width: 30px; height: 30px; font-size: 16px; }
  .pdfv__count { min-width: 46px; font-size: 11.5px; }
  .pdfv__reset { min-width: 48px; padding: 7px 4px; font-size: 10.5px; letter-spacing: .04em; }
  .pdfv__dl { width: 38px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; }
  .pdfv__dl-txt { display: none; }
  .pdfv__dl-ico { display: block; font-size: 16px; line-height: 1; }
  .pdfv__view { height: 74vh; }
  .pdfv__stage { gap: 8px; padding: 8px; }
  .pdfv__hint { font-size: 10.5px; padding: 8px 10px; }
}

/* Le doigt ne doit pas déclencher la sélection de texte pendant un pincement */
.pdfv.is-zoomed .pdfv__view { -webkit-user-select: none; user-select: none; }

@media (prefers-reduced-motion: reduce) {
  .pdfv__page:not(.is-ready)::after { animation: none; }
}
