/* Shared layout rules. Colors come from --sb-* variables set in light.scss / dark.scss */

h1, h2, h3, .navbar-brand { font-family: "Fraunces", Georgia, serif; letter-spacing: -0.01em; }
.navbar-brand { font-weight: 800; }
.navbar { border-bottom: 3px solid var(--sb-warm); }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- Page header band (non-home pages) ---------- */
.quarto-title-block .quarto-title h1.title {
  font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800;
}
.quarto-title-block .quarto-title h1.title::after {
  content: ""; display: block; width: 64px; height: 5px; margin-top: .6rem;
  background: var(--sb-warm); border-radius: 3px;
}
.quarto-title-block .description { color: var(--sb-muted); font-size: 1.1rem; }

/* ---------- Hero (home) ---------- */
main.content:has(.hero) { margin-top: 0 !important; padding-top: 0 !important; }
main.content:has(.hero) #title-block-header { display: none; }
.hero {
  position: relative; overflow: hidden; color: #f3f7f8;
  background:
    linear-gradient(90deg, rgba(6, 30, 38, .82) 0%, rgba(6, 30, 38, .55) 55%, rgba(6, 30, 38, .30) 100%),
    url("../images/hero-bay.jpg") center 45% / cover no-repeat,
    var(--sb-hero-a);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
  margin-top: 0; margin-bottom: 3rem;
}
.hero-credit {
  position: absolute; right: 1rem; bottom: .6rem; margin: 0;
  font-size: .72rem; color: rgba(255,255,255,.6);
}
.hero-credit a { color: rgba(255,255,255,.8); }
.hero-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 1.25rem;
  display: grid; grid-template-columns: 220px 1fr; gap: 3rem; align-items: center;
}
.hero-photo {
  width: 220px; height: 220px; border-radius: 50%; object-fit: cover;
  border: 5px solid rgba(255,255,255,.9); box-shadow: 0 12px 40px rgba(0,0,0,.35);
  background: #d9622b; display: grid; place-items: center;
  font: 800 4.5rem/1 "Fraunces", serif; color: #fff;
}
.hero .hero-name { font-family: "Fraunces", Georgia, serif; letter-spacing: -0.02em; color: #fff; font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 800; margin: 0 0 .4rem; line-height: 1.05; }
.hero .role { font-size: 1.2rem; color: #cfe3e5; margin-bottom: 1.2rem; }
.hero .role strong { color: #f4a261; font-weight: 600; }
.hero .tagline { font-size: 1.15rem; max-width: 38rem; color: #e8f1f2; }
.hero-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.hero-links a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1rem;
  border-radius: 999px; font-weight: 500; text-decoration: none; font-size: .95rem;
  color: #fff; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06);
  transition: background .15s, transform .15s;
}
.hero-links a:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.hero-links a.primary { background: #f4a261; border-color: #f4a261; color: #1b1b1b; }
.hero-links a.primary:hover { background: #f7b77f; }

/* Home body */
.home-body { max-width: 860px; box-sizing: content-box; margin: 0 auto; padding: 0 1.25rem 2rem; }
.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; }
.section-label {
  font: 600 .78rem/1 "IBM Plex Sans", sans-serif; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sb-warm); margin: 0 0 .9rem;
}
.home-body h2 { font-size: 1.7rem; margin-top: 0; }
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 5.2rem 1fr; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--sb-rule); }
.news li:first-child { border-top: 0; }
.news .date { font-family: "IBM Plex Mono", monospace; font-size: .82rem; color: var(--sb-muted); padding-top: .15rem; }
.fact-card {
  background: var(--sb-card); border: 1px solid var(--sb-rule); border-left: 5px solid var(--sb-teal);
  border-radius: 10px; padding: 1.2rem 1.4rem; margin-bottom: 1.2rem;
}
.fact-card p { margin: 0; }
.fact-card .k { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--sb-muted); }

/* ---------- Research themes ---------- */
.themes { display: grid; gap: 1.4rem; margin: 2rem 0; }
.theme {
  overflow: hidden; display: grid; grid-template-columns: 3.2rem 1fr; gap: 1.2rem;
  background: var(--sb-card); border: 1px solid var(--sb-rule); border-radius: 14px; padding: 1.5rem 1.6rem;
  transition: box-shadow .2s, transform .2s;
}
.theme:hover { box-shadow: 0 10px 30px rgba(11,58,74,.12); transform: translateY(-2px); }
.theme.has-photo { grid-template-columns: 3.2rem 1fr 250px; }
.theme-photo { margin: -1.5rem -1.6rem -1.5rem -280px; position: relative; z-index: 0; min-height: 280px; }
.theme.has-photo > div { position: relative; z-index: 1; text-shadow: 0 0 2px var(--sb-card), 0 0 10px var(--sb-card); }  /* text sits above the faded image */
.theme-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  /* fade the image into the card on its left edge */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.12) 30%, rgba(0,0,0,.35) 48%, rgba(0,0,0,.75) 64%, #000 78%);
          mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.12) 30%, rgba(0,0,0,.35) 48%, rgba(0,0,0,.75) 64%, #000 78%);
  transform: translateX(var(--shift, 0%));  /* per-image nudge; set --shift on the <figure> */ object-position: 50% 30%;
  border-radius: 0 13px 13px 0; display: block;
}
.theme .num {
  font: 800 2.2rem/1 "Fraunces", serif; color: var(--sb-warm);
}
.theme h3 { margin: 0 0 .4rem; font-size: 1.35rem; }
.theme p { margin: 0 0 .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { background: var(--sb-chip); color: var(--sb-teal); border-radius: 999px; padding: .15rem .7rem; font-size: .82rem; font-weight: 500; }

/* ---------- Funding logos ---------- */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; margin: 1.2rem 0 2rem; }
.logo-tile {
  display: grid; place-items: center; height: 110px; padding: 1rem 1.2rem;
  background: #fff; border: 1px solid var(--sb-rule); border-radius: 12px;  /* white in both themes so dark logos stay legible */
}
.logo-tile img { width: auto; height: auto; max-width: 100%; max-height: 76px; object-fit: contain; }

/* ---------- Publications ---------- */
.pub-stats { display: flex; gap: 2.5rem; margin: .5rem 0 2.5rem; padding: 1.2rem 0; border-top: 1px solid var(--sb-rule); border-bottom: 1px solid var(--sb-rule); }
.pub-stats div { display: flex; flex-direction: column; }
.pub-stats .n { font: 800 2.4rem/1 "Fraunces", serif; color: var(--sb-teal); }
.pub-stats .l { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--sb-muted); margin-top: .3rem; }

.pub-year:first-of-type { margin-top: 1rem; }
.pub-year { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.pub-year-label {
  font: 800 1.6rem/1 "Fraunces", serif; color: var(--sb-warm);
  position: sticky; top: 5rem; align-self: start; margin: .3rem 0 0; border: 0; padding: 0;
}
.pub { padding: 0 0 1.4rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--sb-rule); }
.pub-year:last-child .pub:last-child { border-bottom: 0; }
.pub-title { font-weight: 600; font-size: 1.08rem; line-height: 1.4; margin-bottom: .3rem; }
.pub-title a { color: inherit; text-decoration: none; background-image: linear-gradient(var(--sb-teal), var(--sb-teal)); background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .25s; }
.pub-title a:hover { background-size: 100% 2px; color: var(--sb-teal); }
.pub-badge { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-left: .5rem; padding: .1rem .5rem; border-radius: 4px; background: var(--sb-warm); color: #fff; vertical-align: .15em; }
.pub-authors { color: var(--sb-muted); font-size: .95rem; }
.pub-authors .me { color: var(--bs-body-color); font-weight: 600; border-bottom: 2px solid var(--sb-warm); }
.pub-authors .more { font-style: italic; }
.pub-venue { font-size: .95rem; margin-top: .1rem; }
.pub-note { font-size: .88rem; color: var(--sb-warm); margin-top: .2rem; }
.pub-links { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; align-items: flex-start; }
.pub-btn, .pub-cite summary {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 500;
  padding: .2rem .65rem; border-radius: 6px; border: 1px solid var(--sb-rule);
  color: var(--sb-teal); text-decoration: none; cursor: pointer; background: var(--sb-card);
  transition: border-color .15s, background .15s;
}
.pub-btn:hover, .pub-cite summary:hover { border-color: var(--sb-teal); background: var(--sb-chip); }
.pub-cite[open] { flex-basis: 100%; }
.pub-cite summary { list-style: none; width: fit-content; }
.pub-cite summary::-webkit-details-marker { display: none; }
.pub-cite pre { margin-top: .6rem; font-size: .78rem; }
.pub-cite pre code { white-space: pre-wrap; word-break: break-word; }
.pub-cite[open] { order: 99; }
.pub-compact { padding-bottom: 1rem; margin-bottom: 1rem; }
.pub-compact .pub-title { font-size: 1rem; }

/* ---------- CV ---------- */
.cv-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.cv-actions a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.1rem; border-radius: 8px;
  text-decoration: none; font-weight: 500; border: 1px solid var(--sb-teal); color: var(--sb-teal);
}
.cv-actions a.primary { background: var(--sb-teal); color: #fff; }
.cv-frame { width: 100%; height: 85vh; min-height: 600px; border: 1px solid var(--sb-rule); border-radius: 10px; background: #fff; }

/* ---------- Footer ---------- */
.nav-footer { border-top: 1px solid var(--sb-rule); font-size: .88rem; }

/* ---------- Small screens ---------- */
@media (max-width: 800px) {
  .hero { padding-bottom: 4.5rem; }
  .hero-credit { left: 1.25rem; right: 1.25rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; text-align: left; }
  .hero-photo { width: 140px; height: 140px; font-size: 3rem; }
  .home-grid { grid-template-columns: 1fr; gap: 2rem; }
  .pub-year { grid-template-columns: 1fr; gap: .5rem; }
  .pub-year-label { position: static; }
  .pub-stats { gap: 1.5rem; }
  .theme { grid-template-columns: 1fr; gap: .4rem; }
  .theme.has-photo { grid-template-columns: 1fr; }
  .theme-photo { margin: .8rem -1.6rem -1.5rem; }
  .theme-photo { min-height: 0; }
  .theme-photo img { transform: none; }
  .theme-photo img { position: static; height: 320px; border-radius: 0 0 13px 13px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
            mask-image: linear-gradient(to bottom, transparent 0%, #000 35%); }
  }
