/* ===== Publications (compact) ===== */

/* List + card */
.md-typeset .pub-list { display: grid; gap: .6rem; }

.md-typeset .pub-item{
  display: grid;
  grid-template-columns: max-content 1fr; /* left column matches image width */
  align-items: stretch;                   /* make image column full card height */
  gap: .6rem;
  padding: .5rem .7rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: .5rem;
  background: var(--md-default-bg-color);
  transition: box-shadow .15s ease, transform .15s ease;
}
.md-typeset .pub-item:hover{
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transform: translateY(-1px);
}

/* Thumbnail (keep aspect ratio, fill height, no frame) */
:root { --pub-thumb-max: 120px; }        /* cap width so very wide images don't dominate */
.md-typeset .pub-item { grid-template-columns: clamp(120px, 10vw, 130px) 1fr; }
.md-typeset .pub-thumb{ height: 100%; display: flex; align-items: stretch; }
.md-typeset .pub-thumb img{
  height: 100%;
  width: auto;                            /* preserve aspect ratio */
  max-width: var(--pub-thumb-max);
  object-fit: contain;                    /* no cropping */
  display: block;
  border: 0;
  background: transparent;
  border-radius: .01rem;                  /* set 0 if you want square corners */
}

/* Typography (compact) */
.md-typeset .pub-item .pub-body{ font-size: .85rem; line-height: 1.3; }
.md-typeset .pub-item .pub-title{
  margin: 0 0 .05rem 0;
  font-size: .95rem;
  line-height: 1.18;
  font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.md-typeset .pub-item .pub-meta{ margin: 0; font-size: .78rem; line-height: 1.15; color: var(--md-default-fg-color--lighter); }

/* Links row (small + separators) */
.md-typeset .pub-item .pub-links{ margin: .2rem 0 0; font-size: .8rem; line-height: 1.1; }
.md-typeset .pub-item .pub-links a{
  display: inline-flex; align-items: center; gap: .28rem; margin-right: .45rem; text-decoration: none;
}
.md-typeset .pub-item .pub-links a:hover{ text-decoration: underline; }
.md-typeset .pub-item .pub-links a:not(:last-child)::after{ content: "·"; margin-left: .45rem; opacity: .6; }

/* Mobile */
/*@media (max-width: 680px){
  :root { --pub-thumb-max: 96px; }       /* slightly narrower thumbs on mobile */
  .md-typeset .pub-item{ gap: .5rem; padding: .45rem .6rem; }
  .md-typeset .pub-item .pub-body{ font-size: .82rem; }
  .md-typeset .pub-item .pub-title{ font-size: .92rem; }
  .md-typeset .pub-item .pub-meta{ font-size: .74rem; }
  .md-typeset .pub-item .pub-links{ font-size: .78rem; }
}
*/


/* --- Fix cards overflowing & single-line authors --- */
.md-typeset .pub-item {
  display: grid;
  grid-template-columns: 84px 1fr; /* or your current 96px/60px */
  gap: .75rem;
  align-items: start;
}

.md-typeset .pub-body {
  min-width: 0;               /* key: let grid child shrink so text wraps */
}

.md-typeset .pub-title,
.md-typeset .pub-meta {
  white-space: normal;        /* ensure wrapping */
  overflow-wrap: anywhere;    /* allow long segments to break if needed */
  word-break: normal;
}

/* (nice-to-have) keep links row tidy and wrapping */
.md-typeset .pub-links {
  margin-top: .35rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}



