/* Responsive site header title */
.site-header-title {
  color: #e7e7e7;
  font-weight: 600;
  text-align: center;
  font-size: clamp(28px, 5vw, 60px);
  line-height: 1.2;
  margin: 20px auto;
  max-width: 90%;
}

/* Optional subtle shadow for better contrast on bright backgrounds */
.site-header-title {
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

header.page-header {
  padding: 20px 10px;
}

/* --- RESEARCH GRID --- */
.research-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  gap: 20px !important;
  margin-top: 40px !important;
  width: 100% !important;
}

.research-card {
  border: 1px solid lightgrey;
  background-color: #e7e7e7;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.research-card:hover {
  transform: translateY(-4px);
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);
}

.research-card img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  margin-bottom: 1em;
}

.research-card .button {
  align-self: start;
  margin-top: 10px;
  text-decoration: none;
  background-color: #77b2d0;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.research-card .button:hover {
  background-color: #1f71a9;
}

/* 🔽 Explicit stacking below 900px */
@media (max-width: 900px) {
  .research-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Responsive spacing and typography for text-heavy pages */
h1 {
  font-size: 2rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #157878; /* or your brand color */
}

p {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

hr {
  margin: 2rem 0;
  border: none;
  border-top: 2px solid #e0e0e0;
}

/* Make sure text doesn't hug the screen edges on mobile */
.main-content {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Slightly reduce heading size on smaller screens */
@media (max-width: 600px) {
  h1 {
    font-size: 1.6rem;
  }
  p {
    font-size: 1rem;
  }
}

/* Responsive headline section with background */
.pageheadline {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 600;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(90deg, #157878, #2a9bcf);
  padding: 1.5rem 0.5rem;
  margin: 0 auto;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  border-radius: 6px 6px 0 0;
}

/* Decorative horizontal rule to match the theme */
hr.custom-hr {
  width: 80%;
  max-width: 500px;
  margin: 1.5rem auto 2rem;
  border: none;
  border-top: 3px solid #77b2d0;
  border-radius: 2px;
}

/* Homepage headline styling — matches .pageheadline */
.homepage-headline {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 600;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(90deg, #157878, #2a9bcf);
  padding: 2rem 1rem;
  margin: 0 auto 2rem;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
  border-radius: 6px;
}

header.page-header {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Gradient banner adjustments for homepage */
header.page-header {
  background: linear-gradient(135deg, #1f71a9, #77b2d0);
  padding: 40px 10px; /* was probably more like 80px before */
  text-align: center;
  color: #e7e7e7;
}

/* Responsive tweak: make it shallower on smaller screens */
@media (max-width: 600px) {
  header.page-header {
    padding: 25px 8px;
  }
}

.homepage-text p {
  max-width: 800px;
  margin: 0 auto 1.5rem auto;
  font-size: 1.1rem;
  line-height: 1.7;
  text-align: justify;
}

@media (max-width: 700px) {
  .homepage-text p {
    font-size: 1rem;
    text-align: left;
    padding: 0 1rem;
  }
}


.publications-list {
  margin-top: 1.5rem;
}

.publication-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 1.5rem;
}

.pub-thumb {
  width: 150px;
  max-width: 30%;
  height: auto;
  border-radius: 4px;
  flex-shrink: 0;
}

.pub-info {
  flex: 1;
  line-height: 1.5;
}

.publication-item {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap; /* ✅ Helps Safari handle tight layouts */
  gap: 15px;
  margin-bottom: 1.5rem;
}

.pub-thumb {
  width: 150px;
  max-width: 30%;
  height: auto;
  border-radius: 4px;
  flex: 0 0 auto; /* ✅ Prevents Safari from squishing images */
}

.pub-info {
  flex: 1 1 60%;
  line-height: 1.5;
  min-width: 250px; /* ✅ Stops text from collapsing too soon */
}

/* 🧠 Responsive stacking on mobile & Safari */
@media (max-width: 900px) {
  .publication-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .pub-thumb {
    width: 80%;
    max-width: 250px;
    margin-bottom: 10px;
  }

  .pub-info {
    text-align: left;
    width: 100%;
  }
}

/* --- Group Page Layout --- */

/* Container for all people */
.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 20px;
  align-items: start;
}

/* Each person card */
.person {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #e7e7e7;
  border: 1px solid lightgrey;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.person:hover {
  transform: translateY(-4px);
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
}

/* Portrait image */
.person-image {
  width: 100%;
  height: auto;              /* keep aspect ratio */
  max-width: 220px;          /* limit size on desktop */
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 10px;
}

/* Info box under portrait */
.personal-info-box {
  text-align: center;
  font-size: 0.95em;
  line-height: 1.4;
  width: 100%;
}

.personal-info-box a {
  color: #157878;
  text-decoration: none;
}

.personal-info-box a:hover {
  text-decoration: underline;
}

/* --- Responsive tweaks --- */

/* 2 per row on tablets */
@media (max-width: 900px) {
  .people {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

/* 1 per row on phones */
@media (max-width: 600px) {
  .people {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .person {
    padding: 10px;
  }

  .person-image {
    max-width: 100%;
  }
}

.group-photo {
  text-align: center;
  margin: 20px auto 30px auto;
  max-width: 850px; /* ✅ tighter for laptop screens */
  width: 90%;        /* still scales nicely on smaller devices */
}

.group-photo img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

