/* =========================================================================
   "대표원장 이야기" 편지형 페이지 전용 스타일
   -------------------------------------------------------------------------
   · 이 파일은 includes/letter-page.php 가 "편지형 페이지"에서만 불러옵니다.
     (다른 건강정보·진료사례·일반 페이지에는 적용되지 않습니다.)
   · 블록 편집기에서 이 페이지를 편집할 때도 같은 파일이 적용되어 거의 같은 모양으로 미리 보입니다.
     그래서 선택자 앞에 :is(.su-letter__body, .editor-styles-wrapper) 를 붙였습니다.
   · 글꼴 (모두 구글 폰트 공식 웹폰트 · SIL OFL 라이선스로 상업용 웹사이트 사용 가능)
       - 손글씨 Yeon Sung(연성체)   : 페이지 제목 / 마지막 다짐 / 서명 — 딱 세 곳  (Regular 한 가지뿐)
       - 본문 고딕 Noto Sans KR 400 : 본문 · 사진 캡션 · 보호자 후기 · 버튼
       - 본문 고딕 Noto Sans KR 700 : 소제목 · 중요한 문장(letter-emphasis)
       - 가는 굵기(Light 등)는 불러오지 않음 / 글꼴이 안 불러와져도 맑은 고딕 등으로 바로 읽힘
   · 블록에 "추가 CSS 클래스" 로 붙이는 이름 (편집기 우측 패널 → 고급 → 추가 CSS 클래스)
       letter-emphasis   핵심 문장 (문단 블록)
       letter-wide       본문보다 넓은 사진 (이미지 블록)
       letter-past       과거 사진 "당시 모습" 표시 (이미지 블록, letter-wide 와 함께)
       letter-review-group / letter-review / letter-capture   보호자 후기 묶음 / 인용 / 원본 캡처
       letter-closing / letter-pledge / letter-signature / letter-link   마무리 묶음 / 다짐 / 서명 / 후기 버튼
   ========================================================================= */

/* ── 대체 글꼴 크기 보정 ─ 웹폰트로 바뀔 때 줄바꿈이 달라져 화면이 덜컥 움직이지 않도록,
      맑은 고딕의 한글 폭(1.00)을 Noto Sans KR(0.92)에 맞춰 줄입니다. 기기에 있는 글꼴만 쓰므로 추가로 내려받지 않습니다. ── */
@font-face {
	font-family: "LT Gothic Fallback";
	font-weight: 400;
	src: local("Malgun Gothic"), local("MalgunGothic"), local("맑은 고딕");
	size-adjust: 92%;
}
@font-face {
	font-family: "LT Gothic Fallback";
	font-weight: 700;
	src: local("Malgun Gothic Bold"), local("MalgunGothic-Bold"), local("맑은 고딕 Bold");
	size-adjust: 92%;
}
/* 손글씨(Yeon Sung)는 글자 폭이 맑은 고딕의 약 0.73배라서 제목·다짐의 줄바꿈이 맞도록 더 줄입니다. */
@font-face {
	font-family: "LT Pen Fallback";
	font-weight: 400;
	src: local("Malgun Gothic"), local("MalgunGothic"), local("맑은 고딕");
	size-adjust: 73%;
}

/* ── 색 · 글꼴 이름표 ── */
.su-letter-page,
.editor-styles-wrapper {
	--lt-bg: #fbf8f1;        /* 흰색에 가까운 따뜻한 아이보리 */
	--lt-ink: #2b2a27;       /* 본문 글자색 (따뜻한 검정) */
	--lt-soft: #5c5850;      /* 사진 설명 등 보조 글자색 */
	--lt-line: #e3dccb;      /* 옅은 구분선 */
	--lt-navy: #00375a;
	--lt-blue: #0064a0;
	--lt-mint: #a0c8b4;
	/* 글꼴 이름표. 웹폰트를 내려받는 동안·못 불러올 때는 뒤쪽 글꼴로 바로 보입니다.
	   "LT ... Fallback" 은 맑은 고딕의 글자 폭만 웹폰트에 맞춘 대체 글꼴(위 @font-face)입니다. */
	--lt-sans: "Noto Sans KR", "LT Gothic Fallback", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif;
	--lt-pen: "Yeon Sung", "LT Pen Fallback", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif;
}

body.su-letter-page,
.editor-styles-wrapper {
	background: var(--lt-bg);
}

/* ── 편지 영역 바깥 틀 ── */
.su-letter {
	padding: 48px 0 72px;
	background: var(--lt-bg);
	color: var(--lt-ink);
}

/* PC 본문 폭 700px (좌우 안쪽 여백 22px 포함해서 744px). 모바일 좌우 여백 22px. */
.su-letter__article {
	max-width: 744px;
	margin: 0 auto;
	padding: 0 22px;
}

/* ── 페이지 제목 (손글씨) ── */
.su-letter__eyebrow {
	margin: 0 0 10px;
	font-family: var(--lt-sans);
	font-size: 0.95rem;
	font-weight: 400;
	letter-spacing: 0.02em;
	color: var(--lt-blue);
}

.su-letter__title,
.editor-styles-wrapper .editor-post-title__input,
.editor-styles-wrapper h1.wp-block-post-title {
	margin: 0 0 34px;
	font-family: var(--lt-pen);
	font-size: clamp(2.15rem, 1.45rem + 2.8vw, 3.2rem);
	font-weight: 400;          /* 인위적으로 굵게 하지 않음 */
	font-style: normal;        /* 기울이지 않음 */
	font-synthesis: none;      /* 글꼴이 없는 굵기·기울임을 억지로 만들지 않음 */
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--lt-navy);
	word-break: keep-all;      /* 단어 중간이 아니라 띄어쓰기에서 줄바꿈 */
	overflow-wrap: break-word;
	text-wrap: balance;        /* 제목 줄바꿈을 보기 좋게 균형 있게 */
	text-align: left;
}

.su-letter__title::after {
	content: "";
	display: block;
	width: 44px;
	height: 3px;
	margin-top: 22px;
	background: var(--lt-mint);
}

/* ── 본문 기본 (고딕, 17.6px, 줄 간격 1.8) ── */
:is(.su-letter__body, .editor-styles-wrapper) {
	font-family: var(--lt-sans);
	font-size: 1.1rem;
	font-weight: 400;          /* 본문은 Regular (Light 사용 안 함) */
	font-synthesis: none;      /* 글꼴에 없는 굵기·기울임을 브라우저가 억지로 만들지 않음 */
	line-height: 1.8;
	color: var(--lt-ink);
	text-align: left;
	word-break: keep-all;
	overflow-wrap: break-word;
}

:is(.su-letter__body, .editor-styles-wrapper) p {
	margin: 0 0 1.35em;
	font-size: 1.1rem;
	line-height: 1.8;
}

:is(.su-letter__body, .editor-styles-wrapper) ul,
:is(.su-letter__body, .editor-styles-wrapper) ol {
	margin: 0 0 1.35em;
	padding-left: 1.3em;
}

:is(.su-letter__body, .editor-styles-wrapper) li {
	margin: 0 0 0.4em;
	line-height: 1.8;
}

:is(.su-letter__body, .editor-styles-wrapper) a {
	color: var(--lt-blue);
	text-underline-offset: 3px;
}

/* ── 소제목: 번호 없이 담백하게 (위에 작은 민트 선만) ── */
:is(.su-letter__body, .editor-styles-wrapper) h2 {
	margin: 2.6em 0 0.8em;
	font-family: var(--lt-sans);
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.5;
	color: var(--lt-navy);
}

:is(.su-letter__body, .editor-styles-wrapper) h2::before {
	content: "";
	display: block;
	width: 28px;
	height: 3px;
	margin-bottom: 12px;
	background: var(--lt-mint);
}

:is(.su-letter__body, .editor-styles-wrapper) h3 {
	margin: 2em 0 0.7em;
	font-family: var(--lt-sans);
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.5;
	color: var(--lt-navy);
}

/* 맨 처음에 소제목이 와도 위쪽 빈 공간이 크지 않게 */
.su-letter__body > :first-child {
	margin-top: 0;
}

/* ── 핵심 문장: 크기와 여백으로 강조 (글 전체에서 2~3곳만) ── */
:is(.su-letter__body, .editor-styles-wrapper) .letter-emphasis {
	margin: 2.1em 0;
	font-size: 1.45rem;
	font-weight: 700;          /* 중요한 문장은 Bold */
	line-height: 1.65;
	color: var(--lt-navy);
}

/* ── 사진: 원본 비율 그대로, 자르지 않음 ── */
:is(.su-letter__body, .editor-styles-wrapper) .wp-block-image {
	margin: 2em 0;
}

:is(.su-letter__body, .editor-styles-wrapper) .wp-block-image img {
	display: block;
	max-width: 100%;
	height: auto;               /* 가로·세로를 늘리거나 잘라내지 않음 */
	border-radius: 10px;
}

:is(.su-letter__body, .editor-styles-wrapper) .wp-block-image figcaption,
:is(.su-letter__body, .editor-styles-wrapper) .wp-element-caption {
	margin: 10px 0 0;
	font-family: var(--lt-sans);
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--lt-soft);
	text-align: left;
}

/* 본문보다 조금 넓은 사진 (PC 에서만 좌우로 110px 씩 넓게, 모바일은 본문 폭 그대로) */
:is(.su-letter__body, .editor-styles-wrapper) .letter-wide img {
	width: 100%;
}

@media (min-width: 1000px) {
	.su-letter__body .letter-wide {
		margin-left: -110px;
		margin-right: -110px;
	}
}

/* 과거 병원 사진: "당시 모습" 표시가 사진 위에 자동으로 붙음 */
:is(.su-letter__body, .editor-styles-wrapper) .letter-past::before {
	content: "과거 사진 · 당시 모습";
	display: inline-block;
	margin-bottom: 8px;
	padding: 3px 10px;
	border-radius: 6px;
	background: var(--lt-mint);
	color: var(--lt-navy);
	font-family: var(--lt-sans);
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.5;
}

/* ── 보호자 후기: 인용문(고딕) + 원본 캡처 ── */
:is(.su-letter__body, .editor-styles-wrapper) .letter-review-group {
	margin: 2.4em 0;
	padding: 22px 22px 20px;
	background: #ffffff;
	border: 1px solid var(--lt-line);
	border-radius: 12px;
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-review {
	margin: 0 0 18px;
	padding: 2px 0 2px 16px;
	border-left: 3px solid var(--lt-mint);
	font-family: var(--lt-sans);
	font-size: 1.05rem;
	font-style: normal;
	line-height: 1.8;
	color: var(--lt-ink);
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-review p {
	margin: 0 0 0.6em;
	font-size: 1.05rem;
	font-style: normal;
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-review cite {
	display: block;
	margin-top: 8px;
	font-size: 0.9rem;
	font-style: normal;
	color: var(--lt-soft);
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-capture {
	margin: 0;
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-capture img {
	border: 1px solid var(--lt-line);
	border-radius: 8px;
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-review-group > :last-child {
	margin-bottom: 0;
}

/* ── 마무리: 마지막 다짐 + 서명 (손글씨) + 작은 후기 버튼 ── */
:is(.su-letter__body, .editor-styles-wrapper) .letter-closing {
	margin: 3em 0 0;
	padding-top: 30px;
	border-top: 1px solid var(--lt-line);
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-pledge,
:is(.su-letter__body, .editor-styles-wrapper) .letter-signature {
	font-family: var(--lt-pen);
	font-weight: 400;
	font-style: normal;
	font-synthesis: none;
	color: var(--lt-navy);
	word-break: keep-all;
	text-align: left;
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-pledge {
	margin: 0 0 18px;
	font-size: clamp(2.05rem, 1.5rem + 2.3vw, 2.7rem);
	line-height: 1.5;
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-signature {
	margin: 0 0 26px;
	font-size: clamp(2.15rem, 1.6rem + 2.3vw, 2.8rem);
	line-height: 1.4;
}

/* 후기 보기 링크: 작은 보조 버튼 */
:is(.su-letter__body, .editor-styles-wrapper) .letter-link {
	margin: 0;
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-link .wp-block-button__link {
	padding: 9px 18px;
	background: transparent;
	border: 1.5px solid var(--lt-navy);
	border-radius: 999px;
	font-family: var(--lt-sans);
	font-size: 0.95rem;
	font-weight: 400;          /* 버튼 글자는 Regular */
	line-height: 1.4;
	color: var(--lt-navy);
	text-decoration: none;
}

:is(.su-letter__body, .editor-styles-wrapper) .letter-link .wp-block-button__link:hover {
	background: var(--lt-navy);
	color: #ffffff;
}

/* ── 모바일 ── */
@media (max-width: 781px) {
	.su-letter {
		padding: 32px 0 56px;
	}

	:is(.su-letter__body, .editor-styles-wrapper) .letter-emphasis {
		font-size: 1.3rem;
	}

	:is(.su-letter__body, .editor-styles-wrapper) .letter-review-group {
		padding: 18px 16px 16px;
	}
}

/* 제목의 쉼표 단위 덩어리: 덩어리 단위로 먼저 줄바꿈, 너무 길면 덩어리 안에서 자연스럽게 줄바꿈 */
.su-letter__phrase {
	display: inline-block;
	max-width: 100%;
}

/* 마지막 다짐: 줄 길이를 고르게 맞춰서 "한 / 아이의" 처럼 한 글자만 윗줄에 남는 줄바꿈을 줄임 */
:is(.su-letter__body, .editor-styles-wrapper) .letter-pledge {
	text-wrap: balance;
}
