/* ============================================================
   pw.css — 부동산위키(propwiki.co.kr) 자체 스킨 v2 (언론사형 프리미엄 + 3단 패널)
   - 클래스 접두어 pw- 통일 · 외부 요청 0 · 시스템 폰트 스택만
   - [임시] 악센트 색 #3b4a5f(딥 블루그레이 계열)는 사람 확정 대기(PW801)
     상태의 임시 적용이다. 확정 시 --pw-accent 계열 변수만 교체한다.
   - 다이어그램·무대 안에서만 시안(--pw-cyan, 로고 유래) 보조 사용.
   - v2: PC(≥1024px) 좌20/중60/우20 3단 · 각 단 독립 세로 스크롤(FR-L3·L4)
     독립 스크롤 패널의 overscroll-behavior는 auto(PW704 §8-3 — contain은 푸터를 가둔다)
   ============================================================ */

:root {
  --pw-accent: #3b4a5f;        /* 임시 악센트 (PW801 확정 대기) */
  --pw-accent-strong: #2b3849;
  --pw-cyan: #35b6d9;          /* 로고 시안 — 무대·그래프 전용 */
  --pw-ink: #1a1d22;
  --pw-ink-soft: #3d434c;
  --pw-mute: #6d747f;
  --pw-line: #e4e1da;
  --pw-line-soft: #eeece6;
  --pw-paper: #faf9f6;
  --pw-panel: #ffffff;
  --pw-serif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", Batang, BatangChe, Georgia, "Times New Roman", serif;
  --pw-sans: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pw-masthead-h: 84px;       /* FR-H1: 기본의 150% */
}

/* ---------- 기본 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.pw-body, body.pw-portal {
  margin: 0;
  font-family: var(--pw-sans);
  font-size: 16px;               /* FR-R1: 본문 최소 16px */
  line-height: 1.7;
  color: var(--pw-ink);
  background: var(--pw-paper);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
img { max-width: 100%; height: auto; }
a { color: var(--pw-accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-size: .92em; background: var(--pw-line-soft); padding: 1px 5px; border-radius: 3px; }

/* ---------- 상단 2층 sticky (FR-L2) ---------- */
.pw-top { position: sticky; top: 0; z-index: 100; }

/* 로고 헤더 = 지식그래프 상징 무대 (FR-H1~H4) */
.pw-masthead {
  position: relative;
  height: var(--pw-masthead-h);
  overflow: hidden;
  background: #f2f0ea;
  border-bottom: 1px solid var(--pw-line);
}
.pw-stage { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.pw-stage-bg {
  position: absolute; inset: -20px;
  width: calc(100% + 40px); height: calc(100% + 40px);
  object-fit: cover; object-position: center;
}
.pw-stage-layer {
  position: absolute; inset: -20px;
  width: calc(100% + 40px); height: calc(100% + 40px);
  will-change: transform;
  pointer-events: none;
}
.pw-mast-inner {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  height: 100%; max-width: 1400px; margin: 0 auto; padding: 0 24px;
}
.pw-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.pw-brand:hover { text-decoration: none; }
.pw-brand-logo {
  width: 46px; height: 46px; display: block;
  filter: drop-shadow(0 1px 4px rgba(250, 249, 246, .9));
}
.pw-wordmark {
  font-family: var(--pw-serif);
  font-size: 30px; font-weight: 700; letter-spacing: .01em;
  color: #1f2a44;
  text-shadow: 0 1px 8px rgba(250, 249, 246, .95), 0 0 2px rgba(250, 249, 246, .8);
  display: flex; align-items: baseline; gap: 10px;
}
.pw-wordmark-sub {
  font-family: var(--pw-sans);
  font-size: 11px; font-weight: 700;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--pw-accent);
}

/* 검색창 — 무대 위에 얹힘 (FR-H2) */
.pw-search { position: relative; margin-left: auto; z-index: 3; }
.pw-search input {
  width: 230px; padding: 8px 14px;
  font: inherit; font-size: 14.5px; color: var(--pw-ink);
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--pw-line);
  border-radius: 2px;
  outline: none;
}
.pw-search input:focus { border-color: var(--pw-accent); background: #fff; }
.pw-search input::placeholder { color: var(--pw-mute); }
.pw-search-results {
  display: none;
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 360px; max-height: 60vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--pw-line);
  border-top: 3px solid var(--pw-accent);
  box-shadow: 0 14px 34px rgba(26, 29, 34, .16);
}
.pw-search-item {
  display: block; padding: 12px 16px;
  border-bottom: 1px solid var(--pw-line-soft);
  text-decoration: none; color: var(--pw-ink);
}
.pw-search-item:hover, .pw-search-sel { background: var(--pw-line-soft); text-decoration: none; }
.pw-search-badge {
  display: inline-block; margin-bottom: 4px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--pw-accent); border: 1px solid var(--pw-line);
  padding: 1px 8px; border-radius: 10px; background: var(--pw-paper);
}
.pw-search-title { display: block; font-size: 15px; line-height: 1.4; }
.pw-search-sum {
  display: block; margin-top: 2px;
  font-size: 13px; line-height: 1.5; color: var(--pw-mute);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pw-search-none { padding: 16px; font-size: 14px; color: var(--pw-mute); text-align: center; }

/* 분류 탭 = 지식 노드 (FR-L6·FR-H5) */
.pw-tabs {
  position: relative;
  display: flex; justify-content: center; gap: 2px;
  background: var(--pw-panel);
  border-bottom: 1px solid var(--pw-line);
  white-space: nowrap;
  overflow-x: auto;              /* 모바일 = 스와이프 */
  scrollbar-width: none;
}
.pw-tabs::-webkit-scrollbar { display: none; }
.pw-tabs::before {               /* 칩들을 잇는 엣지 선 */
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--pw-line-soft);
}
.pw-tab {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  font-size: 14.5px; font-weight: 700;   /* FR-L6: PC 한 줄 14.5px 굵게 */
  color: var(--pw-ink-soft);
  background: var(--pw-panel);
  border-bottom: 3px solid transparent;
  text-decoration: none;
}
.pw-tab:hover { color: var(--pw-accent-strong); text-decoration: none; border-bottom-color: var(--pw-line); }
.pw-tab-active { color: var(--pw-accent-strong); border-bottom-color: var(--pw-accent); }
.pw-tab-dot {                    /* 칩마다 노드 점 */
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pw-accent); opacity: .45; flex: none;
}
.pw-tab:hover .pw-tab-dot, .pw-tab-active .pw-tab-dot { background: var(--pw-cyan); opacity: 1; }

/* ---------- 3단 레이아웃 (FR-L1·L3·L4) ---------- */
.pw-layout { display: block; }
.pw-main { display: block; }
.pw-content { max-width: 1200px; margin: 0 auto; padding: 40px 24px 0; }
.pw-content-article { max-width: 860px; }

.pw-panel { padding: 24px 18px 56px; }   /* padding-bottom 56px: 마지막 줄 잘림 방지 (PW704 §5) */
.pw-panel-title {
  font-family: var(--pw-serif);
  font-size: 17px; font-weight: 700;
  margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--pw-accent-strong);
}

@media (min-width: 1024px) {
  body.pw-body, body.pw-portal {
    height: 100vh; overflow: hidden;
    display: flex; flex-direction: column;
  }
  .pw-top { flex: none; }
  .pw-layout { flex: 1; min-height: 0; display: flex; }
  /* 3단 각각 독립 세로 스크롤 — overscroll은 auto (PW704 §8-3) */
  .pw-panel-left {
    order: -1; width: 20%;
    overflow-y: auto; overscroll-behavior: auto;
    border-right: 1px solid var(--pw-line);
  }
  .pw-main {
    width: 60%;
    overflow-y: auto; overscroll-behavior: auto;
  }
  .pw-panel-right {
    width: 20%;
    overflow-y: auto; overscroll-behavior: auto;
    border-left: 1px solid var(--pw-line);
  }
}
@media (max-width: 1023px) {
  /* 본문 우선 1단 — 좌·우 패널은 본문 아래로 */
  .pw-panel { border-top: 1px solid var(--pw-line); padding: 24px 16px 32px; }
}

/* ---------- 좌패널: 타일 목록 (FR-P1·P2) ---------- */
.pw-tiles { font-size: 15px; }           /* FR-R2: 좌패널 15~15.5px */
.pw-tile {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--pw-line-soft);
  text-decoration: none; color: var(--pw-ink);
}
.pw-tile:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.pw-tile:hover .pw-tile-title { color: var(--pw-accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.pw-tile-thumb {                          /* 이미지 없는 글 = 키워드 타일 (FR-C5) */
  width: 64px; height: 64px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--pw-serif); font-size: 19px; font-weight: 700;
  color: #f4f6f9; background: var(--pw-accent);
  letter-spacing: .08em;
}
.pw-th-land { background: #3b4a5f; }
.pw-th-space { background: #46586f; }
.pw-th-build { background: #52657e; }
.pw-th-number { background: #5e738e; }
.pw-tile-img { width: 64px; height: 64px; flex: none; object-fit: cover; display: block; }
.pw-tile-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pw-tile-title { font-weight: 700; font-size: 15.5px; line-height: 1.4; }
.pw-tile-sum { font-size: 13.5px; line-height: 1.5; color: var(--pw-mute); }
.pw-tile-empty {
  margin-top: 14px; padding: 18px 12px;
  border: 1px dashed var(--pw-line);
  background: var(--pw-panel);
  font-size: 13.5px; line-height: 1.55; color: var(--pw-mute);
  text-align: center;
}

/* ---------- 우패널: 엣지 연결 (FR-P3) ---------- */
.pw-edges {
  list-style: none; margin: 0 0 28px; padding: 0;
  font-size: 16px; line-height: 1.5;      /* FR-R2: 우패널 16px·행간 1.5 */
}
.pw-edge { padding: 12px 0; border-bottom: 1px solid var(--pw-line-soft); }
.pw-edge-why {                            /* 연결 이유 한 줄 — 포인트 색, 제목 위 */
  display: block; margin-bottom: 2px;
  font-size: 13.5px; line-height: 1.5;
  color: var(--pw-accent);
}
.pw-edge-title { font-weight: 700; color: var(--pw-ink); }
.pw-edge-none { font-size: 14px; color: var(--pw-mute); }

/* 위키 소개 카드 + 광고 예약 (FR-P5) */
.pw-intro-card {
  margin-top: 8px; padding: 20px 16px;
  background: var(--pw-panel);
  border: 1px solid var(--pw-line);
  border-top: 3px solid var(--pw-accent);
  text-align: center;
}
.pw-intro-card img { display: block; margin: 0 auto 8px; }
.pw-intro-name { margin: 0; font-family: var(--pw-serif); font-size: 17px; font-weight: 700; }
.pw-intro-label {
  margin: 2px 0 8px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .18em; color: var(--pw-accent);
}
.pw-intro-desc { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--pw-mute); }

/* ---------- 본문(아티클) ---------- */
.pw-article h1 {
  font-family: var(--pw-serif);
  font-size: 34px; line-height: 1.32; font-weight: 700;
  margin: 8px 0 24px; color: var(--pw-ink);
}
.pw-h1-sub { font-family: var(--pw-sans); font-size: 16px; font-weight: 500; color: var(--pw-mute); margin-left: 10px; }
.pw-article h2 {
  font-family: var(--pw-serif);
  font-size: 23px; line-height: 1.4; font-weight: 700;
  margin: 44px 0 14px; padding-top: 20px;
  border-top: 1px solid var(--pw-line);
}
.pw-article h3 {
  font-family: var(--pw-serif);
  font-size: 18.5px; font-weight: 700; margin: 30px 0 10px;
}
.pw-article p { margin: 0 0 16px; }
.pw-article ul, .pw-article ol { margin: 0 0 16px; padding-left: 24px; }
.pw-article li { margin: 6px 0; }
.pw-crumb { font-size: 14px; color: var(--pw-mute); margin: 0 0 4px; }
.pw-crumb a { color: var(--pw-mute); }

/* 강조 상자 · 메타 */
.pw-box {
  background: var(--pw-panel);
  border: 1px solid var(--pw-line);
  border-top: 3px solid var(--pw-accent);
  padding: 20px 24px; margin: 20px 0;
}
.pw-box > :first-child { margin-top: 0; }
.pw-box > :last-child { margin-bottom: 0; }
.pw-meta { font-size: 14px; color: var(--pw-mute); }

/* 표 — 편집형 (상하 굵은 룰) */
.pw-article table {
  width: 100%; border-collapse: collapse;
  margin: 20px 0; font-size: 15px;
  border-top: 2px solid var(--pw-accent-strong);
  border-bottom: 1px solid var(--pw-line);
  background: var(--pw-panel);
}
.pw-article th, .pw-article td {
  padding: 10px 14px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--pw-line-soft);
}
.pw-article th { background: #f4f2ee; font-weight: 700; white-space: nowrap; }

/* ---------- 홈: 섹션 프런트 (FR-L7) ---------- */
.pw-home-head { text-align: center; margin: 6px 0 30px; }
.pw-home-head h1 {
  font-family: var(--pw-serif);
  font-size: 30px; font-weight: 700; margin: 0;
  display: inline-flex; align-items: center; gap: 18px;
}
.pw-home-head h1::before, .pw-home-head h1::after {
  content: ""; width: 64px; border-top: 1px solid var(--pw-line);
}
.pw-home-copy { margin: 10px 0 0; font-size: 15.5px; color: var(--pw-mute); }

/* 리드 스토리 */
.pw-lead { margin: 0 0 56px; }
.pw-lead-link {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 1920 / 720; max-height: 520px;
  background: #10182a;
}
.pw-lead-link:hover { text-decoration: none; }
.pw-lead-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform .8s ease;
}
.pw-lead-link:hover .pw-lead-img { transform: scale(1.025); }
.pw-lead-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13, 20, 34, .88) 0%, rgba(13, 20, 34, .45) 38%, rgba(13, 20, 34, 0) 68%);
}
.pw-lead-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 32px 34px; display: block;
}
.pw-lead-kicker {
  display: inline-block; margin-bottom: 12px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .22em;
  color: #9fd8e8; text-transform: uppercase;
}
.pw-lead-title {
  display: block;
  font-family: var(--pw-serif);
  font-size: 34px; line-height: 1.28; font-weight: 700;
  color: #ffffff; max-width: 21em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
.pw-lead-sum {
  display: block; margin-top: 14px;
  font-size: 16.5px; line-height: 1.65;
  color: rgba(255, 255, 255, .92); max-width: 44em;
}
.pw-lead-more {
  display: inline-block; margin-top: 16px;
  font-size: 14.5px; font-weight: 700; color: #cfe9f2;
  border-bottom: 1px solid rgba(207, 233, 242, .5); padding-bottom: 2px;
}

/* 섹션 제목 */
.pw-sec-title {
  font-family: var(--pw-serif);
  font-size: 23px; font-weight: 700; margin: 0 0 6px;
  display: flex; align-items: center; gap: 16px;
}
.pw-sec-title::after { content: ""; flex: 1; border-top: 1px solid var(--pw-line); }
.pw-sec-sub { margin: 0 0 22px; font-size: 15px; color: var(--pw-mute); }

/* 4 Pillar 카드 그리드 — 60% 컬럼 안에서 2×2 */
.pw-pillars-sec { margin: 0 0 56px; }
.pw-pillars {
  display: grid; gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pw-pillar {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--pw-panel);
  border: 1px solid var(--pw-line);
  border-top: 3px solid var(--pw-accent);
  padding: 22px 22px 18px;
  text-decoration: none; color: var(--pw-ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pw-pillar:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(26, 29, 34, .09);
  border-color: var(--pw-accent);
}
.pw-pillar-no {
  font-size: 12px; font-weight: 700; letter-spacing: .22em;
  color: var(--pw-accent);
}
.pw-pillar-title {
  font-family: var(--pw-serif);
  font-size: 21px; font-weight: 700; line-height: 1.3;
}
.pw-pillar-q { font-size: 15px; font-weight: 700; color: var(--pw-accent-strong); }
.pw-pillar-desc { font-size: 14.5px; line-height: 1.6; color: var(--pw-ink-soft); }
.pw-pillar-outs { font-size: 13px; color: var(--pw-mute); margin-top: auto; padding-top: 10px; }
.pw-pillar-more { font-size: 14px; font-weight: 700; color: var(--pw-accent); }

/* ---------- 전체 글 목록 (all.html · FR-C5) ---------- */
.pw-all-list { margin: 8px 0 24px; }
.pw-item {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 22px 0;
  border-bottom: 1px solid var(--pw-line-soft);
}
.pw-item-thumb { flex: none; display: block; text-decoration: none; }
.pw-item-thumb img { width: 120px; height: 120px; object-fit: cover; display: block; }
.pw-item-kw {
  width: 120px; height: 120px;
  font-size: 30px;
}
.pw-item-info { min-width: 0; }
.pw-item-badge {
  display: inline-block; margin-bottom: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--pw-accent); border: 1px solid var(--pw-line);
  padding: 1px 8px; border-radius: 10px; background: var(--pw-panel);
}
.pw-item-title {
  display: block;
  font-family: var(--pw-serif);
  font-size: 20px; font-weight: 700; line-height: 1.35;
  color: var(--pw-ink);
}
.pw-item-title:hover { color: var(--pw-accent-strong); }
.pw-item-sum { margin: 6px 0 0; font-size: 15px; line-height: 1.6; color: var(--pw-ink-soft); }
.pw-item-meta { margin: 8px 0 0; font-size: 13px; color: var(--pw-mute); }
@media (max-width: 720px) {
  .pw-item { gap: 14px; padding: 16px 0; }
  .pw-item-thumb img, .pw-item-kw { width: 84px; height: 84px; }
  .pw-item-kw { font-size: 22px; }
  .pw-item-title { font-size: 17.5px; }
}

/* 최신 글 · 빈 상태 (정직 표기) */
.pw-latest { margin: 0 0 24px; }
.pw-empty {
  border: 1px dashed var(--pw-line);
  background: var(--pw-panel);
  padding: 40px 24px; margin: 22px 0;
  text-align: center; color: var(--pw-mute);
}
.pw-empty p { margin: 0 auto; max-width: 36em; font-size: 15px; }
.pw-empty-title {
  font-family: var(--pw-serif);
  font-size: 19px; font-weight: 700; color: var(--pw-ink-soft);
  margin: 0 0 8px !important;
}

/* ---------- 푸터 (FR-L5: 본문 패널 맨 끝 · 14px · 행간 1.2) ---------- */
.pw-footer {
  margin-top: 72px; padding: 26px 0 56px;
  border-top: 2px solid var(--pw-accent-strong);
  font-size: 14px; line-height: 1.2; color: var(--pw-mute);
}
.pw-footer-nav { display: flex; flex-wrap: wrap; gap: 6px 0; margin-bottom: 16px; }
.pw-footer-nav a {
  color: var(--pw-ink-soft); font-weight: 500;
  padding: 2px 12px; border-right: 1px solid var(--pw-line);
}
.pw-footer-nav a:first-child { padding-left: 0; }
.pw-footer-nav a:last-child { border-right: 0; }
.pw-footer-disclaimer {
  margin: 0 0 14px; padding: 12px 16px;
  background: var(--pw-line-soft);
  border-left: 3px solid var(--pw-accent);
  line-height: 1.5;
}
.pw-footer-company { margin: 0; line-height: 1.6; }

/* ---------- 반응형 (모바일 1단 · FR-L3) ---------- */
@media (max-width: 720px) {
  :root { --pw-masthead-h: 64px; }
  .pw-mast-inner { padding: 0 14px; gap: 10px; }
  .pw-brand { gap: 10px; }
  .pw-brand-logo { width: 34px; height: 34px; }
  .pw-wordmark { font-size: 21px; gap: 8px; }
  .pw-wordmark-sub { display: none; }
  .pw-search input { width: 34vw; max-width: 150px; min-width: 96px; padding: 6px 10px; font-size: 14px; }
  .pw-search-results { width: 84vw; max-width: 340px; }
  .pw-tabs { justify-content: flex-start; padding: 0 8px; }
  .pw-content { padding: 24px 16px 0; }
  .pw-article h1 { font-size: 26px; }
  .pw-article h2 { font-size: 20px; }
  .pw-pillars { grid-template-columns: 1fr; }
  .pw-lead-link { aspect-ratio: auto; height: 380px; }
  .pw-lead-body { padding: 22px 18px; }
  .pw-lead-title { font-size: 25px; }
  .pw-lead-sum { font-size: 15px; }
  .pw-home-head h1::before, .pw-home-head h1::after { width: 28px; }
  .pw-stage-dot { display: none; }   /* FR-H4: 모바일 = 정적 그림 */
}

/* ---------- 움직임 최소화 (FR-H4) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pw-stage-dot { display: none; }               /* SMIL 빛 점 정지 */
  .pw-lead-img, .pw-pillar { transition: none; }
  .pw-lead-link:hover .pw-lead-img { transform: none; }
  .pw-pillar:hover { transform: none; }
}

/* 칩 호버 엣지 오버레이 (pw-header.js가 생성) */
.pw-edge-overlay { position: fixed; inset: 0; z-index: 99; pointer-events: none; }
