/* Shared styles for every page. */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Lato", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: #222;
  background: #fff;
}

a { color: #1a5f86; }
a:hover { color: #0f3d57; }

/* Header: name on the left, menu on the right. It sits transparent over
   the banner and turns into a solid white bar once the page is scrolled
   (see js/site.js). */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: transparent;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

header.scrolled {
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1rem 2rem;
}

.site-name {
  font-size: 1.5rem;
  font-weight: 400;
  color: #fff;
  text-decoration: none;
  transition: color 0.35s ease;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
}

nav a {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.35s ease;
}

nav a:hover,
nav a[aria-current="page"] { color: #fff; }
nav a[aria-current="page"] { font-weight: 700; }

header.scrolled .site-name { color: #222; }
header.scrolled nav a { color: #555; }
header.scrolled nav a:hover,
header.scrolled nav a[aria-current="page"] { color: #222; }

/* Banner: image behind the header with the page title over it. */
.banner {
  position: relative;
  height: clamp(280px, 42vh, 420px); /* top section only, never the whole screen */
  background-color: #606872;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.25rem 1rem;
}

.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.banner h1 {
  position: relative;
  margin: 0;
  color: #fff;
  font-size: 5.5rem;
  font-weight: 300;
  line-height: 1.1;
}

/* Page body */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

h2 { font-size: 1.5rem; font-weight: 400; color: #1a5f86; margin: 2rem 0 0.5rem; }

/* Home page: photo on the left, name and role on the right */
.intro {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  align-items: flex-start;
}

.photo {
  flex: 1 1 420px;
  max-width: 580px;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover; /* crop to fit, never stretch */
}

.intro-text { flex: 1 1 300px; padding-top: 1rem; }

.intro-text .intro-name {
  font-size: 3rem;
  font-weight: 300;
  color: #1a5f86;
  margin: 0 0 1.5rem;
  line-height: 1.1;
}

.intro-text p { margin: 0 0 0.8rem; font-size: 1.15rem; }

.contact p { margin: 0.2rem 0; }

/* Figures */
figure { margin: 1.5rem auto; max-width: 720px; }
figure img { width: 100%; height: auto; border: 1px solid #eee; }
figcaption { font-size: 0.9rem; color: #555; margin-top: 0.4rem; }
figure.narrow { max-width: 340px; }

/* Photos (not research figures): fixed 3:2 frame, cropped to fit */
figure.photo-frame img { aspect-ratio: 3 / 2; object-fit: cover; }

/* Sections with photos: text on the left, small photos on the right */
.split {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  align-items: flex-start;
}
.split-text { flex: 1 1 360px; }
.split-text p:first-child { margin-top: 0; }
.split-media { flex: 0 0 280px; max-width: 100%; }
.split-media figure { margin: 0.3rem 0 1rem; }

.meta { color: #555; font-style: italic; }

footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  color: #777;
}

@media (max-width: 640px) {
  .header-inner { padding: 0.75rem 1.25rem; }
  .banner { padding-top: 6rem; }
  .banner h1 { font-size: 3rem; }
  .intro-text .intro-name { font-size: 2.3rem; }
  /* Phones: name first, then the photo underneath */
  .intro { flex-direction: column; gap: 1.25rem; }
  .intro-text { order: -1; padding-top: 0; flex: none; }
  .photo { flex: none; max-width: 100%; }
}
