:root {
  --accent: #09a2a2;
  --accent-dark: #087f7f;
  --heading-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: #1f1f1f;
  font-family: var(--heading-font);
  font-size: 16px;
  line-height: 1.5;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

input,
select,
button {
  border: 1px solid #b8b8b8;
  border-radius: 0;
  background: #fff;
  color: #222;
  font: inherit;
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

#search {
  display: block;
  width: 100%;
  margin: 0 0 12px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.filters select,
.filters button {
  width: 100%;
}

button {
  min-height: 42px;
  padding: 9px 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: var(--accent-dark);
}

.view-toggle {
  display: inline-flex;
  margin-bottom: 28px;
  border: 1px solid #b8b8b8;
}

.view-button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid #b8b8b8;
  background: #fff;
  color: #222;
}

.view-button:last-child {
  border-right: 0;
}

.view-button.is-active,
.view-button:hover,
.view-button:focus-visible {
  background: var(--accent);
  color: #fff;
}

.view-button.is-active:hover,
.view-button.is-active:focus-visible {
  background: var(--accent-dark);
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.role-section {
  margin-top: 34px;
}

.role-section:first-child {
  margin-top: 0;
}

.role-section h2 {
  margin: 0 0 18px;
  border-bottom: 1px solid #d8d8d8;
  padding-bottom: 10px;
  font-family: var(--heading-font);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.25;
}

.card {
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  padding: 14px 12px 24px;
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.card:hover,
.card:focus-within {
  box-shadow: none;
}

#results.is-filtering .card,
.card.card-enter {
  opacity: 0;
  transform: translateY(8px);
}

.card.card-enter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.map-view {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.map-view.is-filtering {
  opacity: 0;
  transform: translateY(8px);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}

.member-map {
  min-height: 520px;
  border: 1px solid #e2e2e2;
  background: #f2f2f2;
}

.map-fallback {
  margin: 0;
  padding: 24px;
  color: #555;
}

.member-location-icon,
.member-cluster-icon {
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #3f5f75;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.member-cluster-icon {
  background: #263f4f;
  box-shadow:
    0 0 0 7px rgba(63, 95, 117, 0.22),
    0 2px 10px rgba(0, 0, 0, 0.22);
}

.member-location-icon span,
.member-cluster-icon span {
  display: block;
}

.location-card-enter {
  opacity: 0;
  transform: translateY(8px);
}

.location-card-enter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.map-list {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
}

.location-card {
  border: 1px solid #e2e2e2;
  background: #f2f2f2;
  padding: 16px;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    border-color 160ms ease;
}

.location-card:hover,
.location-card:focus-within {
  border-color: #d4d4d4;
}

.location-card h2 {
  margin: 0 0 4px;
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.25;
}

.location-card p {
  margin: 0 0 10px;
  color: #555;
  font-size: 14px;
  font-weight: 700;
}

.location-card ul {
  margin: 0;
  padding-left: 18px;
  color: #333;
  font-size: 14px;
}

.location-card li + li {
  margin-top: 3px;
}

.profile-image {
  display: block;
  width: 220px;
  height: 220px;
  margin: 0 auto 22px;
  border: 0;
  border-radius: 50%;
  background: #ddd;
  object-fit: cover;
  box-shadow: none;
}

.card h3 {
  margin: 0 0 6px;
  color: #222;
  font-family: var(--heading-font);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.25;
}

.centre-role,
.affiliation {
  color: #555;
  font-size: 14px;
}

.centre-role {
  margin-bottom: 4px;
  font-weight: 700;
}

.affiliation {
  min-height: 42px;
  margin-bottom: 14px;
}

details {
  border-top: 1px solid #ddd;
  padding-top: 12px;
  text-align: left;
}

summary {
  color: #333;
  cursor: pointer;
  font-weight: 700;
  list-style-position: inside;
  text-align: center;
}

summary:hover,
summary:focus-visible {
  text-decoration: underline;
}

.bio-wrapper {
  height: 0;
  overflow: hidden;
  transition: height 220ms ease;
}

.bio {
  margin-top: 14px;
  color: #333;
  font-size: 14px;
  text-align: left;
}

.bio p {
  margin: 0 0 12px;
}

.bio p:last-child {
  margin-bottom: 0;
}

.research-areas {
  color: #444;
}

@media (max-width: 900px) {
  .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-list {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .container {
    padding: 24px 16px 36px;
  }

  h1 {
    font-size: 34px;
  }

  .people-grid,
  .filters {
    grid-template-columns: 1fr;
  }

  .profile-image {
    width: 206px;
    height: 206px;
  }

  .view-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .member-map {
    min-height: 360px;
  }
}
