/* Tabs around live figures — behaviour in static/js/figure-tabs.js.
   Chrome only: every panel's content styles itself. */

.fig-tabs {
  margin: 2rem 0 2.5rem;
}

.fig-tab-strip {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--vx-rule, #d8d7cf);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
}

.fig-tab {
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 8px 14px;
  color: var(--vx-muted, #6b6a63);
  background: transparent;
  border: none;
  /* The open tab is marked by a rule that sits *on* the strip's own border, so
     the strip reads as one line with a piece of it thickened rather than as a
     row of boxes. */
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.fig-tab:hover {
  color: var(--vx-ink, #16160f);
}
.fig-tab.is-on {
  color: var(--vx-ink, #16160f);
  border-bottom-color: var(--vx-accent, #eb6834);
}
.fig-tab:focus-visible {
  outline: 2px solid var(--vx-accent, #eb6834);
  outline-offset: -2px;
}

/* The body is the positioning context the closed panels are taken out of flow
   inside. Its height is whatever the open panel needs. */
.fig-tab-body {
  position: relative;
}

/* A closed panel is hidden but *still laid out*, and that is load-bearing
   rather than fussy: a figure that builds inside a `display: none` subtree
   measures zeros — getBBox, canvas sizes, client rects — and nothing here
   re-measures on reveal, so it would draw wrong once and stay wrong. Out of
   flow so it cannot stretch the page; visibility hidden so it cannot be seen or
   tabbed into. See the note at the top of js/figure-tabs.js. */
.fig-tab-panel.is-off {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  visibility: hidden;
  pointer-events: none;
}

/* Inside a panel a <d-figure> is no longer a grid child, so it has to be told
   to be a block that fills the panel. */
.fig-tab-panel > d-figure {
  display: block;
  width: 100%;
}

/* A panel whose figure wants the text column rather than the page column it
   sits in. 704px is Distill's text column at full width; below that the page
   column is narrower anyway and this does nothing. */
.fig-tab-panel.is-text-width > * {
  max-width: 704px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Easter-egg tabs ─────────────────────────────────────────────────────────
   A panel carrying `data-tab-secret` gets `is-secret` on its strip button
   (js/figure-tabs.js), and the button collapses to a sliver until it is
   hovered, focused or open. The label is still in the DOM the whole time —
   only its width is taken away — so the keyboard walk and a screen reader
   still find it; `color: transparent` rather than `display: none` is what
   keeps that true.

   The sliver is not invisible: it keeps a muted piece of the strip's own rule,
   so what shows is two short dashes past the last real tab. Something to
   notice, not something to read. */
.fig-tab.is-secret {
  max-width: 14px;
  padding-left: 3px;
  padding-right: 3px;
  overflow: hidden;
  white-space: nowrap;
  color: transparent;
  border-bottom-color: var(--vx-rule, #d8d7cf);
  transition: max-width 220ms ease, padding 220ms ease, color 140ms ease;
}
.fig-tab.is-secret:hover,
.fig-tab.is-secret:focus-visible,
.fig-tab.is-secret.is-on {
  max-width: 14rem;
  padding-left: 14px;
  padding-right: 14px;
  color: var(--vx-ink, #16160f);
}
/* The accent rule still means "this is the open one", so hovering a sliver
   must not claim it. */
.fig-tab.is-secret.is-on {
  border-bottom-color: var(--vx-accent, #eb6834);
}
@media (prefers-reduced-motion: reduce) {
  .fig-tab.is-secret {
    transition: none;
  }
}

.egg-panel {
  text-align: center;
}
/* Game screenshots, 230px wide, drawn at exactly 2× — an integer factor with
   nearest-neighbour sampling, or the pixels turn to mush. */
.egg-shot {
  display: block;
  width: 460px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
  border-radius: 2px;
}
.egg-title {
  display: block;
  margin-top: 12px;
  font-size: 17px;
  color: var(--vx-ink, #16160f);
}
.egg-credit {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--vx-muted, #6b6a63);
}
