/* Global Fellows – grid + modal */

:root {
  --fellows-teal: #1f8a82;
  --fellows-ink: #111827;
  --fellows-muted: #6b7280;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  box-sizing: border-box;
  background: transparent !important;
  font-family: "Poppins", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Grid ---------- */

.fellows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 280px);
  justify-content: center;
  gap: 24px;
  background: transparent !important;
}

/* .team-card is included because the first card in your HTML uses the old class names */
.fellows-card,
.fellows-grid .team-card {
  width: 280px !important;
  height: 298px !important;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(17, 24, 39, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fellows-card:hover,
.fellows-grid .team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.14);
}

.fellows-photo,
.fellows-grid .team-photo {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #e5e7eb;
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 1px #e5e7eb, 0 4px 12px rgba(0, 0, 0, 0.12);
  margin-bottom: 18px;
}

.fellows-name,
.fellows-grid .team-name {
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--fellows-ink);
  margin-bottom: 8px;
}

/* Country line */
.fellows-grid .team-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--fellows-teal);
}

/* Years line (second .team-title) */
.fellows-grid .team-title + .team-title {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--fellows-muted);
}

/* ---------- Modal ---------- */

body.fellows-modal-open {
  overflow: hidden;
}

/* Full-screen dark backdrop */
.fellows-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw;
  height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 99999;
  display: block;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  font-family: "Poppins", "Helvetica Neue", Arial, sans-serif;
}

.fellows-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* The modal itself is centred directly on the screen */
.fellows-modal-container {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: min(920px, calc(100vw - 40px));
  max-height: 88vh;
  display: grid;
  grid-template-columns: 38% 62%;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.fellows-close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--fellows-ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease;
}

.fellows-close-modal:hover {
  background: #f3f4f6;
}

.fellows-drag-handle {
  display: none;
}

.fellows-modal-image-col {
  position: relative;
  background: #eef2f3;
  min-height: 320px;
}

.fellows-modal-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.fellows-location-tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--fellows-ink);
  font-size: 12px;
  font-weight: 500;
}

.fellows-location-tag:empty {
  display: none;
}

.fellows-modal-content-col {
  padding: 40px 36px 32px;
  overflow-y: auto;
  box-sizing: border-box;
}

.fellows-modal-name {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--fellows-ink);
}

.fellows-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.fellows-modal-tag {
  padding: 5px 12px;
  border-radius: 999px;
  background: #e8f4f3;
  color: var(--fellows-teal);
  font-size: 11px;
  font-weight: 500;
}

.fellows-modal-bio {
  font-size: 14px;
  line-height: 1.75;
  color: #374151;
}

.fellows-modal-bio p {
  margin: 0;
  white-space: pre-line;
}

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

@media (max-width: 767px) {
  .fellows-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .fellows-card,
  .fellows-grid .team-card {
    width: 100% !important;
    max-width: 280px;
  }

  .fellows-modal-container {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
  }

  .fellows-modal-image-col {
    min-height: 260px;
  }

  .fellows-modal-content-col {
    padding: 24px 22px 32px;
    overflow-y: visible;
  }

  .fellows-modal-name {
    font-size: 22px;
  }
}

@media (max-width: 479px) {
  .container {
    padding: 16px 12px 32px;
  }
}
