/* ── Task Comparison ── */
.task-comparison-header {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 0.25rem;
  position: relative;
  padding-bottom: 0;
  color: var(--text-primary);
}

.task-comparison-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

.task-comparison-header:first-of-type {
  margin-top: 1rem;
}

.task-comparison-header .sub-num {
  color: var(--primary-color);
  margin-right: 0.25rem;
}

/* Side-by-side dataset examples (used in Automated Data Generation subsections) */
.examples-cite {
  text-align: center;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-light);
  margin: 0.75rem 0;
}

.examples-cite a,
.examples-cite a:visited {
  color: var(--primary-color);
  text-decoration: none;
}

.examples-cite a:hover {
  text-decoration: underline;
}

.examples-row {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  margin: 0.5rem 0 1rem;
}

.examples-row .example {
  flex: 1 1 0;
  min-width: 0;
  max-width: 510px;
  margin: 0 auto;
}

@media screen and (max-width: 900px) {
  .examples-row {
    flex-direction: column;
  }
}

.vgoq-link-arrow {
  font-size: 1.6rem;
  margin-right: 0.6rem;
  color: var(--text-primary);
  vertical-align: middle;
  position: relative;
  top: -0.1em;
}

.badge-new {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--text-primary);
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.35rem;
  position: relative;
  top: -0.1em;
}

.task-comparison-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  padding: 0.75rem 0.75rem;
  margin: 0 0 1rem;
}

/* Task cards */
.task-card {
  padding: 1.1rem 1.25rem;
  border-radius: var(--border-radius);
  background: var(--background-secondary);
  transition: var(--transition);
}

.is-light .task-card {
  background: var(--background-primary);
}

.task-row {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.task-row > .task-card {
  flex: 1;
  min-width: 0;
}

@media screen and (max-width: 900px) {
  .task-row {
    flex-direction: column;
  }
  .task-row > .task-card + .task-card {
    margin-top: 0.75rem;
  }
}

.task-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.task-card-body h4 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.task-card-body > p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 0.4rem;
  line-height: 1.8;
}

/* Task card images */
.task-card-images {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 0.75rem 0;
  align-items: stretch;
}

.task-card-images figure {
  flex: 1;
  margin: 0 auto;
  max-width: 510px;
  width: 100%;
}

.task-card-images cite {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-light);
  margin-top: 0.3rem;
}

.task-card-images cite a,
.task-card-images cite a:visited {
  color: var(--primary-color);
  text-decoration: none;
}

.task-card-images cite a:hover {
  text-decoration: underline;
}

a.inline-link,
a.inline-link:visited {
  color: var(--primary-color);
  text-decoration: none;
}

a.inline-link:hover {
  text-decoration: underline;
}

/* Copy BibTeX and Download Poster buttons — matches IVRL signal-leak-bias */
.copy-bibtex-btn,
.download-poster-btn {
  background: var(--primary-color);
  color: white !important;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  margin: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-bibtex-btn:hover,
.download-poster-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.poster-container:hover .download-poster-btn,
.poster-container.show-btn .download-poster-btn {
  opacity: 1 !important;
}

/* VGOQ teaser */
.vgoq-teaser {
  max-width: 720px;
  margin: 0 auto 1rem;
}

/* Side-by-side layout: teaser 60% / text 40% on large screens */
.vgoq-layout {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.vgoq-layout .vgoq-teaser {
  flex: 0 0 60%;
  max-width: 60%;
  margin: 0;
}

.vgoq-layout .vgoq-text {
  flex: 1 1 auto;
  min-width: 0;
}

.vgoq-bracket {
  color: var(--text-primary);
  flex-shrink: 0;
  overflow: visible;
}

.vgoq-bracket-v {
  width: 28px;
  align-self: stretch;
  height: auto;
}

.vgoq-bracket-h {
  display: none;
}

@media screen and (max-width: 900px) {
  .vgoq-layout {
    flex-direction: column;
  }
  .vgoq-layout .vgoq-teaser,
  .vgoq-layout .vgoq-text {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .vgoq-layout .vgoq-teaser {
    margin: 0 auto 1rem;
    max-width: 720px;
  }
  .vgoq-bracket-v { display: none; }
  .vgoq-bracket-h {
    display: block;
    width: 90%;
    height: 28px;
    margin: 0 auto;
  }
}

.vgoq-teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.vgoq-cell {
  position: relative;
  aspect-ratio: 1;
  overflow: visible;
  border-radius: 8px;
  border: 3px solid transparent;
  background: var(--background-accent);
}

.vgoq-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 5px;
}

.vgoq-outline {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

/* Uniform stroke width regardless of each shape's viewBox */
.vgoq-outline path,
.vgoq-outline rect {
  vector-effect: non-scaling-stroke;
  stroke-width: 8;
}

/* Paired outlines: alternating dashes so both colors are visible */
.vgoq-outline.paired-a path {
  stroke-dasharray: 16 16;
}
.vgoq-outline.paired-b path {
  stroke-dasharray: 16 16;
  stroke-dashoffset: 16;
}

/* On hover or sticky filter, the visible (matching) outline goes solid */
.vgoq-teaser:has(.vgoq-teaser-qs li:hover) .vgoq-outline path,
.vgoq-teaser[data-filter] .vgoq-outline path {
  stroke-dasharray: none;
}

.vgoq-cell-fig {
  margin: 0;
}

.vgoq-tag {
  position: absolute;
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  font-style: normal;
  white-space: nowrap;
  z-index: 3;
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.9),
     1px -1px 0 rgba(255, 255, 255, 0.9),
    -1px  1px 0 rgba(255, 255, 255, 0.9),
     1px  1px 0 rgba(255, 255, 255, 0.9),
     0 2px 4px rgba(255, 255, 255, 0.7);
  transition: opacity 0.2s ease;
}

.vgoq-outline {
  transition: opacity 0.2s ease;
}

/* Hover-based filter (desktop): when a pill is hovered, dim everything that's not its category.
   Sticky-filter rules only apply when nothing is hovered, so hover overrides the locked filter. */
.vgoq-teaser:has(.qs-dimensions:hover) .vgoq-outline:not([data-cat="dimensions"]),
.vgoq-teaser:has(.qs-dimensions:hover) .vgoq-tag:not(.vgoq-tag-dimensions),
.vgoq-teaser[data-filter="dimensions"]:not(:has(.vgoq-teaser-qs li:hover)) .vgoq-outline:not([data-cat="dimensions"]),
.vgoq-teaser[data-filter="dimensions"]:not(:has(.vgoq-teaser-qs li:hover)) .vgoq-tag:not(.vgoq-tag-dimensions),

.vgoq-teaser:has(.qs-materials:hover) .vgoq-outline:not([data-cat="materials"]),
.vgoq-teaser:has(.qs-materials:hover) .vgoq-tag:not(.vgoq-tag-materials),
.vgoq-teaser[data-filter="materials"]:not(:has(.vgoq-teaser-qs li:hover)) .vgoq-outline:not([data-cat="materials"]),
.vgoq-teaser[data-filter="materials"]:not(:has(.vgoq-teaser-qs li:hover)) .vgoq-tag:not(.vgoq-tag-materials),

.vgoq-teaser:has(.qs-space:hover) .vgoq-outline:not([data-cat="space"]),
.vgoq-teaser:has(.qs-space:hover) .vgoq-tag:not(.vgoq-tag-space),
.vgoq-teaser[data-filter="space"]:not(:has(.vgoq-teaser-qs li:hover)) .vgoq-outline:not([data-cat="space"]),
.vgoq-teaser[data-filter="space"]:not(:has(.vgoq-teaser-qs li:hover)) .vgoq-tag:not(.vgoq-tag-space),

.vgoq-teaser:has(.qs-sturdiness:hover) .vgoq-outline:not([data-cat="sturdiness"]),
.vgoq-teaser:has(.qs-sturdiness:hover) .vgoq-tag:not(.vgoq-tag-sturdiness),
.vgoq-teaser[data-filter="sturdiness"]:not(:has(.vgoq-teaser-qs li:hover)) .vgoq-outline:not([data-cat="sturdiness"]),
.vgoq-teaser[data-filter="sturdiness"]:not(:has(.vgoq-teaser-qs li:hover)) .vgoq-tag:not(.vgoq-tag-sturdiness) {
  opacity: 0;
}

.vgoq-teaser-qs li {
  cursor: pointer;
  user-select: none;
}

/* Show which pill is the active sticky filter (mobile tap) or hovered (desktop) */
.vgoq-teaser-qs li:hover,
.vgoq-teaser[data-filter="dimensions"] .qs-dimensions,
.vgoq-teaser[data-filter="materials"] .qs-materials,
.vgoq-teaser[data-filter="space"] .qs-space,
.vgoq-teaser[data-filter="sturdiness"] .qs-sturdiness {
  box-shadow: 0 0 0 2px currentColor;
}

.vgoq-tag-dimensions { color: #E97132; }
.vgoq-tag-materials  { color: #0F9ED5; }
.vgoq-tag-space      { color: #A02B93; }
.vgoq-tag-sturdiness { color: #4EA72E; }

.vgoq-teaser-credit {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-light);
  margin: 0.4rem 0 0.6rem;
}

.vgoq-teaser-credit a,
.vgoq-teaser-credit a:visited {
  color: var(--primary-color);
  text-decoration: none;
}

.vgoq-teaser-credit a:hover {
  text-decoration: underline;
}

.vgoq-teaser-qs {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.vgoq-teaser-qs li {
  font-size: 0.78rem;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
  background: var(--background-accent);
  padding: 0.2rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  line-height: 1.4;
}

.vgoq-teaser-qs li em {
  font-style: normal;
}

.qs-dimensions { color: #ea580c; border-color: #fb923c; }
.qs-materials  { color: #0284c7; border-color: #38bdf8; }
.qs-space      { color: #c026d3; border-color: #d946ef; }
.qs-sturdiness { color: #16a34a; border-color: #22c55e; }

.task-card-img-pair {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.img-block {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.img-block img {
  width: 100%;
  border-radius: 6px;
}

.img-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.task-card-img-pair img {
  flex: 1;
  min-width: 0;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  border-radius: 6px;
}

/* ABO examples (containing input-col) get a wider example container so the
   product-listing image and the mask can both render larger. */
.examples-row .example:has(.task-card-input-col) {
  max-width: 630px;
}

/* Give the input-col side a larger flex share than the mask side */
.task-card-img-pair > .task-card-input-col {
  flex: 2 1 0;
}

/* Product-listing input images (above "+ product listing") get bigger caps */
.task-card-input-col img {
  max-width: 540px;
  max-height: 360px;
}

/* Other existing tasks (plain text list, wrapped horizontally) */
.other-tasks {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1.2rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.other-tasks li {
  position: relative;
}

.other-tasks li + li::before {
  content: "·";
  position: absolute;
  left: -0.7rem;
  color: var(--text-light);
}

.task-row + .task-card {
  margin-top: 1rem;
}

.task-card-limitation.subsection-limitation {
  display: block;
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.subsection-limitation .fa-exclamation-triangle {
  font-size: 1.4rem;
  margin-right: 0.4rem;
}

.task-card-limitation strong {
  color: inherit;
}

/* Class tags */
.class-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 0.3rem;
}

.class-tags span {
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
  background: var(--background-accent);
  color: var(--text-secondary);
  padding: 0.1rem 0.45rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  line-height: 1.4;
}

/* Limitation callout */
.task-card-limitation {
  margin-top: 0.3rem;
  font-size: 1rem;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.task-card-limitation i {
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Explanation text */
.task-card-explanation {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0.4rem 0 0;
}

/* Input column (image + metadata stacked) */
.task-card-input-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.task-card-input-col img {
  width: 100%;
  border-radius: 6px;
  object-fit: contain;
}

.input-separator {
  display: block;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1;
}

.input-extra {
  display: block;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.input-extra i {
  color: var(--primary-color);
  margin-right: 0.25rem;
}

/* VGOQ feature list */
.vgoq-intro {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.vgoq-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.vgoq-features li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.vgoq-features li i {
  flex-shrink: 0;
  color: var(--primary-color);
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}

.vgoq-features li span {
  color: var(--text-secondary);
}

.vgoq-features li b {
  color: var(--text-primary);
}

/* ── Architecture diagram (project-specific overrides for ml-figure-template) ── */

/* Print: lock diagram width and zoom to fit page */
@media print {
  [style*="overflow-x"] {
    overflow: visible !important;
  }
  #arch-diagram {
    box-sizing: border-box;
    width: var(--mlfig-w) !important;
    min-width: var(--mlfig-w) !important;
    zoom: var(--mlfig-z, 1);
    break-inside: avoid;
  }
}

/* Grid layout */
#arch-diagram .mlfig-grid {
  grid-template-columns: 1fr 1fr 2fr 2fr;
  grid-template-areas:
    "inimg   inimg   inimg   intxt"
    "vision  vision  vision  text"
    "proj1   proj2   proj3   ."
    ".       .       film    ."
    ".       .       tb1     ."
    ".       .       add1    ."
    ".       .       tb2     ."
    ".       .       add2    ."
    ".       .       tb3     ."
    ".       .       split   .";
  gap: 2rem 0.5rem;
}

#b-vision, #b-text, #b-inimg, #b-intxt {
  justify-self: stretch;
  text-align: center;
  margin: 0 0.5rem;
}

#b-proj1, #b-proj2, #b-proj3 {
  justify-self: center;
  width: 80px;
}

/* Heads and outputs rows (centered under the main column) */
.arch-heads-row,
.arch-outs-row {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  max-width: 420px;
  margin: 3.5rem auto 0;
}

.arch-outs-row {
  margin-top: 2rem;
}

.arch-heads-row > *,
.arch-outs-row > * {
  flex: 1;
  min-width: 0;
  text-align: center;
}

/* Block color variants — override library defaults via CSS variables */
.arch-frozen {
  --mlfig-bg: #dbeafe;
  --mlfig-border: 1.5px solid #60a5fa;
}

.arch-film {
  --mlfig-bg: #fce7f3;
  --mlfig-border: 1.5px solid #f472b6;
}

/* Small block variant (used by Proj 1/2/3) */
.arch-small {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  margin: 0 0.25rem;
}

.arch-block-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
}

.arch-freeze {
  font-size: 1.6rem;
  margin-right: 0.4rem;
  color: #60a5fa;
  vertical-align: middle;
}

/* "+" add block between transformer blocks */
.arch-add-block {
  justify-self: center;
  margin: -0.375rem 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--background-accent);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  position: relative;
  cursor: default;
}

.arch-add-block:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--text-light);
}

/* Split label */
.arch-split-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.5rem 0.75rem;
  background: var(--background-accent);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}

/* Input and output labels */
.arch-output {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  background: var(--background-accent);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}

.arch-dim-static {
  font-size: 0.8rem;
  color: var(--text-light);
  font-family: 'SF Mono', 'Monaco', monospace;
}
