/* In-page brochure viewer — see brochure-viewer.js. A dark lightbox in both
   themes, so the brochure's own white pages read as paper. */
.bv {
  --bv-bg: #0f1a26;
  --bv-ink: #eef1f4;
  --bv-muted: rgba(238, 241, 244, 0.62);
  --bv-chip: rgba(255, 255, 255, 0.09);
  --bv-chip-hover: rgba(255, 255, 255, 0.16);
  --bv-gold: #c6aa76;
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bv-bg); color: var(--bv-ink);
  font-family: var(--font-sans, -apple-system, system-ui, sans-serif);
  display: grid; grid-template-rows: auto 1fr auto;
  opacity: 0; transform: scale(0.985);
  transition: opacity 0.26s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bv.is-open { opacity: 1; transform: none; }
.bv[hidden] { display: none; }
html.bv-lock, html.bv-lock body { overflow: hidden; }

.bv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 10px;
}
.bv-title { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.bv-count { margin-left: 8px; color: var(--bv-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.bv-actions { display: flex; gap: 8px; }
.bv-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px;
  padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--bv-chip); color: var(--bv-ink); text-decoration: none;
  font: 600 13px/1 var(--font-sans, system-ui, sans-serif);
  transition: background 0.15s ease, transform 0.12s ease;
}
.bv-btn:hover { background: var(--bv-chip-hover); }
.bv-btn:active { transform: scale(0.96); }
.bv-close { padding: 0; justify-content: center; }
.bv-btn:focus-visible, .bv-nav:focus-visible, .bv-dot:focus-visible, .bv-track:focus-visible {
  outline: 2px solid var(--bv-gold); outline-offset: 2px;
}

/* The page strip: native horizontal swipe with snap. */
.bv-track {
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.bv-track::-webkit-scrollbar { display: none; }
.bv-track.is-zooming { scroll-snap-type: none; overflow-x: hidden; }
.bv-slide {
  flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
  display: grid; place-items: center; padding: 4px 16px 8px;
  min-height: 0; overflow: hidden; cursor: zoom-in; position: relative;
}
.bv-slide::before {                     /* soft placeholder while the image loads */
  content: ''; position: absolute; width: min(72vw, 52vh); aspect-ratio: 1615 / 2090;
  border-radius: 4px; background: rgba(255, 255, 255, 0.06);
}
.bv-slide.is-loaded::before { display: none; }
.bv-slide img {
  max-width: 100%; width: auto; height: auto;
  /* bar ~64px + foot ~70px + slide padding: fit the whole page on screen */
  max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px);
  object-fit: contain; border-radius: 3px; position: relative;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  opacity: 0; transition: opacity 0.3s ease;
  user-select: none; -webkit-user-select: none;
}
.bv-slide.is-loaded img { opacity: 1; }
.bv-slide.is-zoomed { overflow: auto; cursor: zoom-out; place-items: start; padding: 0; }
.bv-slide.is-zoomed img { max-width: none; max-height: none; width: 220%; box-shadow: none; border-radius: 0; }
@media (min-width: 900px) { .bv-slide.is-zoomed img { width: 130%; } }

.bv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  display: none; place-items: center;
  background: var(--bv-chip); color: var(--bv-ink);
  transition: background 0.15s ease, opacity 0.15s ease;
}
.bv-nav:hover { background: var(--bv-chip-hover); }
.bv-nav:disabled { opacity: 0; pointer-events: none; }
.bv-prev { left: 20px; }
.bv-next { right: 20px; }
@media (hover: hover) and (min-width: 720px) { .bv-nav { display: grid; } }

.bv-foot {
  display: grid; justify-items: center; gap: 8px;
  padding: 8px 16px max(14px, env(safe-area-inset-bottom));
}
.bv-dots { display: flex; gap: 2px; }
.bv-dot {
  width: 24px; height: 24px; border: 0; padding: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.bv-dot::after {
  content: ''; width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.28);
  transition: width 0.2s ease, background 0.2s ease;
}
.bv-dot[aria-selected='true']::after { width: 20px; background: var(--bv-gold); }
.bv-hint { font-size: 12px; color: var(--bv-muted); }

@media (prefers-reduced-motion: reduce) {
  .bv, .bv-slide img, .bv-dot::after { transition: none; }
}

/* Share menu */
.bv-share-wrap { position: relative; }
.bv-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 2; width: 268px;
  background: #ffffff; color: #2e2e2b; border-radius: 14px; padding: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  transform-origin: top right; animation: bv-pop 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bv-menu[hidden] { display: none; }
.bv-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px;
  border: 0; border-radius: 10px; background: none; color: inherit; text-decoration: none; text-align: left;
  font: 500 14px/1.25 var(--font-sans, system-ui, sans-serif); cursor: pointer;
}
.bv-item[hidden] { display: none; }
.bv-item svg { flex: none; color: #1b4d82; }
.bv-item b { display: block; font-weight: 600; }
.bv-item small { display: block; font-size: 12px; color: #6b6b66; margin-top: 2px; }
.bv-item:hover, .bv-item:focus-visible { background: rgba(27, 77, 130, 0.08); outline: none; }
@keyframes bv-pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bv-menu { animation: none; } }
