.snf-flipbook {
  --snf-paper: #f7f1e3;
  --snf-ink: #241f18;
  --snf-accent: #8a1c1c;
  --snf-frame: #2f3b2f;
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f4f6ed 0%, #dde6d1 100%);
  box-shadow: 0 18px 40px rgba(35, 35, 24, 0.16);
}

.snf-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.snf-kicker,
.snf-subtitle,
.snf-page-indicator {
  margin: 0;
}

.snf-kicker {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #5f6c58;
}

.snf-title {
  margin: 8px 0 6px;
  font-size: clamp(1.7rem, 3.4vw, 2.7rem);
  line-height: 0.95;
  color: var(--snf-ink);
}

.snf-subtitle {
  color: var(--snf-accent);
}

.snf-page-indicator {
  font-weight: 700;
  color: var(--snf-frame);
}

.snf-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.snf-layout-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(47, 59, 47, 0.08);
}

.snf-layout-button {
  border: 0;
  background: transparent;
  color: var(--snf-frame);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.snf-layout-button.is-active {
  background: var(--snf-frame);
  color: #fff;
}

.snf-hint {
  margin: 0;
  color: #5f6c58;
  font-size: 0.92rem;
}

.snf-cover {
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(40, 34, 25, 0.16);
}

.snf-cover img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

.snf-viewer {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  gap: 12px;
  align-items: center;
}

.snf-nav {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--snf-frame);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(31, 39, 31, 0.16);
}

.snf-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.snf-page-frame {
  min-height: 700px;
  height: min(84vh, 1120px);
  padding: 16px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.45), transparent 30%),
    linear-gradient(180deg, #efe7d6 0%, #e4d7bc 100%);
  box-shadow: 0 18px 38px rgba(40, 34, 25, 0.18);
  overflow: hidden;
}

.snf-page-frame.is-flipping {
  animation: snf-flip 560ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

@keyframes snf-flip {
  0% { transform: rotateY(0deg) scale(1); opacity: 1; }
  35% { transform: rotateY(-16deg) scale(0.996); opacity: 0.96; }
  55% { transform: rotateY(-8deg) scale(0.998); opacity: 0.98; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

.snf-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  height: 100%;
  align-items: stretch;
}

.snf-page {
  position: relative;
  min-width: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow:
    0 12px 28px rgba(39, 32, 23, 0.12),
    inset 0 0 0 1px rgba(47, 59, 47, 0.08);
  overflow: hidden;
  cursor: zoom-in;
}

.snf-page-left::after {
  content: "";
  position: absolute;
  top: 0;
  right: -9px;
  width: 18px;
  height: 100%;
  background: linear-gradient(90deg, rgba(99, 78, 50, 0.12), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.snf-page-right::before {
  content: "";
  position: absolute;
  top: 0;
  left: -9px;
  width: 18px;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(99, 78, 50, 0.12));
  pointer-events: none;
}

.snf-page-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #ffffff;
}

.snf-actions {
  margin-top: 14px;
  text-align: center;
}

.snf-download {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--snf-frame);
  color: #fff;
  text-decoration: none;
}

.snf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  gap: 16px;
  align-items: center;
  padding: 28px;
  background: rgba(14, 19, 16, 0.88);
}

.snf-lightbox[hidden] {
  display: none;
}

.snf-lightbox-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 0;
}

.snf-lightbox-image {
  max-width: min(94vw, 1500px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.snf-lightbox-close,
.snf-lightbox-nav {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}

.snf-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  font-size: 2rem;
  line-height: 1;
}

.snf-lightbox-nav {
  width: 60px;
  height: 60px;
  font-size: 2rem;
}

.snf-flipbook.is-single .snf-spread {
  grid-template-columns: 1fr;
  gap: 0;
}

.snf-flipbook.is-single .snf-page-right {
  display: none;
}

.snf-flipbook.is-single .snf-page-left::after,
.snf-flipbook.is-single .snf-page-right::before {
  display: none;
}

@media (max-width: 720px) {
  .snf-header {
    flex-direction: column;
  }

  .snf-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .snf-viewer {
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
  }

  .snf-nav {
    width: 44px;
    height: 44px;
  }

  .snf-page-frame {
    min-height: 420px;
    height: 65vh;
    padding: 10px;
  }

  .snf-spread {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .snf-page-right {
    display: none;
  }

  .snf-page-left::after,
  .snf-page-right::before {
    display: none;
  }

  .snf-lightbox {
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
    padding: 16px 8px;
  }

  .snf-lightbox-nav {
    width: 44px;
    height: 44px;
  }
}
