/* Publications section. Reuses the site's design tokens from styles.css. */

.pubgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 28px;
  margin-top: 34px;
}

.pubcard {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pubcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 50px -26px rgba(11, 19, 28, 0.5);
}

.pubcard__media {
  aspect-ratio: 3 / 2;
  background: var(--paper-2);
  overflow: hidden;
}

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

.pubcard__body {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.pubcard__date {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pubcard__title {
  font-family: var(--display);
  font-size: 1.28rem;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}

.pubcard__excerpt {
  font-family: var(--body);
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.pubcard__more {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ochre-dp);
  margin-top: auto;
  padding-top: 6px;
}

/* Fallback card spans the full row when the feed is empty or unreachable. */
.pubcard--empty {
  grid-column: 1 / -1;
}

/* "See More Publications" sits centered under the grid. */
.pubmore {
  margin-top: 84px;
  display: flex;
  justify-content: center;
}

/* Desktop / wide: three per row. Tablet: two per row. Mobile: one per row.
   Handled automatically by auto-fit + minmax above: columns fill the available
   width, so a third card drops in whenever there is room for it. */
@media (max-width: 600px) {
  .pubgrid {
    gap: 22px;
  }
  .pubmore {
    margin-top: 56px;
  }
}
