/* ============================================================
   Publications page — scholarly list.
   Builds on css/portfolio.css tokens (--p, --text, --muted, --border, --bg)
   ============================================================ */

.pub-nav-active { color: #a5b4fc !important; }

/* Browser surfaces themed from the site palette */
.pub-page ::selection, .pub-skip ::selection { background: #c7d2fe; color: #1e1b4b; }
.pub-page a:focus-visible, .pub-page button:focus-visible, .pub-page input:focus-visible,
.pub-skip:focus-visible {
  outline: 2px solid var(--p-dark);
  outline-offset: 2px;
  border-radius: 6px;
}
.pf-nav a:focus-visible, .pf-footer a:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 3px;
  border-radius: 6px;
}
.pub-page a { text-underline-offset: 3px; }
.pub-sub, .pub-n, .pub-seg button { font-variant-numeric: tabular-nums; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pub-skip {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: #fff; color: var(--p-deep); font-weight: 600; font-size: 0.85rem;
  padding: 10px 14px; border-radius: 8px; text-decoration: none;
  transition: top 0.15s ease-out;
}
.pub-skip:focus { top: 8px; }

.pub-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.pub-head h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 2.1rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.pub-sub { color: #475569; font-size: 0.95rem; margin: 0 0 22px; }

.pub-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.pub-tools input[type="search"] {
  flex: 1 1 220px;
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.pub-tools input[type="search"]:focus { outline: 2px solid var(--p); outline-offset: 1px; }

.pub-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.pub-seg button {
  font: inherit; font-size: 0.8rem; font-weight: 500;
  padding: 8px 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  border-right: 1px solid var(--border);
}
.pub-seg button:last-child { border-right: 0; }
.pub-seg button.on { background: var(--p-dark); color: #fff; }
.pub-seg button:not(.on):hover { background: #eef2ff; color: var(--p-deep); }

.pub-all-bib {
  font: inherit; font-size: 0.8rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--p-deep); cursor: pointer;
}
.pub-all-bib:hover { border-color: var(--p); }

.pub-year {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 34px 0 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid #cbd5e1;
  color: #334155;
}

.pub {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 4px 8px;
  margin: 0 0 18px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.0rem;
  line-height: 1.5;
}
.pub-n { font-family: 'Inter', sans-serif; font-size: 0.75rem; color: var(--muted); padding-top: 4px; }
.pub { scroll-margin-top: 88px; }
.pub > div { max-width: 74ch; min-width: 0; }
.pub-target { background: #e0e7ff; border-radius: 8px; outline: 8px solid #e0e7ff; }
.pub-title { font-weight: 600; margin: 0; text-wrap: pretty; }
.pub-authors { margin: 1px 0 0; color: #334155; font-size: 0.95rem; }
.pub-authors strong { font-weight: 600; color: var(--text); }
.pub-venue { margin: 1px 0 0; color: #475569; font-size: 0.95rem; }
.pub-note { margin: 1px 0 0; color: #475569; font-size: 0.88rem; font-style: italic; }
.pub-tier, .pub-type, .pub-award {
  font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 600;
  padding: 1px 7px; border-radius: 5px; margin-left: 6px; vertical-align: 1px; white-space: nowrap;
}
.pub-tier { background: #eef2ff; color: var(--p-deep); }
.pub-type { background: #f1f5f9; color: #475569; }
.pub-award { background: #fef3c7; color: #92400e; }

.pub-links { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px; font-family: 'Inter', sans-serif; }
.pub-link {
  font-size: 0.75rem; font-weight: 500; text-decoration: none;
  padding: 2px 9px; border-radius: 6px; border: 1px solid #c7d2fe; color: var(--p-deep); background: #fff;
  cursor: pointer; font-family: 'Inter', sans-serif;
}
.pub-link:hover { background: #eef2ff; border-color: var(--p); }
.pub-link.pending { border-style: dashed; border-color: #cbd5e1; color: var(--muted); cursor: default; background: transparent; }
.pub-link.pending:hover { background: transparent; border-color: #cbd5e1; }

.pub-check {
  margin: 6px 0 0; font-family: 'Inter', sans-serif; font-size: 0.75rem; color: #92400e;
  background: #fffbeb; border: 1px dashed #f59e0b; border-radius: 6px; padding: 4px 9px;
}

.pub-empty { color: #475569; font-family: 'Inter', sans-serif; padding: 30px 0; max-width: 60ch; }

@media (pointer: coarse) {
  .pub-link { padding: 8px 14px; font-size: 0.8rem; }
  .pub-seg button, .pub-all-bib { padding: 11px 14px; }
}

@media (max-width: 640px) {
  .pub-page { padding: 36px 16px 56px; }
  .pub { grid-template-columns: 30px 1fr; }
  .pub-seg { width: 100%; }
  .pub-seg button { flex: 1; padding: 8px 4px; }
}

@media print {
  .pf-nav, .pub-tools, .pf-footer, .pub-links { display: none; }
}
