/* Sullivan Lab site. Colours from the Trent University brand guide (2024). */
:root {
  --green: #154734;   /* Trent Green */
  --blue: #5b7f95;    /* Trent Blue */
  --heading: #2f5d8a; /* deeper blue for headings */
  --ink: #1f2a26;
  --muted: #5a6661;
  --line: #dfe5e2;
  --tint: #f2f6f4;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 124px; }
body {
  margin: 0;
  font: 18px/1.65 "Nunito Sans", Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--green); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.section { padding: 24px 0; }
.section > :last-child, .section > .wrap > :last-child, .two-col > div > :last-child, .position:last-child { margin-bottom: 0; }
.wrap.section { padding-left: 20px; padding-right: 20px; }
.tint { background: var(--tint); }

h1, h2, h3 { line-height: 1.25; color: var(--heading); }
h2 { font-size: 1.7rem; margin: 0 0 18px; }
h3 { font-size: 1.15rem; margin: 0 0 8px; }
h4 { font-size: 1rem; margin: 18px 0 6px; color: var(--heading); }
p { margin: 0 0 14px; }
.small { font-size: 0.9rem; color: var(--muted); }

/* Header: white name row, blue menu ribbon */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--white); border-bottom: 3px solid var(--green);
}
.header-inner {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px 0; padding-top: 10px; padding-bottom: 10px;
}
.brand {
  font-family: Montserrat, Arial, sans-serif; font-weight: 700;
  font-size: 1.5rem; color: var(--heading); text-decoration: none;
}
/* Trent's logo file is white; an offset drop-shadow redraws it in Trent Green */
.brand-logo { margin-left: 14px; padding-left: 16px; border-left: 2px solid var(--line); }
.brand-logo span { display: block; width: 146px; height: 44px; overflow: hidden; }
.brand-logo img { height: 44px; width: auto; max-width: none; transform: translateX(-400px); filter: drop-shadow(400px 0 0 #154734); }
.nav-ribbon { background: var(--heading); }
.nav-ribbon .wrap { padding-top: 6px; padding-bottom: 6px; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
nav a {
  padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--white);
  font-family: Montserrat, Arial, sans-serif; font-weight: 600; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
  transition: background 0.15s;
}
nav a:hover, nav a.on { background: rgba(255, 255, 255, 0.28); color: var(--white); }
nav a.join { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85); }

/* Hero */
.hero { position: relative; }
.hero img { width: 100%; height: clamp(520px, 42vw, 760px); object-fit: cover; object-position: center 15%; }
.hero-text {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  background: linear-gradient(to top, rgba(10, 30, 22, 0.78) 0%, rgba(10, 30, 22, 0.15) 60%, rgba(10, 30, 22, 0) 100%);
  padding-bottom: 40px;
}
.hero .wrap { max-width: 1280px; }
.hero h1 { color: var(--white); font-family: Oswald, Arial, sans-serif; font-weight: 500; letter-spacing: 0.01em; line-height: 1.2; font-size: clamp(2.65rem, 3.8vw, 4rem); max-width: 1100px; margin: 0 0 10px; }
.hero p { color: var(--white); font-size: clamp(1.21rem, 1.54vw, 1.54rem); max-width: 900px; }
.hero h1, .hero p { text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.35); }

.btn {
  display: inline-block; background: var(--green); color: var(--white);
  padding: 11px 22px; border-radius: 4px; text-decoration: none; font-weight: 600;
}
.btn:hover { background: var(--blue); color: var(--white); }
.btn-disabled { background: var(--muted); }

/* Research themes */
.themes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 26px 0;
}
.theme {
  background: var(--white); border-top: 4px solid var(--blue);
  padding: 20px 22px; border-radius: 4px;
}
.theme p { margin: 0; }
.lead-out { font-weight: 600; color: var(--heading); }

.approaches { columns: 2; column-gap: 40px; }
.approaches li { margin-bottom: 8px; break-inside: avoid; }
.areas li { margin-bottom: 6px; }

/* Trent section */
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.two-col img.square { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; }
/* Location map: Google's map shown read-only; a click opens Google Maps.
   The pin is our own, placed by its pixel offset from the map centre at this zoom. */
.map { grid-column: 1 / -1; }
.map-link { display: block; position: relative; aspect-ratio: 5 / 4; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.map-link iframe { position: absolute; left: 0; top: -50px; width: 100%; height: calc(100% + 50px); border: 0; pointer-events: none; }
/* The iframes keep a fixed size and are scaled by --k (map width / design width, set by a script),
   so the map shows the same area at any window width. The wide map's extra 0.9 sits between
   Google's fixed zoom levels. */
.map-link .map-wide { top: calc(-45px * var(--k, 1)); width: 862.2px; height: 740px; transform: scale(calc(0.9 * var(--k, 1))); transform-origin: 0 0; }
.map-narrow { display: none; }
.map-pin { position: absolute; left: calc(50% - 41px * var(--k, 1)); top: calc(50% - 21.8px * var(--k, 1)); width: 0; height: 0; }
.map-dot { position: absolute; left: -18px; top: -46px; width: 36px; height: 36px; border-radius: 50%; background: var(--green) url("https://www.trentu.ca/themes/custom/trent/dist/images/crest.png") center / 25px no-repeat; border: 2px solid var(--white); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5); }
.map-dot::after { content: ""; position: absolute; left: 9px; top: 32px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 12px solid var(--green); }
.map-label { position: absolute; left: 24px; top: -42px; white-space: nowrap; font: 700 15px/1.4 Montserrat, Arial, sans-serif; color: var(--green); background: rgba(255, 255, 255, 0.9); padding: 2px 7px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.map-badge { position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.93); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); font: 700 14px/1 Montserrat, Arial, sans-serif; color: var(--ink); }
.map-badge img { width: 34px; height: 17px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }
/* Covers Google's label on the lake with its correct name */
.map-lake { position: absolute; left: calc(50% + 4px * var(--k, 1)); top: calc(50% + 152.6px * var(--k, 1)); transform: translate(-50%, -50%); padding: 6px 10px; border-radius: 10px; background: #9bd2e8; box-shadow: 0 0 5px 3px #9bd2e8; font: italic 600 14px/1.15 "Nunito Sans", Arial, sans-serif; letter-spacing: 0.03em; color: #3d6f96; text-align: center; }
.map-usa { position: absolute; left: calc(50% + 197px * var(--k, 1)); top: calc(50% + 245.6px * var(--k, 1)); font: 700 14px Montserrat, Arial, sans-serif; letter-spacing: 0.3em; color: rgba(31, 42, 38, 0.6); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
/* Our own Ottawa label, left of Google's city dot, since Google's label falls off the right edge */
.map-city { position: absolute; left: calc(50% + 374.8px * var(--k, 1)); top: calc(50% - 265.3px * var(--k, 1)); width: 0; height: 0; }
.map-city span { position: absolute; right: 0; top: -11px; white-space: nowrap; font: 600 17px/22px Roboto, Arial, sans-serif; color: #202124; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 3px #fff; }
figure { margin: 0; }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }

.wide-photo img { width: 100%; max-height: 520px; object-fit: cover; }
.wide-photo figcaption { margin-top: 8px; }
.campus-loop { margin-top: 12px; margin-bottom: 12px; }
.campus-loop video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 4px; background: #1f2a26; }

/* Read more links */
.read-more-title { margin-top: 30px; }
.read-more { padding-left: 20px; margin: 0; }
.read-more li { margin-bottom: 6px; }
.read-more span { color: var(--muted); font-size: 0.9rem; }

/* Photo pair and videos */
.pair { margin: 34px 0 0; display: flex; flex-wrap: wrap; gap: 16px; }
.pair figure { flex: 1 1 300px; }
.pair-img { aspect-ratio: 3 / 2; overflow: hidden; border-radius: 4px; }
.pair-img img { width: 100%; height: 100%; object-fit: cover; }
.pair-img.wqc img { transform: scale(1.22); transform-origin: 50% 40%; }
.videos-title { margin-top: 34px; }
.videos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.video { aspect-ratio: 16 / 9; }
.video iframe { width: 100%; height: 100%; border: 0; border-radius: 4px; }

/* People */
.person { background: var(--tint); border-left: 4px solid var(--heading); padding: 16px 22px; border-radius: 4px; margin-bottom: 14px; }
.person .role { margin-bottom: 8px; }
.person-links { margin: 0; font-weight: 600; }

/* Positions */
.position {
  border-left: 4px solid var(--green); padding: 4px 0 4px 22px; margin: 30px 0;
}
.terms { background: var(--tint); padding: 10px 14px; border-radius: 4px; }

.steps li { margin-bottom: 10px; }

/* Placeholders to replace before launch */
.todo { background: #fff1a8; color: #5c4a00; padding: 0 4px; }

/* Footer */
.site-footer { background: var(--green); color: #e8f0ec; padding: 30px 0; margin-top: 24px; }
.site-footer a { color: #ffffff; }
.site-footer .small { color: #c4d6cd; }
.footer-logo { display: inline-block; margin-bottom: 14px; }
.footer-logo img { height: 52px; width: auto; }

/* Phones */
@media (max-width: 720px) {
  body { font-size: 17px; }
  .hero h1 { font-size: 1.7rem; }
  .themes, .two-col, .videos { grid-template-columns: 1fr; }
  .approaches { columns: 1; }
  html { scroll-padding-top: 0; }
  .site-header { position: static; }
  .header-inner { padding-top: 8px; padding-bottom: 8px; gap: 4px 0; }
  .brand { font-size: 1.3rem; }
  .brand-logo { margin-left: 10px; padding-left: 12px; }
  .brand-logo span { width: 113px; height: 34px; }
  .brand-logo img { height: 34px; }
  .nav-ribbon .wrap { padding: 4px 8px; }
  nav { gap: 0; flex-wrap: nowrap; justify-content: space-between; }
  nav a { padding: 4px 6px; font-size: 10px; letter-spacing: 0; }
  nav a[href$="#pi"] { display: none; } /* PI section stays; its menu link is dropped on phones to fit one line */
  /* Let the hero grow with its text so the heading never spills above the photo */
  .hero { display: grid; }
  .hero img, .hero-text { grid-area: 1 / 1; }
  .hero img { height: 100%; min-height: 420px; }
  .hero-text { position: relative; inset: auto; padding-top: 40px; padding-bottom: 28px; }
  .section { padding: 20px 0; }
  .map-badge { left: 8px; top: 8px; gap: 6px; padding: 4px 8px 4px 6px; font-size: 12px; }
  .map-badge img { width: 26px; height: 13px; }
  .map-lake { padding: 3px 7px; font-size: 12px; }
  .map-usa { font-size: 12px; }
  .map-dot { left: -15px; top: -40px; width: 30px; height: 30px; background-size: 21px; }
  .map-dot::after { left: 6px; top: 26px; }
  .map-label { left: 20px; top: -37px; font-size: 13px; }
}

/* Phones: a wider-zoom square map */
@media (max-width: 560px) {
  .map-link { aspect-ratio: 1 / 1; }
  .map-wide, .map-city { display: none; }
  .map-link .map-narrow { display: block; top: calc(-50px * var(--k, 1)); width: 335px; height: 385px; transform: scale(var(--k, 1)); transform-origin: 0 0; }
  .map-pin { left: calc(50% + 6px * var(--k, 1)); top: calc(50% - 56px * var(--k, 1)); }
  .map-lake { left: calc(50% + 2px * var(--k, 1)); top: calc(50% + 36px * var(--k, 1)); }
  .map-usa { left: calc(50% + 100px * var(--k, 1)); top: calc(50% + 130px * var(--k, 1)); }
}

/* Publications */
.pub-year { margin: 30px 0 10px; color: var(--heading); }
.pubs { padding-left: 0; list-style: none; margin: 0; }
.pubs li { margin-bottom: 14px; padding-left: 14px; border-left: 3px solid var(--line); }
.pubs u { text-decoration-color: var(--blue); text-underline-offset: 2px; }
.pub-updated { color: var(--muted); font-size: 0.9rem; }
