/* ==========================================================================
   Publication cards
   Boxed-card layout by default (signal / refined); the editorial theme
   overrides these into a hairline-ruled journal index. All colors, fonts
   and radii come from the theme variables defined in minimal-light.scss.

   Layout per card:
     Row 1 (.pub-meta):     [venue badge] [author status] ........ [PDF]
     Title
     Authors
     Row (.periodical):     journal, year .................. [topic tags]
   ========================================================================== */

.publications {
  margin-top: 1.2rem;
}

.publications ol.bibliography {
  list-style: none;
  padding: 0;
  margin: 0;
}

.publications ol.bibliography li {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.publications ol.bibliography li:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border-hover);
}

/* Row: optional thumbnail + content */
.pub-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.pub-thumb {
  flex: 0 0 var(--thumb-w);
}

.pub-thumb .teaser {
  display: block;
  width: 100%;
  height: var(--thumb-h);
  object-fit: cover;
  border-radius: var(--thumb-radius);
  border: 1px solid var(--border);
  margin: 2px 0 0;
}

.pub-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* Top meta row: venue badge + author status, actions pushed to the far right */
.pub-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 8px;
}

.pub-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-chip);
  background: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid var(--chip-border);
}

/* Secondary venue (e.g. a workshop where a preprint was also presented) reads as
   subordinate to the primary venue: outlined + muted rather than filled. */
.pub-badge-alt {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.pub-note {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--note-color);
}

.pub-actions {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.publications ol.bibliography li .btn {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 4px 11px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  color: var(--accent);
  background: transparent;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.publications ol.bibliography li .btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-weak-bg);
  text-decoration: none;
}

/* Title */
.publications ol.bibliography li .title {
  font-family: var(--font-heading);
  font-size: var(--title-size);
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.publications ol.bibliography li .title a {
  color: var(--heading);
}

.publications ol.bibliography li .title a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Authors */
.publications ol.bibliography li .author {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 5px;
}

.publications ol.bibliography li .author strong {
  color: var(--heading);
  font-weight: 600;
}

/* Journal + year row, with topic tags pushed to the right */
.publications ol.bibliography li .periodical {
  display: flex;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 4px 10px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.publications ol.bibliography li .periodical em {
  font-style: italic;
}

/* Topic tags — pushed to the right end of the journal line */
.pub-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.pub-tag {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Keyboard focus parity for the PDF/Code buttons */
.publications ol.bibliography li .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* On narrow phones let the tags drop to their own line rather than squeeze
   the journal text; on wider screens they stay on the journal/year line. */
@media print, screen and (max-width: 480px) {
  .publications ol.bibliography li .periodical {
    flex-wrap: wrap;
    align-items: center;
  }
}

/* Respect reduced-motion: no card lift on hover */
@media (prefers-reduced-motion: reduce) {
  .publications ol.bibliography li:hover {
    transform: none;
  }
}
