/* ================================================================
   HELIX AMC — 의료진 상세 모달 (seocho/doctors)
   ----------------------------------------------------------------
   [data-doctor-open="<slug>"] 버튼 클릭 시 seocho/doctors/modal.js
   가 동적으로 .helix-doctor-modal 을 body 에 주입.
   디자인 톤: 글로벌 popup (global/popup.css) 과 동일 — 다크 #0d1117,
   메인 블루 #0075d6, 백드롭 blur 4px.
   ================================================================ */

.helix-doctor-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.helix-doctor-modal.is-open {
  display: flex;
  opacity: 1;
}

.helix-doctor-modal_backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 40, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.helix-doctor-modal_panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid rgba(0, 117, 214, 0.18);
  border-radius: 14px;
  padding: 36px 36px 32px;
  box-sizing: border-box;
  color: #1a2230;
  font-family: inherit;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 24px 80px rgba(20, 40, 80, 0.18);
}

.helix-doctor-modal.is-open .helix-doctor-modal_panel {
  transform: translateY(0) scale(1);
}

.helix-doctor-modal_close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #6b7684;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
}

.helix-doctor-modal_close:hover {
  background: rgba(0, 117, 214, 0.10);
  color: #1a2230;
}

/* ── 헤더: 직책/이름/한줄 소개 + 사진 (텍스트 좌, 사진 우) ─────── */
.helix-doctor-modal_header {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 8px;
  align-items: flex-end;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(20, 40, 80, 0.08);
}

/* 텍스트 블록이 늘어나서 사진과 사이가 벌어지는 것 방지 — 내용 폭에 딱 맞춤 */
.helix-doctor-modal_header .helix-doctor-modal_meta {
  flex: 0 1 auto;
}

.helix-doctor-modal_photo-wrap {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: #eef2f6;
  border: 1px solid rgba(0, 117, 214, 0.18);
}

.helix-doctor-modal_photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  transform: scale(1.12);
  transform-origin: 50% 35%;
  display: block;
}

.helix-doctor-modal_photo[src=""],
.helix-doctor-modal_photo:not([src]) {
  opacity: 0;
}

/* 사진이 없는 의료진: 헤더에서 photo-wrap 통째로 숨김.
   회색 빈 박스가 보이는 사고 방지. 텍스트만 자연스럽게 정렬됨. */
.helix-doctor-modal_panel.has-no-photo .helix-doctor-modal_photo-wrap {
  display: none;
}
.helix-doctor-modal_panel.has-no-photo .helix-doctor-modal_header {
  gap: 0;
}

.helix-doctor-modal_meta {
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 0;
}

.helix-doctor-modal_title {
  font-family: inherit;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #0075d6;
  font-weight: 400;
  margin: 0 0 4px;
  white-space: nowrap;
}

.helix-doctor-modal_title::after {
  content: '';
  display: block;
  width: 1em;
  height: 3px;
  background: #0075d6;
  margin-top: 3px;
  border-radius: 2px;
}

.helix-doctor-modal_title:empty {
  display: none;
}

.helix-doctor-modal_name {
  font-size: 26px;
  font-weight: 700;
  color: #0d1117;
  margin: 0;
  line-height: 1.2;
}

.helix-doctor-modal_intro {
  margin: 8px 0 0;
  font-size: 14px;
  color: #4a5563;
  line-height: 1.55;
}

.helix-doctor-modal_intro:empty {
  display: none;
}

/* ── 본문 섹션 (학력 / 경력 / 세부 진료 / 학회·자격 / 논문) ─── */
.helix-doctor-modal_body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.helix-doctor-modal_section h3 {
  font-size: 15px;
  font-weight: 600;
  color: #0075d6;
  letter-spacing: 0.03em;
  margin: 0 0 10px;
}

.helix-doctor-modal_section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.helix-doctor-modal_section li {
  font-size: 15px;
  line-height: 1.55;
  color: #3a4452;
  padding-left: 14px;
  position: relative;
}

.helix-doctor-modal_section li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.78em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(0, 117, 214, 0.75);
}

/* ── 모바일 ──────────────────────────────────────────────── */
@media screen and (max-width: 600px) {
  .helix-doctor-modal {
    padding: 0;
  }
  .helix-doctor-modal_panel {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    padding: 60px 22px 28px;
    border: none;
  }
  .helix-doctor-modal_header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .helix-doctor-modal_photo-wrap {
    width: 96px;
    height: 96px;
  }
  .helix-doctor-modal_name {
    font-size: 22px;
  }
}

/* ── 모달 열린 동안 배경 스크롤 잠금 보조 (modal.js 가 html overflow 도 잠금) ─ */
html.helix-doctor-modal-open,
body.helix-doctor-modal-open {
  overflow: hidden !important;
}

/* 고유 주소 직접 접속도 기존 모달과 같은 화면. 본문은 최초 HTML에 포함. */
.helix-doctor-route { min-height: 100vh; font-family: Arial, "Noto Sans KR", sans-serif; }
body:has(.helix-doctor-route) { margin: 0; background: #f4f7fb; overflow: hidden; }
.helix-doctor-modal-direct { opacity: 1; }
.helix-doctor-modal-direct .helix-doctor-modal_panel { transform: none; }
.helix-doctor-modal-direct .helix-doctor-modal_close { text-decoration: none; }
.helix-doctor-modal-direct .helix-doctor-modal_section h2 {
  font-size: 15px; font-weight: 600; color: #0075d6; letter-spacing: 0.03em; margin: 0 0 10px;
}

/* 독립 상세 페이지. 본문은 생성 시 HTML에 포함되며 JS 없이도 읽을 수 있다. */
.helix-doctor-history-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 24px;
  padding: 8px 0;
  color: #0065b8;
  font-size: 15px;
  text-underline-offset: 5px;
}
.helix-doctor-history-link[hidden] { display: none; }
.helix-doctor-history-link:focus-visible,
.helix-doctor-detail a:focus-visible,
.helix-doctor-directory a:focus-visible { outline: 2px solid #0075d6; outline-offset: 5px; }
.helix-doctor-detail {
  box-sizing: border-box;
  width: min(100% - 40px, 960px);
  margin: 0 auto;
  padding: 36px 0 64px;
  color: #1a2230;
  font-family: Arial, "Noto Sans KR", sans-serif;
  overflow-wrap: anywhere;
}
.helix-doctor-detail *, .helix-doctor-directory * { box-sizing: border-box; }
.helix-doctor-detail a { color: #0065b8; text-underline-offset: 5px; }
.helix-doctor-detail_brand { display: block; font-size: 15px; margin-bottom: 24px; }
.helix-doctor-detail_breadcrumb { font-size: 14px; line-height: 1.8; margin-bottom: 32px; }
.helix-doctor-detail_breadcrumb span { margin: 0 10px; color: #697482; }
.helix-doctor-detail_article { background: #fff; border: 1px solid #dce6ee; border-radius: 14px; padding: 40px; }
.helix-doctor-detail .helix-doctor-modal_header { gap: 28px; align-items: center; }
.helix-doctor-detail .helix-doctor-modal_name { font-size: 36px; }
.helix-doctor-detail_department { color: #566372; font-size: 15px; margin: 14px 0 0; }
.helix-doctor-detail .helix-doctor-modal_section h2 { font-size: 18px; color: #0075d6; margin: 0 0 12px; }
.helix-doctor-detail .helix-doctor-modal_section { margin-top: 28px; }
.helix-doctor-detail .helix-doctor-modal_section li { font-size: 16px; line-height: 1.8; }
.helix-doctor-detail_back { margin-top: 32px; border-top: 1px solid #dce6ee; padding-top: 20px; }
.helix-doctor-directory { font-family: inherit; padding: 28px 0; color: #1a2230; }
.helix-doctor-directory h2 { font-size: 20px; }
.helix-doctor-directory ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.helix-doctor-directory a { display: inline-block; padding: 10px 0; color: #0065b8; font-size: 15px; }
@media screen and (max-width: 600px) {
  .helix-doctor-detail { width: calc(100% - 32px); padding: 24px 0 40px; }
  .helix-doctor-detail_article { padding: 28px 20px; border-radius: 10px; }
  .helix-doctor-detail .helix-doctor-modal_header { flex-direction: column; align-items: flex-start; gap: 20px; }
  .helix-doctor-detail .helix-doctor-modal_name { font-size: 28px; }
  .helix-doctor-detail_breadcrumb { margin-bottom: 24px; }
}
