/* ====================================================================
   VGGT-Ω overrides on top of the Nerfies / Bulma scaffold.
   Keep this small — most styling comes from static/css/index.css.
=================================================================== */

/* Omega character in the title — match top-level page: Source Serif Pro
   with an Oxford-blue → warm-magenta gradient via background-clip:text. */
.publication-title .omega {
  font-family: "Source Serif Pro", "Iowan Old Style", "Apple Garamond",
               "Baskerville", "Times New Roman", serif;
  font-size: 1.22em;
  font-weight: 700;
  background: linear-gradient(135deg, #002147, #b8336a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Disable links rendered as buttons but with aria-disabled */
.button[aria-disabled="true"] {
  opacity: .55;
  pointer-events: none;
}

/* Tighten the gap left after removing the top teaser video. */
.hero .hero-body {
  padding-bottom: 1.25rem;
}
.vggto-abstract {
  padding-top: 1.25rem;
}

.vggto-venue {
  margin: .75rem auto .5rem;
  color: #000;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

/* ---- Demo teaser ---- */
.vggto-demo-teaser {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.demo-teaser-grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.demo-teaser-panel {
  position: relative;
  margin: 0;
  flex: 0 0 auto;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0,0,0,.14);
}
.demo-teaser-panel video {
  width: auto;
  height: clamp(220px, 26vw, 320px);
  max-width: none;
  background: #f5f5f5;
  display: block;
}
.demo-teaser-panel figcaption {
  position: absolute;
  left: 10px;
  top: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(20,20,22,.62);
  padding: 2px 7px;
  border-radius: 3px;
  pointer-events: none;
}
.demo-teaser-credit {
  font-size: 8.5px;
  letter-spacing: .04em;
  text-transform: none;
  opacity: .95;
}
.demo-teaser-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.demo-teaser-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #d7ddd7;
  background: #fff;
  color: #4e5a51;
  font: 600 13px/1 "Google Sans", "Noto Sans", sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.demo-teaser-btn:hover {
  border-color: #b4ddb9;
  color: #2f7d43;
  box-shadow: 0 3px 8px rgba(152,213,162,.18);
}
.demo-teaser-btn.active {
  background: #bdecc5;
  border-color: #bdecc5;
  color: #1d4c28;
  box-shadow: 0 5px 12px rgba(189,236,197,.36);
}
.demo-teaser-btn.active:hover {
  background: #afe4b9;
  border-color: #afe4b9;
  color: #1d4c28;
}
.demo-teaser-btn:focus-visible {
  outline: 2px solid rgba(189,236,197,.65);
  outline-offset: 3px;
}

/* Teaser video sizing — fit width, contain to source aspect */
.hero.teaser video {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- TL;DR ---- */
.vggto-tldr { padding-top: 1rem; padding-bottom: 1rem; }
.tldr-grid .tldr-num {
  font-family: "Google Sans", "Inter", sans-serif;
  font-size: 44px;
  font-weight: 700;
  color: #b8336a;
  line-height: 1.0;
  margin-bottom: 6px;
}
.tldr-grid .tldr-label {
  font-size: 14px;
  color: #444;
  line-height: 1.35;
}
.tldr-grid .dim { color: #888; font-size: 12px; }

/* ---- Tables ---- */
.vggto-bench { font-size: 13px; }
.vggto-bench .lalign { text-align: left; }
.vggto-bench th, .vggto-bench td { text-align: center; padding: 4px 8px !important; }
.vggto-bench .ours td { background: #fbf3f8; }
.vggto-bench .ours.best td { background: #f3d9e7; }

/* ---- Figures (paper figures, language + motion + mem_speed) ---- */
figure.image img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
figure.image figcaption {
  font-size: 13px;
  color: #555;
  margin-top: 8px;
  line-height: 1.4;
}

/* ---- Gallery: vertical stack of rows (video | viewer) ---- */
.vggto-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 18px 0 8px;
}
.row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.row-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  color: #555;
  padding-left: 2px;
}
.row-idx {
  color: #b8336a;
  font-weight: 700;
}
.row-name { color: #555; }
.row-tag {
  position: absolute;
  bottom: 8px; left: 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(20,20,22,.65);
  padding: 2px 8px;
  border-radius: 3px;
  pointer-events: none;
}
.row-panels {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: #f5f5f5;
  border-radius: 15px;
  padding: 8px;
  box-shadow: 0 6px 12px rgba(0,0,0,.15);
}
.row-video {
  flex: 1.55 1 0;
  min-width: 0;
  position: relative;
  background: #f5f5f5;
  aspect-ratio: 2580 / 720;
  overflow: hidden;
  border-radius: 10px;
}
.row-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f5f5f5;
  display: block;
}
.row.portrait .row-panels {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}
.row.portrait .row-video {
  flex: 0.76 1 260px;
}
.row.portrait .row-viewer {
  flex: 1 1 360px;
}
.row.portrait .row-video video {
  object-fit: contain;
}
.row-viewer {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  background: #f5f5f5;
  overflow: hidden;
  border-radius: 10px;
  cursor: grab;
}
.row-viewer:active { cursor: grabbing; }
.viewer-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.viewer-status {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  color: #777;
  background: rgba(255,255,255,.85);
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
}
.viewer-status.error { color: #b8336a; }

/* viewer toolbar (open full ↗) — match gallery's old vb-btn style */
.viewer-toolbar {
  position: absolute;
  top: 8px; right: 8px;
  display: flex; gap: 6px;
  z-index: 5;
}
.vb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  background: rgba(20,20,22,.78);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
  transition: background .12s;
  text-decoration: none;
}
.vb-btn:hover { background: rgba(40,40,44,.92); color: #fff; }
.vb-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #5b8def;
  box-shadow: 0 0 6px rgba(91,141,239,.6);
}
.vb-swap { color: rgba(255,255,255,.6); margin-left: 2px; font-size: 10.5px; }

/* ---- Pager (gallery + interactive share) ---- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 22px 0 8px;
  flex-wrap: wrap;
}
.pager-pages { display: flex; gap: 4px; }
.pager-btn, .pager-num {
  font-family: inherit;
  font-size: 14px;
  color: #555;
  background: #fff;
  border: 1px solid #d8d6d1;
  border-radius: 999px;
  cursor: pointer;
  padding: 6px 12px;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1;
}
.pager-num { min-width: 32px; padding: 6px 10px; }
.pager-btn:hover:not(:disabled), .pager-num:hover {
  background: #f7f4ef;
  color: #111;
  border-color: #b8b6b0;
}
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-num.active {
  background: #b8336a; border-color: #b8336a; color: #fff; font-weight: 600;
}
.pager-num.active:hover {
  background: #b8336a; border-color: #b8336a; color: #fff;
}

/* ---- Interactive section (2 entries per row, each = video | viewer) ---- */
.iv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 18px 0 8px;
}
.iv-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #fff;
  border: 1px solid #e5e3df;
  border-radius: 8px;
  padding: 6px;
}
.iv-video, .iv-view {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}
.iv-video video {
  width: 100%; height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
}
.iv-view { cursor: grab; }
.iv-view:active { cursor: grabbing; }
.iv-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.iv-caption {
  grid-column: 1 / -1;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  color: #888;
  padding: 4px 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.iv-status {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  color: #777;
  background: rgba(255,255,255,.85);
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
}
.iv-status.error { color: #b8336a; }

@media (max-width: 1024px) {
  .iv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .row-panels { flex-direction: column; }
  /* Column direction: the desktop flex-basis: 0 would pin main-axis (height)
     to 0. Use auto so each panel sizes from its aspect-ratio instead. The
     viewer has no aspect-ratio of its own (its canvas child is absolute and
     contributes 0), so give it an explicit one. */
  .row-panels > * { flex: 0 0 auto; }
  .row-viewer { aspect-ratio: 4 / 3; }
  .row.portrait .row-panels {
    flex-direction: column;
    max-width: 100%;
  }
  .row.portrait .row-viewer { aspect-ratio: 4 / 3; }
  .demo-teaser-grid {
    flex-direction: column;
    overflow-x: visible;
  }
  .demo-teaser-panel {
    width: 100%;
  }
  .demo-teaser-panel video {
    width: 100%;
    height: auto;
  }
  .iv-entry { grid-template-columns: 1fr; }
}
