/* 달려라병원 블로그 — scripts/build_site.py 가 만든다. 직접 고치지 말고 build_site.py 의 CSS 를 고친다 */
:root { --paper: #fff; --paper-2: #f7f6f3; --ink: #16181c; --ink-2: #545a63; --ink-3: #8b9099; --line: #e5e2db;
  --brand: #ef7c1f; --accent: #c2410c; --blue: #1b6ec2; --w-page: 72rem; --w-text: 44rem; --gutter: clamp(1rem, 4vw, 2.5rem);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--w-page); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: calc(var(--w-text) + 2 * var(--gutter)); }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 99; }

.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.head-row { display: flex; align-items: center; gap: 1rem; height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand img { height: 2.4rem; width: auto; display: block; }
.brand span { font-weight: 800; font-size: 1.05rem; padding-left: .6rem; border-left: 1px solid var(--line); }
.ext { margin-left: auto; display: flex; gap: 1.1rem; font-size: .9rem; }
.ext a { color: var(--ink-2); text-decoration: none; } .ext a:hover { color: var(--ink); }
.cats { display: flex; gap: 1.4rem; overflow-x: auto; scrollbar-width: none; font-size: .95rem; white-space: nowrap; }
.cats::-webkit-scrollbar { display: none; }
.cats a { color: var(--ink-2); text-decoration: none; padding: .55rem 0 .7rem; position: relative; }
.cats a:hover { color: var(--ink); }
.cats a[aria-current] { color: var(--ink); font-weight: 700; }
.cats a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--brand); }
@media (max-width: 640px) { .ext { display: none; } .brand img { height: 2rem; } .cats { gap: 1.1rem; font-size: .92rem; } }

.list { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }
.list-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.3; margin: 0 0 .4rem; letter-spacing: -.02em; }
.list-head p { color: var(--ink-2); margin: 0 0 2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 2.2rem 1.6rem; }
.grid .empty { grid-column: 1 / -1; padding: 3rem 0; text-align: center; opacity: .75; }
.card a { display: block; color: inherit; text-decoration: none; }
.card img, .card .ph { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--paper-2); border-radius: 6px; }
.card .c-body { padding-top: .8rem; }
.card h2 { font-size: 1.12rem; line-height: 1.45; margin: .35rem 0 .35rem; letter-spacing: -.01em; }
.card a:hover h2 { color: var(--accent); }
.card p { color: var(--ink-2); font-size: .93rem; line-height: 1.6; margin: 0 0 .5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card time { color: var(--ink-3); font-size: .85rem; }
.chip { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--accent); }
.pager { display: flex; gap: .4rem; justify-content: center; margin-top: 3rem; }
.pager a { min-width: 2.4rem; text-align: center; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; }
.pager a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }

.post { padding: clamp(1.5rem, 4vw, 3rem) 0 4rem; }
.crumbs { font-size: .88rem; color: var(--ink-3); display: flex; gap: .45rem; }
.crumbs a { color: var(--ink-2); text-decoration: none; } .crumbs a:hover { color: var(--accent); }
.post h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); line-height: 1.35; letter-spacing: -.025em; margin: .6rem 0 .6rem; }
.post .meta { color: var(--ink-3); font-size: .92rem; display: flex; gap: .45rem; margin: 0 0 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.post-body { font-size: 1.05rem; }
.post-body p { margin: 0 0 1.15em; }
.post-body h2 { font-size: clamp(1.35rem, 3vw, 1.65rem); line-height: 1.4; margin: 5.2em 0 .8em; letter-spacing: -.02em; padding-left: .8rem; border-left: 4px solid var(--brand); }
.post-body h3 { font-size: clamp(1.15rem, 2.5vw, 1.3rem); line-height: 1.45; margin: 2em 0 .6em; }
.post-body img { display: block; margin: 1.6em auto .5em; border-radius: 8px; }
.post-body p > img + em, .post-body p > img + br + em { color: var(--ink-3); font-size: .9rem; }
.post-body em { color: var(--ink-2); }
.post-body ul, .post-body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.post-body li { margin: .25em 0; }
.post-body blockquote { margin: 1.6em 0; padding: 1rem 1.2rem; background: var(--paper-2); border-left: 3px solid var(--brand); }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body a { text-underline-offset: 3px; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.post-body .post-video { display: block; max-width: 100%; margin: 1.6em auto; border-radius: 10px; background: #000; }
.post-body iframe { max-width: 100%; }
.tags { list-style: none; padding: 0; margin: 2.5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: var(--ink-3); font-size: .9rem; }
.around { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1.4rem; }
.around a { color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.5; font-size: .98rem; }
.around a:hover { color: var(--accent); }
.around small { display: block; color: var(--ink-3); font-weight: 400; font-size: .82rem; }
.around .next { grid-column: 2; text-align: right; }
.back { margin-top: 2rem; font-size: .95rem; color: var(--ink-3); }
@media (max-width: 640px) { .around { grid-template-columns: 1fr; } .around .next { grid-column: 1; text-align: left; } body { font-size: 16px; } }

.site-footer { background: #16181c; color: #c9cdd3; font-size: .92rem; line-height: 1.7; padding: 3rem 0 2rem; }
.site-footer strong { color: #fff; display: block; margin-bottom: .5rem; }
.site-footer a { color: #e8e6e1; }
.foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; }
.foot p { margin: 0 0 .4rem; }
.hours { list-style: none; padding: 0; margin: 0; } .hours li { display: flex; justify-content: space-between; max-width: 15rem; }
.flinks a { display: block; }
.copy { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid #2c3036; color: #8b9099; font-size: .82rem; }

/* === 진료 안내 블록 (2026-10-15) === */
/* common.hospital_html(full) → 글 끝 .hr-hosp 블록. WP 필터가 지우는 display·border-radius·box-shadow는 여기서 준다. preview.py 도 이 파일을 읽는다 */
.post-body .hr-hosp { border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(16, 42, 84, .06); }
.post-body .hr-hosp__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.post-body .hr-hosp__head span { margin-left: 0 !important; opacity: .85; }
.post-body .hr-hosp__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-body .hr-hosp__col + .hr-hosp__col { border-left: 1px solid #e6edf5; }
.post-body .hr-hosp__row { display: flex; gap: 10px; }
.post-body .hr-hosp__row b { flex: 0 0 52px; }
.post-body .hr-hosp__hours { border: 0 !important; }
.post-body .hr-hosp__hours th, .post-body .hr-hosp__hours td { background: none !important; border-left: 0 !important; border-right: 0 !important; border-top: 0 !important; font-variant-numeric: tabular-nums; }
.post-body .hr-hosp__cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 18px !important; }
.post-body a.hr-hosp__btn { display: block; margin: 0 !important; text-align: center; border-radius: 10px; transition: filter .15s; }
.post-body a.hr-hosp__btn:hover { filter: brightness(.95); }
.post-body .hr-hosp__foot { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px !important; }
.post-body .hr-hosp__chip { margin: 0 !important; border-radius: 999px; }
@media (max-width: 640px) {
    .post-body .hr-hosp__body, .post-body .hr-hosp__cta { grid-template-columns: 1fr; }
    .post-body .hr-hosp__col + .hr-hosp__col { border-left: 0; border-top: 1px solid #e6edf5; }
}
/* === /진료 안내 블록 === */

/* === 함께 읽으면 좋은 글 카드 (2026-10-06) === */
/* 원고 frontmatter related: [uid] → publish_kboard.py 가 본문 끝에 .hr-related 블록을 붙인다. WP 필터가 인라인 border-radius·box-shadow를 지워서 모양은 여기서 준다 */
.post-body .hr-related { margin-top: 2.5em; padding-top: 1.6em; border-top: 1px solid #e6edf5; }
.post-body .hr-related__head { margin: 0 0 14px !important; }
.post-body .hr-related__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.post-body a.hr-related__card { display: flex !important; flex-direction: column; margin: 0 !important; border: 1px solid #dbe4ef; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(16, 42, 84, .06); text-decoration: none !important; transition: box-shadow .15s, transform .15s; }
.post-body a.hr-related__card:hover { box-shadow: 0 6px 18px rgba(16, 42, 84, .12); transform: translateY(-2px); }
.post-body .hr-related__img { width: 100% !important; aspect-ratio: 16 / 9; object-fit: cover; margin: 0 !important; border-radius: 0 !important; }
.post-body .hr-related__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-body .hr-related__desc { display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) { .post-body .hr-related__grid { grid-template-columns: 1fr; gap: 12px; } }
/* === /함께 읽으면 좋은 글 카드 === */

/* === 본문 표 넘침·둥근 모서리 (2026-10-04) === */
/* 게시판 업로드 때 지워지는 인라인 overflow-x·border-radius·box-shadow를 사이트 CSS로 보충 */
.post-body .hr-table { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; box-shadow: 0 2px 8px rgba(16, 42, 84, .06); }
.post-body .hr-table table { margin: 0; }
@media (max-width: 689.98px) {
    /* 넘칠 일 자체를 줄인다: 첫 칸·제목 줄 줄바꿈 허용(단어 단위), 칸 안쪽 여백 축소 */
    .post-body .hr-table th, .post-body .hr-table td { white-space: normal !important; word-break: keep-all; padding: 10px 10px !important; }
}
/* === /본문 표 넘침·둥근 모서리 === */

/* === 본문 유튜브 영상 (2026-10-11) === */
/* 원고의 <iframe src="https://www.youtube.com/embed/…">. WP 필터가 인라인 aspect-ratio·display·border-radius를 지워서 비율·정렬은 여기서 준다. 쇼츠는 width="360"(세로 9:16) */
.post-body iframe[src*="youtube.com/embed"] { display: block; width: 100% !important; max-width: 100%; height: auto !important; aspect-ratio: 16 / 9; border: 0; margin: 1.2em auto 0.4em; border-radius: 12px; background: #000; }
.post-body iframe[src*="youtube.com/embed"][width="360"] { max-width: 360px !important; aspect-ratio: 9 / 16; }
/* === /본문 유튜브 영상 === */

/* === 본문 이미지 설명 위치 (2026-10-04) === */
/* 이미지와 설명(em)이 한 문단에 나란히 있어 작은 이미지는 설명이 오른쪽에 붙음 → 이미지를 한 줄로, 설명은 아래 */
.post-body p > img { display: block; height: auto; margin-left: auto; margin-right: auto; }  /* 본문보다 작은 이미지는 가운데 */
.post-body p > img + em, .post-body p > img + br + em { display: block; margin-top: 8px; text-align: center; }
/* === /본문 이미지 설명 위치 === */
