/* Look of the old Google Site: full-width bands alternating white and dark
   slate, slate-blue Roboto headings, Open Sans body text.
   In a page, wrap content in <section class="band" markdown="1"> (white) or
   <section class="band dark" markdown="1"> (slate). */
:root {
  --text: #212121;
  --muted: #6a6a6a;
  --bg: #ffffff;
  --heading: #537391;
  --accent: #74a4cb;
  --link: #476581;
  --link-hover: #3072af;
  --dark-bg: #576c7e;
  --dark-text: #e8f4ff;
  --rule: #d5dde4;
  --width: 56rem;
}

html { scroll-padding-top: 5rem; } /* links to #anchors land below the header */

body {
  margin: 0;
  font: 12pt/1.56 "Open Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip; /* full-width bands include the scrollbar's width */
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }

/* Header: white bar that stays at the top while scrolling, like the old
   site's. Full width; the side padding lines its contents up with the text. */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1rem max(1rem, calc((100% - var(--width)) / 2 + 1rem));
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.site-title {
  font: 500 15pt Roboto, sans-serif;
  letter-spacing: 1.5px;
  color: var(--heading);
  text-decoration: none;
}
nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
nav a {
  font-family: Roboto, sans-serif;
  color: var(--heading);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
nav a:hover, nav a[aria-current="page"] {
  color: var(--heading);
  border-bottom-color: var(--accent);
}

/* Content column. Bands stretch to the full window width. */
main {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 1rem;
}
.band {
  margin: 0 calc(50% - 50vw);
  padding: 2.5rem calc(50vw - 50%);
}
.band.dark {
  background: var(--dark-bg);
  color: var(--dark-text);
}
.band.dark h1, .band.dark h2, .band.dark h3,
.band.dark a { color: var(--dark-text); }

h1, h2, h3 {
  font-family: Roboto, sans-serif;
  font-weight: 700;
  color: var(--heading);
}
h1 { font-size: 26pt; line-height: 1.3; margin: 0.5rem 0 1rem; }
h2 { font-size: 18pt; line-height: 1.4; margin: 2.5rem 0 1rem; }
/* Short accent bar above section headings, as on the old site. */
h2::before {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-bottom: 0.6rem;
  border-radius: 2px;
  background: var(--accent);
}
.collapsible-title::before { content: none; }
h3 { font-size: 13pt; line-height: 1.5; letter-spacing: 1px; margin: 1.75rem 0 0.25rem; }
h3 a { text-decoration: none; }
h3 a:hover { text-decoration: underline; }
.band > :first-child { margin-top: 0; }

img { max-width: 100%; height: auto; }

/* Home page: photo beside the bio, stacked on narrow screens. */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}
.hero img { flex: 1 1 18rem; border-radius: 4px; }
.hero > div { flex: 1 1 20rem; }

/* Collapsible blocks (_includes/collapsible.html), after the Google Site's:
   a round chevron button just left of the title, flipping when open. A line
   above and below makes each block (title + abstract) read as one unit. */
.collapsible {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.9rem 0;
}
.collapsible + .collapsible { border-top: 0; }
.collapsible summary {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}
.collapsible summary::-webkit-details-marker { display: none; }
.collapsible-head { display: block; padding-top: 0.35rem; }
.collapsible:not(:has(details)) .collapsible-head { padding-left: 3.25rem; }
.collapsible-title { margin: 0; }
.collapsible-meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
}
.collapsible-body { padding: 0.5rem 0 0 3.25rem; }
.collapsible-body > :first-child { margin-top: 0; }
.collapsible-body > :last-child { margin-bottom: 0.25rem; }
.chevron {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  fill: var(--heading);
  background: rgba(87, 108, 126, 0.08);
  transition: background 0.15s, transform 0.2s;
}
.collapsible summary:hover .chevron { background: rgba(87, 108, 126, 0.18); }
.collapsible summary:focus-visible { outline: none; }
.collapsible summary:focus-visible .chevron { outline: 2px solid var(--accent); }
.collapsible details[open] .chevron { transform: rotate(180deg); }
/* The big "About My Research" block: lines in the heading color. */
.collapsible.section { border-color: var(--heading); }
.collapsible.section .collapsible-head { padding-top: 0.1rem; }
/* On a dark band: light lines, chevron and text. */
.band.dark .collapsible { border-color: rgba(232, 244, 255, 0.35); }
.band.dark .collapsible-meta { color: rgba(232, 244, 255, 0.8); }
.band.dark .chevron { fill: var(--dark-text); background: rgba(255, 255, 255, 0.12); }
.band.dark .collapsible summary:hover .chevron { background: rgba(255, 255, 255, 0.22); }

/* Download link on the CV page, styled like the old site's buttons. */
.button {
  display: inline-block;
  padding: 0.4rem 1.25rem;
  border: 1px solid var(--dark-bg);
  border-radius: 4px;
  color: var(--dark-bg);
  text-decoration: none;
}
.button:hover {
  background: rgba(87, 108, 126, 0.1);
  color: var(--dark-bg);
}

/* Long URLs (e.g. in the CV) wrap instead of widening the page on phones. */
main { overflow-wrap: anywhere; }

/* YouTube embeds: full width, 16:9. */
.video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

footer {
  max-width: var(--width);
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
