/* 서브 지면 반응형 — content
   진료 지면 본문(요약·카드·수술 과정·자주 묻는 질문·관련 진료·상담 안내 띠)
   폰 767 이하 · 태블릿 768~1200 · 데스크톱 1201 이상(데스크톱은 손대지 않는다) */
:root{--iu-content-resp:1}

/* 키보드 초점은 즉시 보이게 */
html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) :is(.dn-insight-section,.dn-geo-content,.dn-geo-block,.wune-related,.breast-bottom-links,.dn-kakao-cta) :is(a,button,summary,[tabindex]):focus-visible{outline:2px solid var(--iub-ink,#242424) !important;outline-offset:2px !important;transition:none !important}

/* 움직임 줄이기 설정이면 카드 목록의 부드러운 넘김을 끈다 */
@media (prefers-reduced-motion:reduce){
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) :is(.dn-insight-track,.wune-related__grid){scroll-behavior:auto !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) :is(.dn-insight-card,.wune-related__link,.dn-kakao-cta__btn,.dn-geo-content summary){transition:none !important}
}

/* 1200 이하 공통 */
@media (max-width:1200px){
  /* 제목 마지막 줄에 두세 글자만 남지 않게 */
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) :is(h2.dn-heading,.dn-geo-content__block>h2,.dn-geo-block>h2,.wune-related__title,.breast-bottom-links__title,.dn-kakao-cta__heading,.dn-insight-card__title,.dn-natural-results__heading){text-wrap:balance}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-geo-content summary{text-wrap:pretty}
  /* 혼자 서 있는 «자세히 보기» 링크는 누르는 높이 44 */
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) :is(.iu-mdopt__go,.iu-scarhub__more){display:inline-flex !important;align-items:center;min-height:44px !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .iu-leg__duo p>a:only-child{display:inline-flex;align-items:center;min-height:44px}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-card__title>a{display:inline-flex;align-items:center;min-height:44px}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-track{overscroll-behavior-x:contain}
}

/* 태블릿 768~1200 — 본문 폭 720 */
@media (min-width:768px) and (max-width:1200px){
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) :is(.dn-insight-section:not(.iu-leg),.dn-geo-block,.dn-natural-results,.breast-bottom-links,.wune-related,.dn-geo-content){--iu-wrap:720px;--iu-gut:24px}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-geo-content>.cont{max-width:768px !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-kakao-cta__inner{max-width:720px !important;margin-inline:auto !important}
  /* 그림 옆 설명이 좁아지지 않게 — 본문 폭에서는 그림 아래로 */
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-section .cont>figure:has(>img+figcaption){grid-template-columns:1fr !important;row-gap:16px}
}
/* 1024~1200 — 그림과 설명이 나란히 놓이는 구역이 많아 본문 폭을 넓히되, 오른쪽 바로가기 막대에 가리지 않게 양쪽 90px 를 비운다 */
@media (min-width:1024px) and (max-width:1200px){
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) :is(.dn-insight-section:not(.iu-leg),.dn-geo-block,.dn-natural-results,.breast-bottom-links,.wune-related,.dn-geo-content){--iu-wrap:min(960px,calc(100vw - 180px))}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-geo-content>.cont{max-width:min(1008px,calc(100vw - 132px)) !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-section.iu-leg>.cont{max-width:calc(100vw - 180px) !important;margin-left:auto !important;margin-right:auto !important}
  /* 이 폭에서 좁아지는 칸 — 카드 안 단계 목록은 한 줄씩, 그림이 끼인 2단 본문은 위아래로 */
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-card .dn-surg__grid{grid-template-columns:1fr !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-section>.cont:has(>figure){grid-template-columns:1fr !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-section>.cont:has(>figure)>*{grid-column:1 !important;grid-row:auto !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .iu-revsteps{grid-template-columns:repeat(3,minmax(0,1fr)) !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .iu-leg__row:has(.wds-cards){grid-template-columns:1fr !important;row-gap:20px}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .iu-leg__row:has(.wds-cards)>*{grid-column:1 !important}
  /* 카드가 세 장뿐인 줄은 넘기지 않고 칸 안에 셋으로 나눠 담는다 */
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-track:has(>:nth-child(3)):not(:has(>:nth-child(4))){grid-auto-columns:calc((100% - 32px) / 3) !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-track:has(>:nth-child(3)):not(:has(>:nth-child(4)))>*{min-width:0 !important}
}
/* 768~1023 — 그림 카드 두 장이 본문 폭을 나눠 쓴다(빈 오른쪽 없이) */
@media (min-width:768px) and (max-width:1023px){
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-track:has(img,picture,svg,.dn-surg,.dn-insight-card__fig){grid-auto-columns:calc(50% - 8px) !important}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-insight-track:has(img,picture,svg,.dn-surg,.dn-insight-card__fig)>.dn-insight-card{flex:0 0 calc(50% - 8px) !important;width:auto !important;max-width:none !important}
}

/* 폰 767 이하 — 좌우 여백 24 */
@media (max-width:767px){
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) :is(.dn-insight-section:not(.iu-leg),.dn-geo-block,.dn-natural-results,.breast-bottom-links,.wune-related,.dn-geo-content,.dn-kakao-cta){--iu-gut:24px}
  /* 관련 진료 카드: 가로로 넘기는 목록 */
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .wune-related__grid{display:flex !important;gap:12px !important;margin:0 -24px !important;padding:0 24px 4px !important;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scroll-padding:0 24px;scrollbar-width:none}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .wune-related__grid::-webkit-scrollbar{display:none}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .wune-related__grid>.wune-related__item{flex:0 0 min(280px,calc(100% - 56px));scroll-snap-align:start;grid-column:auto !important;display:flex}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .wune-related__grid>.wune-related__item>.wune-related__link{flex:1 1 auto;width:100%}
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .wune-related__grid>.wune-related__item:only-child{flex-basis:100%}
}

/* 폰 767 이하 — 상담 안내 띠 버튼은 글이 길면 두 줄로 접는다(옆 버튼과 겹치지 않게) */
@media (max-width:767px){
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) .dn-kakao-cta__btn{white-space:normal !important;text-align:center;line-height:1.2}
}

/* 1200 이하 — 설명 목록 문장 속 링크는 글줄 안에 그대로 둔다(줄 간격이 벌어지지 않게) */
@media (max-width:1200px){
  html body.wds main:not(#iu):not(#iu-c):not(#iu-c2):not(#iu-c3) dl.iu-deflist dd>a{display:inline !important;min-height:0 !important}
}
