/* Category-specific composition shares its column tokens with profile-feed.js. */
[data-feed-current-view="projects"] .profile-feed-grid {
  --feed-columns: 4;
}
[data-feed-current-view="blogs"] .profile-feed-grid,
[data-feed-current-view="writing"] .profile-feed-grid {
  --feed-columns: 3;
}
[data-feed-current-view="research"] .profile-feed-grid,
[data-feed-current-view="papers"] .profile-feed-grid {
  --feed-columns: 1;
}
[data-feed-current-view="talks"] .profile-feed-grid {
  --feed-columns: 2;
}
[data-feed-current-view]:is(
    [data-feed-current-view="projects"],
    [data-feed-current-view="blogs"],
    [data-feed-current-view="writing"],
    [data-feed-current-view="research"],
    [data-feed-current-view="papers"],
    [data-feed-current-view="talks"]
  )
  .profile-feed-grid:not([data-feed-enhanced]) {
  grid-template-columns: repeat(var(--feed-columns), minmax(0, 1fr));
}
.page-projects .project-list.wall-grid {
  --wall-columns: 4;
}
.page-blog .journal-list.wall-grid {
  --wall-columns: 3;
}
:is(.page-projects .project-list, .page-blog .journal-list).wall-grid {
  column-count: var(--wall-columns);
  column-width: auto;
}
/* Compact social rows retain comfortable touch hit areas on coarse pointers. */
.profile-sidebar .profile-social-links,
.profile-sidebar .profile-research-links {
  row-gap: 0;
}
.profile-sidebar .profile-social-link,
.profile-sidebar .profile-resources a {
  min-height: 32px;
  padding-block: 4px;
}
.profile-sidebar .profile-connections {
  margin-top: 20px;
}
.profile-sidebar .profile-research-links {
  margin-top: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  column-gap: 16px;
}
.profile-sidebar .profile-research-links .profile-social-link {
  grid-column: auto;
  gap: 8px;
}
.profile-sidebar .profile-research-links [data-profile-id="orcid_id"] {
  grid-column: 1 / -1;
}
.profile-sidebar .profile-social-links {
  column-gap: 16px;
}
@media (pointer: coarse) {
  .profile-sidebar .profile-social-link,
  .profile-sidebar .profile-resources a {
    min-height: 44px;
  }
}
/* Compact paper previews keep artwork beside metadata, with complete titles. */
.research-card-media,
.research-record-media {
  display: block;
  min-width: 0;
  overflow: hidden;
  width: var(--paper-edge);
  height: var(--paper-edge);
  border-radius: 5px;
  background: var(--surface-alt);
}
.research-card-media img,
.research-record-media img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.paper-card,
:is(.wall-grid, .profile-feed-grid) > .paper-card {
  --paper-edge: 72px;
  display: grid;
  grid-template-columns: var(--paper-edge) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  align-items: start;
}
.paper-card .research-card-media {
  grid-column: 1;
  grid-row: 1;
}
:is(.wall-grid, .profile-feed-grid) .paper-card .wall-card-body,
.paper-card .wall-card-body,
.paper-card .paper-card-heading {
  display: contents;
  padding: 0;
}
.paper-card .paper-card-kicker {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-width: 0;
  min-height: var(--paper-edge);
}
.paper-card .paper-card-kicker > *,
.paper-card .wall-card-body h2,
.paper-card .research-status,
.paper-card .wall-card-body > .wall-excerpt {
  margin: 0;
}
.paper-card .wall-card-body h2,
.paper-card .research-status,
.paper-card .wall-excerpt,
.paper-card .paper-card-actions {
  grid-column: 1 / -1;
  min-width: 0;
}
.paper-card :is(.paper-authors, .paper-venue) {
  display: none;
}
.paper-card .wall-card-body h2 {
  font-size: 15px;
  line-height: 1.45;
}
.paper-card .paper-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  padding: 0;
}
.paper-card .paper-card-actions .project-destinations-card,
.paper-card .paper-card-actions .paper-citation {
  margin: 0;
}
.paper-card .paper-citation {
  min-height: 32px;
  align-items: center;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card {
  --paper-edge: 88px;
  gap: 0 12px;
  padding: 8px;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .wall-card-body {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  min-height: var(--paper-edge);
  padding: 0;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .paper-card-heading {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .paper-card-kicker {
  min-height: 0;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: baseline;
  gap: 2px 10px;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card :is(.wall-meta, .content-updated) {
  font-size: 11px;
  line-height: 1.2;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .wall-card-body h2 {
  font-size: 12.5px;
  line-height: 1.22;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .wall-excerpt {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .wall-excerpt * {
  display: inline;
  white-space: nowrap;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .paper-card-actions {
  margin-top: auto;
  padding: 0;
  gap: 6px 10px;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .project-destinations-card {
  gap: 6px;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card :is(.project-destination, .talk-action-pill) {
  width: auto;
  min-height: 20px;
  padding: 1px 8px;
  justify-content: center;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  text-decoration: none;
  background: var(--bg);
  transition:
    color 140ms,
    border-color 140ms,
    background-color 140ms;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card :is(.project-destination, .talk-action-pill):hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--surface-alt);
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .project-destination {
  width: 24px;
  padding: 1px 2px;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .project-destination > span {
  display: none;
}
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .paper-citation {
  min-height: 20px;
  padding-block: 1px;
  font-size: 11px;
  line-height: 1.2;
}
/* Full attribution and citation disclosures remain outside compact archive previews. */
.research-page .research-paper {
  display: block;
}
.research-record-preview {
  --paper-edge: 88px;
  display: grid;
  grid-template-columns: var(--paper-edge) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.research-record-body {
  min-width: 0;
  min-height: var(--paper-edge);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.research-record-body > *,
.research-record-kicker > * {
  margin: 0;
}
.research-record-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
}
.research-record-kicker > * {
  font-size: 12px;
  line-height: 1.4;
}
.research-record-body h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}
.research-record-body :is(.research-authors, .research-venue) {
  display: none;
}
.research-record-body .research-summary {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
}
.research-record-body .research-summary * {
  display: inline;
  white-space: nowrap;
}
.research-record-extra {
  margin-top: 12px;
}
@media (max-width: 1200px) {
  [data-feed-current-view="projects"] .profile-feed-grid,
  .page-projects .project-list.wall-grid {
    --feed-columns: 3;
    --wall-columns: 3;
  }
}
@media (max-width: 850px) {
  [data-feed-current-view="projects"] .profile-feed-grid,
  [data-feed-current-view="blogs"] .profile-feed-grid,
  [data-feed-current-view="writing"] .profile-feed-grid {
    --feed-columns: 2;
  }
  .page-projects .project-list.wall-grid,
  .page-blog .journal-list.wall-grid {
    --wall-columns: 2;
  }
}
@media (max-width: 580px) {
  [data-feed-current-view="projects"] .profile-feed-grid,
  [data-feed-current-view="blogs"] .profile-feed-grid,
  [data-feed-current-view="writing"] .profile-feed-grid,
  [data-feed-current-view="talks"] .profile-feed-grid {
    --feed-columns: 1;
  }
  .page-projects .project-list.wall-grid,
  .page-blog .journal-list.wall-grid {
    --wall-columns: 1;
  }
}
@media (pointer: coarse) {
  :is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card {
    --paper-edge: 108px;
  }
  :is([data-feed-current-view="research"], [data-feed-current-view="papers"])
    .paper-card
    :is(.project-destination, .paper-citation, .talk-action-pill) {
    min-width: 44px;
    min-height: 44px;
  }
}
@media (max-width: 700px) {
  :is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card {
    --paper-edge: 56px;
    gap: 8px;
  }
  :is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .wall-card-body,
  :is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .paper-card-heading {
    display: contents;
  }
  :is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .paper-card-kicker {
    min-height: var(--paper-edge);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }
  :is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card .paper-card-actions {
    margin: 0;
    padding: 0;
  }
  .research-record-preview {
    --paper-edge: 56px;
    gap: 8px;
  }
  .research-record-body {
    display: contents;
  }
  .research-record-media {
    grid-column: 1;
    grid-row: 1;
  }
  .research-record-kicker {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: var(--paper-edge);
  }
  .research-record-body :is(h3, .research-status, .research-summary) {
    grid-column: 1 / -1;
  }
}
/* Missing optional artwork leaves a full-width readable text preview. */
.paper-card:not(:has(.research-card-media)),
.research-record-preview:not(:has(.research-record-media)) {
  grid-template-columns: minmax(0, 1fr);
}
.paper-card:not(:has(.research-card-media)) .paper-card-kicker,
:is([data-feed-current-view="research"], [data-feed-current-view="papers"]) .paper-card:not(:has(.research-card-media)) .wall-card-body,
.research-record-preview:not(:has(.research-record-media)) .research-record-body {
  grid-column: 1;
}
.paper-card:not(:has(.research-card-media)) .paper-card-kicker {
  min-height: 0;
}

.research-record-preview:not(:has(.research-record-media)) .research-record-kicker {
  grid-column: 1;
  min-height: 0;
}

/* Talk Card: Balanced Feed Presentation & Dedicated Showcase View */
.talk-card {
  position: relative;
  display: flex;
  flex-direction: column;
}
.talk-card .talk-media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-alt);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.talk-card .talk-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.talk-card:hover .talk-media img {
  transform: scale(1.02);
}
.talk-card .talk-card-body {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  gap: 6px;
  flex: 1 1 auto;
}
.talk-card .talk-card-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.talk-card .talk-card-heading .wall-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
}
.talk-card .talk-card-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.talk-card .talk-card-heading h2 a {
  color: var(--ink);
  text-decoration: none;
}
.talk-card .talk-card-heading h2 a:hover {
  color: var(--link);
}
.talk-event-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}
.talk-event-line .talk-event-link,
.talk-event-line .talk-event {
  font-weight: 500;
  color: var(--ink);
}
.talk-event-line .talk-event-link {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}
.talk-event-line .talk-event-link:hover {
  color: var(--link);
  text-decoration-color: var(--link);
}
.talk-summary {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* In general/All feed, keep cards compact by hiding heavy metric strip */
.talk-card .talk-metric-strip {
  display: none;
}
/* Card actions: destinations and article pill */
.talk-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: auto;
  padding-top: 8px;
}
.talk-card-actions .project-destinations-card {
  margin: 0;
}
.talk-card-actions .talk-article-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  min-height: 28px;
  padding: 0 4px;
  transition: color 150ms ease;
}
.talk-card-actions .talk-article-action:hover {
  color: var(--ink);
}
.talk-card-actions .talk-article-action svg {
  width: 12px;
  height: 12px;
}

/* Dedicated layout in Talks View & Talks page */
:is([data-feed-current-view="talks"], .talks-collection) .profile-feed-grid {
  --feed-columns: 2;
  gap: 24px;
}
:is([data-feed-current-view="talks"], .talks-collection) .talk-card {
  max-width: 680px;
}
:is([data-feed-current-view="talks"], .talks-collection) .talk-card .talk-card-body {
  padding: 20px 22px;
  gap: 12px;
}
:is([data-feed-current-view="talks"], .talks-collection) .talk-card .talk-card-heading h2 {
  font-size: 17px;
  line-height: 1.35;
}
:is([data-feed-current-view="talks"], .talks-collection) .talk-event-line {
  font-size: 12.5px;
}
:is([data-feed-current-view="talks"], .talks-collection) .talk-summary {
  font-size: 13px;
  line-height: 1.55;
  -webkit-line-clamp: 4;
}
:is([data-feed-current-view="talks"], .talks-collection) .talk-card .talk-metric-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  margin-top: 4px;
}
:is([data-feed-current-view="talks"], .talks-collection) .metric-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
:is([data-feed-current-view="talks"], .talks-collection) .metric-num {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
:is([data-feed-current-view="talks"], .talks-collection) .metric-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
:is([data-feed-current-view="talks"], .talks-collection) .talk-card-actions {
  padding-top: 4px;
}
:is([data-feed-current-view="talks"], .talks-collection) .talk-card-actions .project-destination {
  min-height: 30px;
  font-size: 12px;
  padding: 3px 10px;
}
:is([data-feed-current-view="talks"], .talks-collection) .talk-article-action {
  font-size: 12px;
}

/* Talks Archive Grid (Standalone page) */
.talks-list.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 24px;
}

/* Mobile & Small Screen Refinements for Talks */
@media (max-width: 768px) {
  [data-feed-current-view="talks"] .profile-feed-grid,
  :is([data-feed-current-view="talks"], .talks-collection) .profile-feed-grid {
    --feed-columns: 1;
    gap: 16px;
  }
  .talks-list.wall-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  :is([data-feed-current-view="talks"], .talks-collection) .talk-card {
    max-width: 100%;
  }
  :is([data-feed-current-view="talks"], .talks-collection) .talk-card .talk-card-body {
    padding: 16px;
    gap: 10px;
  }
  :is([data-feed-current-view="talks"], .talks-collection) .talk-card .talk-card-heading h2 {
    font-size: 15.5px;
  }
}

@media (max-width: 480px) {
  :is([data-feed-current-view="talks"], .talks-collection) .talk-card .talk-metric-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
    padding: 8px 10px;
  }
  :is([data-feed-current-view="talks"], .talks-collection) .metric-num {
    font-size: 12px;
  }
  :is([data-feed-current-view="talks"], .talks-collection) .metric-desc {
    font-size: 10.5px;
    line-height: 1.25;
  }
  :is([data-feed-current-view="talks"], .talks-collection) .talk-card-actions .project-destination {
    min-height: 28px;
    font-size: 11.5px;
    padding: 2px 8px;
  }
}

@media (max-width: 360px) {
  :is([data-feed-current-view="talks"], .talks-collection) .talk-card .talk-metric-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
