/* Highlands History — enlarged figure viewer.
   ===================================================================
   Loaded by every surface that can open the viewer: chapters and the
   archive. These rules lived in chapter-reading.css, which the archive
   does not load — the viewer would have opened there unstyled.
   =================================================================== */
.figure-fullview {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-family: var(--ff-ui);
  font-size: 0.84rem;
  color: var(--c-rust);
  text-decoration: none;
  border-bottom: 1px solid rgba(193, 77, 46, 0.4);
}
.figure-fullview:focus-visible { outline: 2px solid var(--c-rust); outline-offset: 3px; }
.figview {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  /* Neutral, not navy: a coloured ground tints the artifact sitting on
     it, which matters most for the colorized pairs this viewer exists to
     show. Near-black lets the colours read true. */
  background: #12151A;
  color: var(--c-cream, #F5EFE4);
  display: none;
}
.figview[open] { display: flex; flex-direction: column; }
.figview::backdrop { background: rgba(8, 10, 13, 0.94); }
.figview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(245, 239, 228, 0.18);
}
.figview__zoom { display: flex; align-items: center; gap: 8px; }
.figview__btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  font-family: var(--ff-ui);
  font-size: 1rem;
  color: var(--c-cream, #F5EFE4);
  background: transparent;
  border: 1px solid rgba(245, 239, 228, 0.34);
  cursor: pointer;
}
.figview__btn--wide, .figview__close { font-size: 0.84rem; }
.figview__btn[disabled] { opacity: 0.4; cursor: default; }
.figview__btn:focus-visible { outline: 2px solid var(--c-cream, #F5EFE4); outline-offset: 2px; }
.figview__level { min-width: 4ch; text-align: center; font-family: var(--ff-ui); font-size: 0.84rem; }
.figview__stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* The viewer owns gestures inside the stage; the article underneath is
     inert while the dialog is modal, so nothing is trapped. */
  touch-action: none;
}
.figview__art {
  max-width: 100%;
  max-height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}
.figview__cap {
  margin: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  font-family: var(--ff-ui);
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(245, 239, 228, 0.78);
  border-top: 1px solid rgba(245, 239, 228, 0.18);
}
html[data-figview-open] { overflow: hidden; }
.figview__seq { display: flex; align-items: center; gap: 6px; }
.figview__pos {
  min-width: 6ch;
  text-align: center;
  font-family: var(--ff-ui);
  font-size: 0.78rem;
}
.figview__meta {
  padding: 10px 14px 0;
  display: grid;
  gap: 2px;
  font-family: var(--ff-ui);
}
.figview__date { font-size: 0.73rem; color: rgba(245, 239, 228, 0.72); }
.figview__title {
  font-family: var(--ff-display);
  font-size: 1.06rem;
  line-height: 1.2;
}
.figview__credit { font-size: 0.73rem; color: rgba(245, 239, 228, 0.72); }
.figview__details { margin-top: 0.4rem; font-size: 0.78rem; }
.figview__details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.figview__details p { margin: 0 0 0.4rem; line-height: 1.5; }
.figview__permalink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.84rem;
  color: var(--c-cream, #F5EFE4);
}

/* With a sequence open the bar carries eight controls — zoom out, level,
   zoom in, Reset, previous, position, next, Close — which does not fit
   390px in one row. It wraps rather than clipping the ends off. */
@media (max-width: 519px) {
  .figview__bar {
    flex-wrap: wrap;
    row-gap: 6px;
    justify-content: flex-start;
  }
  .figview__btn { min-width: 40px; padding: 0 8px; }
  .figview__btn--wide, .figview__close { font-size: 0.78rem; }
  .figview__close { margin-left: auto; }
  .figview__pos { min-width: 5ch; font-size: 0.73rem; }
}

/* Item record inside the viewer's disclosure. */
.figview__record {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
}
.figview__record dt { color: rgba(245, 239, 228, 0.6); }
.figview__record dd { margin: 0; }

/* Original / colorized tabs. */
.figview__compare {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 0;
}
.figview__cmp {
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--ff-ui);
  font-size: 0.84rem;
  color: var(--c-cream, #F5EFE4);
  background: transparent;
  border: 1px solid rgba(245, 239, 228, 0.34);
  cursor: pointer;
}
.figview__cmp[aria-pressed="true"] {
  background: var(--c-cream, #F5EFE4);
  border-color: var(--c-cream, #F5EFE4);
  color: #12151A;
}
.figview__cmp:focus-visible { outline: 2px solid var(--c-cream, #F5EFE4); outline-offset: 2px; }
.figview__cmpnote {
  flex: 1 1 100%;
  font-family: var(--ff-ui);
  font-size: 0.73rem;
  color: rgba(245, 239, 228, 0.66);
}
