@charset "utf-8";

/* ========================= */
/* RESET */
/* ========================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #dcdcdc; /* fond clair mais contrasté */
  font-family: Arial, sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* ========================= */
/* APP LAYOUT */
/* ========================= */

#app {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* ========================= */
/* BOUTONS */
/* ========================= */

button {
  background: #111;
  border: none;
  color: #fff;
  font-size: 38px;
  width: 60px;
  height: 90px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s, transform 0.1s;
}

button:hover {
  background: #000;
}

button:active {
  transform: scale(0.96);
}

/* ========================= */
/* VIEWER */
/* ========================= */

#viewer {
  max-width: 96vw;
  max-height: 96vh;
  overflow: visible; /* 🔴 OBLIGATOIRE pour voir les ombres */
}

/* ========================= */
/* DOUBLE PAGE */
/* ========================= */

#spread {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px; /* espace entre les pages */
  transition: opacity 0.25s ease;
}

/* ========================= */
/* PAGES */
/* ========================= */

#spread img {
  max-height: 90vh;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 3px;

  /* OMBRE EXTERIEURE VISIBLE */
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ========================= */
/* MOBILE */
/* ========================= */

@media (max-width: 768px) {

  body {
    overflow: auto;
  }

  #app {
    flex-direction: column;
    gap: 10px;
  }

  button {
    width: 100%;
    height: 50px;
    font-size: 26px;
  }

  #viewer {
    width: 100%;
  }

  #spread {
    flex-direction: column;
    gap: 8px;
  }

  #spread img {
    width: 100%;
    max-height: none;
    height: auto;
  }
}

/* ========================= */
/* PLI CENTRAL */
/* ========================= */

#gutter {
  width: 12px;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.35),
    rgba(0,0,0,0.05),
    rgba(0,0,0,0.35)
  );
  pointer-events: none;
}

/* Mobile : pas de pli */
@media (max-width: 768px) {
  #gutter {
    display: none;
  }
}
/* ========================= */
/* TRANSITION PREMIUM */
/* ========================= */

#spread {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#spread.is-changing {
  opacity: 0;
  transform: translateY(4px);
}