/* Project page styles, following the Academic Project Page Template (Bulma + Nerfies). */
:root {
  --lap-purple: #7943c2;
  --lap-shade: #efe7f8;
  --finding: #5b7c82;
  --finding-bg: #eef2f3;
  --ink: #363636;
  --muted: #6b6b6b;
  --rule: #e3e3e3;
}

html { color-scheme: light; background: #fff; }
body { font-family: 'Noto Sans', sans-serif; color: var(--ink); background: #fff; }

.publication-title, .publication-authors, .teaser, .title, .subtitle, .tabs, .sample-label {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}

/* ---------- hero ---------- */
.hero-body { padding-top: 3.5rem; padding-bottom: 1.5rem; }
.publication-title { line-height: 1.25; font-size: 2.4rem !important; }
.publication-title .lap-icon { height: 1.05em; vertical-align: -0.14em; margin-right: 0.3em; }
.publication-authors { margin-top: 0.4rem; }
.publication-authors a, .publication-authors .author-name { color: hsl(204, 86%, 45%) !important; }
.publication-authors a:hover { text-decoration: underline; }
.author-block { display: inline-block; margin: 0 0.15em; }
.affiliations { color: var(--muted); }
.affiliations .author-block { margin: 0 0.7em; }
.publication-links { margin-top: 1.1rem; }
.link-block { display: inline-block; }
.link-block a { margin: 5px 3px; }
.link-block .button.is-static-soon { opacity: 0.55; cursor: default; pointer-events: none; }
.hf-logo { font-style: normal; font-size: 1.05em; line-height: 1; }

/* ---------- teaser ---------- */
.teaser .hero-body { padding-top: 0.5rem; padding-bottom: 2.5rem; }
.teaser img { display: block; width: 100%; margin: 0 auto; }
.teaser .subtitle { font-size: 1.1rem; line-height: 1.55; margin-top: 1rem; color: #4a4a4a; }

/* ---------- teaser video ---------- */
.teaser-video .hero-body { padding-top: 0.5rem; padding-bottom: 1.25rem; }
.teaser-video video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  border-radius: 12px; background: #09090b; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.teaser-video .video-actions { display: flex; justify-content: center; margin-top: 0.85rem; }
.teaser-video .video-actions[hidden] { display: none; }


/* ---------- body sections ---------- */
.section { padding: 2.75rem 1.5rem; }
.section .title.is-3 { margin-bottom: 1.2rem; }
.content p, .content li { font-size: 1.08rem; line-height: 1.7; }
.content h3.title { font-size: 1.3rem; margin-top: 2rem; margin-bottom: 0.8rem; }
.abstract p { font-size: 1.08rem; line-height: 1.7; }

figure.paper-figure { margin: 1.6rem auto 1.8rem; text-align: center; }
figure.paper-figure img { width: 100%; height: auto; display: block; margin: 0 auto; }
figure.paper-figure.narrow img { max-width: 560px; }
figure.paper-figure.medium img { max-width: 760px; }
figure.paper-figure figcaption {
  font-style: normal; font-size: 0.95rem; line-height: 1.55; color: #555; text-align: left;
  max-width: 860px; margin: 0.7rem auto 0;
}
.content figure.paper-figure { margin-left: auto; margin-right: auto; }

.takeaway {
  background: var(--finding-bg); border-left: 4px solid var(--finding);
  padding: 0.9rem 1.2rem; margin: 1.5rem 0; border-radius: 0 6px 6px 0;
}
.takeaway p { margin: 0 !important; font-size: 1.08rem; }
.question { font-style: italic; font-size: 1.2rem !important; text-align: center; }

.lap { color: var(--lap-purple); font-weight: 600; }
.mjx-chtml, mjx-container { font-size: 105% !important; }
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; padding: 0.2rem 0; }

/* ---------- code ---------- */
.content pre { background: #f6f6f8; border-radius: 6px; font-size: 0.86rem; line-height: 1.55; padding: 1rem 1.15rem; }
.code-label { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.3rem !important; }
.code-label code { color: var(--ink); background: #ececf0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.2rem auto 0.4rem; }
.content table.results {
  width: auto; border-collapse: collapse; margin: 0 auto; font-size: 0.98rem; min-width: 560px;
  font-variant-numeric: tabular-nums;
}
.content table.results th, .content table.results td { padding: 0.38rem 0.85rem; border: none; text-align: right; white-space: nowrap; vertical-align: middle; }
.content table.results th { font-weight: 600; border-bottom: 1.5px solid #333; color: var(--ink); }
.content table.results thead tr:first-child th { border-top: 1.5px solid #333; }
.content table.results tbody tr:last-child td { border-bottom: 1.5px solid #333; }
.content table.results td.l, .content table.results th.l { text-align: left; }
.content table.results td.c, .content table.results th.c { text-align: center; }
.content table.results tr.group-start td { border-top: 1px solid #bbb; }
.content table.results td.ours-cell, .content table.results tr.ours td:not(.plain) { background: var(--lap-shade); }
.content table.results td b { font-weight: 700; }
.table-caption { font-size: 0.95rem; color: #555; line-height: 1.55; max-width: 860px; margin: 0.6rem auto 1.6rem; }

/* ---------- sample explorer ---------- */
.explorer-controls { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; margin: 1.2rem 0 1rem; }
.explorer-controls .tabs { margin-bottom: 0; }
.explorer-controls .tabs { white-space: normal; max-width: 100%; }
.explorer-controls .tabs ul { flex-wrap: wrap; flex-shrink: 1; justify-content: center; row-gap: 6px; border-bottom: none; }
.explorer-controls .tabs.is-toggle li.is-active a { background-color: var(--lap-purple); border-color: var(--lap-purple); }
.explorer-controls .buttons { justify-content: center; margin-bottom: 0; }
.explorer-controls .buttons .button.is-selected { background: var(--lap-purple); border-color: var(--lap-purple); color: #fff; }
.explorer-note { font-size: 0.92rem; color: var(--muted); text-align: center; }

.sample-grid { display: grid; grid-template-columns: 150px repeat(8, minmax(0, 1fr)); gap: 4px; align-items: center; }
.sample-grid .col-head { font-size: 0.8rem; color: #666; text-align: center; padding-bottom: 2px; }
.sample-label { font-size: 0.93rem; line-height: 1.25; padding-right: 8px; text-align: right; }
.sample-label .fid { display: block; font-size: 0.78rem; color: #777; font-family: 'Noto Sans', sans-serif; }
.sample-label.is-lap { color: var(--lap-purple); font-weight: 600; }
.sample-grid img {
  width: 100%; aspect-ratio: 1 / 1; display: block; border-radius: 3px; cursor: zoom-in;
  background: #f1f1f1; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.sample-grid img:hover { transform: scale(1.04); box-shadow: 0 2px 10px rgba(0,0,0,0.22); position: relative; z-index: 2; }
.sample-grid .row-gap { grid-column: 1 / -1; height: 4px; }

.compare-modal .modal-content { width: min(1100px, 94vw); }
.compare-box { background: #fff; border-radius: 10px; padding: 1.2rem 1.2rem 1rem; }
.compare-box h4 { font-family: 'Google Sans', 'Noto Sans', sans-serif; font-size: 1.15rem; margin-bottom: 0.8rem; text-align: center; }
.compare-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.compare-row figure { margin: 0; width: min(256px, 28vw); text-align: center; }
.compare-row img { width: 100%; display: block; border-radius: 4px; }
.compare-row figcaption { font-size: 0.85rem; margin-top: 0.3rem; line-height: 1.3; }
.compare-row figcaption.is-lap { color: var(--lap-purple); font-weight: 600; }
.compare-nav { display: flex; justify-content: space-between; margin-top: 0.8rem; }

/* ---------- bibtex / footer ---------- */
.bib-wrap { position: relative; }
.bib-wrap pre { white-space: pre-wrap; padding-right: 5rem; }
.copy-btn { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 1; }
.footer { padding: 2.5rem 1.5rem 3rem; background: #fafafa; }
.footer p { font-size: 0.9rem; color: #666; }

/* ---------- small screens ---------- */
@media screen and (max-width: 768px) {
  .hero-body { padding: 2.2rem 1rem 1rem; }
  .publication-title { font-size: 1.75rem !important; }
  .publication-authors { font-size: 1.05rem !important; }
  .section { padding: 2rem 1rem; }
  .content p, .content li, .abstract p { font-size: 1rem; }
  .sample-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sample-grid .col-head { display: none; }
  .sample-label { grid-column: 1 / -1; text-align: left; padding: 0.4rem 0 0; }
  .sample-label .fid { display: inline; margin-left: 0.4em; }
}

/* Bulma heroes are column flexboxes with auto-margined containers, which then size to their widest
   child (a table); pin them to the section width so wide tables scroll inside .table-wrap instead. */
.hero > .container { width: 100%; min-width: 0; }
