
body.modal-open {
  overflow: hidden;
  width: 100%;
  touch-action: none;
  overscroll-behavior: none;
}

.turnjs-cover {
  text-align: center;
}

.turnjs-launch {
  font-size: 16px;
  cursor: pointer;
}

.turnjs-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, 0%);
  width: 100%;
  height: 100vh;
  z-index: 100000000000;
}

.turnjs-modal-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: 0.7;
  z-index: 100000000000;
}

.turnjs-modal-content {
  position: absolute;
  top: 1vh;
  width: 96%;
  height: 96vh;
  margin: 2vh 2%;
  background: #f8f8f8;
  padding: 10px;
  overflow: hidden;
  z-index: 100000000000001;
}

.turnjs-close {
  float: right;
  font-size: 16px;
  padding: 3px;
  cursor: pointer;
}

.flipbook-wrapper {
  position: relative;
  text-align: center;
  cursor: grab;
  height: 86%;
  overflow: hidden;

}
.flipbook {
  margin: auto auto !important;
}
.flipbook img.zoomed {
  z-index: 10;
  position: relative;
  cursor: grab;
  transition: transform 0.3s;
  transform-origin: center center;
  touch-action: none;
}

@media (orientation: portrait) {
  .flipbook {
    margin: 0 auto !important;
  }
  .flipbook-wrapper {
    display: flex;
    align-items: center;
  }
}
.flipbook-wrapper:active {
  cursor: grabbing;
}
.flipbook .page-wrapper:has( + .odd) {
  box-shadow: -1px 0px 5px #CCC
}

.turn-controls {
  text-align: center;
}

.turn-controls span {
  display: inline-block;
  margin: 0 5px;
  padding: 0;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  position: absolute;
  z-index: 1000;
  top: 43%;
  width: 32px;
  height: 32px;
  overflow: hidden;
  background-color: rgba(255,255,255,0.5);
  border: 2px solid var(--primary);
}
.turn-controls span:before {
  width: 28px;
  height: 28px;
  overflow: hidden;
  content: "";
  display: inline-block;
  background-size:contain;
}
.turn-controls .turn-next {
  right: 6px;
}
.turn-controls .turn-next:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M184 112l144 144-144 144'/%3E%3C/svg%3E");
}
.turn-controls .turn-prev {
  left: 6px;
}
.turn-controls .turn-prev:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M328 112L184 256l144 144'/%3E%3C/svg%3E");
}
.turn-controls .turn-zoom-toggle {
  top: 6px;
  transform: translateX(-50%);
  z-index: 1000;
}
.turn-controls .turn-zoom-in {
  top: 6px;
  left: calc(50% + 48px);
  transform: translateX(-50%);
  border-radius: 50%;
}
.turn-controls .turn-zoom-out {
  top: 6px;
  left: calc(50% - 48px);
  transform: translateX(-50%);
  border-radius: 50%;
}
.turn-controls .turn-zoom-in:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='32' d='M256 112v288M400 256H112'/%3E%3C/svg%3E");
}
.turn-controls .turn-zoom-out:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='32' d='M400 256H112'/%3E%3C/svg%3E");
}
.turn-controls .turn-zoom-toggle:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='32' d='M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304'/%3E%3C/svg%3E");
}
.turn-controls .turn-zoom-toggle.toggle-on:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='32' d='M304 416V304h112M314.2 314.23L432 432M208 96v112H96M197.8 197.77L80 80M416 208H304V96M314.23 197.8L432 80M96 304h112v112M197.77 314.2L80 432'/%3E%3C/svg%3E");
}
.turn-thumbnails-wrapper {
  overflow: hidden;
  align-items: center;
  display: flex;
  justify-content: center;
}
.turn-thumbnails {
  margin-top: 15px;
  display: flex;
  flex-direction: row;
  overflow-x: auto;       /* allow horizontal scroll */
  overflow-y: hidden;
  white-space: nowrap;    /* prevent wrapping */
  padding: 6px 4px;
  gap: 8px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* better iOS scrolling */
    -ms-overflow-style: none;
  scrollbar-width: none;
}

.turn-thumbnails::-webkit-scrollbar {
  display: none;
}

.turn-thumb {
  height: 60px;
  margin: px;
  cursor: pointer;
}

.turn-thumb.selected {
  border: 2px solid #0074d9;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.turnjs-cover-image {
  max-width: 100%;
  height: auto;
}

.turnjs-modal-content button.turnjs-close {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 28px;
  height: 28px;
  overflow: hidden;
  z-index: 1000;
  margin: 0;
}
.turnjs-modal-content button.turnjs-close:before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Cpath fill='none' stroke='%23FFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='32' d='M368 368L144 144M368 144L144 368'/%3E%3C/svg%3E");
  background-size: contain;
}
