/* ============================================================
   NUS theme override for the PRIMO R1 project page.
   Loaded LAST, so it overrides the borrowed Stanford-red theme
   (index.css / revamp.css) without editing those files.

   Palette:
     --nus-blue : #003D7C  (dominant: titles, links, badge, "ours" row, active TOC)
     --nus-blue-tint : light blue washes for highlighted table rows
     --nus-gold : #EF7C00  (sparing accent: TL;DR numerals, a few highlights)
   ============================================================ */

:root {
  --nus-blue: #003D7C;
  --nus-blue-soft: #1a5aa3;
  --nus-blue-tint: rgba(0, 61, 124, 0.05);
  --nus-blue-border: #b9cbe0;
  --nus-gold: #EF7C00;
}

/* ---------- Title / headings ---------- */
.publication-title {
  color: var(--nus-blue);
}

.section-heading {
  color: var(--nus-blue);
}

/* ---------- Authors (names only, inline wrapping list) ---------- */
.author-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1.1rem;
  margin: 1rem auto 0.6rem;
  max-width: 900px;
}

.author-list .author-name {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.15rem;
  color: #000;
  white-space: nowrap;
  line-height: 1.5;
  text-decoration: none;
}

/* Authors with a homepage link: blue name, underline on hover. */
.author-list a.author-name.has-link {
  color: var(--nus-blue) !important;
}

.author-list a.author-name.has-link:hover {
  color: var(--nus-blue-soft) !important;
  text-decoration: underline;
}

/* Keep the affiliation superscript blue even on linked names. */
.author-list a.author-name.has-link sup {
  color: var(--nus-blue);
}

.author-name sup {
  color: var(--nus-blue);
  font-weight: 500;
}

/* ---------- Affiliations ---------- */
.affiliation {
  display: block;
  font-size: 1rem;
  padding-top: 0.6em;
  line-height: 1.7;
}

.affiliation-note {
  display: block;
  font-size: 0.95rem;
  color: #828282;
  padding-top: 0.4em;
}

/* ---------- ECCV venue badge ---------- */
.venue-badge {
  color: var(--nus-blue);
  border-color: var(--nus-blue);
}

/* ---------- Buttons ----------
   The borrowed .button is fixed at width:6em / text-align:right, which clips
   wider labels like "Model/Dataset". Make them auto-width pills instead. */
.button-container {
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.2rem;
}

.button-container .button {
  width: auto;
  height: auto;
  min-height: 2.4em;
  padding: 0.4em 1.1em;
  margin: 0;
  font-size: 1rem;
  text-align: center;
  white-space: nowrap;
  border: 1px solid #e2e2e2;
}

.button .icon i {
  color: var(--nus-blue);
}

/* arXiv wordmark rendered as text (academicons webfont not bundled). */
.arxiv-logo {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: -0.5px;
}

.arxiv-logo .x {
  color: #b31b1b; /* arXiv Cornell red */
}

.button:hover .arxiv-logo,
.button:hover .arxiv-logo .x {
  color: #fff;
}

.button:hover {
  filter: none;
  background-color: var(--nus-blue);
  color: #fff;
}

.button:hover .icon i {
  color: #fff;
}

/* ---------- Figure / table sizing (more compact than reference) ---------- */
.paper-figure {
  max-width: 760px;
  margin: 0.5rem auto 1.5rem;
}

.paper-figure figcaption {
  font-size: 0.85rem;
  max-width: 760px;
}

/* Hero teaser may be a touch wider than body figures. */
#summary + .section .paper-figure,
.hero + .section .paper-figure {
  max-width: 900px;
}

.results-table {
  font-size: 0.84rem;
}

.results-table-wrap {
  max-width: 100%;
  margin: 1rem auto 0.5rem;
  border: 1px solid #ececec;
  border-radius: 8px;
}

/* More generous cell padding so tables breathe. */
.results-table thead th {
  padding: 0.6rem 0.7rem;
}

.results-table tbody td {
  padding: 0.5rem 0.7rem;
}

.results-table td.row-head,
.results-table th.row-head {
  padding-left: 0.9rem;
}

/* Zebra striping on body rows (skip group headers and the highlighted "ours" row). */
.results-table tbody tr:nth-child(even):not(.ours):not(.group-row) {
  background: #fafafc;
}

/* Category group sub-headers: tinted band, small-caps label. */
.results-table tr.group-row td {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nus-blue);
  background: var(--nus-blue-tint);
  border-bottom: 1px solid var(--nus-blue-border);
  padding: 0.45rem 0.9rem;
}

.results-table tr.group-row em {
  font-style: normal;
}

/* The ablation-first top border looks heavy next to group bands; relax it. */
.results-table tr.group-row.ablation-first td {
  border-top: none;
}

/* ---------- Case-study slideshow ---------- */
.slideshow {
  position: relative;
  max-width: 860px;
  margin: 1.25rem auto 0;
  padding: 0 3rem;
}

.slide-track .slide {
  display: none;
  margin: 0 auto;
}

.slide-track .slide.is-active {
  display: block;
  animation: slideFade 0.35s ease;
}

@keyframes slideFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-arrow {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--nus-blue-border);
  background: #fff;
  color: var(--nus-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 2;
}

.slide-arrow:hover {
  background: var(--nus-blue);
  color: #fff;
}

.slide-prev { left: 0; }
.slide-next { right: 0; }

.slide-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #cdd6e2;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.slide-dot:hover { transform: scale(1.15); }

.slide-dot.is-active {
  background: var(--nus-blue);
}

@media (max-width: 600px) {
  .slideshow { padding: 0 2.2rem; }
  .slide-arrow { width: 34px; height: 34px; font-size: 0.85rem; }
}

/* ---------- TL;DR numerals: the sparing GOLD accent ---------- */
.tldr-numeral {
  color: var(--nus-gold);
  font-weight: 700;
}

.tldr-block {
  border-top-color: var(--nus-blue-border);
}

/* ---------- Links ---------- */
.content a,
a.has-text-link {
  color: var(--nus-blue);
}

.content a:hover {
  color: var(--nus-blue-soft);
}

/* ---------- Results tables: highlighted "ours" row ---------- */
.results-table tr.ours {
  background: var(--nus-blue-tint);
}

.results-table tr.ours td {
  border-bottom-color: var(--nus-blue-border);
}

.results-table tr.ours td.row-head {
  color: var(--nus-blue);
  font-weight: 700;
}

/* RoboFail table uses inline cells (not a full row) for the PRIMO R1 entry. */
.results-table td.ours-inline,
.results-table td.row-head.ours-inline {
  background: var(--nus-blue-tint);
  color: var(--nus-blue);
  font-weight: 700;
}

.results-table td.ours-inline.best {
  color: var(--nus-blue);
}

/* Category group sub-headers inside the main results table. */
.results-table tr.group-row td {
  text-align: left;
  color: #555;
  border-bottom: 1px solid #ddd;
  padding-top: 0.6rem;
}

/* Small caption note under tables. */
.table-note {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.8rem;
  color: #6a6a6a;
  line-height: 1.5;
  margin: 0.25rem 0 1.5rem;
}

/* ---------- Floating TOC ---------- */
.toc a.active {
  color: var(--nus-blue);
  border-left-color: var(--nus-blue);
  font-weight: 600;
}

/* ---------- BibTeX copy button hover ---------- */
.bibtex-copy:hover {
  border-color: var(--nus-blue);
  color: var(--nus-blue);
}

/* ---------- FontAwesome counter badge (cosmetic) ---------- */
.fa-layers-counter {
  background-color: var(--nus-blue) !important;
}
