/* Intelligent Sensing Laboratory, Simon Fraser University
   One stylesheet for every page. Plain CSS, system fonts only.
   Sections: 1 base, 2 header, 3 page layout, 4 homepage, 5 inner pages, 6 footer, 7 wider screens. */

/* ---------- 1. Base ---------- */
:root {
  --red: #a6192e;        /* SFU dark red: headings, accents */
  --text: #1f1f1f;
  --muted: #54585a;      /* SFU dark grey */
  --link: #0054a6;       /* the blue used on the old site */
  --band: #f4f2ee;       /* light background band */
  --line: #d9d6d0;
  --max: 64rem;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  /* Serif for reading; each platform has one of these */
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
}

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

a { color: var(--link); }
a:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--sans); line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 1rem; }
h2 {
  color: var(--red);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 2.5rem 0 1rem;
}
h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
h3 a { color: inherit; text-decoration-color: var(--red); }

figure { margin: 0; }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; line-height: 1.45; }

.lead { font-size: 1.25rem; }
.muted { color: var(--muted); }

.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 0.5rem 1rem; }
.skip-link:focus { left: 0.5rem; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Draft markers. Remove each one when the item is confirmed. */
.todo { background: #fff3b0; color: #1f1f1f; font-size: 0.9em; }

/* ---------- 2. Header and navigation ---------- */
.site-header { border-top: 6px solid var(--red); border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
}
.brand { display: flex; align-items: center; gap: 1rem; color: var(--text); text-decoration: none; }
.brand img { width: 140px; height: auto; }
.brand-text { display: flex; flex-direction: column; font-family: var(--sans); }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-affiliation { color: var(--muted); font-size: 0.85rem; }

/* SFU logo: shown unaltered, with clear space equal to its height (40 px) */
.sfu-logo { margin-left: auto; padding: 40px; }
.sfu-logo img { width: 170px; height: 40px; }

nav[aria-label="Main"] { flex-basis: 100%; }
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-family: var(--sans);
  font-size: 1rem;
}
.nav-list a { color: var(--text); text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.nav-list a:hover { border-bottom-color: var(--line); }
/* Current section: the body class of each page picks one menu item, so the NAV block stays identical */
.section-home .nav-home a, .section-research .nav-research a, .section-publications .nav-publications a,
.section-team .nav-team a, .section-news .nav-news a, .section-opportunities .nav-opportunities a,
.section-contact .nav-contact a { border-bottom-color: var(--red); }

/* ---------- 3. Page layout ---------- */
.intro, .themes, .highlights, .awards, .work-with-us, .page-body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}
.page-body > h2:first-of-type { margin-top: 2rem; }
.narrow { max-width: 46rem; }

/* Research pages: section menu beside the content */
.with-menu { max-width: var(--max); margin: 0 auto; }
.section-menu { padding: 1.5rem 1.25rem 0; font-family: var(--sans); font-size: 0.95rem; }
.section-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.section-menu a { color: var(--text); }
.section-menu a[aria-current="page"] { color: var(--red); font-weight: 600; text-decoration: none; }
.with-menu .page-body { padding-top: 1.5rem; }


/* ---------- 4. Homepage ---------- */
/* Heading on top; the photo floats right and the text wraps around it, starting level with the top of the photo */
.intro { display: flow-root; }
.intro-photo { margin: 0 0 1.5rem; }
/* Opening questions: one per line, larger italic type */
.intro-questions { list-style: none; margin: 0 0 1.25rem; padding: 0; font-size: 1.25rem; line-height: 1.5; font-style: italic; }
.intro-questions li { margin: 0 0 0.4rem; }
.intro-links { font-family: var(--sans); }
.intro-links a { margin-right: 1.5rem; font-weight: 600; }

.pi-photo { width: 150px; height: auto; }   /* 300 x 400 file shown at half size */

.theme { display: grid; gap: 1.25rem 2rem; align-items: start; margin-bottom: 2.5rem; }
.theme figure { max-width: 20rem; }

.highlights, .awards { border-top: 1px solid var(--line); }
.highlights h2, .awards h2, .themes h2, .work-with-us h2 { margin-top: 0; }
.highlight-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem 3rem; }
.highlight-list li { border-left: 3px solid var(--red); padding-left: 1rem; }
.highlight-list p { margin: 0 0 0.4rem; }
.source { font-size: 0.95rem; }

.award-grid { display: grid; gap: 1.5rem; }

.people { background: var(--band); padding: 2.5rem 1.25rem; }
.wide-photo { max-width: 46rem; margin: 0 auto; }
.people-text { max-width: 46rem; margin: 1.5rem auto 0; }

/* Group photo reel: a row that scrolls sideways (no JavaScript) */
.reel { max-width: 61.5rem;   /* --max minus page padding */ margin: 1.5rem auto 0; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
.reel:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.reel ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1rem; }
.reel li { flex: 0 0 auto; width: 18rem; scroll-snap-align: start; }
.reel img { display: block; width: 100%; height: 13.5rem; object-fit: cover; }
.reel-hint { max-width: 46rem; margin: 0.5rem auto 0; font-size: 0.9rem; color: var(--muted); }

.two-col { display: grid; gap: 2rem; }

/* ---------- 5. Inner pages ---------- */
/* Figures side by side: each figure's flex share is set from its image shape in the page (style attribute),
   so the images in a row have the same height. Rows wrap to one figure per row on narrow screens. */
.figure-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; max-width: 50rem; align-items: flex-start; }
.figure-row figure, .equipment-grid figure { min-width: 0; margin: 0; }
.figure-row img, .equipment-grid img { width: 100%; }
/* keeps a short last row from stretching to full width */
.equipment-grid::after { content: ""; flex: 2 1 0; }
.wide-figure { max-width: 46rem; margin: 1.5rem 0; }
/* Equipment photos: rows of equal height, like .figure-row */
.equipment-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.small-figure { max-width: 24rem; margin: 1.5rem 0; }


.columns { padding-left: 1.25rem; }
.columns li { break-inside: avoid; }

/* Research overview: small picture beside each theme */
.theme-list { list-style: none; margin: 0; padding: 0; }
.theme-list li { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.5rem; }
.thumb { width: 8rem; flex-shrink: 0; }
.theme-list p { margin: 0; }

/* Facilities table */
table { border-collapse: collapse; width: 100%; max-width: 40rem; }
.equipment-table { max-width: 50rem; }
.equipment-table td:first-child { padding-right: 1.5rem; }
th, td { text-align: left; padding: 0.4rem 0.75rem 0.4rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--sans); font-size: 0.95rem; }

/* Publications */
.jump { font-family: var(--sans); font-size: 0.95rem; }
.jump a { margin-right: 1rem; }
.pub-list { padding-left: 2rem; }
.pub-list li { margin-bottom: 0.75rem; }

/* Team */
.pi { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.pi h2 { margin-top: 0; }
.pi-name { font-family: var(--sans); font-weight: 700; margin-top: 0; }
.member-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem 2rem; }
.member { display: flex; gap: 1rem; align-items: flex-start; }
.member img { width: 105px; flex-shrink: 0; }
.member ul { margin: 0; padding-left: 1.1rem; font-size: 1rem; }
.alumni { display: grid; gap: 0 2.5rem; }
.alumni ul { padding-left: 1.1rem; font-size: 1rem; }

/* News */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { margin-bottom: 0.9rem; }
.news-date { display: block; font-family: var(--sans); font-size: 0.9rem; font-weight: 700; color: var(--muted); }

/* Galleries */
.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1.25rem; }
.gallery-grid img { width: 100%; height: 9rem; object-fit: cover; }
.gallery-grid span { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.4; margin-top: 0.3rem; }

/* Opportunities and contact */
.code-line { font-family: Consolas, "Courier New", monospace; background: var(--band); padding: 0.5rem 0.75rem; }
.contact-list dt { font-family: var(--sans); font-weight: 700; margin-top: 1rem; }
.contact-list dd { margin: 0.2rem 0 0; }

/* Contact page map (Google Maps iframe) */
.map { display: block; width: 100%; max-width: 600px; height: 400px; border: 0; margin: 1.5rem 0; background: #eeeeee; }

/* ---------- 6. Footer ---------- */
.site-footer {
  border-top: 6px solid var(--red);
  background: #2b2b2b;
  color: #fff;
  padding: 1.5rem 0;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.site-footer p { max-width: var(--max); margin: 0 auto 0.5rem; padding: 0 1.25rem; }
/* Micrographs of the Canadian flag and map, shown on every page */
.footer-micro { max-width: var(--max); margin: 0 auto 1.25rem; padding: 0 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.footer-micro img { width: auto; height: 72px; border: 1px solid #6b6b6b; }
.site-footer .footer-micro p { flex: 1 1 14rem; max-width: none; margin: 0; padding: 0; color: #d0d0d0; font-size: 0.85rem; }
.site-footer a { color: #fff; margin-right: 1.5rem; }
.site-footer a:focus-visible { outline-color: #fff; }

/* ---------- 7. Wider screens ---------- */
@media (min-width: 48rem) {
  .intro-photo { float: right; width: 45%; margin: 0.4rem 0 1rem 1.5rem; }
  .equipment-table td:first-child { white-space: nowrap; }   /* one line from tablet width up; wraps on phones */
  .two-col, .highlight-list, .alumni { grid-template-columns: 1fr 1fr; }
  .brand img { width: 180px; }
  .member-grid { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
  .award-grid { grid-template-columns: repeat(2, 1fr); }
  .theme { grid-template-columns: 20rem 1fr; }
  .theme-flip { grid-template-columns: 1fr 20rem; }
  .theme-flip figure { order: 2; }
  .columns { columns: 2; column-gap: 2.5rem; }
}
@media (min-width: 64rem) {
  .award-grid { grid-template-columns: repeat(4, 1fr); }
  .intro-photo { float: right; width: 26rem; margin: 0.4rem 0 1rem 2.5rem; }
}
