/* Cards / grids */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: var(--space-6);
}

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (min-width: 1040px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
  padding: 18px;
  transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  border-color: rgba(61, 123, 255, 0.22);
}

/* Anchor-as-card helper (used by Explore grid) */
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link:focus {
  outline: none;
  box-shadow: var(--ring);
}

.card-title {
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card-text { margin: 0; color: var(--muted); }

/* Professor */
.prof-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-top: var(--space-6);
  align-items: center;
}

.prof-photo {
  width: min(260px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 0 auto;
  background: var(--surface-2);
}

.prof-photo img { width: 100%; height: 100%; object-fit: cover; }

.prof-box {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  padding: clamp(18px, 2.6vw, 24px);
}

.prof-name {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.kv {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.kv strong { color: var(--text); }

.inline-link {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 700;
}

.inline-link:hover { text-decoration: underline; }

@media (min-width: 920px) {
  .prof-grid { grid-template-columns: 320px 1fr; }
  .prof-photo { margin: 0; }
}

/* Members */
.member {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  align-items: center;
}

.avatar {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Members as "page" list (one column, row-like cards) */
.members-list {
  grid-template-columns: 1fr;
}

.members-list .card {
  padding: 16px;
}

@media (min-width: 920px) {
  .members-list .member {
    grid-template-columns: 96px 1fr;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.member h3 { margin: 0 0 6px; font-size: 1.05rem; }
.member p { margin: 0; color: var(--muted); }

/* People directory (members page) */
.people {
  display: grid;
  gap: var(--space-7);
}

.people-columns {
  display: grid;
  gap: var(--space-6);
}

.people-col {
  display: grid;
  gap: 14px;
}

.people-subtitle {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-size: 1.06rem;
  margin: 0;
  color: var(--text);
}

.people-group {
  display: grid;
  gap: 14px;
}

.people-title {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-size: 1.2rem;
  margin: 0;
  color: var(--text);
}

.people-list {
  display: grid;
  gap: 10px;
}

.person {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.person:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: rgba(8, 145, 178, 0.22);
}

.person-avatar {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--avatar-bg);
}

.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.person-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.achv-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(0, 56, 118, 0.18);
  background: rgba(0, 56, 118, 0.07);
  color: rgba(0, 56, 118, 0.92);
  flex: 0 0 auto;
}

.achv-icon svg { display: block; }

.person-name {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.person-role {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  white-space: nowrap;
}

.person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.person-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.person-more {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 750;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.person-more:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.person-more:focus {
  outline: none;
  box-shadow: var(--ring);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(8, 145, 178, 0.18);
  background: var(--surface-teal);
  color: var(--secondary);
  font-size: 0.84rem;
  font-weight: 750;
}

@media (min-width: 720px) {
  .person { grid-template-columns: 120px 1fr; padding: 18px 20px; }
  .person-avatar { width: 120px; height: 120px; }
}

@media (min-width: 980px) {
  .person { grid-template-columns: 140px 1fr; }
  .person-avatar { width: 140px; height: 140px; }
}

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

/* Modal (People detail) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 90;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 100;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  width: min(920px, 96vw);
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  padding: 18px;
  max-height: calc(100dvh - 36px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card--gallery {
  width: min(1080px, 96vw);
}

.gallery-modal-body {
  display: grid;
  gap: 16px;
}

.gallery-modal-media {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
}

.gallery-modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-modal-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (min-width: 920px) {
  .gallery-modal-body { grid-template-columns: 1.35fr 0.65fr; align-items: start; }
  .gallery-modal-media { aspect-ratio: 16 / 11; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  color: var(--text);
}

.modal-close:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.modal-close:focus { outline: none; box-shadow: var(--ring); }

.modal-body {
  display: grid;
  gap: 16px;
}

.modal-photo {
  width: min(220px, 68vw);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin: 10px auto 0;
}

.modal-photo img { width: 100%; height: 100%; object-fit: cover; }

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.modal-role { margin: 8px 0 0; color: var(--muted); font-weight: 700; }

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* PI modal: mini info grid */
.pi-mini-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.pi-mini-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 12px 12px;
}

.pi-mini-k {
  color: var(--muted-2);
  font-weight: 850;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

.pi-mini-v {
  margin-top: 6px;
  font-weight: 750;
  color: var(--text);
  word-break: break-word;
}

@media (min-width: 720px) {
  .pi-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 980px) {
  .pi-mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.pi-career-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.pi-career-item {
  margin: 8px 0;
}

.modal-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.modal-section-title {
  margin: 0 0 10px;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.modal-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

/* Achievements (People modal) */
.ach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ach-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 12px 12px;
}

.ach-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.ach-year {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-weight: 850;
  font-size: 0.82rem;
}

.ach-type {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(61, 123, 255, 0.22);
  background: rgba(61, 123, 255, 0.10);
  color: rgba(0, 56, 118, 0.92);
  font-weight: 800;
  font-size: 0.82rem;
}

.ach-title {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.ach-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.ach-venue {
  margin-top: 6px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ach-indexes {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ach-index {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(2, 6, 23, 0.14);
  background: rgba(2, 6, 23, 0.04);
  color: rgba(2, 6, 23, 0.78);
  font-size: 0.80rem;
  font-weight: 850;
}

.modal-empty { margin: 0; color: var(--muted); }

@media (min-width: 920px) {
  .modal-body { grid-template-columns: 260px 1fr; align-items: start; }
  .modal-photo { margin: 6px 0 0; }
}

body.modal-open { overflow: hidden; }

