/* Waleed Bin Khalid — shared site styles */
:root {
  --ink: #1a1a1a;
  --muted: #555;
  --rule: #dcdcdc;
  --accent: #7a1f2b;
  --bg: #ffffff;
  --todo: #fff4c2;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 "Computer Modern Serif", "Latin Modern Roman", "CMU Serif", "Times New Roman", Times, serif;
}
.page { max-width: 780px; margin: 0 auto; padding: 28px 20px 60px; }

/* Name + nav */
.masthead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px; padding-bottom: 10px; }
h1.name { margin: 0; font-size: 40px; font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; font-weight: 400; }
/* Placeholder links: styled like links, not clickable yet */
.nav a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Intro block */
.intro { display: grid; grid-template-columns: 200px 1fr; gap: 32px; padding: 24px 0; align-items: center; }
.intro img { width: 200px; height: 240px; object-fit: cover; display: block; background: #eee; border-radius: 6px; }
.degrees { font-size: 15px; line-height: 1.45; display: grid; grid-template-columns: 1fr; gap: 16px; }
.degrees p { margin: 0; padding-left: 10px; border-left: 2px solid var(--accent); }
.degrees b { font-weight: 700; display: block; }

/* Sections */
section { padding: 16px 0 6px; }
h2 { margin: 0 0 10px; font-size: 23px; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 14px; }
a.text-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }
a.text-link:hover { color: var(--accent); }
.todo { background: var(--todo); padding: 0 3px; font-weight: 400; }
.seeking { font-weight: 400; }

/* Affiliations */
.affils { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 16px; margin: 24px 0; padding: 20px 16px; background: #fafafa; border-radius: 8px; }
.affil { text-align: center; font-size: 13px; line-height: 1.35; }
.affil .logo { height: 52px; text-decoration: none; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.affil .logo img { max-height: 52px; max-width: 120px; object-fit: contain; }
.affil .logo.pair { gap: 8px; }
.affil .logo.pair img.blend { height: 46px; width: auto; flex-shrink: 0; mix-blend-mode: multiply; }
.affil .logo.pair img.wide { width: 80px; height: auto; flex-shrink: 0; }
.affil .years { color: var(--muted); }
.affil a.logo:hover img { opacity: .8; }

/* Lists */
ul.plain { margin: 0 0 14px; padding-left: 18px; }
ul.plain li { margin-bottom: 6px; }

/* Publications */
.pub { display: grid; grid-template-columns: 170px 1fr; gap: 18px; padding: 12px 0; align-items: start; }
.pub img { width: 170px; height: 115px; object-fit: cover; display: block; border: 1px solid #e3e3e3; }
.pub .title { font-weight: 700; margin: 0 0 2px; }
.pub .authors, .pub .venue { margin: 0 0 2px; font-size: 16px; }
.pub .venue { font-style: italic; }
.pub .links { font-size: 15px; margin-top: 4px; }
.pub .links a { color: var(--accent); margin-right: 12px; text-decoration: underline; text-underline-offset: 2px; }
.pub p.blurb { font-size: 16px; margin: 6px 0 0; }
.pub .status { display: inline-block; margin: 4px 0 0; padding: 0 6px; border: 1px solid var(--accent); border-radius: 3px; color: var(--accent); font-size: 13px; }
.thumb-placeholder { width: 170px; height: 115px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; border: 1px dashed var(--rule); background: #fafafa; color: var(--muted); font-size: 13px; font-style: italic; }

/* Projects */
.proj { margin: 0 0 12px; }
.proj .title { font-weight: 700; }
.proj .tags { color: var(--muted); font-size: 15px; font-style: italic; }

/* Teaching */
.row { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.row .when { color: var(--muted); white-space: nowrap; font-size: 16px; }

.more a { color: var(--accent); }
footer { padding-top: 18px; color: var(--muted); font-size: 14px; text-align: center; }

@media (max-width: 620px) {
  h1.name { font-size: 32px; }
  .intro { grid-template-columns: 1fr; }
  .intro img { width: 160px; height: 190px; }
  .degrees { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; }
  .pub img { width: 100%; height: 170px; }
  .thumb-placeholder { width: 100%; height: 120px; }
  .row { flex-direction: column; gap: 0; }
}

/* Projects page */
.page-intro { margin: 18px 0 6px; color: var(--muted); }
.page-intro a { color: var(--accent); }
.toc { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; font-size: 15px; }
.toc a { color: var(--accent); text-decoration: none; }
h2.group { margin: 26px 0 4px; }
.project { padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.project:last-of-type { border-bottom: 0; }
.project h3 { margin: 0 0 2px; font-size: 19px; font-weight: 700; line-height: 1.3; }
.project .tags { margin: 0 0 8px; color: var(--muted); font-size: 15px; font-style: italic; }
.project .status { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--accent); border-radius: 3px; color: var(--accent); font-size: 12px; font-style: normal; vertical-align: 2px; }
.project p { font-size: 16px; }
.media { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 10px 0 8px; }
.media.wide { grid-template-columns: 1fr; }
.media:has(> figure:only-child) { grid-template-columns: minmax(0, 540px); justify-content: center; }
.media figure { margin: 0; }
.media iframe, .media img { display: block; width: 100%; aspect-ratio: 16 / 10; border: 1px solid #e3e3e3; background: #f4f4f4; object-fit: cover; }
.media.square iframe { aspect-ratio: 1 / 1; }
.media.wide img { aspect-ratio: auto; object-fit: contain; }
.media img.contain { object-fit: contain; background: #fff; }
.media figcaption { margin-top: 4px; font-size: 14px; color: var(--muted); text-align: center; }
.links { font-size: 15px; }
.links a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; margin-right: 12px; }
.links a:hover { color: var(--ink); }
