/* =========================================================
   모든 테마 공통 컴포넌트 (빌드 시 각 테마 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; }

/* =========================================================
   테마: portal — 포털(네이버) 느낌. 큰 검색창 + 탭 메뉴, 회색 바탕에 흰 박스, 왼쪽 프로필 패널,
   작은 글씨·촘촘한 정보 밀도. 강조색은 업체 대표색(--brand)
   ========================================================= */
:root {
  --brand: #0e6b6f; --brand-ink: #0a4f52; --brand-soft: #e7f3f2;
  --ink: #1e1e23; --ink-2: #505058; --ink-3: #8e8e96; --line: #e4e6ea; --line-2: #eef0f2;
  --canvas: #f4f5f7; --box: #ffffff; --radius: 12px;
  --wrap: 1680px; --gutter: clamp(12px, 2.4vw, 40px);
}
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-size: 14px; line-height: 1.55; letter-spacing: -0.02em; }
.wrap { max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- 헤더 ---------- */
.pt-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.pt-header-in { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.pt-logo { display: flex; align-items: center; gap: 8px; flex: none; }
.pt-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 16px; }
.pt-logo img { height: 32px; width: auto; }
.pt-logo b { font-size: 20px; font-weight: 900; letter-spacing: -0.05em; color: var(--brand); }
.pt-logo em { font-style: normal; font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -0.05em; }
.pt-search { flex: 1; max-width: 640px; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 22px; border: 2px solid var(--brand); border-radius: 26px; background: #fff; color: var(--ink-3); font-size: 16px; text-align: left; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.pt-search i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.pt-search:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.pt-util { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.pt-util a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 16px; }
.pt-util a:hover { border-color: var(--brand); color: var(--brand); }
.pt-menu { width: 40px; height: 40px; border: 0; background: none; display: none; place-items: center; }
.pt-tabs { border-top: 1px solid var(--line-2); }
.pt-tabs-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pt-tabs-in::-webkit-scrollbar { display: none; }
.pt-tabs a { position: relative; padding: 13px 12px 12px; font-size: 15px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pt-tabs a:hover { color: var(--ink); }
.pt-tabs a.is-active { color: var(--brand); font-weight: 800; }
.pt-tabs a.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 2px; background: var(--brand); }
.m-nav { display: none; }

/* ---------- 레이아웃 ---------- */
.pt-canvas { padding: 20px 0 40px; }
.pt-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.pt-main { min-width: 0; display: grid; gap: 16px; }
.pt-aside { position: sticky; top: 140px; display: grid; gap: 16px; }
.pt-box { background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.pt-box-title, .pt-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.pt-box-title { margin-bottom: 10px; }
.pt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pt-head a { font-size: 13px; color: var(--ink-3); }
.pt-head a:hover { color: var(--brand); }

/* 프로필 */
.pt-profile { text-align: center; }
.pt-avatar { width: 88px; height: 88px; margin: 4px auto 12px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 34px; font-weight: 900; overflow: hidden; border: 1px solid var(--line); }
.pt-avatar img { width: 70%; height: auto; object-fit: contain; }
.pt-profile > b { display: block; font-size: 17px; }
.pt-profile p { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.pt-stats { display: flex; justify-content: center; gap: 14px; margin: 14px 0; padding: 10px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); }
.pt-stats b { color: var(--ink); }
.pt-btns { display: flex; gap: 6px; }
.pt-btn { flex: 1; display: inline-flex; justify-content: center; align-items: center; padding: 9px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 700; background: #fff; }
.pt-btn:hover { border-color: var(--brand); color: var(--brand); }
.pt-btn.primary { flex: none; padding: 11px 22px; background: var(--brand); color: #fff; border-color: var(--brand); }
.pt-tree { list-style: none; margin: 0; padding: 0; }
.pt-tree a { display: block; padding: 7px 4px; color: var(--ink-2); border-radius: 6px; }
.pt-tree a:hover { background: var(--canvas); }
.pt-tree a.is-active { color: var(--brand); font-weight: 800; }
.pt-tree span { color: var(--ink-3); font-size: 12px; }
.pt-rank { list-style: none; margin: 0; padding: 0; }
.pt-rank a { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; padding: 7px 0; line-height: 1.45; }
.pt-rank a:hover { text-decoration: underline; }
.pt-rank em { font-style: normal; font-weight: 900; color: var(--brand); }

/* 소개 */
.pt-intro h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.04em; }
.pt-intro h1 span { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 6px; }
.pt-intro p { margin: 0; color: var(--ink-2); }

/* 카드 */
.pt-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pt-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pt-card a { display: block; }
.pt-card-img { display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--canvas); margin-bottom: 10px; }
.pt-card-img img { width: 100%; height: 100%; object-fit: cover; }
.pt-card h3 { margin: 4px 0 4px; font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pt-card a:hover h3 { text-decoration: underline; }
.pt-cat { display: inline-block; font-size: 12px; font-weight: 700; color: var(--brand); }
.pt-meta { display: block; font-size: 12px; color: var(--ink-3); }
.pt-meta i { font-style: normal; margin: 0 5px; }

/* 목록 */
.pt-items { border-top: 1px solid var(--line-2); }
.pt-item { border-bottom: 1px solid var(--line-2); }
.pt-item.is-hidden { display: none; }
.pt-item a { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 20px; padding: 16px 0; align-items: center; }
.pt-item h3 { margin: 2px 0 4px; font-size: 16.5px; font-weight: 700; line-height: 1.45; }
.pt-item a:hover h3 { text-decoration: underline; }
.pt-item p { margin: 0 0 6px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pt-item-img { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--canvas); }
.pt-item-img img { width: 100%; height: 100%; object-fit: cover; }
.pt-more { display: block; width: 100%; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 700; color: var(--ink-2); }
.pt-more:hover { background: var(--canvas); }

/* 카테고리 박스 */
.pt-catgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pt-titles { list-style: none; margin: 0; padding: 0; }
.pt-titles li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--line); }
.pt-titles li:last-child { border-bottom: 0; }
.pt-titles a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-titles a:hover { text-decoration: underline; color: var(--brand); }
.pt-titles time { flex: none; font-size: 12px; color: var(--ink-3); }

/* 의료진·FAQ·원칙·병원 */
.pt-docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pt-doc { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fafbfc; }
.pt-av { width: 60px; height: 60px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 900; font-size: 22px; overflow: hidden; flex: none; }
.pt-av.sm { width: 40px; height: 40px; font-size: 16px; }
.pt-doc h3 { margin: 0; font-size: 15px; }
.pt-role { margin: 0 0 6px; color: var(--brand); font-size: 12.5px; font-weight: 700; }
.pt-doc p { margin: 0 0 6px; color: var(--ink-2); font-size: 13px; }
.pt-doc ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-3); }
.pt-faq details { border-bottom: 1px solid var(--line-2); }
.pt-faq summary { cursor: pointer; list-style: none; padding: 12px 0; font-weight: 700; font-size: 15px; display: flex; gap: 10px; }
.pt-faq summary::-webkit-details-marker { display: none; }
.pt-faq b { color: var(--brand); flex: none; }
.pt-faq details p { margin: 0 0 12px; display: flex; gap: 10px; color: var(--ink-2); background: var(--canvas); padding: 12px 14px; border-radius: 8px; }
.pt-faq details p b { color: var(--ink-3); }
.pt-values { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pt-values li { padding: 12px 14px; background: var(--canvas); border-radius: 8px; }
.pt-values b { display: block; color: var(--brand); margin-bottom: 2px; }
.pt-values span { color: var(--ink-2); font-size: 13px; }
.pt-clinic-name { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.pt-clinic-name span { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.pt-info { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.pt-info div { display: grid; grid-template-columns: 76px minmax(0, 1fr); padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.pt-info dt { color: var(--ink-3); }
.pt-info dd { margin: 0; }
.pt-info dd small { display: block; color: var(--ink-3); font-size: 12px; }

/* ---------- 글 상세 ---------- */
.pt-article { padding: clamp(22px, 3vw, 44px) clamp(18px, 4vw, 64px); }
.pt-article-head { border-bottom: 1px solid var(--line-2); padding-bottom: 18px; margin-bottom: 22px; }
.pt-article-head h1 { margin: 6px 0 16px; font-size: clamp(24px, 2.2vw, 34px); line-height: 1.38; letter-spacing: -0.045em; }
.pt-writer { display: flex; align-items: center; gap: 10px; }
.pt-writer b { font-size: 14px; }
.pt-writer span { font-size: 12.5px; color: var(--brand); font-weight: 700; }
.pt-writer small { display: block; font-size: 12.5px; color: var(--ink-3); }
.pt-writer em { font-style: normal; color: var(--brand); font-weight: 700; }
.pt-cover { margin: 0 0 24px; }
.pt-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.pt-summary { background: var(--brand-soft); border-radius: 10px; padding: 16px 20px; margin-bottom: 20px; }
.pt-summary strong { display: block; color: var(--brand-ink); font-size: 13px; margin-bottom: 4px; }
.pt-summary p { margin: 0; font-size: 16px; font-weight: 600; }
.pt-summary ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); }
.pt-toc { background: var(--canvas); border-radius: 10px; padding: 14px 18px; margin-bottom: 24px; }
.pt-toc strong { font-size: 13px; color: var(--ink-2); }
.pt-toc ol { margin: 6px 0 0; padding-left: 18px; }
.pt-toc a:hover, .pt-toc a.is-active { color: var(--brand); }
.pt-prose { font-size: 16.5px; line-height: 1.9; letter-spacing: -0.01em; }
.pt-prose p { margin: 0 0 1.2em; }
.pt-prose h2 { font-size: 21px; margin: 1.8em 0 .6em; line-height: 1.45; scroll-margin-top: 140px; }
.pt-prose h3 { font-size: 18px; margin: 1.4em 0 .5em; }
.pt-prose figure { margin: 1.4em 0; }
.pt-prose figure img { width: 100%; height: auto; border-radius: 8px; }
.pt-prose figcaption { font-size: 13px; color: var(--ink-3); text-align: center; margin-top: 6px; }
.pt-prose blockquote { margin: 1.4em 0; padding: 14px 18px; border-left: 3px solid var(--brand); background: var(--canvas); color: var(--ink-2); }
.pt-prose ul, .pt-prose ol { padding-left: 1.3em; }
.pt-prose a { color: var(--brand); text-decoration: underline; }
.pt-prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 14.5px; }
.pt-prose th, .pt-prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.pt-prose thead th { background: var(--canvas); }
.pt-prose caption { caption-side: bottom; font-size: 12px; color: var(--ink-3); padding-top: 6px; }
.pt-article .pt-faq h2, .pt-sources h2 { font-size: 18px; margin: 32px 0 8px; }
.pt-article .pt-faq summary { cursor: pointer; padding: 12px 0; font-weight: 700; border-bottom: 1px solid var(--line-2); }
.pt-article .pt-faq details p { display: block; margin: 10px 0 12px; }
.pt-sources ol { padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }
.pt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.pt-tags a { font-size: 13px; color: var(--brand); padding: 5px 10px; background: var(--brand-soft); border-radius: 14px; }
.pt-notice { font-size: 12.5px; color: var(--ink-3); margin-top: 20px; }
.pt-writer-box { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 14px; margin-top: 24px; padding: 18px; border: 1px solid var(--line-2); border-radius: 10px; background: #fafbfc; }
.pt-writer-box span { font-size: 12.5px; color: var(--brand); font-weight: 700; }
.pt-writer-box p { margin: 6px 0 0; color: var(--ink-2); font-size: 13.5px; }
.pt-creds { color: var(--ink-3) !important; font-size: 12.5px !important; }
.pt-pn { padding: 6px 22px; }
.pt-pn a { display: grid; grid-template-columns: 64px minmax(0, 1fr); padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.pt-pn a:last-child { border-bottom: 0; }
.pt-pn span { color: var(--ink-3); font-size: 13px; }
.pt-pn a:hover { color: var(--brand); }

/* ---------- 푸터 ---------- */
.pt-footer { background: #fff; border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.pt-foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin-bottom: 14px; }
.pt-foot-links a { padding: 0 12px; color: var(--ink-2); font-weight: 600; border-left: 1px solid var(--line); }
.pt-foot-links a:first-child { border-left: 0; }
.pt-foot-links a:hover { color: var(--brand); }
.pt-footer address { font-style: normal; line-height: 1.8; }
.pt-footer p { margin: 8px 0 0; }
.pt-copy b { color: var(--ink); }

/* ---------- 반응형 ---------- */
@media (max-width: 1279px) {
  .pt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .pt-layout { grid-template-columns: minmax(0, 1fr); }
  .pt-aside { position: static; order: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-aside .pt-profile { grid-column: 1 / -1; }
  .pt-main { order: 1; }
}
@media (max-width: 860px) {
  .pt-header-in { flex-wrap: wrap; gap: 10px 14px; padding-top: 10px; padding-bottom: 10px; min-height: 0; }
  .pt-search { order: 3; flex-basis: 100%; max-width: none; height: 46px; }
  .pt-util a { display: none; }
  .pt-menu { display: grid; }
  .m-nav.is-open { display: block; position: fixed; inset: 0; z-index: 120; background: #fff; padding: 72px 20px 24px; overflow-y: auto; }
  .m-nav a { display: block; padding: 13px 4px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--line-2); }
  .menu-btn[aria-expanded="true"] { position: fixed; top: 10px; right: 12px; z-index: 130; background: #fff; border-radius: 50%; }
  .pt-aside { top: auto; }
  .pt-catgrid, .pt-info { grid-template-columns: minmax(0, 1fr); }
  .pt-cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
  .pt-aside { grid-template-columns: minmax(0, 1fr); }
  .pt-item a { grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; }
  .pt-item h3 { font-size: 15px; }
  .pt-item p { -webkit-line-clamp: 1; }
  .pt-docs, .pt-values { grid-template-columns: minmax(0, 1fr); }
  .pt-cards.three { grid-template-columns: minmax(0, 1fr); }
  .pt-box { padding: 16px; }
  .pt-prose { font-size: 16px; }
}

/* =========================================================
   생성기 전용 보조 스타일 (모든 테마 공통, 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; }
