:root {
  --primary: #3f51b5;
  --primary-dark: #2c387e;
  --secondary: #f50057;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  color: rgba(0, 0, 0, 0.87);
  background-color: #fff;
}

main {
  flex: 1 0 auto;
}

/* ---------- Header ---------- */

.site-banner {
  padding-top: 16px;
}

.site-banner .lab-logo {
  max-width: 85%;
}

.site-title {
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 2.125rem;
  line-height: 1.2;
  margin: 0;
}

@media only screen and (max-width: 600px) {
  .site-title {
    font-size: 1.5rem;
  }
}

nav {
  background-color: var(--primary) !important;
  box-shadow: none;
}

nav .brand-logo {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  margin-left: 16px;
}

nav ul a {
  color: #fff;
  font-size: 1.1rem;
}

.sidenav li > a {
  color: rgba(0, 0, 0, 0.87);
}

.sidenav .subheader {
  font-weight: 700;
}

/* ---------- Headings ---------- */

.section-heading {
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 2.125rem;
}

@media only screen and (max-width: 600px) {
  .section-heading {
    font-size: 1.6rem;
  }
}

/* ---------- Hero / featured post ---------- */

.hero {
  position: relative;
  background-color: #424242;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  color: #fff;
  margin-bottom: 32px;
  overflow: hidden;
}

.hero .hero-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
}

.hero .hero-content {
  position: relative;
  padding: 24px;
}

@media only screen and (min-width: 993px) {
  .hero .hero-content {
    padding: 48px;
    padding-right: 0;
    max-width: 83%;
  }
}

.hero .hero-content h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 0;
}

.hero .hero-content p {
  font-size: 1.5rem;
}

/* ---------- News list ---------- */

.news-list {
  border: none;
}

.news-list .collection-item {
  border: none;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.news-list .news-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--secondary);
  flex-shrink: 0;
}

.news-list .news-icon i {
  font-size: 1.3rem;
}

.news-list .news-date {
  display: block;
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ---------- Card grids ----------
   Materialize's grid floats its columns, so a card that is even slightly
   taller than its neighbours makes the next card snag on the overhang and
   drift right. Flex avoids that and equalizes heights within each line. */

.row.card-grid {
  display: flex;
  flex-wrap: wrap;
}

.row.card-grid::after {
  display: none;
}

/* Selectors are qualified with .row to outrank Materialize's own
   `.row .col.l3` rules, which are more specific than `.card-grid > .col`. */
.row.card-grid > .col {
  display: flex;
  float: none;
  min-width: 0;
  /* Materialize sets margin-left:auto on every .col to reset offset-*.
     Under floats that resolves to 0, but an auto margin on a flex item
     eats the free space and pushes the card to the right. */
  margin-left: 0;
}

/* The column's align-items:stretch sizes the card, which correctly leaves
   the card's own margins as the gap between rows. Setting height:100% here
   would instead size the card to the full column and push its margins
   outside it, making adjacent rows touch. */
.row.card-grid > .col > .card {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------- Profile / project cards ---------- */

.profile-card .card-image-square {
  width: 100%;
  padding-top: 100%;
  background-size: cover;
  background-position: center;
}

.project-card .card-image-16x9 {
  width: 100%;
  padding-top: 56.25%;
  background-size: cover;
  background-position: center;
}

.profile-card .card-content,
.project-card .card-content {
  flex: 1 0 auto;
}

.profile-card .card-name {
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 0;
  font-size: 1.5rem;
}

.profile-card .card-title {
  font-weight: 700;
  font-size: 1rem;
}

.profile-card .card-action {
  padding-top: 0;
  border: none;
  display: flex;
  justify-content: center;
  gap: 4px;
}

/* One fixed-size centred box per link, so the Material Icons font and the
   inline SVGs sit on exactly the same optical baseline.
   !important is needed because Materialize's own rule for card-action links
   is `.card .card-action a:not(.btn):not(.btn-large)...` — a five-deep :not()
   chain that outranks any reasonable selector we could write here. */
.profile-card .card-action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 0 !important;
  color: var(--primary) !important;
}

.profile-card .card-action a > i,
.profile-card .card-action a > svg {
  width: 24px;
  height: 24px;
  font-size: 24px;
  line-height: 1;
}

.people-section {
  margin-top: 40px;
}

.people-section:first-of-type {
  margin-top: 16px;
}

/* ---------- Publications ---------- */

.pub-list .pub-item {
  display: block;
  padding: 12px 0;
}

.pub-year-divider {
  display: flex;
  align-items: center;
  margin: 24px 0 16px;
}

.pub-year-divider .chip-year {
  background-color: var(--primary-dark);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0 32px;
}

.pub-year-divider::before,
.pub-year-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: #e0e0e0;
}

.pub-year-divider::before {
  margin-right: 16px;
}

.pub-year-divider::after {
  margin-left: 16px;
}

.pub-buttons {
  margin-top: 8px;
}

.pub-buttons a {
  border: 1px solid var(--secondary);
  color: var(--secondary);
  background-color: transparent;
  margin-right: 8px;
  margin-top: 4px;
}

.pub-buttons a:hover {
  background-color: rgba(245, 0, 87, 0.08);
}

/* ---------- Research chips ---------- */

.project-card .chip {
  background-color: #e8eaf6;
  color: var(--primary-dark);
}

.project-card .card-title-text {
  font-size: 1.3rem;
}

/* ---------- Footer ---------- */

footer.page-footer {
  background-color: #fff;
  color: inherit;
  padding-top: 24px;
  margin-top: 48px;
}

footer.page-footer .footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border-top: 2px solid var(--primary-dark);
  padding: 16px 0;
}

footer.page-footer .footer-logo {
  max-width: 80%;
}

footer.page-footer .footer-address {
  font-size: 0.9rem;
  text-align: right;
  flex: 1;
}

footer.page-footer .footer-credit {
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.6);
  text-align: center;
  padding-bottom: 16px;
}

footer.page-footer .footer-credit a {
  color: rgba(0, 0, 0, 0.75);
}

@media only screen and (max-width: 600px) {
  footer.page-footer .footer-address {
    text-align: left;
    margin-top: 12px;
  }
}
