.flipbook-grid {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 46px;
  max-width: 980px;
  margin: 50px auto 30px;
}

.flipbook-grid .item-grid {
  width: 400px;
  max-width: calc(50% - 24px);
}

.flipbook-grid .item-box {
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.flipbook-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #111;
  color: #fff;
  text-decoration: none;
  border: 0;
}

.flipbook-card:hover {
  color: #fff;
  text-decoration: none;
}

.flipbook-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flipbook-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  box-sizing: border-box;
  background: rgba(230, 86, 0, 0.88);
  color: #fff;
  font-size: 18px;
  line-height: 1.25;
  text-align: center;
}

.pdf-flipbook-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(20, 20, 20, 0.92);
  display: flex;
  flex-direction: column;
}

.pdf-flipbook-modal[hidden] {
  display: none;
}

.pdf-flipbook-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.pdf-flipbook-toolbar button,
.pdf-flipbook-toolbar a {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #999;
  background: #f8f8f8;
  color: #222;
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.pdf-flipbook-toolbar button:hover,
.pdf-flipbook-toolbar a:hover {
  background: #eee;
}

.pdf-flipbook-toolbar [data-flip-status] {
  min-width: 70px;
  text-align: center;
  color: #222;
  font-weight: 600;
}

.pdf-flipbook-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
}

#pdfFlipbook {
  width: min(96vw, 1320px);
  height: calc(100dvh - 95px);
  max-height: 900px;
}

#pdfFlipbook .page {
  background: #fff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

#pdfFlipbook canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.flipbook-page-loader {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #555;
  font-size: 16px;
}

body:has(.pdf-flipbook-modal:not([hidden])) {
  overflow: hidden;
}

@media (max-width: 768px) {
  .flipbook-grid {
    gap: 24px;
    margin-top: 30px;
  }

  .flipbook-grid .item-grid {
    width: min(100%, 400px);
    max-width: 100%;
  }

  .pdf-flipbook-toolbar {
    gap: 6px;
    padding: 8px;
  }

  .pdf-flipbook-toolbar button,
  .pdf-flipbook-toolbar a {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .pdf-flipbook-stage {
    padding: 8px;
  }

  #pdfFlipbook {
    width: 98vw;
    height: calc(100dvh - 82px);
  }
}