/* The homepage's three-column, text-first layout throughout the portfolio. */
:root {
  --editorial-columns: 3;
  --editorial-gap: 32px;
  --editorial-title: clamp(1.4375rem, 2.3vw, 2.125rem);
  --editorial-thumb: calc((min(100vw, 1920px) - 2 * var(--pad) - 2 * var(--editorial-gap)) / 3);
}

body[data-topic] :is(.project-grid, .event-grid, .research-grid, .publication-grid, .course-catalog .course-list, .dossier-grid) {
  display: grid;
  grid-template-columns: repeat(var(--editorial-columns), minmax(0, 1fr));
  gap: 48px var(--editorial-gap);
  align-items: stretch;
}

body[data-topic] .editorial-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 16px 0 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

body[data-topic] .editorial-card :is(.project-card-copy, .event-copy, .research-project-copy, .publication-copy, .course-copy) {
  border: 0;
  margin: 0;
  padding: 0 0 24px;
  min-width: 0;
}

body[data-topic] .editorial-card :is(h2, h3) {
  font-size: var(--editorial-title);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin: 12px 0 18px;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

body[data-topic] .editorial-card .research-project-title-long {
  font-size: clamp(1.375rem, 1.85vw, 1.6875rem);
  line-height: 1.2;
}

body[data-topic] .editorial-card p {
  font-size: 1rem;
  line-height: 1.55;
  max-width: none;
  margin: 0 0 18px;
}

body[data-topic] .editorial-card :is(.micro, .course-meta, .selection-scale, .research-project-period, .research-meta-label) {
  font-size: .875rem;
  line-height: 1.5;
}

body[data-topic] .editorial-card .text-link {
  font-size: .875rem;
  gap: 16px;
  margin-top: 0;
}

body[data-topic] .editorial-card > :is(.project-card-media, .event-photo, .research-project-image, .book-cover, .course-thumb, .course-figure, .course-number) {
  width: 100%;
  margin: auto 0 0;
  padding: 0;
}

body[data-topic] .editorial-card :is(figcaption, .project-credit) {
  display: block;
  background: #fff;
  border: 0;
  padding: 0;
  margin: 10px 0 0;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

body[data-topic] .editorial-card figcaption a {
  max-width: none;
  text-align: left;
}

body[data-topic] .editorial-card .research-project-result { margin-bottom: 18px; }
body[data-topic] .editorial-card .research-project-result p { margin-bottom: 0; }
body[data-topic] .editorial-card .research-project-funding { padding-top: 16px; }
body[data-topic] .editorial-card .research-project-funding strong { font-size: 1.25rem; }
body[data-topic] .editorial-card .research-project-links { margin-top: 20px; gap: 14px 20px; }
body[data-topic] .publication-actions { gap: 14px 20px; }
body[data-topic] .publication-copy .large-copy { font-size: 1.125rem; line-height: 1.45; letter-spacing: -.015em; }
body[data-topic] .course-catalog .course-list { border: 0; }
body[data-topic] .course-number { max-height: 170px; font-size: 2.25rem; padding-top: 16px; }

/* Keep the same small image scale inside a project; full-size links stay available. */
body[data-topic] :is(.project-gallery.compact-photographs, .blatter-images) {
  max-width: none;
  grid-template-columns: repeat(var(--editorial-columns), minmax(0, 1fr));
  gap: 48px var(--editorial-gap);
  align-items: start;
}

body[data-topic] .project-gallery .gallery-wide,
body[data-topic] .project-gallery.compact-photographs .gallery-wide { grid-column: auto; }

body[data-topic] :is(.feature-wide, .framework-portrait, .framework-detail, .blatter-research-image) {
  width: 100%;
  max-width: var(--editorial-thumb);
}
body[data-topic] .cv-portrait { max-width: min(240px, var(--editorial-thumb)); }
.editorial-cover .poster-code { font-size: clamp(2rem, 3vw, 3.25rem); }

@media (max-width: 1100px) {
  :root { --editorial-columns: 2; --editorial-gap: 24px; --editorial-thumb: calc((100vw - 2 * var(--pad) - var(--editorial-gap)) / 2); }
}

@media (max-width: 700px) {
  :root { --editorial-columns: 1; --editorial-title: 1.75rem; --editorial-thumb: min(100vw - 2 * var(--pad), 420px); }
  body[data-topic] :is(.project-grid, .event-grid, .research-grid, .publication-grid, .course-catalog .course-list, .dossier-grid) { gap: 36px; }
  body[data-topic] .editorial-card .research-project-title-long { font-size: 1.5rem; }
  body[data-topic] .editorial-card > :is(.project-card-media, .event-photo, .research-project-image, .book-cover, .course-thumb, .course-figure, .course-number),
  body[data-topic] .dossier-grid > figure { max-width: 420px; }
}
