/* Brand Colors from gdm-colors.sty */
:root {
  --primary-color: #1A73E8;
  --primary-dark: #1557B0;
  --primary-light: #E8F0FE;
  --text-color: #3D4045; /* dmgray1000 */
  --header-color: #0A1533; /* dmblue1000 */
  --bg-color: #FFFFFF;
  --bg-alt: #F0F5F5; /* dmgray50 */
  --border-color: #D6DBE3; /* dmgray200 */
  --accent-teal: #00CCA7; /* dmteal400 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 20px;
}

.logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 20px;
}

.logo-inline {
  max-height: 24px;
  width: auto;
  vertical-align: middle;
  margin-bottom: 4px;
}

h1 {
  font-size: 2.5rem;
  color: var(--header-color);
  margin-top: 10px;
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.authors {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.authors a {
  color: var(--primary-color);
  text-decoration: none;
}

.authors a:hover {
  color: var(--primary-dark);
}

.author {
  white-space: nowrap;
}

.affiliations {
  font-size: 0.95rem;
  color: #6C727A; /* dmgray800 */
  margin-bottom: 30px;
}

.links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  transition: background-color 0.2s, transform 0.1s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: var(--primary-dark);
}

.btn:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-light);
}

.btn-disabled {
  background-color: #BBC2CD; /* dmgray400 */
  color: white;
  cursor: not-allowed;
}
.btn-disabled:hover {
  background-color: #BBC2CD;
}

section {
  margin-bottom: 60px;
}

section h2 {
  font-size: 1.8rem;
  color: var(--header-color);
  margin-bottom: 25px;
}

.tldr {
  background-color: var(--primary-light);
  border-left: 5px solid var(--primary-color);
  padding: 15px 20px;
  border-radius: 0 12px 12px 0; /* Callout style, rounded right corners */
  margin-bottom: 40px;
  font-size: 1.1rem;
  font-style: italic;
}

/* Teaser Grid Desktop */
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px 10px;
  margin-bottom: 40px;
}

.teaser-header {
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 5px;
  font-size: 1rem;
  color: var(--header-color);
  text-align: center;
}

.header-orig {
  grid-row: 1;
  grid-column: 1 / -1;
}

.header-vipe {
  grid-row: 4;
  grid-column: 1 / -1;
}

/* Original Row Placement */
.orig-1 { grid-row: 2; grid-column: 1; }
.orig-2 { grid-row: 2; grid-column: 2; }
.orig-3 { grid-row: 2; grid-column: 3; }
.orig-4 { grid-row: 2; grid-column: 4; }
.orig-5 { grid-row: 2; grid-column: 5; }
.orig-6 { grid-row: 2; grid-column: 6; }

.label-orig-1 { grid-row: 3; grid-column: 1; }
.label-orig-2 { grid-row: 3; grid-column: 2; }
.label-orig-3 { grid-row: 3; grid-column: 3; }
.label-orig-4 { grid-row: 3; grid-column: 4; }
.label-orig-5 { grid-row: 3; grid-column: 5; }
.label-orig-6 { grid-row: 3; grid-column: 6; }

/* VIPE Row Placement */
.vipe-1 { grid-row: 5; grid-column: 1; }
.vipe-2 { grid-row: 5; grid-column: 2; }
.vipe-3 { grid-row: 5; grid-column: 3; }
.vipe-4 { grid-row: 5; grid-column: 4; }
.vipe-5 { grid-row: 5; grid-column: 5; }
.vipe-6 { grid-row: 5; grid-column: 6; }

.label-vipe-1 { grid-row: 6; grid-column: 1; }
.label-vipe-2 { grid-row: 6; grid-column: 2; }
.label-vipe-3 { grid-row: 6; grid-column: 3; }
.label-vipe-4 { grid-row: 6; grid-column: 4; }
.label-vipe-5 { grid-row: 6; grid-column: 5; }
.label-vipe-6 { grid-row: 6; grid-column: 6; }

/* Video/GIF styling */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 12px; /* Increased corner radius */
  border: 1px solid #000000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: #000;
}

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

.teaser-label {
  text-align: center;
  font-size: 0.8rem;
  margin-top: 5px;
  font-weight: 600;
}



.abstract-text {
  font-size: 1.05rem;
  text-align: justify;
}

/* Task Sections */
.task-split {
  margin-bottom: 40px;
}

.task-split h3 {
  font-size: 1.4rem;
  color: var(--header-color);
  margin-bottom: 15px;
}

.task-split h3 a {
  color: var(--primary-color);
  text-decoration: none;
}

.task-split h3 a:hover {
  color: var(--primary-dark);
}

.comparison-highlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 20px;
  row-gap: 8px; /* Tighter vertical spacing */
  margin-bottom: 30px;
}

.column-highlight {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
}

.variants-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 0; /* Removed margin to match top comparison gap */
  margin-bottom: 40px;
}

.variant-item {
  display: flex;
  flex-direction: column;
}

.mini-video {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px; /* Proportionally rounded for smaller grid items */
}

.variant-label {
  font-size: 0.75rem;
  text-align: center;
  margin-top: 6px;
  font-weight: 500;
  word-break: break-word;
  font-style: italic; /* Italicize variant names in grid */
}

/* Split Titles (e.g. "Split: 5x5 Maze") */
.task-split > .task-split > h4 {
  font-size: 1.1rem;
  color: var(--header-color);
  margin-top: 30px;
  margin-bottom: 10px;
  font-weight: 600;
}

/* Other Variants headers (both main tasks and splits) */
section#tasks > .task-split > h4,
.task-split > .task-split > h5 {
  font-size: 1rem; /* Same as .column-title */
  color: var(--header-color);
  margin-top: 25px;
  margin-bottom: 12px; /* Increased to match top spacing visually */
  font-weight: 600;
  line-height: 1; /* Remove extra vertical leading */
}

.column-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--header-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-end; /* Bottom-align text and badge inside the header */
  align-self: end; /* Bottom-align the header itself in the grid row */
}

.column-text {
  display: flex;
  flex-wrap: wrap;
  column-gap: 15px; /* Spacing between title and variant name */
  row-gap: 4px; /* Spacing when wrapped */
  align-items: baseline;
}

.header-prefix {
  white-space: nowrap;
}

.variant-name {
  white-space: nowrap;
  font-weight: 400; /* non-bold */
  font-style: italic;
}

.task-prompt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: -5px;
  margin-bottom: 15px; /* Reduced to pull layout tighter */
  padding: 8px 12px;
  background-color: var(--bg-alt); /* Light grey background */
  border-left: 3px solid var(--border-color);
  border-radius: 0 12px 12px 0; /* Callout style, no radius on left */
  line-height: 1.4;
}

.badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
}

.badge-fail {
  background-color: #F8D7DA;
  color: #721C24;
}

.badge-success {
  background-color: #D4EDDA;
  color: #155724;
}

.caption {
  font-size: 0.9rem;
  color: #6C727A;
  margin-top: 8px;
}

/* BibTeX */
.bibtex-container {
  position: relative;
  background-color: var(--bg-alt);
  border-radius: 12px; /* Match main boxes */
  padding: 15px;
  border: 1px solid var(--border-color);
}

.bibtex-code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  margin: 0;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px;
  font-size: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #6C727A;
  transition: color 0.2s;
}

.copy-btn:hover {
  color: var(--primary-color);
  background: none;
}

/* Responsive design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  .teaser-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 15px;
  }
  
  .header-orig {
    grid-row: 1;
    grid-column: 1;
  }
  
  .header-vipe {
    grid-row: 1;
    grid-column: 2;
  }
  
  /* Task 1: Physics */
  .orig-1 { grid-row: 2; grid-column: 1; }
  .vipe-1 { grid-row: 2; grid-column: 2; }
  .label-orig-1 { grid-row: 3; grid-column: 1 / -1; font-size: 0.9rem; margin-bottom: 10px; }
  .label-vipe-1 { display: none; }
  
  /* Task 2: Conjunctive */
  .orig-2 { grid-row: 4; grid-column: 1; }
  .vipe-2 { grid-row: 4; grid-column: 2; }
  .label-orig-2 { grid-row: 5; grid-column: 1 / -1; font-size: 0.9rem; margin-bottom: 10px; }
  .label-vipe-2 { display: none; }
  
  /* Task 3: Connect Dots */
  .orig-3 { grid-row: 6; grid-column: 1; }
  .vipe-3 { grid-row: 6; grid-column: 2; }
  .label-orig-3 { grid-row: 7; grid-column: 1 / -1; font-size: 0.9rem; margin-bottom: 10px; }
  .label-vipe-3 { display: none; }
  
  /* Task 4: Sort 3 */
  .orig-4 { grid-row: 8; grid-column: 1; }
  .vipe-4 { grid-row: 8; grid-column: 2; }
  .label-orig-4 { grid-row: 9; grid-column: 1 / -1; font-size: 0.9rem; margin-bottom: 10px; }
  .label-vipe-4 { display: none; }
  
  /* Task 5: Maze */
  .orig-5 { grid-row: 10; grid-column: 1; }
  .vipe-5 { grid-row: 10; grid-column: 2; }
  .label-orig-5 { grid-row: 11; grid-column: 1 / -1; font-size: 0.9rem; margin-bottom: 10px; }
  .label-vipe-5 { display: none; }
  
  /* Task 6: RushHour */
  .orig-6 { grid-row: 12; grid-column: 1; }
  .vipe-6 { grid-row: 12; grid-column: 2; }
  .label-orig-6 { grid-row: 13; grid-column: 1 / -1; font-size: 0.9rem; margin-bottom: 10px; }
  .label-vipe-6 { display: none; }
  
  .comparison-highlight {
    display: flex;
    flex-direction: column;
    row-gap: 24px; /* Space between stacked columns on mobile */
  }
  
  .column-highlight {
    display: flex;
    flex-direction: column;
    width: 100%;
    row-gap: 8px; /* Spacing between header and video on mobile */
  }

  .column-title {
    align-self: stretch; /* Reset grid alignment on mobile to prevent right-aligning */
  }
  
  .variants-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.podcast-player {
  background-color: var(--bg-alt);
  padding: 20px;
  border-radius: 12px; /* Match main boxes */
  border: 1px solid var(--border-color);
  margin-top: 20px;
}

.podcast-player audio {
  width: 100%;
  margin-top: 10px;
}

/* Collapsible Tasks (details/summary) */
#tasks > .task-split {
  margin-bottom: 12px; /* Tighter spacing between tasks when collapsed */
}

details {
  background: none;
}

summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0; /* Reduced padding for tighter header */
  background: none;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  list-style: none; /* Hide default arrow */
}

summary::-webkit-details-marker {
  display: none; /* Hide default arrow in Safari */
}

summary::before {
  content: "\f054"; /* chevron-right */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--text-color);
  transition: transform 0.2s ease;
}

details[open] > summary::before {
  transform: rotate(90deg); /* Rotate down when open */
}

.task-split summary h3 {
  margin: 0;
  display: inline-block;
  font-size: 1.4rem; /* Match original h3 font-size */
}

.task-content {
  padding-left: 27px; /* Align content with the summary text (icon width + gap) */
  padding-top: 4px; /* Reduced vertical spacing */
  padding-bottom: 4px;
}

.task-content > p:first-child {
  margin-top: 2px; /* Pull description text closer to header when expanded */
}
