/* memoire.css : styles propres à la page Mémoire (memoire.html, flipbook) */
.flipbook-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  min-height: 70vh;
}

.flipbook-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  background: transparent;
}

/* Mode plein écran */
.flipbook-wrapper:fullscreen,
.flipbook-wrapper:-webkit-full-screen {
  max-width: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

/* Force le mode paysage en plein écran sur mobile */
.flipbook-wrapper.force-landscape {
  width: 100vh !important;
  height: 100vw !important;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center;
  position: fixed;
  top: 50%;
  left: 50%;
  background: var(--ink);
  z-index: 9999;
}

#flipbook-container {
  min-height: 240px; /* plus d'ombre autour de la double page : à l'ouverture, elle dessinait une fausse page blanche à côté de la couverture */
}

.flipbook-wrapper:fullscreen #flipbook-container,
.flipbook-wrapper:-webkit-full-screen #flipbook-container,
.flipbook-wrapper.force-landscape #flipbook-container {
  background: var(--ink);
  box-shadow: none;
}

/* Pages du flipbook */
.thesis-page {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}

.thesis-page img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ne coupe pas le texte du mémoire */
  display: block;
}

.thesis-page-cover {
  background: #1a1a1a;
  color: white;
  width: 100%;
  height: 100%;
}

.thesis-page-cover img {
  object-fit: cover;
}

/* Commandes */
.flipbook-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.flipbook-btn {
  background: transparent;
  border: 1px solid var(--graphite);
  padding: 10px 25px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.flipbook-btn:hover {
  background: var(--graphite);
  color: white;
}

.flipbook-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-indicator {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: #666;
}

/* Bouton "Quitter" (visible uniquement en plein écran) */
.exit-fullscreen-btn {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--paper);
  border: 1px solid var(--paper);
  padding: 8px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 10000;
  transition: background-color 0.2s ease;
}
.exit-fullscreen-btn:hover {
  background: var(--ink);
}

.flipbook-wrapper:fullscreen .exit-fullscreen-btn,
.flipbook-wrapper:-webkit-full-screen .exit-fullscreen-btn,
.flipbook-wrapper.force-landscape .exit-fullscreen-btn {
  display: block;
}

@media (max-width: 768px) {
  .flipbook-section {
    padding: 20px 0;
  }
  .flipbook-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
  .flipbook-btn {
    padding: 8px 18px;
    font-size: 0.8rem;
  }
}

/* Texte de présentation du mémoire : lignes de lecture confortables, même sur très grand écran */
.project-description,
.more-text {
  max-width: 72ch;
}
