/* Components of this page on top of the template's index.css */

.figure-caption {
  color: #4a4a4a;
  font-size: 0.95rem;
  margin-top: 0.75rem;
  text-align: left;
}

/* Reference vs ours comparison: drag or move the handle to reveal the reference */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.compare {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
  cursor: ew-resize;
  user-select: none;
  touch-action: pan-y;
}
.compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.compare .compare-top {
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}
.compare .compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}
.compare .compare-handle::after {
  content: "\2194";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #222;
  font-size: 16px;
  text-align: center;
}
.compare .compare-label {
  position: absolute;
  top: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.75rem;
  pointer-events: none;
}
.compare .compare-label.left { left: 6px; }
.compare .compare-label.right { right: 6px; }
.compare-psnr {
  text-align: center;
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Side-by-side videos (reference left, ours right) */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.video-grid video {
  width: 100%;
  border-radius: 6px;
  background: #000;
}
.video-labels {
  display: flex;
  justify-content: space-around;
  font-size: 0.8rem;
  color: #666;
}

.real-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.real-grid img {
  width: 100%;
  border-radius: 4px;
}
.real-grid .col-label {
  text-align: center;
  font-size: 0.85rem;
  color: #555;
}

.results-table {
  margin: 0 auto;
}
.results-table td,
.results-table th {
  text-align: center !important;
  vertical-align: middle;
}
.results-table td:first-child,
.results-table th:first-child {
  text-align: left !important;
}

.method-figure {
  width: 100%;
  background: #fff;
}

.link-block a.is-disabled {
  pointer-events: none;
  opacity: 0.5;
}

@media screen and (max-width: 768px) {
  .compare-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: 1fr; }
}

/* The zoom tiles are 3x nearest-neighbor upscales: keep the pixels sharp */
.compare-zoom img {
  image-rendering: pixelated;
}
