body {
  margin: 0;
  font-family: "EB Garamond", serif;
  background: #1b1b1b;
  display: flex;
  justify-content: center;
}

/* MAIN WRAPPER */
#main-wrapper {
  display: flex;
  width: 100%;
  max-width: 1200px;
  height: 100vh;
}

/* FLIPBOOK */
#flipbook {
  position: relative;
  flex: 1;
  height: 100%;
  perspective: 2000px;
  overflow: hidden;
  touch-action: pan-y; /* allows vertical scroll + horizontal swipe */
}

.page {
  background: #f2f2f2;
  color: #222;
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
  transform-origin: left;
  transition: transform 0.6s ease;
  overflow-y: auto;
}

.page:not(:first-child) {
  transform: rotateY(180deg);
}

.page-number {
  position: absolute;
  bottom: 10px;
  right: 15px;
  opacity: 0.5;
  font-size: 12px;
}

/* SIDE MENU */
#side-menu-container {
  width: 140px;
  background: #ffffff;
  padding: 10px;
  overflow-y: auto;
}

#side-menu button {
  width: 100%;
  margin-bottom: 5px;
  padding: 6px;
  font-size: 12px;
  cursor: pointer;
}

#lang-buttons {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

#lang-buttons button {
  font-size: 11px;
  padding: 4px 6px;
  cursor: pointer;
}

/* MOBILE */
@media (max-width: 768px) {
  #main-wrapper {
    flex-direction: column;
  }

  #side-menu-container {
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  #side-menu {
    display: flex;
    overflow-x: auto;
    gap: 5px;
  }

  #side-menu button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}


@media print {

  body {
    background: white;
  }

  #side-menu-container,
  #lang-buttons {
    display: none !important;
  }

  #flipbook {
    display: block;
    width: 100%;
  }

  .page {
    transform: none !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
    page-break-after: always;
  }

}


@media print {

  .page {
    page-break-after: always;
    padding: 40px;
  }

  .page-number {
    position: absolute;
    bottom: 10px;
    right: 20px;
  }

}