

/* RESEARCH GROUPS */
.research-groups-container {
  display: flex;
  flex-direction: column;
  gap: 60px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 20px;
}
.group-title {
  text-align: center;
  color: var(--metu-red); /* METU red */
  font-size: 20px;
  font-weight: 600;
  margin: 0px 0 20px;
  text-transform: uppercase; /* optional */
}
.research-group-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.research-card {
  flex: 0 1 calc(33.333% - 20px);
  max-width: 300px;
  min-width: 260px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 24px 16px 56px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
  position: relative;
  transition: transform 0.2s ease;
}

.research-card:hover {
  transform: translateY(-3px);
}

.lab-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  word-break: break-word;
}

.lab-divider {
  margin: 10px auto 15px;
  border: none;
  border-top: 1px solid #ccc;
  width: 80%;
}

.lab-description {
  font-size: 14px;
  color: #555;
  margin: 10px 0 30px;
  line-height: 1.5;
  text-align: justify;
  min-height: 3.5em;
}

.member-bar {
  position: absolute;
  bottom: 12px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-photo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
}

/* RESEARCH OVER VIEW*/
.research-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  max-width: 1080px;
  margin: 0 auto;
}

/* Default: all cards have image on left */
.field-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  min-height: 240px;
}

/* Apply image on right for cards in even rows: 3rd and 4th, 7th and 8th, etc. */
.research-fields-grid > div:nth-child(4n+3),
.research-fields-grid > div:nth-child(4n+4) {
  flex-direction: row-reverse;
}

.field-image {
  width: 220px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.research-fields-grid > div:nth-child(4n+3) .field-image,
.research-fields-grid > div:nth-child(4n+4) .field-image {
  border-top-right-radius: 12px;
  border-top-left-radius: 0;
}

.field-content {
  flex: 1;
  padding: 20px 24px;
}

.field-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}

.field-description {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  text-align: justify;
}

/* -------- Responsive Mobile View (1-column) -------- */
@media (max-width: 768px) {
  .research-fields-grid {
    grid-template-columns: 1fr; /* <--- stack all cards vertically */
  }

  .field-card {
    flex-direction: row; /* reset base direction */
  }

  .research-fields-grid > div:nth-child(even) {
    flex-direction: row-reverse;
  }

  .field-image {
    width: 220px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 0;
  }

  .research-fields-grid > div:nth-child(even) .field-image {
    border-top-right-radius: 12px;
    border-top-left-radius: 0;
  }
}