/* 시술 상세 SSR 페이지 (성형·모발·여성 공용)
   템플릿: templates/medical-item-detail.html */

.medical-item-detail {
  /* 폭 제한을 여기 두면 안의 블록이 화면 끝까지 못 나간다.
     제한을 자식으로 내려 블록만 빠져나갈 수 있게 한다. */
  margin: 0 auto;
  padding: 0 0 40px;
  /* 헤더가 position:fixed 라 본문이 그 아래로 가린다 — 헤더 높이만큼 내린다 */
  padding-top: 125px;
}

/* 블록을 뺀 나머지는 폭 1200, 좌우 여백 20.
   화면 끝까지 나가야 하는 것에는 .full-bleed 를 붙인다 — 새로 생겨도 여기를 안 고친다. */
.medical-item-detail > *:not(.dblocks):not(.full-bleed) {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* 카드가 늘어서는 섹션만 화면에 맞춰 넓힌다.
   읽는 글(시술명·경로)은 넓히지 않는다 — 줄이 길어지면 눈이 다음 줄을 찾기 어렵다. */
.medical-item-detail > .item-related {
  max-width: min(1640px, 100%);
}


/* 경로 표시 */
.medical-item-detail .breadcrumb {
  font-size: 13px;
  color: #666;
  margin-bottom: 20px;
}

.medical-item-detail .breadcrumb a {
  color: #666;
  text-decoration: none;
}

.medical-item-detail .breadcrumb a:hover {
  color: #111;
}

.medical-item-detail .breadcrumb .current {
  color: #333;
  font-weight: 600;
}

/* 시술명·설명 */
.medical-item-detail h1 {
  font-size: clamp(32px, 2.8vw, 42px);
  font-weight: 700;
  margin-bottom: clamp(12px, 1vw, 18px);
  line-height: 1.3;
}

/* 대표 이미지 — 시술 배너는 세로가 긴 경우가 많아 비율을 강제하지 않는다(잘림 방지) */
.medical-item-detail figure {
  margin: 0 0 30px;
  overflow: hidden;
  border-radius: 8px;
  background: #f5f5f5;
}

.medical-item-detail figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* 시술 상세 본문 (Quill 리치 HTML) */
.medical-item-detail .section-body {
  font-size: 15px;
  color: #444;
  line-height: 1.8;
  margin-bottom: 30px;
  padding: 0;                /* ql-editor 기본 패딩 제거 */
}

.medical-item-detail .section-body img {
  /* 본문 이미지 원본이 전부 1080px 이라 그 이상 늘리면 흐려진다 */
  max-width: min(100%, 1080px);
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* 하단 이동 버튼 */
.medical-item-detail .cta-area {
  text-align: center;
  margin-top: 40px;
  padding: 30px 20px;   /* 좌우는 다른 자식과 같게 — 0 으로 두면 여백 없이 붙는다 */
  border-top: 1px solid #eee;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.medical-item-detail .cta-btn {
  display: inline-block;
  background: #111;
  color: #fff;
  padding: 14px 36px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
}

.medical-item-detail .cta-btn:hover {
  opacity: .85;
}

.medical-item-detail .cta-btn.sub {
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
}

@media (max-width: 768px) {
  .medical-item-detail {
    padding: 20px 16px;
    padding-top: 90px;   /* 고정 헤더(70px) 아래로 */
  }

  .medical-item-detail h1 {
    font-size: 24px;
  }

  .medical-item-detail .cta-btn {
    width: 100%;
  }
}

/* 이 시술의 후기·전후사진 */
.item-related { margin-top: clamp(48px, 5vw, 88px); }
.item-related h2 { font-size: clamp(20px, 1.9vw, 30px); margin: 0 0 clamp(14px, 1.2vw, 22px); }
.item-related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.item-related-card { display: block; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden;
  text-decoration: none; color: inherit; background: #fff; }
.item-related-card img {
  width: 100%;
  aspect-ratio: 1400 / 989;   /* 전후사진 원본 비율 — 잘리지 않게 */
  object-fit: contain;
  background: #f4f5f6;
  display: block;
}
.item-related-cap { display: block; padding: 8px 10px; font-size: 13px; color: #666; }
.item-related-more { display: inline-block; margin-top: 12px; font-size: 14px; color: #6d28d9; text-decoration: none; }

@media (max-width: 768px) {
  .item-related { margin-top: 32px; }
  .item-related h2 { font-size: 18px; }
  .item-related-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

/* 함께 보는 시술 */
.item-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.item-chip { display: inline-block; padding: 7px 14px; border: 1px solid #d6c9bb;
  border-radius: 16px; background: #fff; color: #333; text-decoration: none; font-size: 14px; }
.item-chip:hover { background: #f6f1ea; }

/* 담당 의료진 */
.item-doctors { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.item-doctor { border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; overflow: hidden; }
.item-doctor img {
  width: 100%;
  aspect-ratio: 750 / 776;    /* 의료진 사진 원본 비율 */
  object-fit: contain;
  background: #f4f5f6;
  display: block;
}
.item-doctor-body { padding: 10px 12px; }
.item-doctor-body b { display: block; font-size: 15px; }
.item-doctor-body span { font-size: 13px; color: #666; }


@media (max-width: 768px) {
  .item-doctors { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* 경과 구간별 후기 수 */
.item-timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.item-timeline-cell { border: 1px solid #e5e7eb; border-radius: 8px; background: #fff;
  padding: 14px 10px; text-align: center; text-decoration: none; color: inherit; }
.item-timeline-cell:hover { background: #faf8f5; }
.item-timeline-cell b { display: block; font-size: 13.5px; color: #6d28d9; margin-bottom: 4px; }
.item-timeline-cell .n { font-size: 20px; font-weight: 700; }
.item-timeline-cell .u { font-size: 12px; color: #888; margin-left: 2px; }
.item-timeline-cell.on { border-color: #6d28d9; background: #f5f3ff; }
.item-timeline-cell.on b { font-weight: 700; }
/* 앵커로 뛸 때 고정 헤더에 제목이 가리지 않게 */
#itemReviews { scroll-margin-top: 95px; }
.item-timeline-clear { display: inline-block; margin-bottom: 12px; font-size: 13px;
  color: #6d28d9; text-decoration: underline; }
