/* ============================================================
   Wencui (Wen) Han — personal academic site
   Palette: Stony Brook University — Stony Brook Red (#990000) + black
   ============================================================ */

:root {
  /* --- Stony Brook University brand palette --- */
  /* Primary: Stony Brook Red #990000 + Stony Brook Black */
  --sbu-red:       #990000;   /* primary red — links, buttons, badges */
  --sbu-red-2:     #990000;   /* accent rules, eyebrows, card top borders */
  --sbu-red-light: #C1272D;   /* hover state */
  --sbu-red-dark:  #6E0000;   /* pressed / deep accent */
  --sbu-black:     #1A1A1A;   /* headings, footer — softened from pure black */

  /* Neutrals */
  --paper:         #FBFAFA;
  --paper-alt:     #F3F1F1;
  --paper-dim:     #E8E4E4;
  --border-strong: #D4CDCD;

  --ink:      #1F1D1D;
  --ink-soft: #454141;
  --ink-mute: #736D6D;

  --rule:     #E3DEDE;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --maxw: 1080px;
  --gutter: 2rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--sbu-red); text-decoration: none; }
a:hover { color: var(--sbu-red-light); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--sbu-black);
  line-height: 1.22;
  margin: 0 0 .6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.15rem); }
h2 { font-size: clamp(1.5rem, 2.7vw, 1.95rem); }
h3 { font-size: 1.16rem; }

p { margin: 0 0 1.15rem; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.narrow { max-width: 760px; }

/* ---------- Skip link (accessibility) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--sbu-black);
  color: #fff;
  padding: .7rem 1.2rem;
  z-index: 100;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ============================================================
   Header / navigation
   ============================================================ */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(251, 250, 250, 0.93);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.05rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--sbu-black);
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.brand:hover { color: var(--sbu-black); text-decoration: none; }
.brand span { color: var(--ink-mute); font-weight: 400; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: .45rem .6rem;
  cursor: pointer;
  color: var(--sbu-black);
  font-size: 1.1rem;
  line-height: 1;
}

nav.main-nav ul {
  display: flex;
  gap: 1.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  font-size: 0.935rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.005em;
  padding: .35rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .16s ease, border-color .16s ease;
}

nav.main-nav a:hover {
  color: var(--sbu-red);
  text-decoration: none;
  border-bottom-color: var(--border-strong);
}

nav.main-nav a[aria-current="page"] {
  color: var(--sbu-black);
  border-bottom-color: var(--sbu-red-2);
}

/* ============================================================
   Hero (home)
   ============================================================ */

.hero {
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: clamp(2rem, 5vw, 4.2rem);
  align-items: start;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--sbu-red-2);
  margin-bottom: 1rem;
}

.hero h1 { margin-bottom: .45rem; }

.hero .role {
  font-family: var(--serif);
  font-size: 1.16rem;
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
  line-height: 1.5;
}
.hero .role strong { color: var(--sbu-black); font-weight: 600; }

.lede {
  font-size: 1.09rem;
  color: var(--ink-soft);
  max-width: 60ch;
}
.lede strong { color: var(--ink); font-weight: 600; }

.portrait {
  border-radius: 4px;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(26,26,26,.06), 0 12px 32px -12px rgba(153,0,0,.20);
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 18%;
}

.portrait-caption {
  font-size: .8rem;
  color: var(--ink-mute);
  margin-top: .85rem;
  line-height: 1.5;
}

/* ---------- Buttons / link row ---------- */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.9rem;
}

.btn {
  display: inline-block;
  font-size: .9rem;
  font-weight: 500;
  padding: .62rem 1.25rem;
  border-radius: 3px;
  border: 1px solid var(--sbu-red);
  color: var(--sbu-red);
  background: transparent;
  transition: background .16s ease, color .16s ease;
}
.btn:hover { background: var(--sbu-red); color: #fff; text-decoration: none; }

.btn-primary { background: var(--sbu-red); color: #fff; }
.btn-primary:hover { background: var(--sbu-black); border-color: var(--sbu-black); color: #fff; }

/* ============================================================
   Sections
   ============================================================ */

section.block {
  padding: clamp(3rem, 6vw, 4.6rem) 0;
  border-bottom: 1px solid var(--rule);
}
section.block:last-of-type { border-bottom: none; }

.section-head { margin-bottom: 2.4rem; max-width: 68ch; }
.section-head p { color: var(--ink-soft); margin-bottom: 0; }

/* ---------- Research theme cards ---------- */

.themes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 1.35rem;
}

.theme {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.7rem 1.6rem 1.5rem;
  border-top: 3px solid var(--sbu-red-2);
  transition: box-shadow .18s ease, transform .18s ease;
}
.theme:hover {
  box-shadow: 0 10px 28px -14px rgba(153,0,0,.20);
  transform: translateY(-2px);
}

.theme h3 { margin-bottom: .55rem; font-size: 1.1rem; }
.theme p { font-size: .945rem; color: var(--ink-soft); margin-bottom: .9rem; }

.theme .tags {
  font-size: .78rem;
  color: var(--ink-mute);
  letter-spacing: .02em;
  border-top: 1px solid var(--paper-dim);
  padding-top: .8rem;
  margin: 0;
}

/* ============================================================
   Publications
   ============================================================ */

.pub-group { margin-bottom: 3.2rem; }
.pub-group:last-child { margin-bottom: 0; }

.pub-group > h2 {
  font-size: 1.32rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--sbu-red-2);
  margin-bottom: 1.6rem;
}

.pub-group > h2 .count {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: .04em;
  margin-left: .55rem;
}

ol.pubs, ul.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pub;
}

ol.pubs li, ul.pubs li {
  position: relative;
  padding: 1.15rem 0 1.15rem 3.1rem;
  border-bottom: 1px solid var(--rule);
}
ol.pubs li:last-child, ul.pubs li:last-child { border-bottom: none; }

ol.pubs li::before {
  counter-increment: pub;
  content: counter(pub);
  position: absolute;
  left: 0;
  top: 1.25rem;
  font-family: var(--serif);
  font-size: .88rem;
  color: var(--ink-mute);
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-title {
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--sbu-black);
  display: block;
  margin-bottom: .3rem;
  line-height: 1.4;
}

.pub-meta { font-size: .93rem; color: var(--ink-soft); margin: 0; }
.pub-meta em { color: var(--ink); font-style: italic; }

.pub-authors { font-size: .93rem; color: var(--ink-soft); margin: 0 0 .18rem; }
.pub-authors .me { color: inherit; font-weight: 400; }

.venue {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sbu-red);
  background: var(--paper-alt);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: .18rem .5rem;
  margin-top: .5rem;
}
.venue.premier { color: #fff; background: var(--sbu-red); border-color: var(--sbu-red); }
.venue.status  { color: var(--ink-soft); background: transparent; border-style: dashed; }

.note {
  font-size: .87rem;
  color: var(--ink-mute);
  background: var(--paper-alt);
  border-left: 3px solid var(--border-strong);
  padding: .85rem 1.1rem;
  margin-bottom: 1.8rem;
  border-radius: 0 3px 3px 0;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- Selected publications (home) ---------- */

.selected li { padding-left: 0; }
.selected li::before { display: none; }

/* ============================================================
   Teaching / CV — timeline + tables
   ============================================================ */

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

.course-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.course-list li:last-child { border-bottom: none; }

.course-name {
  font-family: var(--serif);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--sbu-black);
}
.course-level { display: block; font-family: var(--sans); font-size: .875rem; font-weight: 400; color: var(--ink-soft); margin-top: .12rem; }

.course-years {
  font-size: .85rem;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--sbu-red);
  background: var(--paper-alt);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: .14rem .45rem;
  margin-left: .5rem;
  vertical-align: middle;
}

.cv-entry {
  display: grid;
  grid-template-columns: 152px 1fr;
  gap: 1.6rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}
.cv-entry:last-child { border-bottom: none; }

.cv-date {
  font-size: .875rem;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  padding-top: .12rem;
}

.cv-body h3 { margin-bottom: .22rem; font-size: 1.05rem; }
.cv-body p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li {
  padding: .72rem 0 .72rem 1.35rem;
  position: relative;
  border-bottom: 1px solid var(--rule);
  font-size: .96rem;
  color: var(--ink-soft);
}
ul.plain li:last-child { border-bottom: none; }
ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.32rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sbu-red-light);
}
ul.plain li strong { color: var(--ink); font-weight: 600; }

/* ---------- Stat strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  margin: 2.4rem 0 0;
}

.stat { background: #fff; padding: 1.5rem 1.3rem; }
.stat .num {
  font-family: var(--serif);
  font-size: 2.05rem;
  font-weight: 600;
  color: var(--sbu-red);
  line-height: 1;
  display: block;
  margin-bottom: .42rem;
}
.stat .label {
  font-size: .8rem;
  color: var(--ink-mute);
  letter-spacing: .02em;
  line-height: 1.45;
  display: block;
}

/* ============================================================
   Contact
   ============================================================ */

.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2rem 1.9rem;
  border-top: 3px solid var(--sbu-red-2);
}

dl.contact-dl { margin: 0; }
dl.contact-dl dt {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sbu-red-2);
  margin-bottom: .3rem;
}
dl.contact-dl dd {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.55;
}
dl.contact-dl dd:last-child { margin-bottom: 0; }

.profile-links { list-style: none; margin: 0; padding: 0; }
.profile-links li { border-bottom: 1px solid var(--rule); }
.profile-links li:last-child { border-bottom: none; }
.profile-links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 0;
  font-size: .97rem;
}
.profile-links a:hover { text-decoration: none; }
.profile-links a:hover .link-name { text-decoration: underline; text-underline-offset: 3px; }
.link-name { font-weight: 500; }
.link-arrow { color: var(--ink-mute); font-size: .85rem; }

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  background: var(--sbu-black);
  border-top: 4px solid var(--sbu-red);
  color: var(--paper-dim);
  padding: 3rem 0 2.4rem;
  margin-top: 0;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer .fname {
  font-family: var(--serif);
  font-size: 1.14rem;
  color: #fff;
  margin-bottom: .35rem;
}
.site-footer p { font-size: .88rem; margin: 0 0 .3rem; color: rgba(255,255,255,.76); }
.site-footer a { color: var(--paper-dim); }
.site-footer a:hover { color: #fff; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-nav a { font-size: .88rem; }

.copyright {
  max-width: var(--maxw);
  margin: 2.2rem auto 0;
  padding: 1.5rem var(--gutter) 0;
  border-top: 1px solid rgba(255,255,255,.18);
  font-size: .8rem;
  color: rgba(255,255,255,.55);
}

/* ============================================================
   Page header (interior pages)
   ============================================================ */

.page-head {
  padding: clamp(2.6rem, 5vw, 4rem) 0 clamp(2rem, 3.5vw, 2.8rem);
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--paper-alt) 0%, var(--paper) 100%);
}
.page-head h1 { margin-bottom: .5rem; }
.page-head p { color: var(--ink-soft); max-width: 64ch; margin-bottom: 0; font-size: 1.04rem; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 260px; }
  .hero-grid .portrait-wrap { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
  .cv-entry { grid-template-columns: 1fr; gap: .35rem; }
}

@media (max-width: 720px) {
  :root { --gutter: 1.35rem; }
  body { font-size: 16px; }

  .nav-toggle { display: block; }

  nav.main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 12px 24px -14px rgba(26,26,26,.28);
    display: none;
  }
  nav.main-nav.open { display: block; }
  nav.main-nav ul { flex-direction: column; gap: 0; padding: .4rem 0; }
  nav.main-nav li { border-bottom: 1px solid var(--paper-dim); }
  nav.main-nav li:last-child { border-bottom: none; }
  nav.main-nav a {
    display: block;
    padding: .85rem var(--gutter);
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  nav.main-nav a[aria-current="page"] { border-left-color: var(--sbu-red-2); border-bottom-color: transparent; }
  nav.main-nav a:hover { border-bottom-color: transparent; }

  .site-header { position: relative; }
  .header-inner { position: relative; }

  ol.pubs li { padding-left: 2.6rem; }
  ol.pubs li::before { width: 1.75rem; height: 1.75rem; font-size: .8rem; }

  .course-list li { grid-template-columns: 1fr; gap: .3rem; }
}

@media print {
  .site-header, .site-footer, .btn-row, .nav-toggle { display: none; }
  body { background: #fff; font-size: 11pt; }
  .theme, .contact-card { break-inside: avoid; }
}

/* ============================================================
   Campus imagery — Stony Brook aerial
   ============================================================ */

/* --- Full-width banner band (homepage) --- */

.campus-band {
  position: relative;
  min-height: clamp(300px, 38vw, 460px);
  display: flex;
  align-items: flex-end;
  background-image: url("campus.jpg");
  background-size: cover;
  background-position: center 42%;
  border-top: 1px solid var(--rule);
  border-bottom: 4px solid var(--sbu-red);
  overflow: hidden;
}

/* Scrim: dark at the bottom so the text stays legible over the plaza */
.campus-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      105deg,
      rgba(10, 8, 8, .82) 0%,
      rgba(10, 8, 8, .58) 38%,
      rgba(10, 8, 8, .10) 72%,
      rgba(10, 8, 8, 0) 100%
    ),
    linear-gradient(
      to top,
      rgba(10, 8, 8, .80) 0%,
      rgba(10, 8, 8, .42) 30%,
      rgba(10, 8, 8, .06) 62%,
      rgba(10, 8, 8, 0) 85%
    );
}

.campus-band .wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-top: 3rem;
  padding-bottom: 2.4rem;
}

.campus-band .eyebrow {
  color: #fff;
  opacity: .82;
  margin-bottom: .7rem;
}

.campus-band h2 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  max-width: 22ch;
  margin-bottom: .7rem;
  text-shadow: 0 1px 24px rgba(0,0,0,.45);
}

.campus-band p {
  color: rgba(255,255,255,.9);
  max-width: 58ch;
  font-size: 1.02rem;
  margin-bottom: 0;
  text-shadow: 0 1px 16px rgba(0,0,0,.5);
}

.campus-band .campus-credit {
  position: absolute;
  right: var(--gutter);
  bottom: .7rem;
  z-index: 1;
  font-size: .68rem;
  letter-spacing: .04em;
  color: rgba(255,255,255,.5);
  margin: 0;
}

/* --- Interior page headers over the same photo --- */

.page-head.page-head--photo {
  position: relative;
  background-image: url("campus.jpg");
  background-size: cover;
  background-position: center 55%;
  border-bottom: 4px solid var(--sbu-red);
}

.page-head--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(12, 10, 10, .90) 0%,
    rgba(12, 10, 10, .78) 46%,
    rgba(12, 10, 10, .52) 100%
  );
}

.page-head--photo .wrap { position: relative; z-index: 1; }
.page-head--photo h1 { color: #fff; text-shadow: 0 1px 20px rgba(0,0,0,.4); }
.page-head--photo p  { color: rgba(255,255,255,.9); text-shadow: 0 1px 14px rgba(0,0,0,.45); }
.page-head--photo .btn { color: #fff; border-color: rgba(255,255,255,.75); }
.page-head--photo .btn:hover { background: #fff; color: var(--sbu-black); border-color: #fff; }
.page-head--photo .btn-primary { background: var(--sbu-red); border-color: var(--sbu-red); }
.page-head--photo .btn-primary:hover { background: #fff; color: var(--sbu-red); border-color: #fff; }

@media (max-width: 720px) {
  .campus-band { min-height: 320px; background-position: center 46%; }
  .campus-band .campus-credit { display: none; }
}

@media print {
  .campus-band { display: none; }
  .page-head--photo { background-image: none; }
  .page-head--photo h1, .page-head--photo p { color: var(--ink); text-shadow: none; }
}

/* ============================================================
   Embedded PDF (CV page)
   ============================================================ */

.pdf-frame {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--sbu-red);
  border-radius: 4px;
  background: var(--paper-alt);
  overflow: hidden;
  box-shadow: 0 10px 30px -18px rgba(26,26,26,.35);
}

.pdf-frame object,
.pdf-frame iframe {
  display: block;
  width: 100%;
  height: min(88vh, 1150px);
  border: 0;
}

.pdf-fallback {
  font-size: .9rem;
  color: var(--ink-mute);
  margin-top: 1.1rem;
  margin-bottom: 0;
}

@media (max-width: 720px) {
  /* inline PDF viewers are unusable on phones — point at the download instead */
  .pdf-frame object,
  .pdf-frame iframe { height: 60vh; }
}

@media print {
  .pdf-frame, .pdf-fallback { display: none; }
}

/* Course number, right-aligned in the course list */
.course-code {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--sbu-red);
  background: var(--paper-alt);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: .2rem .55rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .course-code { justify-self: start; }
}

/* Campus band with no overlaid text — show the photograph clean.
   The dark scrim exists only to keep white text legible; with no text it
   would just dim the picture for no reason. */
.campus-band--plain::before { content: none; }
.campus-band--plain { min-height: clamp(260px, 30vw, 400px); }

/* Bias the banner crop toward the top of the frame — sky and the tree canopy,
   with the buildings reduced to a strip along the bottom. */
.campus-band--plain { background-position: center 10%; }

@media (max-width: 720px) {
  .campus-band--plain { background-position: center 12%; }
}

/* Publications page: the section heading was removed as a duplicate of the
   page title, so the group carries the red rule itself. */
.pub-group { border-top: 2px solid var(--sbu-red); padding-top: .4rem; }

/* ============================================================
   Campus photo — one shared crop everywhere
   ------------------------------------------------------------
   Percentage background-position resolves against the container,
   so the same value shows a different slice at a different height.
   To make every page show the SAME part of the photo, the banner
   and the interior page headers share both the height and the
   position below.
   ============================================================ */

.campus-band--plain,
.page-head.page-head--photo {
  min-height: clamp(260px, 30vw, 400px);
  background-position: center 20%;
}

/* header text sits vertically centred now that the box has a fixed height */
.page-head.page-head--photo {
  display: flex;
  align-items: center;
}
.page-head.page-head--photo > .wrap { width: 100%; }

@media (max-width: 720px) {
  .campus-band--plain,
  .page-head.page-head--photo {
    min-height: 240px;
    background-position: center 20%;
  }
}

/* ============================================================
   Media mention link + lightbox
   ============================================================ */

.pub-media {
  display: inline-block;
  margin-top: .55rem;
  font-size: .84rem;
  font-weight: 500;
  color: var(--sbu-red);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: .28rem .65rem;
  background: var(--paper-alt);
}
.pub-media:hover { background: var(--sbu-red); color: #fff; text-decoration: none; border-color: var(--sbu-red); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 13, 13, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  cursor: zoom-out;
}
.lightbox img {
  max-width: min(92vw, 640px);
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 24px 70px -20px rgba(0,0,0,.7);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: .4rem;
}

/* the flex display above would otherwise defeat the hidden attribute */
.lightbox[hidden] { display: none; }

/* Row of media-mention chips under a publication */
.pub-media-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .55rem;
}
.pub-media-row .pub-media { margin-top: 0; }

/* Tall images (multi-page documents) scroll inside the lightbox */
.lightbox { overflow-y: auto; }
.lightbox img { max-height: none; margin: auto 0; }

/* Page popups (archived media copies) inside the lightbox */
.lightbox iframe {
  width: min(92vw, 720px);
  height: 88vh;
  border: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 24px 70px -20px rgba(0,0,0,.7);
}

/* Belt-and-braces: hidden lightbox children must never render */
.lightbox img[hidden], .lightbox iframe[hidden] { display: none; }
