/* 서브 지면 본문 정리 — 양쪽 정렬 · 행간과 문단 간격을 값 하나로 · 맨 마지막에 읽힌다
   :not(#iu-sub) 는 지면별 규칙보다 한 단계 앞서게 하려고 붙였다 */
:root {
  --iu-body-lh: 1.6;
  --iu-para-gap: 16px;
}

/* 본문 단락: 양쪽 정렬, 마지막 줄은 왼쪽 */
html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) :is(
  div.cont > p,
  .dn-sub-hero__intro-inner > p,
  .dn-natural-results__body p,
  .dn-geo-content__block p,
  .dn-geo-card p,
  details > div p,
  .dn-insight-card__desc,
  .iu-revsteps__d,
  .breast-bottom-card__desc,
  .breast-bottom-links__desc,
  .iu-fat__text,
  .iu-fat__lede,
  .iu-equip__desc,
  .blog-card__summary,
  .lg-text,
  .lg-method__dl dd,
  .iu-bd-sub p,
  .iu-bd-items p,
  .iu-sjtypes__card p,
  .rr-guide__inner p,
  .dn-doctor-intro__body p,
  .about-hub__why-summary p,
  .about-hub__value-card p,
  .iu-mdopt__d,
  .g1-faq-note,
  .dn-surg__step,
  .iu-leg__row p,
  .iu-leg__duo p,
  .iu-deflist dd,
  .lg-criteria dd,
  .iu4-skin__row dd,
  .iu-bd-grid > li > p,
  .wune-related__desc,
  .wds-notice__text,
  .iu-nosetypes__desc,
  .cont_text > p,
  .lg-note,
  div.cont > div > p,
  .pp-doc section > p
) {
  text-align: justify !important;
  text-align-last: left !important;
  text-justify: inter-character;
  text-wrap: wrap !important;
  line-height: var(--iu-body-lh) !important;
}

html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) :is(
  div.cont > p,
  .dn-natural-results__body p,
  .dn-geo-content__block p,
  details > div p,
  .iu-bd-sub p,
  .rr-guide__inner p,
  .dn-doctor-intro__body p
):lang(en) {
  hyphens: auto;
}

/* 의료진 수상·방송·특허 머리 설명은 원래 정렬(왼쪽) 그대로 */
html body.wds main:not(#iu):not(#iu-sub) .content_wrap .doctor-media__header p.doctor-media__desc {
  text-align: left !important;
}

/* 이어지는 문단 사이는 한 값 */
html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) :is(
  div.cont,
  .dn-sub-hero__intro-inner,
  .dn-natural-results__body,
  .dn-geo-content__block,
  .dn-geo-card,
  details > div,
  .iu-bd-sub,
  .rr-guide__inner,
  .dn-doctor-intro__body
) > p:has(+ p) {
  margin-bottom: var(--iu-para-gap) !important;
}
html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) :is(
  div.cont,
  .dn-sub-hero__intro-inner,
  .dn-natural-results__body,
  .dn-geo-content__block,
  .dn-geo-card,
  details > div,
  .iu-bd-sub,
  .rr-guide__inner,
  .dn-doctor-intro__body
) > p + p {
  margin-top: 0 !important;
}

/* 홈 본문도 같은 값으로 — 가운데 정렬 문구는 그대로 둔다 */
html body.wds main#main :is(.s2-philo__title > p.s2-lead, .s2-rule__p, .s2-note__p, .s2-care__p, .s2-disclaimer) {
  text-align: justify !important;
  text-align-last: left !important;
  text-justify: inter-character;
  line-height: var(--iu-body-lh) !important;
}
html body.wds main#main :is(.s2-rule__p, .s2-note__p, .s2-care__p, .s2-disclaimer):lang(en) {
  hyphens: auto;
}

/* 폰 폭(767px 이하)은 줄이 짧아 양쪽 정렬이 글자·어절 사이를 크게 벌린다 — 왼쪽 정렬로 둔다 */
@media (max-width: 767px) {
html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) :is(
  div.cont > p,
  .dn-sub-hero__intro-inner > p,
  .dn-natural-results__body p,
  .dn-geo-content__block p,
  .dn-geo-card p,
  details > div p,
  .dn-insight-card__desc,
  .iu-revsteps__d,
  .breast-bottom-card__desc,
  .breast-bottom-links__desc,
  .iu-fat__text,
  .iu-fat__lede,
  .iu-equip__desc,
  .blog-card__summary,
  .lg-text,
  .lg-method__dl dd,
  .iu-bd-sub p,
  .iu-bd-items p,
  .iu-sjtypes__card p,
  .rr-guide__inner p,
  .dn-doctor-intro__body p,
  .about-hub__why-summary p,
  .about-hub__value-card p,
  .iu-mdopt__d,
  .g1-faq-note,
  .dn-surg__step,
  .iu-leg__row p,
  .iu-leg__duo p,
  .iu-deflist dd,
  .lg-criteria dd,
  .iu4-skin__row dd,
  .iu-bd-grid > li > p,
  .wune-related__desc,
  .wds-notice__text,
  .iu-nosetypes__desc,
  .cont_text > p,
  .lg-note,
  div.cont > div > p,
  .pp-doc section > p
),
html body.wds main#main :is(.s2-philo__title > p.s2-lead, .s2-rule__p, .s2-note__p, .s2-care__p, .s2-disclaimer) {
  text-align: left !important;
}
}

/* 한국어 본문: 음절 단위로 줄을 넘기고 양쪽 정렬(남는 폭이 작아 글자 사이가 덜 벌어진다) */
html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) :is(
  div.cont > p,
  .dn-sub-hero__intro-inner > p,
  .dn-natural-results__body p,
  .dn-geo-content__block p,
  .dn-geo-card p,
  details > div p,
  .dn-insight-card__desc,
  .iu-revsteps__d,
  .breast-bottom-card__desc,
  .breast-bottom-links__desc,
  .iu-fat__text,
  .iu-fat__lede,
  .iu-equip__desc,
  .blog-card__summary,
  .lg-text,
  .lg-method__dl dd,
  .iu-bd-sub p,
  .iu-bd-items p,
  .iu-sjtypes__card p,
  .rr-guide__inner p,
  .dn-doctor-intro__body p,
  .about-hub__why-summary p,
  .about-hub__value-card p,
  .iu-mdopt__d,
  .g1-faq-note,
  .iu-leg__row p,
  .iu-leg__duo p,
  .iu-deflist dd,
  .lg-criteria dd,
  .iu4-skin__row dd,
  .iu-bd-grid > li > p,
  .wune-related__desc,
  .wds-notice__text,
  .iu-nosetypes__desc,
  .cont_text > p,
  .lg-note,
  div.cont > div > p,
  .pp-doc section > p
):lang(ko),
html body.wds main#main :is(.s2-philo__title > p.s2-lead, .s2-rule__p, .s2-note__p, .s2-disclaimer):lang(ko) {
  text-align: justify !important;
  text-align-last: left !important;
  text-justify: inter-character;
  word-break: normal !important;
}
/* 나열형 줄, 의료진 머리 설명, 좁은 카드(단계·장비·인사이트) 글은 왼쪽 정렬 */
html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) :is(.dn-surg__step, .iu-equip__desc, .dn-insight-card__desc, .iu-revsteps__d, .cont_title_wrap .cont_text p):lang(ko),
html body.wds main#main p.s2-care__p.s2-care__p:lang(ko) {
  text-align: left !important;
}
html body.wds main:not(#iu):not(#iu-sub) .content_wrap .doctor-media__header p.doctor-media__desc:lang(ko) {
  text-align: left !important;
}

/* 3~4칸 단계 카드 설명은 칸이 좁아 모든 언어에서 왼쪽 정렬 */
html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) .iu-revsteps__d.iu-revsteps__d.iu-revsteps__d {
  text-align: left !important;
}

/* 예약 지면 머리 안내 문구는 원래 가운데 정렬 그대로 */
html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) :is(.wune-consult__lead.wune-consult__lead.wune-consult__lead, .wune-consult__hint.wune-consult__hint.wune-consult__hint) {
  text-align: center !important;
  text-align-last: center !important;
}
html body.wds main:not(#iu):not(#iu-sub) :is(.content_wrap, .cont_wrap) .wune-consult__hint.wune-consult__hint.wune-consult__hint {
  text-wrap: balance !important;
  word-break: keep-all !important;
}

/* 홈 영상 카드: 칸이 좁고 낮으면 위 표식이 제목을 덮는다 — 그런 칸에서는 표식을 뺀다 */
html body #s2page.s2 .s2-vid__box--plain { container-type: inline-size; }
html body #s2page.s2 .s2-vid__box--plain .s2-vid__mark { white-space: nowrap; }
@container (max-width: 219px) {
  html body #s2page.s2 .s2-vid__box--plain .s2-vid__mark { display: none; }
}

/* 소개 문단과 바로 아래 «한눈에 보기» 사이를 좁히고, 두 글 칸의 폭을 맞춘다 */
html body.wds main:not(#iu):not(#iu-sub) .dn-sub-hero__intro + .dn-geo-block {
  padding-top: 36px !important;
}
html body.wds main:not(#iu):not(#iu-sub) :is(.dn-sub-hero__intro-inner > p, .dn-sub-hero__intro + .dn-geo-block .dn-geo-card) {
  max-width: 720px;
  width: 100%;
}

/* 2×2 포인트 카드: 열 폭은 같게, 설명은 칸 폭을 끝까지 쓴다 */
html body.wds main:not(#iu):not(#iu-sub) .dn-insight-track > .dn-insight-card {
  min-width: 0;
}
html body.wds main:not(#iu):not(#iu-sub) .dn-insight-track > .dn-insight-card > :is(.dn-insight-card__title, .dn-insight-card__desc) {
  max-width: none;
  width: 100%;
}

/* 나란한 카드: 제목이 한 줄이든 두 줄이든 설명 윗선을 같은 높이로 맞춘다.
   카드 안 칸(번호·제목·설명)을 바깥 격자의 줄에 걸쳐(subgrid) 같은 줄끼리 높이를 공유한다.
   글·그림은 그대로이고 줄 높이만 맞춘다. 한 칸으로 쌓이는 폭에서는 달라지는 것이 없다. */
@supports (grid-template-rows: subgrid) {
@media (min-width: 768px) {
  /* 수술·치료 단계(번호·제목·설명) */
  html body.wds main:not(#iu):not(#iu-sub) ol.iu-revsteps {
    grid-auto-rows: auto;
  }
  html body.wds main:not(#iu):not(#iu-sub) ol.iu-revsteps > li.iu-revsteps__item {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
    row-gap: 0;
    align-content: start;
  }
  /* 칸 수가 다른 카드(제목·설명 2칸 / 번호·제목·소제목·설명 4칸)는 줄 수를 칸 수에 맞춘다 */
  html body.wds main:not(#iu):not(#iu-sub) ol.iu-revsteps > li.iu-revsteps__item:not(:has(> .iu-revsteps__n)) {
    grid-row: span 2;
  }
  html body.wds main:not(#iu):not(#iu-sub) ol.iu-revsteps > li.iu-revsteps__item:has(> .iu-revsteps__n):has(> .iu-revsteps__s) {
    grid-row: span 4;
  }
  /* 글만 있는 포인트 카드(제목·설명 / 번호·제목·설명) */
  html body.wds main:not(#iu):not(#iu-sub) .dn-insight-track:not(:has(img, picture, svg, .dn-surg, .dn-insight-card__fig)) > .dn-insight-card:has(> .dn-insight-card__title):has(> .dn-insight-card__desc) {
    display: grid !important;
    grid-template-rows: subgrid !important;
    grid-row: span 2 !important;
    row-gap: 0 !important;
    align-content: start;
  }
  html body.wds main:not(#iu):not(#iu-sub) .dn-insight-track:not(:has(img, picture, svg, .dn-surg, .dn-insight-card__fig)) > .dn-insight-card:has(> .dn-insight-card__num):has(> .dn-insight-card__title):has(> .dn-insight-card__desc) {
    grid-row: span 3 !important;
  }
}
  /* 글 카드 + 그림 카드가 섞인 가로 넘김 묶음(좁은 폭에서 카드별 줄이 어긋나던 것): 번호·제목·설명·그림 4줄을 공유 */
  @media (max-width: 767px) {
    html body.wds main:not(#iu):not(#iu-sub) .dn-insight-track:has(> .dn-insight-card:not(:first-child) > .dn-insight-card__fig):has(> .dn-insight-card > .dn-insight-card__num) {
      grid-template-rows: auto auto auto 1fr !important;
    }
    html body.wds main:not(#iu):not(#iu-sub) .dn-insight-track:has(> .dn-insight-card:not(:first-child) > .dn-insight-card__fig):has(> .dn-insight-card > .dn-insight-card__num) > .dn-insight-card {
      display: grid !important;
      grid-template-rows: subgrid !important;
      grid-row: span 4 !important;
      row-gap: 0 !important;
      align-content: start;
    }
  }
}

/* 등장 — 스크립트가 켜 둔 경우에만 숨긴다 */
.iu-rv-on [data-iu-rv] {
  transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1), transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
  transition-delay: var(--iu-rv-delay, 0ms);
}
.iu-rv-on [data-iu-rv]:not(.iu-rv-in) { opacity: 0; }
.iu-rv-on [data-iu-rv="head"]:not(.iu-rv-in) { transform: translateY(18px); }
.iu-rv-on [data-iu-rv="card"]:not(.iu-rv-in) { transform: translateY(24px); }
.iu-rv-on [data-iu-rv="img"]:not(.iu-rv-in) { transform: scale(0.96); }
.iu-rv-on [data-iu-rv="img"] { transform-origin: 50% 60%; }
@media (prefers-reduced-motion: reduce) {
  .iu-rv-on [data-iu-rv] { opacity: 1 !important; transform: none !important; transition: none !important; }
}
@media print {
  .iu-rv-on [data-iu-rv] { opacity: 1 !important; transform: none !important; }
}
