/* PDF flipbook viewer */

:root {
  --color-accent: #c8102e;
  --font-open: "Open Sans", sans-serif;
  --font-roboto: "Roboto", sans-serif;
}

html,
.pdf-flipbook-standalone {
  height: 100%;
}

.pdf-flipbook-standalone {
  margin: 0;
  overflow: hidden;
  background: #fff;
  font-family: var(--font-open);
  color: #000;
}

.pdf-flipbook-standalone *,
.pdf-flipbook-standalone *::before,
.pdf-flipbook-standalone *::after {
  box-sizing: border-box;
}

.pdf-flipbook-standalone main {
  height: 100%;
  min-height: 100dvh;
}

.pdf-flipbook-page {
  background: #fff;
  overflow: hidden;
}

.pdf-flipbook-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.pdf-flipbook-page-view {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
}

.pdf-flipbook-layout {
  display: flex;
  flex: 1;
  align-items: stretch;
  min-height: 0;
  gap: 8px;
}

.pdf-flipbook-main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.pdf-flipbook-nav {
  display: flex;
  flex-shrink: 0;
  align-self: stretch;
  padding: 8px 8px 8px 0;
}

.pdf-flipbook-nav-list {
  display: grid;
  grid-template-columns: repeat(4, 22px);
  grid-template-rows: repeat(var(--nav-rows, 18), 1fr);
  grid-auto-flow: column;
  gap: 0;
  height: 100%;
  max-height: none;
  overflow: visible;
}

.pdf-flipbook-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  font-family: var(--font-open);
  font-size: 11px;
  font-weight: 400;
  color: #8a8a8a;
  cursor: pointer;
  transition: color 0.15s, font-weight 0.15s;
}

.pdf-flipbook-nav-btn:hover {
  color: #000;
}

.pdf-flipbook-nav-btn.active {
  color: #000;
  font-weight: 800;
  background: none;
}

.pdf-flipbook-nav-btn:focus-visible {
  outline: 1px solid #000;
  outline-offset: 1px;
}

.pdf-flipbook-page-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px max(12px, env(safe-area-inset-left));
  pointer-events: none;
}

.pdf-flipbook-page-header h1 {
  font-family: var(--font-roboto);
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin: 0;
}

.pdf-flipbook-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.16);
  font-family: var(--font-open);
  font-size: 14px;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

.pdf-flipbook-back:hover {
  text-decoration: underline;
}

.pdf-flipbook-status {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: #fff;
  color: #666;
  font-family: var(--font-open);
  font-size: 14px;
}

.pdf-flipbook-status[hidden] {
  display: none !important;
}

.pdf-flipbook-stage {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  touch-action: none;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
}

.pdf-flipbook-stage-inner {
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  transform-origin: center center;
  will-change: transform;
}

.pdf-flipbook-book {
  margin: 0 auto;
}

.pdf-flipbook-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  pointer-events: none;
}

.pdf-flipbook-counter {
  font-family: var(--font-open);
  font-size: 14px;
  font-weight: 600;
  color: #555;
}

.pdf-flipbook-hint {
  text-align: center;
  font-family: var(--font-open);
  font-size: 12px;
  color: #aaa;
  margin: 0;
}

@media (max-width: 767px), (max-height: 600px) {
  .pdf-flipbook-page-header h1,
  .pdf-flipbook-nav,
  .pdf-flipbook-footer {
    display: none;
  }

  .pdf-flipbook-stage {
    padding: 0;
    overflow: hidden;
    touch-action: none;
  }
}
