/* Book preview block */
.bookpreview {
  --bookpreview-max-height: 640px;
  --bookpreview-gap: 1rem;
  width: 100%;
  max-width: 100%;
  max-height: var(--bookpreview-max-height);
  margin: 1.5rem auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: var(--bookpreview-gap);
}

.bookpreview-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: var(--bookpreview-max-height);
}

.bookpreview-thumb {
  width: calc((var(--bookpreview-max-height) - (3 * 0.5rem)) / 4);
  height: calc((var(--bookpreview-max-height) - (3 * 0.5rem)) / 4);
  min-width: 64px;
  min-height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.bookpreview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.bookpreview-thumb.is-active {
  border-color: #4f9d7b;
}

.bookpreview-main {
  margin: 0;
  max-height: var(--bookpreview-max-height);
  height: var(--bookpreview-max-height);
  aspect-ratio: 210 / 297;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bookpreview-main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  display: block;
}

@media (max-width: 900px) {
  .bookpreview {
    --bookpreview-max-height: 520px;
  }
}

@media (max-width: 720px) {
  .bookpreview {
    --bookpreview-max-height: 420px;
    max-height: none;
    flex-direction: column;
    align-items: center;
  }

  .bookpreview-thumbs {
    flex-direction: row;
    max-width: 100%;
    max-height: none;
  }

  .bookpreview-main {
    max-height: none;
  }

  .bookpreview-thumb {
    width: 22vw;
    height: 22vw;
    max-width: 90px;
    max-height: 90px;
  }
}
