/* =========================================================
   모든 테마 공통 컴포넌트 (빌드 시 각 테마 theme.css 앞에 합쳐짐)
   blog.js 가 사용하는 상태 클래스와 검색 레이어만 정의합니다.
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; word-break: keep-all; overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 300; background: #111; color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 8px; }
.is-hidden { display: none !important; }
.dd { position: relative; }
.dd-panel { display: none; }
.dd.is-open .dd-panel { display: block; }
.m-nav { display: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 검색 레이어 */
.search-layer { position: fixed; inset: 0; z-index: 200; background: rgba(15, 18, 22, .5); display: none; padding: 10vh 16px; }
.search-layer.is-open { display: block; }
.search-box { max-width: 680px; margin: 0 auto; background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.search-box input { width: 100%; border: 0; border-bottom: 2px solid var(--brand); font: inherit; font-size: 20px; padding: 8px 4px 12px; outline: none; background: transparent; }
.search-results { margin-top: 12px; max-height: 56vh; overflow-y: auto; }
.search-results a { display: block; padding: 12px 6px; border-bottom: 1px solid #eceef0; font-size: 15px; color: #1b1e22; }
.search-results a:hover { color: var(--brand); }
.search-results small { display: block; color: #8a9097; font-size: 12px; margin-top: 2px; }
.search-empty { color: #8a9097; padding: 16px 6px; font-size: 14px; }

/* =========================================================
   Theme: press — 워드프레스 블로그형
   상단 정보바 · 중앙 사이트 타이틀 · 본문 + 사이드바 위젯 · 다크 위젯 푸터
   ========================================================= */
:root {
  --brand: #0e6b6f; --brand-ink: #0a4f52; --brand-soft: #e7f3f2;
  --ink: #1e1e1e; --ink-2: #50575e; --ink-3: #8c8f94; --line: #dcdcde; --bg: #f0f0f1; --paper: #fff;
  --dark: #1d2327; --dark-2: #2c3338;
  --serif: "Noto Serif KR", "Nanum Myeongjo", serif;
  --wrap: 1680px; --gutter: clamp(16px, 3vw, 40px); --side: 360px;
}
body { font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif; color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.7; }
.wrap { max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
a:hover { color: var(--brand); }

/* ---------- 상단 정보바 ---------- */
.p-topbar { background: var(--dark); color: #c3c4c7; font-size: 13px; }
.p-topbar .wrap { display: flex; gap: 24px; align-items: center; height: 38px; overflow: hidden; white-space: nowrap; }
.p-topbar a { color: #fff; }
.p-top-home { margin-left: auto; }

/* ---------- 마스트헤드 ---------- */
.p-masthead { background: var(--paper); text-align: center; padding: clamp(28px, 3.4vw, 56px) 0 clamp(20px, 2.4vw, 36px); }
.p-site-title { font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 3vw, 48px); letter-spacing: -0.03em; color: var(--ink); }
.p-site-title:hover { color: var(--brand); }
.p-site-desc { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }

/* ---------- 메뉴 ---------- */
.p-nav { position: sticky; top: 0; z-index: 50; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 3px solid var(--brand); }
.p-nav .wrap { display: flex; align-items: center; justify-content: center; position: relative; }
.p-menu { list-style: none; display: flex; margin: 0; padding: 0; }
.p-menu > li > a, .p-menu .dd > button {
  display: block; padding: 16px 20px; border: 0; background: none; font-size: 15px; font-weight: 700; color: var(--ink);
}
.p-menu > li > a:hover, .p-menu .dd > button:hover, .p-menu a.is-current { color: var(--brand); }
.p-menu .dd-panel { position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--brand); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.p-menu .dd-panel a { display: block; padding: 10px 18px; border-bottom: 1px solid var(--bg); font-size: 14px; }
.p-search-btn { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; }
.p-search-btn:hover { color: var(--brand); }
.p-menu-btn { display: none; }

/* ---------- 레이아웃 ---------- */
.p-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: clamp(24px, 2.6vw, 48px); padding-top: clamp(24px, 2.6vw, 48px); padding-bottom: 64px; align-items: start; }
.p-main { min-width: 0; }
.p-section-title { font-family: var(--serif); font-size: 22px; margin: 40px 0 18px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.p-entry-cat { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--brand); padding: 3px 10px; border-radius: 3px; }
.p-entry-cat:hover { color: #fff; background: var(--brand-ink); }
.p-entry-meta { font-size: 13px; color: var(--ink-3); margin: 6px 0 12px; }
.p-more { display: inline-block; font-weight: 700; font-size: 14px; color: var(--brand); border-bottom: 1px solid currentColor; }
.p-button { display: block; text-align: center; padding: 12px 16px; margin-top: 10px; border-radius: 4px; background: var(--brand); color: #fff; font-weight: 700; border: 0; font-size: 15px; }
.p-button:hover { background: var(--brand-ink); color: #fff; }
.p-button.alt { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.p-button.alt:hover { border-color: var(--brand); color: var(--brand); }

/* 추천(스티키) 글 */
.p-sticky { position: relative; background: var(--paper); padding: clamp(16px, 2vw, 32px); border: 1px solid var(--line); }
.p-sticky-thumb { display: block; margin-bottom: 20px; overflow: hidden; }
.p-sticky-thumb img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.p-badge { position: absolute; top: clamp(28px, 2.8vw, 44px); left: clamp(28px, 2.8vw, 44px); background: var(--dark); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; }
.p-sticky-title { font-family: var(--serif); font-size: clamp(24px, 2.2vw, 36px); line-height: 1.35; margin: 12px 0 0; }
.p-sticky p { color: var(--ink-2); margin: 0 0 14px; font-size: 17px; }

/* 글 목록 */
.p-entries { display: grid; gap: 20px; }
.p-entry { display: grid; grid-template-columns: minmax(200px, 38%) 1fr; background: var(--paper); border: 1px solid var(--line); }
.p-entry-thumb { overflow: hidden; }
.p-entry-thumb img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; transition: transform .4s; }
.p-entry:hover .p-entry-thumb img { transform: scale(1.04); }
.p-entry-body { padding: clamp(18px, 2vw, 32px); }
.p-entry-title { font-family: var(--serif); font-size: clamp(19px, 1.5vw, 24px); line-height: 1.4; margin: 12px 0 0; }
.p-entry-body p { margin: 0 0 14px; color: var(--ink-2); }
.p-pagination { display: flex; gap: 6px; margin: 28px 0 0; flex-wrap: wrap; }
.p-pagination a, .p-pagination span { min-width: 40px; height: 40px; padding: 0 12px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.p-pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.p-pagination .dots { border: 0; background: none; }
.p-loadmore { margin-top: 20px; }

/* 박스 섹션 (FAQ, 의료진, 원칙) */
.p-box { background: var(--paper); border: 1px solid var(--line); padding: 4px clamp(18px, 2vw, 32px) clamp(18px, 2vw, 32px); margin-top: 32px; }
.p-box .p-section-title { margin-top: 24px; }
.p-faq details { border-bottom: 1px solid var(--line); }
.p-faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 16px; }
.p-faq summary::marker { color: var(--brand); }
.p-faq details p { margin: 0 0 16px; color: var(--ink-2); padding-left: 18px; }
.p-docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.p-doc { display: flex; gap: 14px; }
.p-doc h3 { margin: 0 0 4px; font-size: 17px; }
.p-doc h3 small, .p-authorbio h2 small { display: block; font-size: 13px; color: var(--brand); font-weight: 600; font-family: "Pretendard Variable", sans-serif; }
.p-doc p { margin: 0; font-size: 14px; color: var(--ink-2); }
.p-creds { margin-top: 6px !important; font-size: 12px !important; color: var(--ink-3) !important; }
.p-dav { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.p-dav.lg { width: 56px; height: 56px; font-size: 20px; }
.p-vals { margin: 0; padding-left: 1.2em; color: var(--ink-2); }
.p-vals li { margin-bottom: 6px; }
.p-vals b { color: var(--ink); }

/* ---------- 사이드바 위젯 ---------- */
.p-sidebar { display: grid; gap: 24px; position: sticky; top: 72px; }
.widget { background: var(--paper); border: 1px solid var(--line); padding: 22px; }
.widget-title { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 800; letter-spacing: .04em; position: relative; }
.widget-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 40px; height: 2px; background: var(--brand); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.p-wsearch form { display: flex; }
.p-wsearch input { flex: 1; min-width: 0; border: 1px solid var(--line); border-right: 0; padding: 10px 12px; font: inherit; font-size: 14px; }
.p-wsearch button { border: 0; background: var(--dark); color: #fff; padding: 0 16px; font-weight: 700; font-size: 14px; }
.p-wlogo { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.p-wlogo span { width: 40px; height: 40px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.p-wabout > p { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.p-hours { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 12px; }
.p-hours th, .p-hours td { padding: 6px 0; border-bottom: 1px dashed var(--line); text-align: left; }
.p-hours th { color: var(--ink-3); font-weight: 600; width: 60px; }
.p-waddr { font-size: 14px; margin: 0 0 4px !important; }
.p-waddr small { color: var(--ink-3); }
.p-wcats li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--bg); font-size: 15px; }
.p-wcats li span { color: var(--ink-3); font-size: 13px; }
.p-wcats a.is-current { color: var(--brand); font-weight: 700; }
.p-wpop li + li { margin-top: 12px; }
.p-wpop a { display: flex; gap: 12px; align-items: center; }
.p-wthumb { flex: none; width: 64px; height: 64px; overflow: hidden; }
.p-wthumb img { width: 100%; height: 100%; object-fit: cover; }
.p-wpop b { display: block; font-size: 14px; line-height: 1.45; font-weight: 600; }
.p-wpop time { font-size: 12px; color: var(--ink-3); }
.p-wdocs li { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 13px; color: var(--ink-3); }
.p-wdocs b { display: block; color: var(--ink); font-size: 14px; }
.p-wlist li { padding: 8px 0; border-bottom: 1px solid var(--bg); font-size: 14px; }
.p-tagcloud { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.p-tagcloud a { color: var(--ink-2); }

/* ---------- 단일 글 ---------- */
.p-crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.p-crumb span { color: var(--ink-2); }
.p-single { background: var(--paper); border: 1px solid var(--line); padding: clamp(20px, 3vw, 56px); }
.p-single-title { font-family: var(--serif); font-size: clamp(28px, 2.6vw, 44px); line-height: 1.32; margin: 14px 0 6px; letter-spacing: -0.02em; }
.p-reviewed { color: var(--brand); font-weight: 700; }
.p-featured { margin: 24px 0 0; }
.p-featured img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.p-content { font-size: 18px; line-height: 1.9; margin-top: 32px; }
.p-content p { margin: 0 0 1.4em; }
.p-content h2 { font-family: var(--serif); font-size: clamp(22px, 1.7vw, 28px); margin: 2em 0 .8em; padding-left: 14px; border-left: 4px solid var(--brand); line-height: 1.4; scroll-margin-top: 80px; }
.p-content blockquote { margin: 2em 0; padding: 20px 28px; background: var(--bg); border-left: 4px solid var(--ink); font-family: var(--serif); font-size: 19px; }
.p-content figure { margin: 2em 0; }
.p-content figcaption { font-size: 14px; color: var(--ink-3); text-align: center; margin-top: 8px; }
.p-content .table-wrap { margin: 2em 0; }
.p-content table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; }
.p-content caption { text-align: left; font-weight: 700; margin-bottom: 8px; }
.p-content th, .p-content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.p-content thead th { background: var(--bg); }
.p-answer { background: var(--brand-soft); border: 1px solid var(--brand); padding: 22px 26px; margin-bottom: 24px; }
.p-answer strong { color: var(--brand-ink); }
.p-answer p { margin: 6px 0 10px !important; font-weight: 600; }
.p-answer ul { margin: 0; padding-left: 1.2em; font-size: 16px; }
.p-toc { display: inline-block; min-width: min(100%, 420px); background: var(--bg); border: 1px solid var(--line); padding: 16px 24px; margin-bottom: 24px; font-size: 15px; }
.p-toc ol { margin: 8px 0 0; padding-left: 1.2em; }
.p-sources { font-size: 15px; color: var(--ink-2); }
.p-single-foot { margin-top: 40px; }
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.p-tags span { font-weight: 700; margin-right: 4px; }
.p-tags a { background: var(--bg); padding: 4px 10px; border-radius: 3px; }
.p-notice { font-size: 13px; color: var(--ink-3); }
.p-authorbio { display: flex; gap: 18px; padding: 24px; background: var(--bg); margin: 24px 0; }
.p-authorbio h2 { margin: 0 0 6px; font-size: 18px; font-family: var(--serif); }
.p-authorbio p { margin: 0; font-size: 15px; color: var(--ink-2); }
.p-postnav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.p-postnav a { padding: 18px 0; font-weight: 700; font-family: var(--serif); }
.p-postnav a[rel="next"] { text-align: right; border-left: 1px solid var(--line); padding-left: 16px; }
.p-postnav small { display: block; font-family: "Pretendard Variable", sans-serif; font-weight: 600; font-size: 12px; color: var(--ink-3); }
.p-related h2 { font-family: var(--serif); font-size: 20px; margin: 32px 0 14px; }
.p-related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.p-related img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; margin-bottom: 8px; }
.p-related span { font-weight: 700; font-size: 15px; line-height: 1.45; }

/* 보관함 */
.p-archive-head { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--brand); padding: 24px 28px; margin-bottom: 24px; }
.p-archive-head p { margin: 0; font-size: 13px; color: var(--ink-3); font-weight: 700; letter-spacing: .06em; }
.p-archive-head h1 { font-family: var(--serif); margin: 4px 0 8px; font-size: clamp(26px, 2.4vw, 38px); }
.p-archive-head div { color: var(--ink-2); }

/* ---------- 푸터 ---------- */
.p-footer { background: var(--dark); color: #a7aaad; font-size: 14px; }
.p-fwidgets { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 48px; }
.p-footer h2 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.p-footer ul { list-style: none; margin: 0; padding: 0; line-height: 2.1; }
.p-footer address { font-style: normal; line-height: 2; }
.p-footer a:hover { color: #fff; }
.p-site-info { background: #101517; padding: 18px 0; font-size: 12px; }
.p-site-info .wrap { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.p-site-info span:last-child { margin-left: auto; letter-spacing: .04em; }
.p-site-info b { color: #fff; }

/* =========================================================
   반응형
   ========================================================= */
@media (max-width: 1280px) { :root { --side: 300px; } .p-docs { grid-template-columns: 1fr; } }
@media (max-width: 1024px) {
  .p-layout { grid-template-columns: 1fr; }
  .p-sidebar { position: static; grid-template-columns: repeat(2, 1fr); }
  .p-fwidgets { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 820px) {
  .p-menu { display: none; }
  .p-nav .wrap { justify-content: space-between; height: 52px; }
  .p-menu-btn { display: block; border: 0; background: none; font-weight: 700; font-size: 15px; padding: 0; }
  .p-search-btn { position: static; transform: none; }
  .m-nav.is-open { display: block; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 55px; z-index: 49; }
  .m-nav a { display: block; padding: 14px var(--gutter); border-top: 1px solid var(--bg); font-weight: 700; }
}
@media (max-width: 640px) {
  .p-entry { grid-template-columns: 1fr; }
  .p-sidebar { grid-template-columns: 1fr; }
  .p-fwidgets { grid-template-columns: 1fr; gap: 28px; }
  .p-related ul { grid-template-columns: 1fr; }
  .p-postnav { grid-template-columns: 1fr; }
  .p-postnav a[rel="next"] { text-align: left; border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .p-authorbio { flex-direction: column; }
  .p-content { font-size: 17px; }
  .p-sticky-thumb img, .p-featured img { aspect-ratio: 16 / 10; }
  .p-site-info span:last-child { margin-left: 0; }
}

/* =========================================================
   생성기 전용 보조 스타일 (모든 테마 공통, theme.css 뒤에 합쳐짐)
   시안에는 없던 실제 데이터용 요소(사진 아바타, 핵심 포인트, 빈 목록 등)
   ========================================================= */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.key-points { margin: 12px 0 0; padding-left: 1.2em; }
.key-points li { margin: 4px 0; }
.empty-list { padding: 48px 0; text-align: center; color: #8a9097; }
.notfound { padding: 96px 0; text-align: center; }
.notfound h1 { margin: 0 0 12px; }
.notfound p { margin: 0 0 24px; color: #5b6168; }
.t-avatar, .p-dav, .a-av { overflow: hidden; }
.t-avatar img, .p-dav img, .a-av img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.t-logo img, .a-logo img, .p-wlogo img { height: 30px; width: auto; }
.ola-link { color: inherit; text-decoration: none; }
.ola-link:hover { text-decoration: underline; }
