/* =========================================================
   STAFF + MODAL (CLEAN FINAL)
   - 카드/모달 중복 제거
   - PC hover만 적용, 모바일 hover 제거
   - 모달: "첫번째 첨부 이미지" 형태로 고정(이미지 영역 + 본문)
   ========================================================= */

/* ---------- Tokens ---------- */
:root{
  --wrap: 1200px;

  /* Staff typography */
  --fz-page: 18px;
  --fz-name: 34px;
  --fz-role: 18px;
  --fz-sub:  15px;
  --fz-mini: 16px;
  --fz-btn:  18px;

  /* Colors */
  --c-main: #12b9d7;
  --c-text: #222;
  --c-sub:  #666;
  --c-line: #dfe3e7;
  --c-bgth: #f6f8fa;

  /* Layout */
  --photoW: 420px;
  --cardGap: 60px;
  --listGap: 200px;
  --headGap: 100px;
  --infoTop: 100px;

  /* Buttons */
  --btnH: 48px;
  --btn-blue: #00A9C8; /* 모바일/기본 단색 최종 */
  --btn-dark: #303030;
  --btn-dark-hover: #0006BB;

  /* Modal */
  --modal-maxW: 560px;     /* 모바일/기본 모달 폭(첫번째 이미지 느낌) */
  --modal-maxW-pc: 1000px; /* PC는 넓게 */
  --modal-radius: 18px;

  /* ✅ 모달 이미지 비율 (첫번째 이미지처럼) */
  --modal-img-w: 967;
  --modal-img-h: 454; /* 여기 숫자 낮추면(예:420) 세로가 더 줄어듦 */
}

/* =========================================================
   STAFF
   ========================================================= */
.staff-wrap{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 80px 20px;
  font-size: var(--fz-page);
  color: var(--c-text);
}

.staff-head{
  text-align: center;
  margin-bottom: var(--headGap);
}
.staff-head h2{
  margin: 0 0 12px;
  font-size: 50px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.staff-head p{
  margin: 0;
  color: #555;
  line-height: 1.6;
  font-weight: 500;
  font-size: 25px;
}

.staff-list{
  display: flex;
  flex-direction: column;
  gap: var(--listGap);
}

/* Card (PC) */
.staff-card{
  display: grid;
  grid-template-columns: var(--photoW) 1fr;
  gap: var(--cardGap);
  align-items: stretch;
}
.staff-photo{height:100%;}
.staff-photo picture,
.staff-photo img{height:100%;}
.staff-photo img{
  width:100%;
  display:block;
  background:#f2f4f6;
  object-fit: cover;
  object-position: center;
}

.staff-info{
  height:100%;
  display:flex;
  flex-direction: column;
  padding-top: var(--infoTop);
}

/* title */
.staff-title h3{
  margin:0;
  display:flex;
  align-items:flex-end;
  gap:10px;
}
.staff-title h3 strong{
  font-size: var(--fz-name);
  letter-spacing:-0.02em;
  color: var(--c-text);
}
.staff-title h3 span{
  font-size: var(--fz-role);
  color: var(--c-text);
  margin-bottom: 4px;
}

/* ✅ 설명 아래 라인(여기만) */
.staff-sub{
  margin-top: 8px;
  color: var(--c-sub);
  font-size: var(--fz-sub);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--c-line);
}

/* 진료과목 */
.staff-dl{
  display:grid;
  grid-template-columns: 90px 1fr;
  gap:12px;
  margin:26px 0 20px;
}
.staff-dl dt{
  font-weight:700;
  color: var(--c-text);
  font-size: var(--fz-btn);
}
.staff-dl dd{
  margin:0;
  color:#444;
  line-height:1.7;
}

/* 진료시간 */
.staff-time{
  padding-top: 18px;
}
.time-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}
.time-label{
  font-weight:800;
  color: var(--c-text);
}
.time-legend{
  color:#666;
  font-size: var(--fz-mini);
  display:flex;
  align-items:center;
  gap:8px;
}
.dot{
  width:10px;height:10px;border-radius:50%;display:inline-block;
}
.dot.on{background: var(--c-main);}
.dot.off{background:#d3d8dd;}

.time-table{
  display:grid;
  grid-template-columns: 60px repeat(6, 1fr);
  border-top:1px solid var(--c-line);
  border-bottom:1px solid var(--c-line);
}
.time-table .th,
.time-table .td{
  padding:10px 8px;
  border-right:1px solid var(--c-line);
  text-align:center;
  font-size: var(--fz-mini);
}
.time-table .th{
  background: var(--c-bgth);
  color: var(--c-text);
  font-weight:700;
}
.time-table .td{color:#555;}
.time-table .th:last-child,
.time-table .td:last-child{border-right:0;}

/* Buttons */
.staff-btns{
  display:flex;
  margin-top: auto; /* ✅ PC에서 사진 하단 라인 맞춤 */
}
.staff-btns .btn{
  flex:1 1 0;
  height: var(--btnH);
  padding:0;
  margin:0;
  border:0;
  text-decoration:none;
  cursor:pointer;

  display:flex;
  align-items:center;
  justify-content:center;

  font-family: inherit;
  font-size: var(--fz-btn);
  font-weight:700;
  line-height:1;
  letter-spacing:-0.02em;

  appearance:none;
  -webkit-appearance:none;

  outline:none !important;
  box-shadow:none !important;
}

/* 단일 컬러 기본값 */
.staff-btns .btn-blue{ background: var(--btn-blue); color:#fff; }
.staff-btns .btn-dark{ background: var(--btn-dark); color:#fff; }

/* PC에서만 hover */
@media (hover:hover) and (pointer:fine){
  .staff-btns .btn-dark:hover{ background: var(--btn-dark-hover); }
  /* 약력보기는 hover해도 같은 컬러 유지(요청대로 단색 유지 원하면 그대로) */
  .staff-btns .btn-blue:hover{ background: var(--btn-blue); }
}

/* 모바일에서 버튼이 표랑 너무 딱 붙지 않게 */
@media (max-width:1024px){
  :root{
    --fz-page: 16px;
    --fz-btn:  15px;
  }
  .staff-wrap{padding:50px 16px;}
  .staff-head h2{font-size:26px;}
  .staff-head p{font-size:15px;}

  .staff-card{grid-template-columns:1fr;gap:18px;}
  .staff-info{padding-top:0;height:auto;}
  .staff-title h3 strong{font-size:26px;}

  .staff-dl{grid-template-columns:1fr;gap:6px;margin:16px 0;}
  .staff-dl dt,
  .time-label{
    font-size:16px;        /* ✅ 진료과목/진료시간 타이틀 동일 */
    font-weight:700;
    line-height:1.4;
    letter-spacing:-0.02em;
  }
  .time-table{grid-template-columns:52px repeat(6,1fr);}

  .staff-btns{ margin-top: 28px; }  /* ✅ 모바일은 표와 간격 */
  .staff-btns .btn{height:46px;}
}

/* =========================================================
   MODAL (첫번째 첨부 이미지 스타일로 고정)
   ========================================================= */

/* blur target */
.page-blur{transition: filter .35s ease;}
.page-blur.is-blurred{filter: blur(8px);}

/* overlay */
.staff-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
}
.staff-modal.is-open{
  display:flex;
  align-items:center;       /* ✅ 중앙 */
  justify-content:center;   /* ✅ 중앙 */
  padding: 24px 16px;       /* ✅ 가장자리 여백 */
}

/* dim */
.staff-modal__dim{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
  opacity:0;
  animation: dimIn .28s ease forwards;
}

/* panel */
.staff-modal__panel{
  position:relative;
  z-index:1;
  width: min(var(--modal-maxW), 100%);
  max-height: calc(100vh - 48px);
  background:#fff;
  border-radius: var(--modal-radius);
  overflow:hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);

  display:flex;
  flex-direction:column;

  opacity:0;
  transform: translateY(16px) scale(.985);
  animation: panelIn .32s cubic-bezier(.2,.8,.2,1) forwards;
}

/* PC에서는 더 넓게 */
@media (min-width:1025px){
  .staff-modal__panel{
    width: min(var(--modal-maxW-pc), calc(100% - 120px));
  }
}

/* top bar */
.staff-modal__top{
  flex:0 0 auto;
  background: var(--c-main);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 18px;
}
.staff-modal__title{
  font-size: 22px;
  font-weight:700;
  letter-spacing:-0.02em;
}
.staff-modal__close{
  background:none;
  border:0;
  color:#fff;
  font-size: 30px;
  line-height:1;
  cursor:pointer;
  transition: transform .25s ease;
}
@media (hover:hover) and (pointer:fine){
  .staff-modal__close:hover{ transform: rotate(180deg); }
}

/* image area (첫번째 첨부처럼) */
.staff-modal__img{
  width:100%;
  aspect-ratio: calc(var(--modal-img-w) / var(--modal-img-h));
  background:#000;
  overflow:hidden;
}
.staff-modal__img img{
  width:100%;
  height:100%;
  object-fit: cover;
  object-position: center; /* ✅ 기본은 중앙(배민철/홍혜진) */
  display:block;
}

/* body */
.staff-modal__body{
  flex:1 1 auto;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px 22px;
}

/* modal text */
.modal-name{
  display:flex;
  gap:10px;
  align-items:flex-end;
  margin: 0 0 10px;
}
.modal-name strong{
  font-size: 24px;
  font-weight:800;
  color: var(--c-main);
}
.modal-name span{
  font-size: 15px;
  color:#888;
  margin-bottom:2px;
}
.modal-cols{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  border-top: 1px solid #e7ecef;
  padding-top: 12px;
}
.modal-cols p{
  margin:0 0 8px;
  line-height: 1.35;  /* ✅ 행간 줄이기 */
  font-size: 14px;
  color:#444;
}

/* mobile: 1 column */
@media (max-width:1024px){
  .modal-cols{grid-template-columns:1fr;}
}

/* ✅ 모바일에서 "정지원/노성윤"만 머리 살리기 */
@media (max-width:1024px){
  #staffModal[data-doctor="jjw"] .staff-modal__img img{ object-position: center 18%; }
  #staffModal[data-doctor="nsy"] .staff-modal__img img{ object-position: center 12%; }
  /* 배민철/홍혜진은 중앙 유지 */
  #staffModal[data-doctor="bmc"] .staff-modal__img img{ object-position: center; }
  #staffModal[data-doctor="hhj"] .staff-modal__img img{ object-position: center; }
}

/* close animation hook */
.staff-modal.is-closing .staff-modal__dim{ animation: dimOut .22s ease forwards; }
.staff-modal.is-closing .staff-modal__panel{ animation: panelOut .22s ease forwards; }

@keyframes dimIn{ to{opacity:1;} }
@keyframes panelIn{ to{opacity:1; transform: translateY(0) scale(1);} }
@keyframes dimOut{ to{opacity:0;} }
@keyframes panelOut{ to{opacity:0; transform: translateY(8px) scale(.99);} }

/* 모바일: 링크(진료예약) 터치/활성 상태에서 색 튀는거 방지 */
@media (max-width:1024px){
  .staff-btns .btn-dark,
  .staff-btns .btn-dark:link,
  .staff-btns .btn-dark:visited,
  .staff-btns .btn-dark:hover,
  .staff-btns .btn-dark:focus,
  .staff-btns .btn-dark:active{
    background: #303030 !important;
    color: #fff !important;
  }

  .staff-btns .btn-blue,
  .staff-btns .btn-blue:link,
  .staff-btns .btn-blue:visited,
  .staff-btns .btn-blue:hover,
  .staff-btns .btn-blue:focus,
  .staff-btns .btn-blue:active{
    background: #00A9C8 !important;
    color: #fff !important;
  }

  /* iOS 터치 하이라이트(파란/빨간 느낌) 제거 */
  .staff-btns .btn{
    -webkit-tap-highlight-color: transparent;
  }
}
