/* ==========================================================================
   parts/horse-pedigree.css — the full-pedigree PDF box (parts/horse/pedigree.php + assets/js/parts/horse-pedigree.js).
   Live: `div#pedigree-full.self--center` > `#brxe-qccrkb` (flex, centred) > `.wppdfemb-frame-container-1` (width 900px,
   capped by the parent) > PDF Embedder iframe whose viewer sets it to 771 px tall (BEHAVIOUR-R2 §2.2.3):
   900 / 696 / 348 × 771 at 1440 / 768 / 390. Closed = display:none (the `hidden` attribute; base.css [hidden]).
   Open: pages are canvases at the frame width, stacked in a 771 px scroll box with a hidden scrollbar; a 32 px toolbar
   (page n / N, zoom −/+, download) sits over the bottom edge while the pointer is over the box (live's toolbar is
   hover-only) or focus is inside it; always shown without hover (touch). The page background stays the section's navy.
   ========================================================================== */

.horse-pedigree {
  --hp-toolbar-bg: rgba(15, 32, 45, .92);            /* measured one-off: --secondary at 92 % over the pages */
  position: relative;
  align-self: center;                                /* live .self--center */
  width: 900px;                                      /* live #brxe-qccrkb .wppdfemb-frame-container-1 (literal) */
  max-width: 100%;
  text-align: left;
}

.horse-pedigree__frame {
  height: 771px;                                     /* live: the viewer's measured iframe height at every width */
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;                             /* live: continuous scroll, scrollbar hidden */
  outline-offset: -2px;
}
.horse-pedigree__frame::-webkit-scrollbar { display: none; }

.horse-pedigree__pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 100%;
  width: max-content;
}

.horse-pedigree__page {
  display: block;
  max-width: none;
  background-color: var(--white);                    /* PDF.js viewer .page background */
}

.horse-pedigree__status {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-m);
  color: var(--white);
  text-align: center;
}
.horse-pedigree__status a {
  --link-color: var(--white);
  --link-color-hover: var(--primary-light);
  text-decoration: underline;
}

/* Toolbar (JS-built on first open): hover-only on pointers that hover, as live's (toolbarfixed off). */
.horse-pedigree__toolbar {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  height: 32px;                                      /* live PDF.js toolbar (literal) */
  padding-inline: 1rem;
  background-color: var(--hp-toolbar-bg);
  color: var(--white);
  font-size: 1.3rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.horse-pedigree:hover .horse-pedigree__toolbar,
.horse-pedigree:focus-within .horse-pedigree__toolbar {
  opacity: 1;
  pointer-events: auto;
}
@media (hover: none) {
  .horse-pedigree__toolbar { opacity: 1; pointer-events: auto; }
}

.horse-pedigree__tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 .6rem;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  --focus-color: var(--primary-light);
}
.horse-pedigree__tool:disabled { opacity: .4; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .horse-pedigree__tool:not(:disabled):hover { background-color: var(--white-trans-20); }
}
body a.horse-pedigree__tool { color: var(--white); }

.horse-pedigree__page-label {
  min-width: 7ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .horse-pedigree__toolbar { transition: none; }
}
