/* ============================================================
   인플레하우스 · 학습하기 (Learn) — 아티클 "셸/전역" 스타일
   정적 HTML 아티클 "단독 페이지" 전용. (SPA 인라인 뷰어는 로드하지 않는다.)
   여기의 규칙은 html/body 및 사이트 헤더·푸터·읽기 진행 바 등
   페이지 전체(크롬)를 다룬다 — 이런 전역 규칙이 SPA 앱 셸로 번지면
   앱 UI 가 깨지므로, 콘텐츠 스타일(article.css)과 분리해 둔다.
   반드시 article.css 다음에 로드한다(:root 토큰을 재사용).
   ============================================================ */

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--canvas);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* 한글은 음절 단위로 아무 데서나 줄바꿈되지 않도록 — 공백(어절) 기준으로만 끊는다.
     긴 단일 토큰(URL 등)은 넘치지 않게 break-word로 보완. */
  word-break: keep-all;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 읽기 진행 바 ---------- */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: transparent; z-index: 100;
}
.reading-progress > span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--brand), #4d86ff);
  transition: width 0.08s linear;
}

/* ---------- 상단 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  max-width: 1080px; margin: 0 auto;
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand-mark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-strong); font-weight: 700; }
.brand-mark img { width: 26px; height: 26px; border-radius: 7px; }
.brand-mark span { font-size: 15px; letter-spacing: -0.01em; }
.header-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; transition: all 0.15s;
}
.header-back:hover { color: var(--ink-strong); border-color: var(--muted-soft); text-decoration: none; }

/* ---------- 사이트 푸터 ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft); background: var(--surface-soft);
  margin-top: 56px;
}
.site-footer .wrap { max-width: 1080px; padding-top: 36px; padding-bottom: 44px; }
.site-footer .foot-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-strong); font-weight: 700; font-size: 14px; }
.site-footer .foot-brand img { width: 22px; height: 22px; border-radius: 6px; }
.site-footer p { font-size: 12.5px; color: var(--muted-soft); line-height: 1.7; margin: 14px 0 0; max-width: 640px; }
.site-footer .foot-links { margin-top: 16px; display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer .foot-links a { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- 반응형(셸) ---------- */
@media (max-width: 640px) {
  .site-header__inner { padding: 0 18px; }
  .brand-mark span { display: none; }
}

/* ---------- 레거시: 과거 SPA iframe 임베드 모드(?embed=1) ----------
   SPA 는 더 이상 iframe 으로 임베드하지 않고 본문을 인라인 주입한다.
   단독 페이지에 ?embed=1 로 직접 접근하는 경우를 위해 규칙만 남겨둔다(무해). */
.embed .site-header,
.embed .site-footer,
.embed .reading-progress {
  display: none;
}
.embed .article-hero {
  border-radius: 0;
}
.embed .article-hero .wrap {
  padding-top: 44px;
}
.embed body {
  overflow: hidden;
}

@media print {
  .site-header, .reading-progress, .article-footer-nav, .site-footer { display: none; }
  body { color: #000; }
}
