/* ==========================================================================
   Additions for the research site revamp.
   Loaded after styles.css - never modifies the original theme.
   ========================================================================== */

:root {
  --site-brand: #bd5d38;
  --site-ink: #2f3437;
  --site-muted: #6c757d;
  --site-line: #e6e3de;
  --site-surface: #faf9f7;
  --site-radius: 12px;

  /* research theme colours, carried over from the original palette */
  --t-hydro: 111, 174, 224;
  --t-ground: 43, 79, 125;
  --t-transport: 156, 49, 41;
  --t-multiphase: 192, 107, 94;
  --t-hpc: 104, 138, 76;
}

/* ---------- filter bar ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.filter-chip {
  border: 1px solid var(--site-line);
  background: #fff;
  color: var(--site-muted);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.filter-chip:hover {
  border-color: var(--site-brand);
  color: var(--site-brand);
}

.filter-chip[aria-pressed="true"] {
  background: var(--site-brand);
  border-color: var(--site-brand);
  color: #fff;
}

.filter-count {
  color: var(--site-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ---------- publication list ---------- */

.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pub-item {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.75rem;
  padding: 1rem 0.25rem;
  border-bottom: 1px solid var(--site-line);
}

.pub-num {
  color: var(--site-muted);
  font-weight: 800;
  font-size: 0.9rem;
  padding-top: 0.15rem;
}

.pub-body {
  min-width: 0;
}

.pub-authors,
.pub-title,
.pub-venue {
  margin: 0;
  line-height: 1.55;
}

.pub-authors {
  font-size: 0.92rem;
  color: var(--site-muted);
}

.pub-authors .me {
  color: var(--site-ink);
  font-weight: 800;
}

/* corresponding-author asterisk; .me highlights Zhi Li in an author list */
.me {
  color: var(--site-ink);
  font-weight: 800;
}

.corr-mark {
  font-weight: 800;
  color: var(--site-brand);
  margin-left: 0.05em;
}

.pub-title {
  color: var(--site-ink);
  font-weight: 500;
}

.pub-venue {
  font-size: 0.92rem;
  color: var(--site-muted);
  font-style: italic;
}

.pub-lang {
  font-weight: 400;
  font-size: 0.86em;
  color: var(--site-muted);
  white-space: nowrap;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.pub-links a {
  color: var(--site-brand);
  text-decoration: none;
  word-break: break-all;
}

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

/* linkable (first author / corresponding) entries */

.pub-item--detail {
  cursor: pointer;
  border-radius: var(--site-radius);
  transition: background 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.pub-item--detail:hover,
.pub-item--detail:focus-visible {
  background: var(--site-surface);
  transform: translateX(3px);
  outline: none;
}

.pub-item--detail:focus-visible {
  box-shadow: 0 0 0 2px rgba(189, 93, 56, 0.35);
}

.pub-item--detail .pub-title {
  color: var(--site-ink);
}

.pub-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--site-brand);
  letter-spacing: 0.01em;
}

.pub-more::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.pub-item--detail:hover .pub-more::after {
  transform: rotate(-45deg) translate(2px, 2px);
}

.pub-thumb {
  width: 132px;
  border: 1px solid var(--site-line);
  border-radius: 8px;
  overflow: hidden;
  align-self: start;
  background: #fff;
}

.pub-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.pub-item--has-thumb {
  grid-template-columns: 2.6rem 1fr 132px;
}

/* ---------- role + tag pills ---------- */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  line-height: 1.5;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pill--first,
.pill--corresponding {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.pill--first {
  color: #fff;
  background: var(--site-brand);
}

.pill--corresponding {
  color: #fff;
  background: var(--site-brand);
}

.pill--hydro {
  color: rgb(var(--t-hydro));
  background: rgba(var(--t-hydro), 0.14);
  border-color: rgba(var(--t-hydro), 0.34);
}

.pill--ground {
  color: rgb(var(--t-ground));
  background: rgba(var(--t-ground), 0.1);
  border-color: rgba(var(--t-ground), 0.28);
}

.pill--transport {
  color: rgb(var(--t-transport));
  background: rgba(var(--t-transport), 0.1);
  border-color: rgba(var(--t-transport), 0.28);
}

.pill--multiphase {
  color: rgb(var(--t-multiphase));
  background: rgba(var(--t-multiphase), 0.14);
  border-color: rgba(var(--t-multiphase), 0.34);
}

.pill--hpc {
  color: rgb(var(--t-hpc));
  background: rgba(var(--t-hpc), 0.14);
  border-color: rgba(var(--t-hpc), 0.34);
}

/* ---------- team ---------- */

.team-group-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--site-ink);
  margin: 2rem 0 1rem;
  letter-spacing: 0.02em;
}

.team-group-title:first-of-type {
  margin-top: 0;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.85rem;
}

.member-card {
  text-align: left;
  width: 100%;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  background: #fff;
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.member-card:hover,
.member-card:focus-visible {
  border-color: rgba(189, 93, 56, 0.45);
  box-shadow: 0 6px 18px rgba(47, 52, 55, 0.07);
  transform: translateY(-2px);
  outline: none;
}

.member-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(189, 93, 56, 0.35);
}

.member-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--site-ink);
  margin: 0 0 0.15rem;
}

.member-meta {
  font-size: 0.85rem;
  color: var(--site-muted);
  margin: 0;
}

.member-years {
  font-size: 0.85rem;
  color: var(--site-brand);
  margin: 0.35rem 0 0;
}

.member-topic {
  font-size: 0.85rem;
  color: var(--site-muted);
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

/* ---------- detail panel ---------- */

.detail-modal .modal-content {
  border: none;
  border-radius: 16px;
  overflow: hidden;
}

.detail-modal .modal-header {
  border-bottom: 1px solid var(--site-line);
  padding: 1.1rem 1.5rem;
}

.detail-modal .modal-body {
  padding: 1.5rem;
}

.detail-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--site-brand);
  font-weight: 800;
  margin: 0 0 0.4rem;
}

/* the theme forces uppercase on every heading - undo it for names and titles */
.detail-title {
  text-transform: none;
  letter-spacing: -0.005em;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--site-ink);
  line-height: 1.4;
  margin: 0 0 0.6rem;
}

.modal-title,
.detail-modal .h6 {
  text-transform: uppercase;
}

.detail-authors {
  font-size: 0.95rem;
  color: var(--site-muted);
  line-height: 1.6;
  margin: 0 0 0.3rem;
}

.detail-authors .me {
  color: var(--site-ink);
  font-weight: 800;
}

.detail-venue {
  font-size: 0.92rem;
  color: var(--site-muted);
  font-style: italic;
  margin: 0;
}

.detail-figure {
  margin: 1.5rem 0;
}

.detail-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--site-line);
  border-radius: 8px;
  background: #fff;
  display: block;
}

.detail-caption {
  font-size: 0.82rem;
  color: var(--site-muted);
  line-height: 1.6;
  margin: 0.6rem 0 0;
}

.detail-section-title {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--site-muted);
  font-weight: 800;
  margin: 1.5rem 0 0.5rem;
}

.detail-abstract {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--site-ink);
  margin: 0;
}

.detail-abstract--missing {
  color: var(--site-muted);
  font-style: italic;
}

/* publication list inside a member panel */

.detail-pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-pub-link {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.15rem 0.5rem;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 0.6rem 0.5rem;
  cursor: pointer;
  transition: background 0.18s ease;
}

.detail-pub-link:hover,
.detail-pub-link:focus-visible {
  background: var(--site-surface);
  outline: none;
}

.detail-pub-num {
  grid-row: 1 / span 2;
  color: var(--site-muted);
  font-weight: 800;
  font-size: 0.85rem;
  padding-top: 0.1rem;
}

.detail-pub-title {
  color: var(--site-ink);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
}

.detail-pub-venue {
  color: var(--site-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.detail-rel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rel-chip {
  border: 1px solid var(--site-line);
  background: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--site-ink);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.rel-chip:hover {
  border-color: var(--site-brand);
  color: var(--site-brand);
}

/* ---------- empty / placeholder ---------- */

.site-empty {
  color: var(--site-muted);
  font-size: 0.92rem;
  font-style: italic;
}

/* ---------- small screens ---------- */

@media (max-width: 767.98px) {
  .pub-item--has-thumb {
    grid-template-columns: 2.2rem 1fr;
  }

  .pub-thumb {
    grid-column: 2;
    width: 100%;
    max-width: 260px;
  }

  .detail-modal .modal-body,
  .detail-modal .modal-header {
    padding: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pub-item--detail,
  .member-card,
  .filter-chip {
    transition: none;
  }
}

/* ---------------- CV block (About: appointments + education) ---------------- */

.cv-heading {
  margin: 1.6rem 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--site-ink);
  padding-bottom: 0.45rem;
  border-bottom: 2px solid rgba(189, 93, 56, 0.25);
}

.cv-row {
  display: flex;
  flex-direction: column;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(44, 56, 74, 0.09);
}

.cv-row:last-child {
  border-bottom: 0;
}

.cv-row-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--site-ink);
  line-height: 1.35;
}

.cv-row-sub {
  margin: 0.15rem 0 0;
  font-size: 0.94rem;
  color: var(--site-muted);
}

.cv-row-side {
  margin-top: 0.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--site-brand);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .cv-row {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
  }

  .cv-row-side {
    margin-top: 0;
    flex-shrink: 0;
  }
}

/* ------------------------------------------------------------------
   Responsive figures
   The Start Bootstrap theme wrapped every content figure in
   <span class="d-none d-lg-block">, which hides them entirely below the
   lg breakpoint (992px) -- i.e. in narrow windows and preview panes.
   .fig-wrap replaces that wrapper so figures are always visible.
   ------------------------------------------------------------------ */
.fig-wrap {
  max-width: 100%;
  margin: 1.25rem 0;
}

.fig-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 992px) {
  .fig-wrap {
    max-width: 80%;
  }
}

/* Small round avatar shown in the collapsed navbar on narrow screens,
   so the portrait is visible there too instead of only "Zhi Li". */
.img-profile-sm {
  width: 38px;
  height: 38px;
  object-fit: cover;
  flex-shrink: 0;
}
