/* ============================
   BASE
   ============================ */

body {
  background: #ffffff !important;
}

.members-hero {
  width: min(860px, calc(100% - 80px));
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(31, 107, 209, 0.05) 0%,
    rgba(122, 196, 138, 0.06) 100%
  );
  border: 1px solid var(--border);
  border-radius: 18px;
  margin: 0.9rem auto 0.6rem;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.members-hero-content {
  text-align: center;
  padding: 0.7rem 1rem;
}

.members-subtitle {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-green);
  margin: 0 0 0.12rem;
  font-weight: 700;
}

.members-hero h1 {
  font-size: 1.62rem;
  font-weight: 780;
  color: var(--ink-900);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1.title,
.quarto-title h1,
main > h1:first-of-type {
  display: none;
}

/* ============================
   HEADINGS / DIVIDERS
   ============================ */

h2 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0.75rem 0 0.2rem;
  color: var(--ink-900);
  font-weight: 760;
  letter-spacing: -0.02em;
  position: relative;
  line-height: 1.15;
}

h2::after {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  margin: 0.32rem auto 0;
  border-radius: 999px;
  background: var(--accent-line);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  max-width: 1020px;
  margin: 0.8rem auto 0.6rem;
}

/* ============================
   SECTION WRAPPER
   ============================ */

.members-section {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 auto 0.5rem;
  max-width: 1040px;
}

/* ============================
   GRID
   ============================ */

.members-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 1040px;
  margin: 0 auto 0.4rem;
}

/* ============================
   MEMBER CARD
   ============================ */

.member-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
  border: 1px solid var(--border);
  box-shadow:
    0 2px 8px rgba(15, 23, 42, 0.04),
    0 1px 2px rgba(15, 23, 42, 0.03);
  width: 200px;
  flex: 1 1 180px;
  max-width: 210px;
  min-height: 0;
  padding: 0.65rem 0.6rem 0.65rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

.member-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 10px 20px rgba(31, 107, 209, 0.07),
    0 0 0 4px rgba(122, 196, 138, 0.10);
  border-color: rgba(63, 134, 230, 0.22);
}

.member-photo {
  width: 100%;
  max-width: 170px;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  object-fit: cover;
  margin: 0 auto 0.35rem;
  display: block;
  border: 2px solid #e7efe9;
  box-shadow:
    0 3px 8px rgba(15, 23, 42, 0.04),
    0 0 0 4px rgba(122, 196, 138, 0.06);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.member-card:hover .member-photo {
  border-color: rgba(122, 196, 138, 0.55);
  transform: scale(1.012);
  box-shadow:
    0 8px 16px rgba(31, 107, 209, 0.06),
    0 0 0 6px rgba(122, 196, 138, 0.12);
}

.member-name {
  font-size: 0.96rem;
  font-weight: 760;
  line-height: 1.2;
  color: var(--ink-900);
  margin: 0 0 0.06rem;
  padding: 0;
}

.member-role {
  font-size: 0.79rem;
  color: var(--ink-500);
  margin: 0 0 0.22rem;
  font-weight: 500;
  padding: 0;
  line-height: 1.25;
}

.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.2rem;
  padding: 0;
  width: 100%;
}

.member-tags span {
  background: var(--accent-green-100);
  color: var(--accent-green);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 670;
  letter-spacing: 0.01em;
  border: 1px solid #dbeee3;
  line-height: 1.2;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.member-card:hover .member-tags span {
  background: #e8f4ed;
  border-color: #d2e8db;
}

/* ============================
   MODAL
   ============================ */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
}

.modal-content {
  background: #ffffff;
  border-radius: 22px;
  max-width: 820px;      /* было 740px */
  width: 94%;            /* было 92% */
  max-height: 86vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid var(--border);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.24),
    0 8px 18px rgba(15, 23, 42, 0.08);
  animation: modal-slide-up 0.26s ease-out;
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(30px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: sticky;
  top: 0;
  right: 0;
  float: right;
  font-size: 1.9rem;
  font-weight: 300;
  color: var(--ink-500);
  cursor: pointer;
  padding: 0.85rem 1.15rem 0.45rem;
  line-height: 1;
  transition: color 0.18s ease, transform 0.18s ease;
  background: #ffffff;
  z-index: 10;
}

.modal-close:hover {
  color: var(--kaist-blue-600);
  transform: scale(1.05);
}

.modal-header {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: 1rem 1.5rem 1.15rem;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.modal-photo {
  width: 158px;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  object-fit: cover;
  border: 3px solid #eef3f8;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.modal-name {
  font-size: 1.52rem;
  font-weight: 780;
  margin: 0 0 0.2rem;
  color: var(--ink-900);
  letter-spacing: -0.02em;
}

.modal-role {
  font-size: 0.96rem;
  color: var(--ink-500);
  margin: 0 0 0.78rem;
  font-weight: 500;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.88rem;
  background: var(--chip-bg);
  color: var(--kaist-blue-600);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 650;
  border: 1px solid #dbe9ff;
  transition: all 0.18s ease;
}

.modal-link i { font-size: 0.95rem; }

.modal-link:hover {
  background: var(--kaist-blue-600);
  color: #ffffff;
  transform: translateY(-1px);
}

.modal-section {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.modal-section:last-child { border-bottom: none; }

.modal-section h3 {
  font-size: 1rem;
  font-weight: 760;
  color: var(--ink-900);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
  position: relative;
}

.modal-section h3::after {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  margin: 0.35rem 0 0;
  border-radius: 999px;
  background: var(--accent-line);
}

.modal-edu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-edu li {
  padding: 0.3rem 0;
  color: var(--ink-600);
  font-size: 0.92rem;
  line-height: 1.5;
}

.modal-edu li b {
  color: var(--accent-green);
  font-weight: 760;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.modal-tags span {
  background: var(--accent-green-100);
  color: var(--accent-green);
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
  border: 1px solid #dbeee3;
}

.modal-bio {
  color: var(--ink-600);
  font-size: 0.95rem;
  line-height: 1.68;
  margin: 0;
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 768px) {
  .members-hero {
    min-height: 84px;
    margin-bottom: 0.68rem;
    width: min(860px, calc(100% - 24px));
  }

  .members-hero-content { padding: 0.78rem 1rem; }
  .members-subtitle { font-size: 0.66rem; }
  .members-hero h1 { font-size: 1.5rem; }

  h2 { font-size: 1.42rem; margin: 0.85rem 0 0.3rem; }
  h2::after { width: 44px; margin-top: 0.34rem; }
  hr { margin: 0.58rem auto 0.72rem; }

  .members-grid { gap: 0.75rem; margin-bottom: 0.8rem; }

  .member-card {
    width: 100%;
    max-width: 300px;
    min-height: auto;
    padding: 0.72rem 0.68rem;
  }

  .member-photo { max-width: 156px; margin-bottom: 0.4rem; }

  .modal-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 1.2rem 1.1rem;
  }

  .modal-links { justify-content: center; }
  .modal-content { width: 96%; max-height: 90vh; }
  .modal-section { padding: 1rem 1.2rem; }
  .modal-photo { width: 145px; }
  .modal-section h3::after { margin-left: auto; margin-right: auto; }
}

.member-card {
  flex: 0 0 200px !important;
  width: 200px !important;
  max-width: 200px !important;
}

hr {
  display: none !important;
}

.page-rows-contents,
main.content {
  background: rgba(248, 250, 252, 0.5) !important;
}