 :root {
  --bg: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --accent: #496C8A;
  --accent-dark: #304D67;
  --line: #dadce0;
  --soft: #f3f3f3;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

.container {
  width: min(1040px, 92%);
  margin: 0 auto;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Top navigation */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.site-name {
  color: var(--text);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-name:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 14px;
}

.nav a {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  line-height: 1.2;
}

.nav a:hover,
.nav a.active {
  color: var(--accent-dark);
  text-decoration: none;
}

/* General page layout */

.page {
  padding: 22px 0 58px;
}

.section {
  padding: 0 0 30px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.section:last-child {
  border-bottom: none;
}

.narrow {
  max-width: 820px;
}

.section h2 {
  margin: 0 0 16px;
  font-size: 27px;
  font-weight: 400;
  color: var(--text);
}

.section h3,
.year-heading {
  margin: 24px 0 10px;
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}

.section p {
  margin-top: 0;
  margin-bottom: 14px;
}

ul {
  padding-left: 22px;
}

li {
  margin-bottom: 8px;
}

.link-list {
  margin-top: 16px;
}

/* Page hero images */

.page-hero {
  position: relative;
  margin: 0 0 30px;
  height: 132px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--soft);
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.page-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-title {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 92%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: #ffffff;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* Home */

.home-hero {
  height: 150px;
}

.home-hero::after {
  background: rgba(0, 0, 0, 0.28);
}

.home-hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-hero-text {
  position: absolute;
  z-index: 2;
  text-align: center;
  color: #ffffff;
  width: fit-content;
  max-width: 90%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.75);
  background: rgba(0, 0, 0, 0.22);
  padding: 10px 18px;
  border-radius: 8px;
}

.home-hero-text p {
  margin: 0 0 6px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-hero-text h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.15;
}

.home-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 44px;
}

.home-card {
  width: 100%;
  max-width: 340px;
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
}

.home-photo-carousel {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.home-photo-carousel img {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  object-position: center;
  scroll-snap-align: start;
  border-radius: 6px;
  background: var(--soft);
}

.home-photo-carousel::-webkit-scrollbar {
  height: 7px;
}

.home-photo-carousel::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.home-photo-carousel::-webkit-scrollbar-thumb {
  background: #c9c9c9;
  border-radius: 10px;
}

.home-card p {
  margin: 10px 0;
  color: var(--muted);
  font-size: 15px;
}

.home-text {
  max-width: 680px;
}

.home-text p {
  margin-top: 0;
  margin-bottom: 15px;
}

.home-links {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.home-links a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent-dark);
  font-size: 14px;
}

.home-links a:hover {
  background: var(--soft);
  text-decoration: none;
}

/* Entries */

.entry {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 22px;
  padding: 14px 0;
  border-bottom: 1px solid #eeeeee;
}

.entry:last-child {
  border-bottom: none;
}

.entry-date {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.entry p {
  margin: 0;
}

.entry strong {
  font-weight: 600;
}

/* Service entry with side photo */

.service-entry-with-side-photo {
  grid-template-columns: 110px minmax(0, 1fr);
}

.service-entry-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: start;
}

.service-entry-text p {
  margin: 0;
}

.service-entry-main img {
  width: 100%;
  height: 150px;
  display: block;
  object-fit: cover;
  object-position: center 75%;
  border-radius: 8px;
}

/* Publications */

.publication {
  padding: 12px 0 12px 18px;
  border-left: 4px solid var(--accent);
  background: transparent;
}

.publication p {
  margin: 6px 0;
}

/* Buttons */

.button {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--accent-dark);
  border-radius: 4px;
  color: var(--accent-dark);
  font-weight: 500;
}

.button:hover {
  background: var(--accent-dark);
  color: white;
  text-decoration: none;
}

/* Research group photos */

.group-gallery {
  max-width: 900px;
  margin: 24px auto 36px;
}

.group-gallery h2 {
  margin-bottom: 22px;
}

.group-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  align-items: start;
  margin-top: 20px;
}

.group-photo-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.group-photo-card img {
  width: 100%;
  height: 260px;
  display: block;
  object-fit: contain;
  object-position: center top;
  background: #f3f3f3;
  border-radius: 0;
}

.group-photo-card figcaption {
  margin: 0;
  padding: 12px 14px 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.caption-title {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 3px;
}

.caption-names {
  display: block;
}

/* Compatibility: hide old duplicated page-title if a file still has one */

.page-title {
  display: none;
}

/* Footer */

.footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Responsive */

@media (max-width: 1100px) {
  .service-entry-with-side-photo {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .service-entry-main {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .service-entry-main img {
    width: 100%;
    max-width: 520px;
    height: auto;
    object-fit: contain;
    object-position: center;
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .nav {
    justify-content: flex-start;
  }

  .home-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .home-card {
    max-width: 360px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 760px) {
  .page {
    padding-top: 18px;
  }

  .page-hero {
    height: 105px;
    margin-bottom: 26px;
  }

  .home-hero {
    height: 120px;
  }

  .hero-title {
    font-size: 27px;
  }

  .home-hero-text p {
    font-size: 12px;
  }

  .home-hero-text h1 {
    font-size: 29px;
  }

  .group-gallery {
    max-width: 100%;
  }

  .group-photo-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .group-photo-card img {
    height: auto;
    max-height: none;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .site-header {
    padding: 11px 0;
  }

  .site-name {
    font-size: 18px;
  }

  .nav {
    gap: 6px 11px;
  }

  .nav a {
    font-size: 11px;
  }

  .section h2 {
    font-size: 25px;
  }

  .home-text h1 {
    font-size: 30px;
  }

  .group-photo-card figcaption {
    font-size: 14px;
  }
}

/* Blue editorial styling inspired by the reference site. */
:root {
  --bg: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --accent: #496C8A;
  --accent-dark: #304D67;
  --line: #dadce0;
  --soft: #f3f3f3;
}

body { color: var(--text); line-height: 1.55; }
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
.site-header {
  border-top: 3px solid var(--accent);
  border-bottom-color: var(--line);
  box-shadow: 0 2px 12px rgba(20, 58, 92, .035);
}
.site-name { color: var(--accent-dark); font-weight: 650; }
.nav { gap: 8px 15px; }
.nav a {
  color: #5f6368;
  font-size: .82rem;
  text-transform: none;
  letter-spacing: 0;
  padding: 0 0 4px;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.page-hero:not(.contact-hero) {
  height: auto;
  min-height: 0;
  overflow: visible;
  border-radius: 0;
  border-left: 4px solid var(--accent);
  background: linear-gradient(105deg, #f0f0f0 0%, #fafafa 55%, #ffffff 100%);
  padding: 22px 24px;
  margin-bottom: 30px;
}
.page-hero:not(.contact-hero)::after { display: none; }
.page-hero:not(.contact-hero) .hero-title {
  position: static;
  width: auto;
  transform: none;
  color: var(--accent-dark);
  text-align: left;
  text-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  letter-spacing: -.02em;
  font-weight: 500;
}
.home-hero {
  height: auto;
  min-height: 0;
  justify-content: flex-start;
  border-left: 4px solid var(--accent);
  border-radius: 0;
  background: linear-gradient(105deg, #f0f0f0 0%, #fafafa 55%, #ffffff 100%);
  padding: 24px;
}
.home-hero::after { display: none; }
.home-hero-text {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  max-width: none;
  width: auto;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  text-align: left;
  text-shadow: none;
}
.home-hero-text p {
  color: var(--muted);
  font-size: .94rem;
  text-transform: none;
  letter-spacing: 0;
}
.home-hero-text h1 {
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -.02em;
}
.home-grid { grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); gap: 38px; }
.home-card {
  max-width: none;
  border: 0;
  border-left: 3px solid var(--line);
  border-radius: 0;
  padding: 4px 0 4px 18px;
}
.home-card p { color: var(--muted); }
.home-text { max-width: 760px; }
.home-links { gap: 12px 22px; }
.home-links a {
  padding: 0 0 3px;
  border: 0;
  border-bottom: 2px solid #9BB3C7;
  border-radius: 0;
  color: var(--accent-dark);
}
.home-links a:hover { background: transparent; border-bottom-color: var(--accent-dark); }
.section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
}
.section h2::before {
  content: "";
  display: inline-block;
  flex: 0 0 4px;
  width: 4px;
  height: 1.05em;
  border-radius: 2px;
  background: var(--accent);
}
.section h3, .year-heading {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}
.entry-date { color: var(--accent-dark); font-weight: 650; }
.publication { border-left-color: var(--accent); background: transparent; }
.group-gallery { margin-top: 12px; }
.group-photo-grid { grid-template-columns: 1fr; gap: 0; margin-top: 0; }
.group-photo-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
}
.group-photo-card figcaption { padding: 0; }
.caption-title { color: var(--text); font-family: Georgia, "Times New Roman", serif; }
.footer { color: var(--muted); }
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; gap: 24px; }
  .home-card { max-width: 360px; }
}
@media (max-width: 760px) {
  .page-hero:not(.contact-hero) { padding: 18px 16px; }
  .home-hero { padding: 20px 16px; }
}


/* Dark editorial theme and a wider, horizontal page frame. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --accent: #496C8A;
  --accent-dark: #304D67;
  --line: #d8d8d8;
  --soft: #f3f3f3;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1218;
  --text: #e7edf2;
  --muted: #b0b0b0;
  --accent: #496C8A;
  --accent-dark: #9BBAD2;
  --line: #34373a;
  --soft: #17191c;
}
body {
  background: var(--bg);
  color: var(--text);
  transition: background-color .2s ease, color .2s ease;
}
.container { width: min(1260px, 94%); }
.site-header {
  background: var(--bg);
  border-bottom-color: var(--line);
}
.topbar {
  flex-wrap: nowrap;
  align-items: center;
  gap: 18px;
}
.site-name { flex: 0 0 auto; }
.nav {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 7px 12px;
}
.nav a {
  white-space: nowrap;
  font-size: .76rem;
}
.site-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}
.site-control {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .76rem;
  line-height: 1.2;
  cursor: pointer;
}
.site-control:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}
.site-control:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.language-toggle { min-width: 42px; font-weight: 700; }
.page { padding-top: 28px; }
.narrow { max-width: none; }
.entry { grid-template-columns: 150px minmax(0, 1fr); }
.home-grid {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: clamp(30px, 5vw, 64px);
}
.home-card { max-width: none; }
.home-text { max-width: 900px; }
.page-hero:not(.contact-hero) {
  border-left-width: 5px;
  padding: 26px 30px;
}
.group-gallery { max-width: none; }
.group-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.group-photo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}
.group-photo-card figcaption { padding: 12px 14px; }
:root[data-theme="dark"] .site-header {
  border-top-color: var(--accent);
  box-shadow: 0 2px 16px rgba(0,0,0,.24);
}
:root[data-theme="dark"] .nav a { color: #b8b8b8; }
:root[data-theme="dark"] .nav a:hover,
:root[data-theme="dark"] .nav a.active { color: var(--accent-dark); }
:root[data-theme="dark"] .page-hero:not(.contact-hero) {
  background: linear-gradient(105deg, #202124 0%, #17191c 62%, #0d1218 100%);
}
:root[data-theme="dark"] .home-card {
  background: #17191c;
  border-color: var(--line);
}
:root[data-theme="dark"] .entry { border-bottom-color: var(--line); }
:root[data-theme="dark"] .group-photo-card img {
  background: #17191c;
}
:root[data-theme="dark"] .group-photo-card { background: var(--bg); }
:root[data-theme="dark"] .publication { background: transparent; }
:root[data-theme="dark"] .home-links a { border-bottom-color: #3D566B; }
:root[data-theme="dark"] .contact-hero::after { background: rgba(0,0,0,.38); }
@media (max-width: 1120px) {
  .topbar { flex-wrap: wrap; }
  .nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .site-controls { margin-left: auto; }
}
@media (max-width: 760px) {
  .topbar { gap: 10px 14px; }
  .nav { gap: 8px 13px; }
  .page { padding-top: 20px; }
  .entry { grid-template-columns: 1fr; gap: 5px; }
  .group-photo-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}


/* Contact uses the submitted books-and-flowers photo as its only image. */
.contact-hero { height: 220px; margin-bottom: 18px; }
.contact-hero img { object-position: center 40%; }
.contact-details { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.contact-details p { margin-bottom: 8px; }
.contact-details p:last-child { margin-bottom: 0; }
@media (max-width: 760px) {
  .contact-hero { height: 160px; margin-bottom: 14px; }
  .contact-details p { margin-bottom: 6px; }
}


/* Stack the home photo above its introduction on mobile and small tablets. */
@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .home-card, .home-text { max-width: none; }
}


/* Student tutoring offer */
.student-offer {
  max-width: 980px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--soft);
}
.student-offer h2 { margin-bottom: 14px; }
.student-offer h3 {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
}
.student-offer-content { max-width: 820px; }
.student-offer p { margin: 0 0 12px; }
.student-cta { margin-top: 4px; }
@media (max-width: 560px) {
  .student-offer { padding: 18px 16px; }
}
