/* —— Base typography ——————————————————————————————— */
:root{
  --text: #0f172a;          /* slate-900 */
  --muted: #475569;         /* slate-600 */
  --border: #e2e8f0;        /* slate-200 */
  --accent: #0ea5e9;        /* sky-500 */
}

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
               "Apple SD Gothic Neo", "Malgun Gothic", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  background: #fff;
}


/* —— Header / Navigation ——————————————————————————— */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo {
  width: 200px;
  object-fit: contain;
}

.brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .1px;
  white-space: nowrap;
}

/* 메뉴 */
.main-nav { margin-left: auto; }
.nav-list {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-list a {
  display: inline-block;
  padding: 6px 2px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .2px;
  transition: color .2s ease, border-color .2s ease;
  border-bottom: 2px solid transparent;
}
.nav-list a:hover,
.nav-list a:focus {
  color: var(--text);
  border-bottom-color: var(--accent);
  outline: none;
}

.site-footer {
  background: #f8fafc;         /* 연한 회색 배경 */
  border-top: 1px solid #e2e8f0;
  padding: 20px 0;
  margin-top: 40px;
  font-size: 0.9rem;
  color: #475569;              /* slate-600 */
  text-align: center;
}

.site-footer .footer-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-footer .footer-lab {
  font-weight: 600;
  color: #0f172a;              /* 진한 slate */
  margin-bottom: 4px;
}

.site-footer .footer-address {
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.site-footer .footer-copy {
  font-size: 0.8rem;
  color: #64748b;              /* slate-500 */
}


/* 현재 페이지 강조(옵션): 각 페이지에서 body나 main에 data-page 속성을 주고 매칭해도 됨 */
/* 예: <body data-page="publications"> … */
body[data-page="people"]        .nav-list a[href="/people"],
body[data-page="publications"]  .nav-list a[href="/publications"],
body[data-page="research"]      .nav-list a[href="/research"],
body[data-page="teaching"]      .nav-list a[href="/teaching"],
body[data-page="gallery"]       .nav-list a[href="/gallery"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* —— Main spacing ———————————————————————————————— */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* —— Small screens —————————————————————————————— */
/* ===== Mobile (스마트폰) 레이아웃 조정 ===== */
@media (max-width: 640px) {
  /* 헤더 컨테이너는 필요 시 줄바꿈 허용 */
  .nav-container {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;              /* 로고/메뉴 줄바꿈 허용 */
  }

  /* 로고 줄이기 */
  .brand-logo {
    width: 100px;                  /* was: 40px */
    display: block;
    margin: 0 auto;
  }

  /* 긴 제목 숨김(이미 있으면 그대로 유지) */
  .brand-text {
    display: none;                /* 로고만 보이게 */
  }

  /* 메뉴: 작은 글자 + 줄바꿈 */
  .main-nav {
    flex: 1 1 100%;
  }
  .nav-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;              /* 여러 줄 허용 */
    gap: 8px 12px;                /* 세로/가로 간격 */
    margin-top: 2px;
  }
  .nav-list a {
    font-size: 0.92rem;           /* 살짝 축소 */
    padding: 6px 0;
    border-bottom-width: 2px;     /* 호버 밑줄 유지 */
  }

  /* 첫 줄에 로고, 그 아래에 메뉴가 두 줄까지 나올 수 있음 */
  .site-header {
    border-bottom: 1px solid var(--border);
  }
}


/* ===== People sections ===== */
.people-section { margin: 36px 0 44px; }
.people-section + .people-section { border-top: 1px solid var(--border); padding-top: 36px; }
.people-section-title {
  font-size: 1.35rem;
  margin: 0 0 16px;
  position: relative;
}
.people-section-title::after {
  content: "";
  position: absolute; left: 0; bottom: -6px;
  width: 48px; height: 2px; background: var(--accent); border-radius: 2px;
}

/* ===== 카드 레이아웃: 상단(사진+헤드) / 하단(설명/연락처 전체폭) ===== */
.person-card{
  display:grid;
  grid-template-columns: 120px 1fr;                 /* 좌: 사진, 우: 헤드 */
  grid-template-areas:
    "photo head"
    "desc  desc"
    "contacts contacts";
  gap:14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  padding:16px;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.person-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15,23,42,.08);
  border-color:#dbe4f3;
}

/* 사진: 왼쪽 칸 고정 */
.person-photo{
  grid-area: photo;
  width:120px; height:120px;
  object-fit:cover;
  border-radius:50%;
  border:1px solid var(--border);
  background:#f8fafc;
}

/* 상단 이름/직급: 사진 오른쪽 한 줄(필요 시 두 줄) */
.person-head{
  grid-area: head;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.person-name{ font-weight:800; font-size:1.06rem; line-height:1.2; }
.person-position{ color:var(--muted); margin-top:4px; }

/* ✅ 연구 태그 */
.person-tags{
  margin-top:8px;
  display:flex; flex-wrap:wrap; gap:6px;
}
.chip{
  display:inline-block;
  padding: 2px 8px;
  border-radius:999px;
  background:#f1f5f9;          /* slate-100 */
  color:#334155;               /* slate-700 */
  border:1px solid #e2e8f0;    /* slate-200 */
  font-size:.75rem;
  line-height:1.6;
  white-space:nowrap;
}

/* 하단 설명: 전체 너비 */
.person-bio{
  grid-area: desc;     /* 두 컬럼(span) */
  margin-top:2px;
  color:#334155;
}

/* 하단 연락처: 전체 너비 */
.person-contacts{
  grid-area: contacts; /* 두 컬럼(span) */
  display:flex;
  flex-direction: column;
  gap: 6px;
  margin-top:8px;
}

.person-contects a {
  display: block;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text);
  overflow-wrap: anywhere;
}

.icon-link{
  display:inline-flex; align-items:center; gap:6px;
  text-decoration:none; color:var(--text); font-weight:600;
  font-size:.92rem;
  overflow-wrap:anywhere;      /* 긴 이메일 자동 줄바꿈 */
}
.icon-link:hover{ color:var(--accent); }
.i{
  display:inline-flex; align-items:center; justify-content:center;
  width:10px; height:10px;
  font-size:.85rem; font-weight:10;
  color:#0369a1; background:#e0f2fe; border-radius:6px;
}

/* 반응형: 모바일에서 사진/헤드 수직 스택 */
@media (max-width: 560px){
  .person-card{
    grid-template-columns: 80px 1fr;
    grid-template-areas:
      "photo head"
      "desc  desc"
      "contacts contacts";
  }
  .person-photo{ width:80px; height:80px; }
}

/* 섹션/그리드(기존) */
.people-grid{
  display:grid;
  grid-template-columns: repeat(12,1fr);
  gap:18px;
}
@media (min-width:1200px){ .person-card{ grid-column: span 4; } }
@media (min-width:720px) and (max-width:1199px){ .person-card{ grid-column: span 6; } }
@media (max-width:719px){ .person-card{ grid-column: 1 / -1; } }

/* ===== Publications ===== */
.pubs { margin-top: 8px; }

/* 타입 헤더 */
.pub-type {
  font-size: 1.25rem;
  margin: 22px 0 8px;
  position: relative;
}
.pub-type::after {
  content: "";
  position: absolute; left: 0; bottom: -6px;
  width: 48px; height: 2px; background: var(--accent); border-radius: 2px;
}

/* 연도 헤더 */
.pub-year { margin: 18px 0 8px; color: #0f172a; font-weight: 800; }

/* 리스트 */
.pub-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 8px;
}
.pub-item {
  display: grid;
  grid-template-columns: 64px 1fr;    /* 좌: 순번, 우: 본문 */
  gap: 10px 16px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.pub-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
  border-color: #dbe4f3;
}

.pub-num {
  box-sizing: border-box;
  width: 48px; height: 48px;
  border-radius: 10px;
  background: #f1f5f9;          /* slate-100 */
  color: #334155;               /* slate-700 */
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0;    /* slate-200 */
}

/* 본문 */
.pub-body { min-width: 0; }
.pub-title-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.pub-title { font-weight: 800; }
.pub-link { text-decoration: none; font-weight: 700; }
.pub-link:hover { color: var(--accent); }

.pub-authors { margin-top: 2px; color: #0f172a; }
.pub-venue   { margin-top: 2px; color: #475569; font-style: italic; }

/* 배지: Top-tier > Excellent */
.badge-top {
  display:inline-block; padding:2px 8px; border-radius:999px;
  background:#fef3c7; border:1px solid #fde68a; color:#92400e;
  font-size:.78rem; font-weight:800; letter-spacing:.2px;
}
.badge-ex {
  display:inline-block; padding:2px 8px; border-radius:999px;
  background:#e0e7ff; border:1px solid #c7d2fe; color:#3730a3;
  font-size:.78rem; font-weight:700; letter-spacing:.2px;
}

/* 반응형 */
@media (max-width: 720px) {
  .pub-item { grid-template-columns: 48px 1fr; }
  .pub-num { width: 40px; height: 40px; }
}
@media (max-width: 520px) {
  .pub-item { grid-template-columns: 1fr; }
  .pub-num { order: -1; margin-bottom: 6px; }
}


/* ===== Research (hero형 카드) ===== */

.research-section { margin: 36px 0 44px; }
.research-section + .people-section { border-top: 1px solid var(--border); padding-top: 36px; }
.research-section-title {
  font-size: 1.35rem;
  margin: 0 0 16px;
  position: relative;
}
.research-section-title::after {
  content: "";
  position: absolute; left: 0; bottom: -6px;
  width: 48px; height: 2px; background: var(--accent); border-radius: 2px;
}


.research-list {
  display: grid;
  gap: 24px;
  margin-bottom: 40px;
}

/* 박스는 넉넉하게, 내용 섹션은 위→아래로 */
.research-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.research-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  border-color: #dbe4f3;
}

.research-title {
  margin: 0 0 6px 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
}

.research-meta {
  color: #475569;             /* slate-600 */
  font-size: .95rem;
  margin-bottom: 10px;         /* 메타 ↔ 이미지 사이 간격 */
}

/* 대표 도면: 크게, 박스 폭을 꽉 채움 */
.research-hero {
  margin-top: 6px;
  margin-bottom: 10px;
  background: #f8fafc;        /* 밝은 캔버스 */
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;                /* 이미지가 흰 테두리에 붙지 않게 */
}
.research-hero img {
  width: 100%;
  max-height: 480px;           /* 필요 시 400~520px로 조절 */
  object-fit: contain;         /* 그림 비율 유지하며 크게 */
  display: block;
  border-radius: 6px;
}

/* 설명: 넉넉한 행간 */
.research-desc {
  margin-top: 6px;
  line-height: 1.6;
  color: #334155;              /* slate-700 */
}

/* 모바일에서도 동일한 단일 컬럼 */
@media (max-width: 720px) {
  .research-hero img { max-height: 380px; }
}


/* —— Latest News ——————————————————————————— */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.news-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: none;
  background: none;
  flex-wrap: nowrap;
}

.news-date {
  box-sizing: border-box;
  flex: 0 0 120px;
  width: 120px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  text-align: left;
}

.news-badge {
  box-sizing: border-box;
  flex: 0 0 100px;
  width: 100px;
  display: inline-block;
  text-align: center;
  padding: 2px 0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .2px;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* 카테고리별 배지 색상 */
.badge-paper    { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }  /* cyan-ish */
.badge-award    { background: #fef3c7; color: #92400e; border-color: #fde68a; }  /* amber */
.badge-newcomer { background: #e0f2fe; color: #075985; border-color: #bae6fd; }  /* sky */
.badge-event    { background: #e9d5ff; color: #5b21b6; border-color: #d8b4fe; }  /* violet */
.badge-book     { background: #dcfce7; color: #166534; border-color: #bbf7d0; }  /* green */

.news-text {
  margin: 0;
  white-space: normal;
}

/* 좁은 화면 대응 */
@media (max-width: 640px) {
  .news-item {
    flex-wrap: wrap;
  }
}


/* —— Vision ———————————————————————————————— */
.vision { margin: 28px 0 8px; }
.vision-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);   /* 데스크톱: 3열 */
  gap: 18px;
}
.vision-card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px;
  background:#fff;
  text-align:center;
}

/* 로고(이미지) 영역: 같은 라인/높이로 정렬되도록 고정 높이 */
.vision-logo-wrap{
  height:120px;                 /* 필요 시 100~140px로 조정 */
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:10px;
}
.vision-logo{
  max-width:140px;              /* 로고 너비 제한 */
  max-height:100%;              /* 카드 안에서 최대 높이 */
  object-fit:contain;           /* 비율 유지 */
  display:block;
}

.vision-title{
  margin:6px 0 6px;
  font-size:1.05rem;
  font-weight:700;
}
.vision-desc{
  margin:0;
  color:var(--muted);
  line-height:1.55;
}

/* 반응형: 화면이 좁아지면 자동으로 2열 → 1열 */
@media (max-width: 980px){
  .vision-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .vision-grid{ grid-template-columns: 1fr; }
  .vision-logo-wrap{ height:100px; }
}

/* —— Gallery —— */
.gallery-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin: 8px 0 16px; }
.gfilter {
  border:1px solid var(--border); background:#fff; color:#334155;
  border-radius: 999px; padding:6px 10px; font-weight:600; cursor:pointer;
}
.gfilter.is-active { border-color:#0ea5e9; color:#0ea5e9; }

.gallery-grid {
  list-style:none; margin:0; padding:0;
  display:grid; gap:16px;
  grid-template-columns: repeat(12, 1fr);
}
.gallery-year {
  grid-column: 1 / -1;
  font-weight: 800;
  color: #0f172a;
  margin: 6px 0 4px;
  border-left: 4px solid var(--accent);
  padding-left: 8px;
}

.gallery-card { grid-column: span 4; border:1px solid var(--border); border-radius:12px; overflow:hidden; background:#fff; }
.gallery-card img { width:100%; height:220px; object-fit:cover; display:block; }
.gmeta { padding:10px 12px; }
.gtitle { font-weight:800; }
.gcap { color:#475569; margin-top:2px; }
.gdate { color:#64748b; font-size:.85rem; margin-top:4px; }

/* 반응형 */
@media (max-width: 1024px){ .gallery-card { grid-column: span 6; } }
@media (max-width: 640px){ .gallery-card { grid-column: 1 / -1; } }

/* 라이트박스 */
.lightbox { position:fixed; inset:0; display:grid; place-items:center; z-index:9999; }
.lightbox[hidden] { display: none !important; }
.lb-backdrop { position:absolute; inset:0; background: rgba(0,0,0,.5); }
.lb-figure { position:relative; background:#0b1020; padding:10px; border-radius:12px; max-width:min(92vw, 1200px); max-height:90vh; display:flex; flex-direction:column; gap:8px; }
.lb-figure img { max-width:100%; max-height:76vh; object-fit:contain; background:#fff; border-radius:8px; }
.lb-figure figcaption { color:#e5e7eb; font-size:.95rem; text-align:center; }
.lb-close { position:absolute; top:6px; right:8px; font-size:28px; line-height:1; background:none; border:none; color:#e5e7eb; cursor:pointer; }

/* 페이지네이션 */
.pager {
  display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:center;
  margin-top: 16px;
}
.pbtn {
  border:1px solid var(--border); background:#fff; color:#334155;
  border-radius: 8px; padding:6px 10px; text-decoration:none; font-weight:600;
}
.pbtn[aria-disabled="true"] { opacity:.45; pointer-events:none; }
.ppage { color:#475569; font-weight:700; }

