/* Custom styles on top of Bulma, following the Academic Project Page Template conventions. */

body {
  font-family: 'Noto Sans', sans-serif;
}

.publication-title {
  font-family: 'Google Sans', sans-serif;
}

.content {
  font-size: 1.1rem;
}

.content p,
.content ul {
  text-align: justify;
}

.publication-authors {
  margin-top: 1rem;
  font-family: 'Google Sans', sans-serif;
}

.author-block {
  display: inline-block;
  margin: 0 0.3rem;
}

.publication-venue {
  margin-top: 0.75rem;
  font-weight: bold;
  color: #4a4a4a;
}

.author-notes {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #4a4a4a;
}

.publication-authors a {
  color: #0085FF;
  text-decoration: none;
}

.publication-links .link-block {
  display: inline-block;
  margin: 0.25rem 0.2rem;
}

/* Figure captions sit under the media, as on the reference pages, but stay
   readable at paragraph length instead of full title weight. */
.figure-caption {
  font-family: 'Noto Sans', sans-serif;
  font-weight: 400;
  color: #4a4a4a;
  margin-top: 0.9rem;
  margin-bottom: 2rem;
  line-height: 1.55;
}

.figure-caption strong {
  color: #363636;
}

/* Teaser */
.teaser img {
  border-radius: 8px;
}

/* Wide paper tables: keep them legible on narrow screens by scrolling
   rather than shrinking the type to nothing. */
.paper-table {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.paper-table img {
  min-width: 660px;
}

/* Insight columns in the analysis section.
   Plots differ slightly in aspect ratio, so pin the media box to a fixed
   height and give the headings a floor — otherwise headings and captions
   land at different baselines across the three columns. */
.insight-row {
  margin-top: 1.5rem;
  align-items: stretch;
}

.insight-row .column {
  display: flex;
  flex-direction: column;
}

.insight-row figure.image {
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.insight-row figure.image img {
  width: auto;
  max-width: 100%;
  max-height: 210px;
  object-fit: contain;
  border: 1px solid #ededed;
  border-radius: 6px;
  background: #fff;
}

.insight-row .title {
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.insight-row p {
  color: #4a4a4a;
  line-height: 1.5;
}

/* Headline metric tiles */
.metric-row {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.metric {
  border: 1px solid #e4ebe8;
  border-radius: 8px;
  background: #f7fbf9;
  padding: 1rem 0.9rem;
  height: 100%;
  text-align: center;
}

.metric span,
.metric small {
  display: block;
  color: #7a7a7a;
  font-size: 0.8rem;
}

.metric strong {
  display: block;
  font-family: 'Google Sans', sans-serif;
  color: #363636;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0.35rem 0 0.25rem;
}

/* Supporting numbers under the tables */
.note-row {
  margin-top: 1.5rem;
}

.note {
  border-left: 3px solid #167d66;
  background: #f7f9fa;
  padding: 0.9rem 1rem;
  height: 100%;
}

.note strong {
  display: block;
  font-family: 'Google Sans', sans-serif;
  color: #363636;
  font-size: 1.4rem;
}

.note span {
  color: #7a7a7a;
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Hero gallery: SparSTAR outputs alone, mosaic with one 2x2 feature tile.
   Grid rows are sized by the 16:9 single tiles; the feature drops aspect-ratio
   and fills its 2x2 area instead, so rows stay aligned (an aspect-ratio on a
   row-spanning item fights the gap and leaves it short). */
.gallery-section {
  padding: 0 0 2.5rem;
}

.gallery-title {
  margin-bottom: 1.1rem !important;
}

.video-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 10px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 14px;
}

.g-item {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  transition: transform .25s ease, box-shadow .25s ease;
}

.g-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, .18);
}

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

.g-feature {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

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

@media screen and (max-width: 560px) {
  .video-gallery { grid-template-columns: 1fr; gap: 8px; }
  .g-feature { grid-column: span 1; grid-row: span 1; aspect-ratio: 16 / 9; }
}

/* Section walkthrough videos (Method / Analysis). 1280x720 explainers, so cap the
   width rather than letting them span the full text column. */
.demo-video {
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  margin: 0.5rem auto 0;
  border-radius: 6px;
  border: 1px solid #dfe5ea;
  background: #000;
}

/* Qualitative videos: a 2x2 grid so each side-by-side pair stays small.
   Use the player controls (or fullscreen) to inspect a pair closely. */
.video-grid {
  margin-top: 1rem;
}

.video-grid video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  background: #000;
}

.video-grid .figure-caption {
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Supporting plots that should not compete with the tables. */
.small-figure {
  max-width: 560px;
  margin: 2.25rem auto 0;
}

#BibTeX pre {
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 0.85rem;
}

@media screen and (max-width: 768px) {
  .content {
    font-size: 1rem;
  }
  .content p,
  .content ul {
    text-align: left;
  }
  .small-figure {
    max-width: 100%;
  }
}
