/* ────────────────────────────────────────────────────────────
   MG-Select project page — Nerfies/Bulma-layered styles
   ──────────────────────────────────────────────────────────── */

body {
  font-family: 'Noto Sans', 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fff;
  color: #222;
}

.title, .title.is-1, .title.is-2, .title.is-3, .title.is-4 {
  font-family: 'Google Sans', sans-serif;
}

.publication-title {
  font-family: 'Castoro', 'Google Sans', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* MG-Select brand emphasis (like .robocurate / .nerfies) */
.mgselect {
  font-weight: 700;
}

/* ── Hero / title block ─────────────────────────────────────── */
.venue-badge {
  display: inline-block !important;
  padding: 0.75rem 1.8rem !important;
  margin-bottom: 2rem !important;
  font-size: 1.3rem !important;
  border-radius: 999px !important;
  background: #eaf5f5 !important;
  color: #1f4f50 !important;
  font-family: 'Google Sans', sans-serif !important;
  letter-spacing: 0.02em !important;
  border: 1.5px solid #c3dddd !important;
}
.venue-badge strong {
  color: #2c7a7b;
  font-weight: 700;
}

.publication-authors {
  margin-top: 0.75rem;
  line-height: 1.9;
}
.publication-authors .author-block {
  margin-right: 0.4rem;
}
.publication-authors a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(0,0,0,0.25);
  text-underline-offset: 3px;
}
.publication-authors a:hover {
  color: #2c7a7b;
}

/* Buttons (dark rounded) */
.publication-links {
  margin-top: 1.5rem;
}
.publication-links .link-block {
  display: inline-block;
  margin: 0.25rem 0.3rem;
}
.button.is-dark {
  background-color: #1f1f1f;
  color: #fff;
}
.button.is-dark:hover {
  background-color: #333;
  color: #fff;
}

/* Reduce hero bottom padding so TL;DR sits closer */
.hero-tight .hero-body {
  padding-bottom: 0.5rem !important;
}

/* ── TL;DR box ──────────────────────────────────────────────── */
.tldr-section {
  padding: 0 1.5rem 0.8rem !important;
}
.tldr-box {
  background: linear-gradient(135deg, #f0f7f7 0%, #fafbfc 100%);
  border: 1px solid #d3e4e5;
  border-left: 5px solid #2c7a7b;
  border-radius: 10px;
  padding: 1.3rem 1.5rem 1.3rem 1.5rem;
  position: relative;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #1a3a3b;
}
.tldr-box p {
  margin: 0;
  padding-top: 0.1rem;
}
.tldr-tag {
  display: inline-block;
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  background: #2c7a7b;
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-right: 0.7rem;
  vertical-align: middle;
}

/* ── Teaser image (below TL;DR) ─────────────────────────────── */
.teaser-section {
  padding: 0.5rem 1.5rem 1.5rem !important;
}
.teaser-img {
  width: 100%;
  max-width: 1200px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ── Main figure (inline in method) ─────────────────────────── */
.main-figure img {
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-width: 100%;
}
.fig-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #fff;
}
.figure-caption {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #555;
  font-family: 'Noto Sans', sans-serif;
  text-align: center;
  line-height: 1.55;
}

/* Placeholder boxes */
.placeholder-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 280px;
  background: repeating-linear-gradient(
    45deg,
    #f3f4f6,
    #f3f4f6 10px,
    #ebedef 10px,
    #ebedef 20px
  );
  border: 1.5px dashed #c7cbd1;
  border-radius: 10px;
  color: #6b7280;
  padding: 2rem 1rem;
  text-align: center;
}
.placeholder-image.small {
  min-height: 200px;
}
.placeholder-image.video {
  background:
    radial-gradient(circle at center, rgba(44,122,123,0.07) 0, transparent 60%),
    repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 10px, #ebedef 10px, #ebedef 20px);
}
.placeholder-image.video::before {
  content: "▶";
  display: block;
  font-size: 2.2rem;
  color: #9ca3af;
  margin-bottom: 0.7rem;
}
.placeholder-label {
  font-weight: 600;
  font-size: 1rem;
  font-family: 'Google Sans', sans-serif;
}
.placeholder-hint {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #9aa0a6;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ── Stat cards (Key Results) ───────────────────────────────── */
.stats-row {
  margin-top: 1rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.8rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  height: 100%;
}
.stat-number {
  font-family: 'Castoro', serif;
  font-size: 3rem;
  font-weight: 500;
  color: #2c7a7b;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-label {
  font-size: 0.9rem;
  color: #4a4a4a;
  font-family: 'Google Sans', sans-serif;
  line-height: 1.45;
}

/* ── Method section ─────────────────────────────────────────── */
.method-step {
  margin-bottom: 2.2rem;
}
.method-step .step-title {
  font-weight: 700;
  font-family: 'Google Sans', sans-serif;
  font-size: 1.2rem;
  margin-bottom: 0.7rem;
  color: #1a1a1a;
  border-left: 3px solid #2c7a7b;
  padding-left: 0.7rem;
}

/* Equations */
.equation-block {
  margin: 1.2rem 0;
  padding: 1rem 1.2rem;
  background: #fafbfc;
  border-left: 3px solid #2c7a7b;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
}
.eq-row {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.3rem;
  align-items: center;
  margin: 0.7rem 0;
}
.eq-label {
  font-weight: 600;
  color: #2c7a7b;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.95rem;
  white-space: nowrap;
  text-align: right;
}
.eq-body {
  overflow: visible !important;
  text-align: left;
}
.eq-body mjx-container,
.eq-body mjx-container svg {
  max-width: 100% !important;
  overflow: visible !important;
}
@media (max-width: 640px) {
  .eq-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .eq-label {
    text-align: left;
  }
}
.equation-center {
  text-align: center;
  margin: 1rem 0;
  font-size: 1.05rem;
}

/* Variant chips */
.variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 1rem;
}
.variant-chip {
  padding: 0.3rem 0.7rem;
  background: #eef2f3;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #374151;
  font-family: 'Google Sans', sans-serif;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 2rem;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-family: 'Google Sans', sans-serif;
}
.results-table.compact {
  font-size: 0.88rem;
}
.results-table th,
.results-table td {
  padding: 0.6rem 0.9rem;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}
.results-table th {
  background: #f5f7fa;
  color: #1a1a1a;
  font-weight: 600;
  border-bottom: 2px solid #d1d5db;
}
.results-table tbody tr:first-child td {
  border-top: 1px solid #e5e7eb;
}
.results-table td:first-child,
.results-table th:first-child {
  text-align: left;
}
.results-table tr.highlight {
  background: #eaf5f5;
}
.results-table tr.highlight td {
  color: #1a1a1a;
}
.result-caption {
  font-size: 0.92rem;
  color: #4a4a4a;
  margin: 1.5rem 0 0.3rem;
}
ul.bench-caption {
  margin: 0 0 1rem 0;
  padding-left: 1.4rem;
  line-height: 1.7;
  list-style-type: disc !important;
  list-style-position: outside;
}
ul.bench-caption li {
  display: list-item !important;
  margin-bottom: 0.4rem;
}
.table-footnote {
  font-size: 0.78rem;
  color: #8a8a8a;
  font-family: 'Google Sans', sans-serif;
  text-align: right;
  margin: 0.3rem 0 0;
  font-style: italic;
}

/* ── Efficiency grid (Figure 3 + Table 5(b)) ───────────────── */
.efficiency-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-top: 1.5rem;
}
.efficiency-grid figure {
  margin: 0;
}
@media (max-width: 900px) {
  .efficiency-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Qualitative 2×2 video stage ────────────────────────────── */
.qual-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  max-width: 1100px;
  margin: 0 auto;
}

.qual-col {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.qual-header {
  background: #111;
  color: #fff;
  text-align: center;
  font-family: 'Google Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.qual-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qual-sublabel {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.95rem;
  color: #1a1a1a;
  text-align: center;
  font-weight: 500;
}

.qual-row.ours .qual-sublabel {
  color: #2c7a7b;
  font-weight: 700;
}

.qual-video {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  aspect-ratio: 2560 / 720;  /* matches source video */
}

.qual-row.ours .qual-video {
  outline: 2px solid #2c7a7b;
  outline-offset: -2px;
}

.qual-video video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.qual-caption {
  text-align: center;
  max-width: 760px;
  margin: 1.8rem auto 0;
  font-size: 0.95rem;
  color: #4a4a4a;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .qual-stage {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ── BibTeX block ───────────────────────────────────────────── */
.bibtex-wrap {
  position: relative;
  background: #1a1a1a;
  color: #f1f1f1;
  border-radius: 10px;
  padding: 1.2rem;
  margin-top: 1rem;
}
.bibtex-wrap pre {
  background: transparent;
  color: inherit;
  margin: 0;
  padding: 0;
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #2e2e2e;
  color: #fff;
  border: 1px solid #3f3f3f;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: 'Google Sans', sans-serif;
  transition: background 0.15s ease;
}
.copy-btn:hover {
  background: #444;
}
.copy-btn.copied {
  background: #2c7a7b;
  border-color: #2c7a7b;
}

/* ── Acknowledgments ────────────────────────────────────────── */
.ack {
  color: #4a4a4a;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: #fafafa;
  border-top: 1px solid #e5e7eb;
  padding: 2rem 1.5rem;
}
.footer .content p {
  font-size: 0.88rem;
  color: #6b7280;
  margin-bottom: 0.4rem;
}
.footer a {
  color: #2c7a7b;
}

/* ── Misc Bulma overrides ───────────────────────────────────── */
.section {
  padding: 3rem 1.5rem;
}
@media (min-width: 769px) {
  .section {
    padding: 4rem 1.5rem;
  }
}
.has-background-light {
  background-color: #fafbfc !important;
}
.title.is-3 {
  margin-bottom: 1.5rem;
}
.title.is-4 {
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  color: #1a1a1a;
}
.content p {
  line-height: 1.75;
}
.content table { margin: 0; }
