/*
Theme Name:   GeneratePress Child
Theme URI:    https://blog.thdang.co.kr
Description:  태흥당한방병원 블로그 전용 자식 테마. 브랜드 가이드 기반 디자인 시스템.
Author:       Agency
Template:     generatepress
Version:      2.2.0
Text Domain:  generatepress-child
*/

/* ══════════════════════════════════════════
   1. 폰트
   ══════════════════════════════════════════ */

@font-face {
	font-family: 'Pretendard';
	src: url('fonts/Pretendard-400.woff2') format('woff2');
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Pretendard';
	src: url('fonts/Pretendard-600.woff2') format('woff2');
	font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Pretendard';
	src: url('fonts/Pretendard-700.woff2') format('woff2');
	font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'MaruBuri';
	src: url('fonts/MaruBuri-400.woff2') format('woff2');
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'MaruBuri';
	src: url('fonts/MaruBuri-600.woff2') format('woff2');
	font-weight: 600; font-style: normal; font-display: swap;
}

/* ══════════════════════════════════════════
   2. 디자인 토큰 — 브랜드 가이드 기준
   ══════════════════════════════════════════ */

:root {
	--thd-ink:        #3E2C12;   /* 공식 딥브라운 */
	--thd-ink-mid:    #6C6155;
	--thd-ink-soft:   #8E8375;
	--thd-gold:       #C79661;   /* 공식 골드 */
	--thd-gold-deep:  #A87C4B;
	--thd-gold-tint:  #F2E8DA;
	--thd-cream:      #F7F4EE;
	--thd-paper:      #FFFFFF;
	--thd-line:       #E4DCCE;
	--thd-line-soft:  #EFE9DF;

	--thd-serif: 'MaruBuri', 'Nanum Myeongjo', 'AppleMyungjo', Batang, serif;
	--thd-sans:  'Pretendard', 'Pretendard Variable', -apple-system, BlinkMacSystemFont,
	             'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;

	--thd-wrap: 1240px;
	--thd-read: 40rem;
}

/* ══════════════════════════════════════════
   3. 기본
   ══════════════════════════════════════════ */

body {
	font-family: var(--thd-sans);
	background: var(--thd-cream);
	color: var(--thd-ink);
	font-size: 16.5px;
	line-height: 1.85;
	word-break: keep-all;
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--thd-gold-deep); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover, a:focus-visible { color: var(--thd-ink); }
:focus-visible { outline: 2px solid var(--thd-gold); outline-offset: 2px; }

h1, h2, h3, h4, .thd-serif { font-family: var(--thd-serif); font-weight: 400; letter-spacing: -.005em; }

.separate-containers .inside-article,
.separate-containers .page-header,
.separate-containers .paging-navigation,
.one-container .container { background: transparent; }

.site-content { max-width: var(--thd-wrap); margin: 0 auto; padding: 0 24px; }
.site-content .content-area { width: 100%; }

/* ══════════════════════════════════════════
   4. 헤더
   ══════════════════════════════════════════ */

.site-header {
	background: var(--thd-paper);
	border-bottom: 1px solid var(--thd-line);
}
.inside-header {
	max-width: var(--thd-wrap);
	margin: 0 auto;
	padding: 20px 24px !important;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}
.site-logo img, .site-logo .header-image {
	height: 40px !important;
	width: auto !important;
	max-height: none;
}
/* 로고 이미지가 있으므로 사이트 제목·태그라인 텍스트는 숨김 */
.site-branding,
.site-header .main-title,
.site-header .site-description { display: none; }
.main-navigation { background: transparent; flex: 0 1 auto; }
.main-navigation .inside-navigation { padding: 0; }
.main-navigation .main-nav > ul { display: flex; gap: 4px; }
.main-navigation .main-nav ul li a {
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1;
	padding: 10px 14px;
	color: var(--thd-ink-mid);
	transition: color .15s ease;
}
.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li.current-menu-item > a { color: var(--thd-gold-deep); }
.main-navigation .menu-toggle { color: var(--thd-ink); }

/* ══════════════════════════════════════════
   5. 히어로 (홈 · 아카이브)
   ══════════════════════════════════════════ */

.thd-hero {
	text-align: center;
	padding: 62px 24px 54px;
	border-bottom: 1px solid var(--thd-line);
	margin-bottom: 48px;
}
.thd-hero__kicker {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .2em;
	color: var(--thd-gold-deep);
	margin-bottom: 16px;
}
.thd-hero__title {
	font-family: var(--thd-serif);
	font-size: clamp(26px, 4vw, 40px);
	font-weight: 400;
	line-height: 1.45;
	margin: 0 0 14px;
	text-wrap: balance;
}
.thd-hero__sub {
	margin: 0 auto;
	max-width: 46ch;
	font-size: 15px;
	color: var(--thd-ink-soft);
}
.thd-hero--term .thd-hero__sub { max-width: 56ch; }

/* ══════════════════════════════════════════
   6. 글 목록 — 카드 그리드
   ══════════════════════════════════════════ */

body.archive .site-main,
body.blog .site-main,
body.search-results .site-main {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
	gap: 30px 26px;
	align-items: stretch;
}
body.archive .site-main > *:not(article),
body.blog .site-main > *:not(article),
body.search-results .site-main > *:not(article) { grid-column: 1 / -1; }

body.archive .site-main article,
body.blog .site-main article,
body.search-results .site-main article {
	background: var(--thd-paper);
	border: 1px solid var(--thd-line);
	margin: 0;
	overflow: hidden;
	transition: border-color .18s ease, transform .18s ease;
}
body.archive .site-main article:hover,
body.blog .site-main article:hover { border-color: var(--thd-gold); transform: translateY(-2px); }

body.archive .site-main .inside-article,
body.blog .site-main .inside-article { padding: 0 !important; }

/* 이미지는 카드 하단에 붙습니다 (레퍼런스와 동일한 구성) */
.site-main article .post-image {
	margin-top: auto !important;
	padding-top: 22px;
}
.site-main article .post-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 1 !important;
	object-fit: cover;
	display: block;
	border-top: 1px solid var(--thd-line-soft);
}
/* 아카이브 기본 헤더 숨김 (히어로가 대신) */
body.archive .page-header,
body.blog .page-header,
body.search-results .page-header { display: none; }

/* ── 카드 구성 ──
   텍스트가 위, 이미지가 아래에 붙는 세로형 카드.
   카테고리 → 제목 → 구분선 → 발췌 → 날짜 → (여백) → 이미지  */

.site-main article .inside-article {
	display: flex;
	flex-direction: column;
	min-height: 380px;
	text-align: center;
}
.site-main article .thd-cat-wrap { order: 1; }
.site-main article .entry-header { order: 2; display: flex; flex-direction: column; }
.site-main article .entry-header .entry-title { order: 1; }
.site-main article .entry-header .entry-meta { order: 2; }
.site-main article .entry-summary { order: 3; }
.site-main article .post-image,
.site-main article .featured-image { order: 9; }

.site-main article .thd-cat-wrap,
.site-main article .entry-header,
.site-main article .entry-summary { padding-left: 28px; padding-right: 28px; }

.site-main article .entry-header { padding-top: 6px; }
.site-main article .entry-title {
	font-family: var(--thd-serif);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.55;
	margin: 0;
	/* 제목 아래 얇은 구분선 */
	padding-bottom: 16px;
	position: relative;
}
/* 두 줄로 고정 — 카드 높이 편차 방지.
   line-clamp 를 제목 자체에 걸면 ::after 구분선이 잘리므로 링크에 겁니다. */
.site-main article .entry-title a {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: calc(19px * 1.55 * 2);
}
.site-main article .entry-title::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: 64%;
	height: 1px;
	background: var(--thd-line);
}
.site-main article .entry-title a { color: var(--thd-ink); text-decoration: none; }
.site-main article .entry-title a:hover { color: var(--thd-gold-deep); }

.site-main article .entry-summary {
	font-size: 14px;
	line-height: 1.75;
	color: var(--thd-ink-soft);
	margin-top: 16px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.site-main article .entry-header .entry-meta {
	font-size: 12.5px;
	color: var(--thd-ink-soft);
	margin-top: 14px;
	padding: 0;
}
.site-main article .entry-meta a { color: inherit; text-decoration: none; }
.site-main article footer.entry-meta,
.site-main article .entry-meta .comments-link { display: none; }
/* 수정일·발행일 중복 노출 정리 — 발행일만 */
.site-main article .entry-meta time.updated:not(.published) { display: none; }

/* 카테고리 라벨 */
.thd-cat {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	color: var(--thd-gold-deep);
	margin-bottom: 8px;
}

/* 페이지네이션 */
.paging-navigation { grid-column: 1 / -1; text-align: center; padding-top: 26px !important; }
.paging-navigation .nav-links > * { margin: 0 4px; }

/* ══════════════════════════════════════════
   7. 단일 글 (LAYER 2 — 가독성 우선)
   ══════════════════════════════════════════ */

body.single .site-main,
body.page .site-main { max-width: var(--thd-read); margin: 0 auto !important; }

body.single .inside-article,
body.page .inside-article { padding: 0 !important; }

body.single .entry-header { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--thd-line); }
body.single .entry-title,
body.page .entry-title {
	font-family: var(--thd-serif);
	font-size: clamp(24px, 3.6vw, 33px);
	font-weight: 400;
	line-height: 1.5;
	margin: 0 0 12px;
	text-wrap: balance;
}
body.single .entry-meta { font-size: 13px; color: var(--thd-ink-soft); }
body.single .entry-meta a { color: inherit; text-decoration: none; }

.entry-content { font-size: 16.5px; }
.entry-content > * { max-width: 100%; }

.entry-content h2 {
	font-family: var(--thd-serif);
	font-size: 22px;
	font-weight: 600;
	margin-top: 2.6em;
	margin-bottom: .75em;
	padding-bottom: .35em;
	border-bottom: 2px solid var(--thd-gold);
	display: inline-block;
	line-height: 1.45;
}
.entry-content h3 {
	font-family: var(--thd-serif);
	font-size: 18.5px;
	font-weight: 600;
	margin-top: 3.2em;
	margin-bottom: .5em;
}
.entry-content p { line-height: 1.9; }
.entry-content strong { font-weight: 700; }

.entry-content .post-image,
.entry-content figure { margin: 2em 0; }
.entry-content img { border-radius: 2px; }
.entry-content figcaption { font-size: 13px; color: var(--thd-ink-soft); text-align: center; margin-top: .6em; }

/* ══════════════════════════════════════════
   8. 푸터
   ══════════════════════════════════════════ */

.thd-site-footer { background: var(--thd-ink); color: rgba(255,255,255,.72); margin-top: 80px; }
/* GeneratePress 기본 푸터(빈 div)는 제거 — margin 만 남아 하단 공백을 만듭니다 */
div.site-footer { display: none !important; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: #fff; }

.thd-footer { max-width: var(--thd-wrap); margin: 0 auto; padding: 54px 24px 40px; }
.thd-footer__top {
	display: grid;
	grid-template-columns: minmax(220px, 1.2fr) repeat(auto-fit, minmax(150px, 1fr));
	gap: 34px;
	padding-bottom: 34px;
	border-bottom: 1px solid rgba(255,255,255,.14);
}
.thd-footer__logo img { height: 38px; width: auto; opacity: .95; }
.thd-footer__slogan {
	font-family: var(--thd-serif);
	font-size: 15px;
	letter-spacing: .22em;
	color: var(--thd-gold);
	margin-top: 16px;
}
.thd-footer h4 {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	color: var(--thd-gold);
	margin: 0 0 12px;
	font-family: var(--thd-sans);
}
.thd-footer ul { list-style: none; margin: 0; padding: 0; }
.thd-footer li { font-size: 14px; margin-bottom: 7px; line-height: 1.6; }
.thd-footer__bottom {
	padding-top: 22px;
	font-size: 12.5px;
	color: rgba(255,255,255,.5);
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	justify-content: space-between;
}
.site-info { display: none; }

/* ══════════════════════════════════════════
   9. 반응형
   ══════════════════════════════════════════ */

@media (max-width: 900px) {
	.thd-hero { padding: 46px 20px 40px; margin-bottom: 36px; }
}
@media (max-width: 768px) {
	body { font-size: 16px; }
	.inside-header { padding: 16px 20px !important; flex-wrap: wrap; }
	.site-logo img, .site-logo .header-image { height: 32px !important; }
	.site-content { padding: 0 20px; }
	body.archive .site-main, body.blog .site-main { grid-template-columns: 1fr; gap: 22px; }
	.thd-footer__top { grid-template-columns: 1fr; gap: 26px; }
	.entry-content h2 { font-size: 20px; }
}

/* ══════════════════════════════════════════
   10. 접근성 · 인쇄
   ══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
	.site-header, .site-footer, .main-navigation, .thd-hero { display: none; }
	body { background: #fff; font-size: 11pt; }
}

/* ── 2026-08-27 레이아웃 보정 ── */
/* 1) 목차 박스 위아래 여백 동일 */
.entry-content .msk-toc__title { margin-top: 0; }
.msk-toc__list li:last-child { margin-bottom: 0; }
/* 2) 표 헤더 가운데 정렬 */
.entry-content table th { text-align: center; }
/* 3) 저자 박스 전체 가운데 정렬 */
.msk-authorbox { text-align: center; }
.msk-authorbox .msk-person { flex-direction: column; align-items: center; }
.msk-person__creds { list-style-position: inside; padding-left: 0; margin-left: 0; }

/* 문단 하단 간격 보강 */
.entry-content p { margin-bottom: 1.9em; }

/* 박스 내부 제목 여백 예외 (본문 H3 여백이 박스 안까지 적용되지 않게) */
.entry-content .msk-keypoints h3 { margin-top: 0; }
.entry-content .msk-faq h3 { margin-top: 1.6em; }
.entry-content .msk-faq h3:first-child { margin-top: 0; }

/* 단일 글: 제목·메타를 본문 위로 (카드용 order 규칙이 단일 글에 적용되는 것 보정) */
body.single .site-main article .entry-header { order: -1; }
body.single .site-main article .inside-article { min-height: 0; }

/* 단일 글 제목 위 여백 */
body.single .entry-header, body.page .entry-header { margin-top: 64px; }

/* 단일 글: 제목 아래 카드용 짧은 선 제거 (날짜 아래 구분선 하나만 유지) */
body.single .site-main article .entry-title::after { display: none; }
body.single .site-main article .entry-title { min-height: 0; padding-bottom: 0; }

/* 푸터 위 '오시는 길' 지도 섹션 */
.thd-map-section { background: #f7f5f2; padding: 56px 20px; margin-top: 72px; }
.thd-map-inner { max-width: 860px; margin: 0 auto; text-align: center; }
.thd-map-title { font-size: 1.35em; margin: 0 0 10px; }
.thd-map-addr { color: #6b6b6b; margin: 0 0 24px; }
.thd-map-frame iframe { display: block; width: 100%; height: 380px; border: 0; border-radius: 8px; }
@media (max-width: 600px) { .thd-map-frame iframe { height: 300px; } }

/* 검색: 헤더 상단 아이콘으로 일원화, 본문 대형 검색 박스는 숨김 */
.no-results .search-form,
.no-results .wp-block-search { display: none; }
.no-results .page-content { margin-bottom: 0; }

/* 헤더 내비게이션 검색 아이콘 */
.main-navigation .search-item > a { padding-left: 14px; padding-right: 14px; }
.main-navigation .search-item svg { width: 17px; height: 17px; }
.navigation-search input[type="search"] { font-size: 1em; }

/* 헤더 돋보기 (검색 페이지 링크) */
.main-navigation .menu-bar-items .thd-search-item > a { padding-left: 14px; padding-right: 14px; }
.main-navigation .menu-bar-items .thd-search-item svg { width: 17px; height: 17px; }

/* 검색 페이지 대형 입력창 */
.thd-searchbox { max-width: 680px; margin: -12px auto 56px; padding: 0 20px; }
.thd-searchbox__form { display: flex; align-items: stretch; background: #fff; border: 1px solid #e2ddd4; border-radius: 6px; overflow: hidden; }
.thd-searchbox__form input[type="search"] { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 15px 18px; font-size: 1.02em; color: var(--contrast); }
.thd-searchbox__form input[type="search"]:focus { outline: none; background: transparent; border: 0; }
.thd-searchbox__form button { flex: 0 0 auto; border: 0; background: transparent; padding: 0 20px; color: #7a7268; cursor: pointer; }
.thd-searchbox__form button:hover, .thd-searchbox__form button:focus { background: transparent; color: var(--contrast); }
.thd-searchbox__form button svg { width: 18px; height: 18px; display: block; }
@media (max-width: 600px) { .thd-searchbox { margin-bottom: 40px; } }

/* 모바일 다크 모드 대비 문제 수정
   플러그인(medical-schema-kit)이 다크 모드에서 박스 배경만 어둡게 바꾸는데,
   사이트 본문 글자색은 밝은 디자인 기준이라 글씨가 묻힘.
   이 사이트는 라이트 디자인 고정이므로 원래 밝은 색으로 되돌립니다. */
@media (prefers-color-scheme: dark) {
	.entry-content {
		--msk-accent: #2c6349;
		--msk-accent-bg: #e3ede7;
		--msk-warn: #a3392c;
		--msk-warn-bg: #f7e6e3;
		--msk-note: #9a5b2b;
		--msk-note-bg: #f6ebe0;
		--msk-line: rgba(0, 0, 0, .12);
		--msk-tint: rgba(0, 0, 0, .035);
	}
}

/* 상단으로 가기 버튼 — 브랜드 톤의 원형 버튼
   (표시/숨김은 테마가 generate-back-to-top__show 클래스로 제어하므로 opacity는 그 상태에만 지정) */
a.generate-back-to-top {
	right: 24px;
	bottom: 24px;
	width: 46px;
	height: 46px;
	line-height: 46px;
	border-radius: 50%;
	background-color: var(--thd-ink) !important;
	color: #fff !important;
	border: 1px solid rgba(255,255,255,.18);
	box-shadow: 0 4px 14px rgba(62,44,18,.22);
	transition: opacity .25s ease, background-color .2s ease, transform .25s ease;
}
a.generate-back-to-top.generate-back-to-top__show { opacity: .88; }
a.generate-back-to-top:hover,
a.generate-back-to-top:focus {
	background-color: var(--thd-gold-deep) !important;
	color: #fff !important;
	opacity: 1;
}
@media (max-width: 600px) {
	a.generate-back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; line-height: 42px; }
}

/* 어두운 푸터 위에 겹칠 때: 흰색 버튼으로 전환 */
a.generate-back-to-top.thd-btt--on-dark {
	background-color: #fff !important;
	color: var(--thd-ink) !important;
	border-color: rgba(62,44,18,.14);
	box-shadow: 0 4px 16px rgba(0,0,0,.32);
}
a.generate-back-to-top.thd-btt--on-dark:hover,
a.generate-back-to-top.thd-btt--on-dark:focus {
	background-color: var(--thd-gold) !important;
	color: var(--thd-ink) !important;
}
