/* Shared tweaks that apply in both light and dark mode. */

/* Accessibility baseline: visible keyboard focus, and respect for users
   who've asked the OS for reduced motion. */
:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

h1, h2, h3 {
  letter-spacing: -0.015em;
}

h2 {
  margin-top: 2.2rem;
  margin-bottom: 0.9rem;
}

/* Subtle divider under section headings on content pages. */
main h2 {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

/* Publication / project list items. */
.pub-list ul {
  list-style: none;
  padding-left: 0;
}

.pub-title {
  font-weight: 600;
}

.pub-venue {
  font-style: italic;
}

.pub-links a {
  font-size: 0.85em;
  text-decoration: none;
  margin-right: 0.6rem;
  white-space: nowrap;
}

.pub-links a:hover {
  text-decoration: underline;
}

/* Year headers inside listings, and CV entry dates (see .cv-entry below). */
.year-label {
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
  font-size: 0.9em;
  white-space: nowrap;
}

/* Year groupings in the generated publication list. */
.csl-bib-body {
  margin-bottom: 0.5rem;
}

.csl-entry {
  margin-bottom: 0.85rem;
  padding-left: 1.6em;
  text-indent: -1.6em;
}

.csl-entry a {
  text-decoration: none;
  overflow-wrap: anywhere;
}

.csl-entry a:hover {
  text-decoration: underline;
}

/* Zotero brace-protection leaves stray spans; keep them inheriting normally. */
.csl-entry span {
  font: inherit;
}

/* ORCID has no Bootstrap Icons glyph, so draw the official mark instead.
   It is a two-tone image (black disc, white "iD"), not a single-colour path,
   so it cannot be a CSS mask that inherits currentColor. */
.about-link[href*="orcid.org"]::before {
  content: "";
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.18em;
  margin-right: 0.35em;
  background: url("icons/ORCID-iD_icon_BW_vector.svg") center / contain no-repeat;
}

/* The black disc would vanish against the dark theme; invert to white-on-black. */
.quarto-dark .about-link[href*="orcid.org"]::before {
  filter: invert(1);
}

/* Below Bootstrap's lg breakpoint Quarto stacks the about-page link buttons one
   per row at full width. With seven of them that is a ~490px column, which
   pushes the bio off a phone screen entirely. Lay them out as wrapping chips
   instead. Desktop (992px and up) keeps Quarto's own layout untouched. */
@media (max-width: 991.98px) {
  /* The selector has to be this long. Quarto's own rule is
     `div.quarto-about-trestles .about-entity .about-links`, specificity (0,3,1),
     so a shorter selector loses no matter what order the files load in. */
  div.quarto-about-trestles .about-entity .about-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: auto;
    column-gap: 0.45rem;
    row-gap: 0.45rem;
    padding-bottom: 1em;
  }

  div.quarto-about-trestles .about-entity .about-links .about-link {
    width: auto;
    padding: 0.3em 0.7em;
    font-size: 0.85rem;
  }
}

/* Open data / code / preregistration links, from links.csv. */
.pub-badge {
  display: inline-block;
  text-indent: 0;
  font-size: 0.74em;
  line-height: 1.5;
  padding: 0.10em 0.62em;
  margin: 0.28em 0.3em 0 0;
  border-radius: 999px;
  border: 1px solid var(--bs-primary);
  color: var(--bs-primary);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pub-badge:hover,
.pub-badge:focus {
  background: var(--bs-primary);
  color: var(--bs-body-bg);
  text-decoration: none;
}

.featured-links {
  font-size: 0.85em;
  white-space: nowrap;
}

/* Year-heading rhythm, shared by the talks list and the citeproc-generated
   year groups on the Publications page (render_by_year() in bibtools.R
   emits plain "### <year>" headings — wrap that output in
   .pub-year-groups to pick this up). */
.talks h3,
.pub-year-groups h3 {
  font-variant-numeric: tabular-nums;
  margin-top: 2rem;
  margin-bottom: 0.9rem;
}

.talk-links {
  font-size: 0.85em;
  white-space: nowrap;
}

/* Tighter about-page image. */
.about-image {
  border-radius: 50%;
}

/* Shared "rule card" treatment: pub list items, featured papers, talks,
   the homepage research-interests list, and CV entries. Same left-rule +
   hover-to-primary pattern everywhere — unified so changing the look means
   editing one block, not five. */
.pub-list li,
.featured p,
.talks p,
.research-list li,
.cv-entry {
  padding-left: 1rem;
  border-left: 3px solid rgba(128, 128, 128, 0.3);
  transition: border-left-color 0.15s ease;
}

.pub-list li,
.featured p {
  margin-bottom: 1.3rem;
}

.talks p {
  margin-bottom: 1.1rem;
}

.research-list ul {
  list-style: none;
  padding-left: 0;
}

.research-list li {
  margin-bottom: 0.9rem;
}

/* --- CV entries (cv.qmd) ---
   Two columns: role/institution on the left, a tabular-nums date on the
   right — the classic CV shape, built from the same rule-card the rest of
   the site already uses instead of a one-off table. */
.cv-entry {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.cv-entry-body {
  flex: 1 1 auto;
}

.cv-entry .year-label {
  flex-shrink: 0;
}

/* :focus-within, not just :hover — these blocks contain links, so keyboard
   users tabbing to a link inside should get the same affordance as a mouse
   hover, not silence. */
.pub-list li:hover,
.pub-list li:focus-within,
.featured p:hover,
.featured p:focus-within,
.talks p:hover,
.talks p:focus-within,
.research-list li:hover,
.research-list li:focus-within,
.cv-entry:hover,
.cv-entry:focus-within {
  border-left-color: var(--bs-primary);
}
/* Color-scheme toggle icon override — swap Bootstrap Icons' sun/moon
   for Lucide's outline versions, which read cleaner against the site's
   thin-border, geometric style. Rendered as a mask so it inherits
   currentColor and needs no separate light/dark rule. */
.quarto-color-scheme-toggle .bi::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: var(--toggle-icon) center / contain no-repeat;
  mask: var(--toggle-icon) center / contain no-repeat;
}
/* Correct selectors: Quarto toggles via the .alternate class on the <a>,
   not via bi-sun-fill/bi-moon-stars-fill classes on the <i>. Quarto's own
   rule sets background-image directly (bi-toggle-off/on), so we must kill
   that and paint our own icon via mask + currentColor instead. !important
   is needed because Quarto's compiled selector includes `.navbar`, giving
   it higher specificity than ours. */
.navbar .quarto-color-scheme-toggle .bi::before {
  background-image: none !important;
  background-color: currentColor;
  -webkit-mask: var(--toggle-icon) center / contain no-repeat;
  mask: var(--toggle-icon) center / contain no-repeat;
}

.navbar .quarto-color-scheme-toggle:not(.alternate) .bi::before {
  --toggle-icon: url("icons/sun.svg");
}

.navbar .quarto-color-scheme-toggle.alternate .bi::before {
  --toggle-icon: url("icons/moon.svg");
}
/* ============================================
   Search box (Algolia Autocomplete) — minimal
   restyle matching the site's aesthetic.
   ============================================ */

#quarto-search {
  --aa-primary-color-rgb: 79, 199, 214; /* dark theme $primary — see note below for light */
  --aa-muted-color-rgb: 128, 128, 128;
  --aa-panel-border-radius: 10px;
  --aa-input-border-radius: 8px;
  --aa-panel-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* --- Magnifying-glass button in the navbar --- */

.navbar .aa-SubmitIcon {
  width: 20px !important;
  height: 20px !important;
}
/* ============================================
   ABOUT PAGE
   ============================================ */

.about-container {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

.about-photos {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.about-text {
  min-width: 0;
}


/* ============================================
   ABOUT PAGE — MOBILE
   Text first, photos underneath
   ============================================ */

@media screen and (max-width: 600px) {

  .about-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  .about-text {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: none !important;
  }

  .about-photos {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    margin-top: 2rem !important;
  }

  .about-photo {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
}
/* ============================================
   404 page (404.qmd)
   ============================================ */

.notfound {
  max-width: 30rem;
  margin: 3rem auto 2rem;
  text-align: center;
}

.notfound-icon {
  width: 130px;
  height: auto;
  margin-bottom: 0.5rem;
}

.notfound .pub-badge {
  margin: 0.3em 0.35em 0 0;
}