/* 이벤트·후기·전후사진 상세와 블록 미리보기의 바탕 CSS — 시술 상세는 item-detail.css 를 쓴다 */

.medical-item-detail {
  /* 폭 제한을 여기 두면 안의 블록이 화면 끝까지 못 나간다.
     제한을 자식으로 내려 블록만 빠져나갈 수 있게 한다. */
  margin: 0 auto;
  padding: 0 0 40px;
  /* 상세 전용 헤더(85px)가 fixed 라 그만큼 내린다 */
  padding-top: 85px;
}

/* 블록을 뺀 나머지는 폭 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; }

@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)); }
}
