/* Broker Brink marketing-plan flip book (StPageFlip) — v4
   Desktop: stage is one page on the cover (centered, large), two pages after turn.
   Height is always one page (88vh cap), so cover↔spread does not shift the page vertically. */
.bb-flip {
  --bb-flip-page-w: 1700;
  --bb-flip-page-h: 2200;
  --bb-flip-accent: #1a2a44;
  --bb-flip-stage-bg: #e8eaee;
  --bb-flip-arrow: 3.5rem;
  margin: 1.25rem 0 0;
  width: 100%;
  position: relative;
}
.bb-flip__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 auto 0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #1a2a44;
  color: #fff;
  font: 600 0.8rem/1.2 Poppins, system-ui, sans-serif;
  letter-spacing: 0.01em;
  max-width: 100%;
}
.bb-flip__pill-wrap { text-align: center; }

/* Frame shrinks to the stage so side arrows sit beside the book, not the outer wrap */
.bb-flip__frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 2.6rem;
  box-sizing: border-box;
}

.bb-flip__stage {
  position: relative;
  width: min(100%, calc(88vh * var(--bb-flip-page-w) / var(--bb-flip-page-h)));
  aspect-ratio: var(--bb-flip-page-w) / var(--bb-flip-page-h);
  max-height: 88vh;
  margin: 0 auto;
  background: var(--bb-flip-stage-bg);
  border-radius: 8px;
  overflow: hidden;
  touch-action: pan-y;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.18);
}

/* Desktop default in HTML is is-cover (single page). Open spreads widen the stage; height stays one page. */
@media (min-width: 860px) {
  #bbp-plan .bb-flip {
    width: min(1200px, 96vw);
    max-width: 1200px;
    margin-left: 50%;
    transform: translateX(-50%);
  }
  .bb-flip__frame { padding: 0 var(--bb-flip-arrow); }
  /* Cover and spread share one page size: min(half of 1088-cap, 88vh * page ratio). */
  .bb-flip__stage {
    width: min(
      calc((1200px - 2 * var(--bb-flip-arrow)) / 2),
      calc((100vw - 2 * var(--bb-flip-arrow) - 2rem) / 2),
      calc(88vh * var(--bb-flip-page-w) / var(--bb-flip-page-h))
    );
    max-width: none;
    aspect-ratio: var(--bb-flip-page-w) / var(--bb-flip-page-h);
  }
  .bb-flip:not(.is-cover) .bb-flip__stage {
    width: min(
      calc(1200px - 2 * var(--bb-flip-arrow)),
      calc(100vw - 2 * var(--bb-flip-arrow) - 2rem),
      calc(88vh * (var(--bb-flip-page-w) * 2) / var(--bb-flip-page-h))
    );
    max-width: none;
    aspect-ratio: calc(var(--bb-flip-page-w) * 2) / var(--bb-flip-page-h);
  }
}

.bb-flip__book,
.bb-flip__book .stf__parent,
.bb-flip__book .stf__wrapper,
.bb-flip__book .stf__block,
.bb-flip__book canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  box-sizing: border-box;
}
.bb-flip__book .stf__wrapper { padding-bottom: 0 !important; }
.bb-flip__book canvas,
.bb-flip__book .stf__item,
.bb-flip__book img { max-width: none; }

/* Side nav arrows — on the frame, hugging the stage */
.bb-flip__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #1a2a44;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.35);
  padding: 0;
  appearance: none;
}
.bb-flip__nav svg { width: 1.15rem; height: 1.15rem; display: block; pointer-events: none; }
.bb-flip__nav:hover:not(:disabled) { background: #243a5c; transform: translateY(-50%) scale(1.06); }
.bb-flip__nav:focus-visible { outline: 3px solid #c9a227; outline-offset: 2px; }
.bb-flip__nav:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.bb-flip__nav--prev { left: 0.15rem; }
.bb-flip__nav--next { right: 0.15rem; }
@media (min-width: 860px) {
  .bb-flip__nav { width: 3.15rem; height: 3.15rem; }
  .bb-flip__nav svg { width: 1.35rem; height: 1.35rem; }
}

.bb-flip__curl {
  position: absolute;
  right: 0; bottom: 0;
  width: 72px; height: 72px;
  pointer-events: none;
  z-index: 4;
  background:
    linear-gradient(225deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.55) 42%, rgba(0,0,0,0.12) 43%, transparent 60%);
  box-shadow: -2px -2px 8px rgba(0,0,0,0.12);
  opacity: 0;
  transform-origin: 100% 100%;
  border-top-left-radius: 4px;
}
.bb-flip__curl.is-play { animation: bb-curl 1.6s ease-in-out 1; }
@media (prefers-reduced-motion: reduce) {
  .bb-flip__curl.is-play { animation: none; opacity: 0.55; }
}
@keyframes bb-curl {
  0% { opacity: 0; transform: scale(0.4); }
  25% { opacity: 1; transform: scale(1); }
  55% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(0.85); }
}

.bb-flip__zoom-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  overflow: hidden;
  background: #1a1f2a;
  cursor: grab;
  touch-action: none;
}
.bb-flip__zoom-layer.is-on { display: block; }
.bb-flip__zoom-layer.is-dragging { cursor: grabbing; }
.bb-flip__zoom-img {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  max-width: none !important;
  will-change: transform;
}

.bb-flip__toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.85rem auto 0;
  padding: 0.4rem 0.55rem;
  width: fit-content;
  max-width: 100%;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(16, 24, 40, 0.14);
  border: 1px solid #e3e7ee;
}
.bb-flip__tool {
  appearance: none;
  border: 0;
  background: transparent;
  color: #1a2a44;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 1rem/1 Poppins, system-ui, sans-serif;
}
.bb-flip__tool:hover { background: #eef2f7; }
.bb-flip__tool:disabled { opacity: 0.4; cursor: default; }
.bb-flip__tool svg { width: 1.15rem; height: 1.15rem; }
.bb-flip__counter {
  font: 600 0.9rem/1.2 Montserrat, system-ui, sans-serif;
  color: #2a3340;
  min-width: 4.75rem;
  text-align: center;
  padding: 0 0.25rem;
}
.bb-flip__sep { width: 1px; height: 1.4rem; background: #d5dae3; margin: 0 0.15rem; }
.bb-flip__hint {
  margin: 0.55rem 0 0;
  text-align: center;
  font: 400 0.85rem/1.35 Montserrat, system-ui, sans-serif;
  color: #5a6573;
}
.bb-flip__dl { margin: 0.85rem 0 0; text-align: center; }
.bb-flip__dl a {
  color: #1a2a44;
  font: 600 0.9rem/1.3 Poppins, system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Fullscreen: fill most of the viewport; drop the 1200px / 88vh caps */
.bb-flip.is-fs {
  position: fixed;
  inset: 0;
  z-index: 99999;
  margin: 0;
  padding: 0.75rem 0.75rem 1rem;
  background: #2a303c;
  overflow: auto;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  transform: none;
}
.bb-flip.is-fs .bb-flip__frame {
  max-width: 100%;
  width: fit-content;
  margin: 0 auto;
}
.bb-flip.is-fs .bb-flip__stage {
  max-height: calc(100vh - 7.25rem);
  background: #3a4150;
  width: min(calc(100vw - 2 * var(--bb-flip-arrow) - 1.5rem), calc((100vh - 7.25rem) * var(--bb-flip-page-w) / var(--bb-flip-page-h)));
  max-width: none;
  aspect-ratio: var(--bb-flip-page-w) / var(--bb-flip-page-h);
}
.bb-flip.is-fs:not(.is-cover) .bb-flip__stage {
  width: min(calc(100vw - 2 * var(--bb-flip-arrow) - 1.5rem), calc((100vh - 7.25rem) * (var(--bb-flip-page-w) * 2) / var(--bb-flip-page-h)));
  aspect-ratio: calc(var(--bb-flip-page-w) * 2) / var(--bb-flip-page-h);
}
.bb-flip.is-fs .bb-flip__pill { background: #c9a227; color: #1a2a44; }
.bb-flip.is-fs .bb-flip__toolbar { background: #fff; }
.bb-flip.is-fs .bb-flip__hint,
.bb-flip.is-fs .bb-flip__dl { color: #d5dae3; }
.bb-flip.is-fs .bb-flip__dl a { color: #fff; }

#bbp-plan .bbp-plan { display: none !important; }

@media (max-width: 859px) {
  .bb-flip__frame {
    width: 100%;
    max-width: 100%;
    padding: 0 2.6rem;
  }
  .bb-flip__stage {
    width: min(100%, calc(88vh * var(--bb-flip-page-w) / var(--bb-flip-page-h)));
  }
  .bb-flip__nav { width: 2.5rem; height: 2.5rem; }
  .bb-flip__pill { font-size: 0.72rem; padding: 0.3rem 0.7rem; }
}
