/* Publication-specific styles (loaded only on /pub/ pages) */

/* --- Publication detail page header (built by pub/post-header.html) ---
   The full-width tinted band + flush-to-navbar comes from Quarto's
   title-block-banner (set in pub/_metadata.yml); these rules style the
   content. Mirrors blog/blog.css's post-detail header (same grid mechanics,
   same breadcrumb pill shape) with a blue accent instead of purple, matching
   the rest of the pub pages (.pub-tag, .pub-card-more). No date/reading-time/
   author badges here — they read as awkward on an academic publication page,
   so the header is just breadcrumb + title + subtitle. */
.quarto-title-banner {
  margin-bottom: 0.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

/* Grid placement (the banner is a page-columns grid):
   row 1 = breadcrumb (Publications pill), row 2 = title. */
.post-breadcrumb {
  grid-column: body-content-start / body-content-end;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: max-content;
  color: #0c447c;
  text-decoration: none;
  margin-bottom: 0.9rem;
}
.post-breadcrumb .bub-type {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  background: #0c447c;
  color: #fff;
  transition: background 0.15s ease;
}
.post-breadcrumb:hover .bub-type {
  background: #082f57;
}
.post-header-main {
  grid-column: body-content-start / body-content-end;
  grid-row: 2;
  min-width: 0;
}
/* Fallback when no banner grid is present */
.post-header-row {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.post-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.22;
  margin: 0 0 0.5rem;
}
.post-subtitle {
  font-size: 1.02rem;
  color: #555;
  line-height: 1.5;
  margin: 0;
}
.post-tags {
  margin-top: 0.85rem;
}
.post-tags > p {
  margin: 0;
}

/* Switch to the stacked layout exactly when Quarto drops the margin/ToC
   (~992px), so the header and the ToC change together (no two-step jump). */
@media (max-width: 991.98px) {
  .post-breadcrumb,
  .post-header-main {
    grid-column: body-content-start / body-content-end;
    grid-row: auto;
  }
  .post-header-row {
    display: block;
  }
  .post-title {
    font-size: 1.45rem;
  }
}

/* --- Detail page body: two-column layout (main + sidebar) ---
   Modelled on syntheticsociety.oii.ox.ac.uk's research page: an open,
   unboxed main column (no more "everything in one bordered card") with a
   narrower sidebar for citation / recognition / related talks. The page is
   widened (grid: body-width in pub/_metadata.yml) so the sidebar is genuine
   extra width, not stolen from the reading column.
   Named .pub-detail (not .pub) deliberately — pub/index.qmd's current
   listing format still uses bare ::: pub ::: per entry (the old boxed-card
   style, see .pub in styles.css); reusing that class name here made every
   listing entry inherit this grid too and broke the listing page. */
.pub-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.75rem;
  align-items: start;
}
.pub-main {
  min-width: 0;
}
.pub-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 0.9rem;
  min-width: 0;
}
@media (max-width: 900px) {
  .pub-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Plain-language "hook" line — one sentence giving readers a way in before
   the formal citation/abstract, editorial-style rather than academic-style. */
.pub-hook {
  font-size: 1.03rem;
  font-style: italic;
  color: #333;
  line-height: 1.6;
  margin: 0.9rem 0 1.1rem;
  padding-left: 0.9rem;
  border-left: 3px solid #dce6f0;
}

/* --- Sidebar: one field style for everything ---
   Links, Authors, Published, Citation, Recognition, Related Talks all use
   the same label + content + left-border-accent treatment — no boxes, no
   shading. The only thing that still looks different is the "value"
   typography: short facts (Authors, Published) are bold single lines;
   longer content (Citation, Recognition, Related Talks) is normal-weight
   prose; Links keeps the .pub-link pill buttons (same component used
   elsewhere on the site), just living in this field position now. */
.pub-fields {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.pub-field {
  border-left: 2px solid #dce6f0;
  padding-left: 0.9rem;
}
.pub-field-label {
  font-size: 0.74rem;
  color: #7a7a7a;
  margin: 0 0 0.25rem;
}
.pub-field-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}
.pub-field-value a {
  color: #0c447c;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.pub-field-value a:hover {
  border-bottom-color: currentColor;
}
/* .pub-link pills inside a field: keep their own grey pill styling rather
   than inheriting the plain-link blue/bold/underline rules above (a
   descendant two-class selector so it reliably wins over `.pub-field-value a`).
   Re-declaring the full border (not just color) matters: `.pub-field-value a`
   sets border-bottom specifically, which — at equal-or-higher specificity —
   silently overrode just the pill's bottom edge, leaving the other three
   sides visible and the bottom "cut off". */
.pub-field-value .pub-link {
  color: #444;
  font-weight: 400;
  border: 1px solid #d0d0d0;
}
.pub-field-value .pub-link:hover {
  color: #000;
  border: 1px solid #d0d0d0;
  background: #f3f3f3;
}
/* Longer prose content (citation text, recognition line, talks list) —
   normal weight, reads as a sentence rather than a fact. */
.pub-field-content {
  font-size: 0.87rem;
  font-weight: 400;
  color: #333;
  line-height: 1.55;
  margin: 0;
}
.pub-field-content a {
  color: #0c447c;
}
.pub-field-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* "Copy citation" / "Copy BibTeX" utility buttons — small bordered pills,
   the one place in the sidebar that still looks like a button, since these
   trigger a JS action rather than just displaying a fact. */
.citation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
}
.citation-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.1rem 0.55rem;
  margin: 0;
  border: 1px solid #d0d0d0;
  border-radius: 999px;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.citation-copy-btn:hover {
  background: #f3f3f3;
  color: #000;
}
.citation-copy-btn.is-copied {
  background: #eaf3de;
  border-color: #bcd8a0;
  color: #3b6d11;
}
