/*!*****************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/%5Fsites/[channel]/site.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************************/
/* =============================================================
 * WriteRun 블로그 공개면 — user_order/design/assets/styles.css 이식본
 *
 * 원본과의 유일한 차이:
 *   body[data-gnb=…] → [data-gnb=…]
 *   Next 의 <body> 는 루트 레이아웃 소유라 채널별 속성을 붙일 수 없다.
 *   대신 채널 레이아웃이 래퍼 <div class="wr-site" data-gnb=… data-list=… data-page=…> 를 렌더한다.
 *   (선택자가 [data-…] 로 느슨해지므로 반드시 wr-site 래퍼 안에서만 쓸 것)
 *
 * ⚠️ 디자인 함정(HANDOFF §9) 그대로 유지:
 *   · body { overflow-x: clip }  — hidden 으로 되돌리면 sticky 가 전부 죽는다
 *   · .thumb 의 aspect-ratio 는 여기 한 곳이 단일 소스
 *   · [hidden] { display:none !important }
 * ============================================================= */

/* =============================================================
 * WriteRun 블로그 데모 — 공용 스타일
 * -------------------------------------------------------------
 * 1. 디자인 토큰 (CSS 커스텀 프로퍼티)
 * 2. 리셋 · 기본 타이포
 * 3. 공용 컴포넌트 (버튼 · 배지 · 카드 · 토스트)
 * 4. 공개면 — 헤더 / 홈 / 콘텐츠 뷰 / 푸터
 * 5. 관리자면
 * 6. 반응형 (Tablet 768–1023 / Mobile ≤767)
 *
 * 디자인 토큰은 :root 에 정의되어 있고, 관리자 "디자인 수정"에서
 * JS 로 이 변수들을 덮어써 실시간 미리보기를 구현합니다.
 * ============================================================= */

/* =============================================================
 * 1. 디자인 토큰
 * ============================================================= */
:root {
  /* --- 색 --------------------------------------------------- */
  --brand-accent: #d9773f;
  --brand-accent-ink: #ffffff;      /* 악센트 위 텍스트 */
  --brand-accent-soft: rgba(217, 119, 63, 0.12);
  --brand-accent-hover: #c2642f;

  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f2ee;
  --text: #1f1d1b;
  --text-muted: #6b6560;
  --border: #e5e1da;
  --border-strong: #d3cec5;

  --success: #3f7d58;
  --warning: #b7791f;
  --danger: #b3453c;

  /* --- 타입 ------------------------------------------------- */
  --font-sans: 'Pretendard', 'Pretendard Variable', -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-serif: 'Nanum Myeongjo', 'Apple SD Gothic Neo', Georgia, 'Times New Roman', serif;
  --font-mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;

  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);

  --fs-base: 16px;
  --lh-base: 1.75;
  --lh-tight: 1.32;

  /* 본문 텍스트 3단계 — applyTheme() 가 덮어씁니다 */
  --lh-prose: 1.85;         /* 행간: 1.65 / 1.85 / 2.05 */
  --tracking-prose: 0em;    /* 자간: -0.012em / 0 / 0.022em */

  /* --- 형태 ------------------------------------------------- */
  /* 둥글기는 관리자에서 0 · 4 · 8 · 12 · 16px 5단계로 조절합니다.
     --radius-media 는 썸네일 · 커버 · 본문 이미지 전용입니다. */
  --radius: 12px;
  --radius-sm: 7px;
  --radius-media: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(31, 29, 27, 0.05);
  --shadow: 0 2px 4px rgba(31, 29, 27, 0.04), 0 8px 24px rgba(31, 29, 27, 0.06);
  --shadow-lg: 0 4px 8px rgba(31, 29, 27, 0.05), 0 16px 40px rgba(31, 29, 27, 0.1);

  /* --- 밀도 (관리자에서 조절) --------------------------------- */
  --density: 1;                       /* compact .8 / comfortable 1 / spacious 1.25 */
  --card-pad: calc(20px * var(--density));
  --grid-gap: calc(24px * var(--density));
  --section-gap: calc(64px * var(--density));

  /* --- 레이아웃 --------------------------------------------- */
  --container: 1180px;
  --reading-width: 700px;             /* 본문 영역 3단계: 620 / 700 / 780 */

  /* 로고 표시 높이(S 28 / M 40 / L 56). GNB 높이는 여기에 맞춰 자동 확장됩니다. */
  --logo-h: 40px;
  --header-h: max(68px, calc(var(--logo-h) + 28px));

  /* --- 모션 ------------------------------------------------- */
  --t-fast: 120ms ease;
  --t: 200ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* 그림자 프리셋 · 다크 보정 · 리스트형 레이아웃은
   applyTheme() 가 생성하는 테마 CSS(<style id="wr-theme">)에서 주입됩니다.
   → assets/app.js 의 buildThemeCSS() 참고 */

/* =============================================================
 * 2. 리셋 · 기본
 * ============================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;

  /* §11-1 가로 스크롤 없음.
     주의: overflow-x: hidden 을 쓰면 body 가 스크롤 컨테이너가 되어
     GNB(sticky) · 본문 좌우 레일 · 목차의 position:sticky 가 전부 죽습니다.
     clip 은 스크롤 컨테이너를 만들지 않으므로 sticky 가 살아 있습니다. */
  overflow-x: clip;
}
/* clip 미지원 브라우저에서만 hidden 으로 폴백합니다. */
@supports not (overflow-x: clip) {
  body { overflow-x: hidden; }
}

img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
}

/* 접근성 — 키보드 포커스 링 */
:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--brand-accent); color: var(--brand-accent-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600;
  transition: top var(--t);
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* =============================================================
 * 3. 공용 컴포넌트
 * ============================================================= */

/* --- 버튼 ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.btn:hover { border-color: var(--text-muted); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--brand-accent-ink);
}
.btn-primary:hover { background: var(--brand-accent-hover); border-color: var(--brand-accent-hover); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(179, 69, 60, 0.08); border-color: var(--danger); }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; border-radius: 6px; }
.btn-icon { padding: 9px; border-radius: var(--radius-sm); }
.btn-icon svg { width: 18px; height: 18px; }

/* --- 배지 ---------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center;
  /* flex 컨테이너(.card__body 등)의 자식이 되면 stretch 되어 가로로 꽉 차므로
     내용만큼만 차지하도록 교차축 정렬과 폭을 고정합니다. */
  align-self: flex-start;
  width: -moz-fit-content;
  width: fit-content; max-width: 100%;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  white-space: nowrap;
}
.badge-status {
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-status[data-status='published'] { background: rgba(63, 125, 88, 0.1); color: var(--success); border-color: transparent; }
.badge-status[data-status='draft']     { background: rgba(183, 121, 31, 0.1); color: var(--warning); border-color: transparent; }

/* --- 썸네일 플레이스홀더 --------------------------------------- */
.thumb {
  position: relative;
  /* 콘텐츠 썸네일은 서비스 전역에서 16:9 로 통일합니다. */
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-media);
  background: var(--surface-2);
  overflow: hidden;
  display: grid; place-items: center;
  isolation: isolate;
}
.thumb::after {
  content: attr(data-label);
  position: absolute; inset: auto 0 0 0;
  padding: 10px 12px;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.28), transparent);
}

/* --- 토스트 -------------------------------------------------- */
.toast-region {
  position: fixed; z-index: 300;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: min(92vw, 380px);
  padding: 13px 16px;
  background: var(--text); color: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem; font-weight: 500;
  animation: toast-in var(--t) both;
  pointer-events: auto;
}
.toast[data-leaving='true'] { animation: toast-out 160ms ease forwards; }
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast[data-kind='success'] svg { color: #7fd4a0; }
.toast[data-kind='danger'] svg  { color: #f0938c; }

@keyframes toast-in  { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(6px) scale(0.98); } }

/* --- 빈 상태 ------------------------------------------------- */
.empty {
  padding: 56px 24px; text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}
.empty strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 1.0625rem; }

/* =============================================================
 * 4. 공개면
 * ============================================================= */

/* --- 헤더 (GNB) ----------------------------------------------
 * 3가지 스타일. 관리자 "페이지 디자인"에서 [data-gnb] 로 전환합니다.
 *   plain    — 배경과 구분 없음 (경계선·그림자 없음)
 *   bordered — 하단 구분선으로 본문과 분리 (기본)
 *   floating — 떠 있는 카드처럼 보이는 영역
 * 구성: [로고 + 메뉴] ─── [검색] [커스텀 CTA]
 * ----------------------------------------------------------- */
.site-header {
  position: -webkit-sticky;
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-gnb-sticky='false'] .site-header { position: static; }

/* plain — 배경과 하나로 */
[data-gnb='plain'] .site-header {
  background: transparent;
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
  border-bottom-color: transparent;
}
/* 스크롤 시에도 배경이 비쳐야 하므로 sticky 상태에서 살짝만 흐립니다 */
[data-gnb='plain'] .site-header {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}

/* bordered — 기본값 (위 .site-header 그대로) */

/* floating — 떠 있는 카드 */
[data-gnb='floating'] .site-header {
  background: transparent;
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
  border-bottom: 0;
  padding-top: 14px;
}
[data-gnb='floating'] .site-header__inner {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  /* 그림자 강도를 '없음'으로 두어도 떠 있는 느낌은 유지해야 하므로 고정값 */
  box-shadow: 0 2px 6px rgba(31, 29, 27, 0.06), 0 10px 30px rgba(31, 29, 27, 0.08);
  height: calc(var(--header-h) - 12px);
  padding-inline: 22px;
  max-width: calc(var(--container) - 48px);
  margin-inline: auto;
}
/* 카드 자체가 컨테이너 역할을 하므로 바깥 여백만 유지 */
[data-gnb='floating'] .container.site-header__inner { width: auto; }
.site-header__inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.375rem; font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--brand-accent);
  flex-shrink: 0;
}
.logo small {
  display: block; font-size: 0.625rem; font-weight: 600;
  letter-spacing: 0.14em; color: var(--text-muted);
  margin-top: -2px;
}

/* 업로드한 로고 이미지 — 관리자에서 고른 크기(S/M/L)를 --logo-h 로 받습니다.
   비율이 1:1~16:9 로 제한되어 있어 어느 자리에서도 안정적으로 들어갑니다. */
/* 자유 크롭이라 가로로 긴 로고가 올 수 있습니다. max-width 에 걸리면
   contain 때문에 높이가 줄어드므로 여유를 넉넉히 둡니다. */
.logo-img {
  height: var(--logo-h); width: auto; max-width: 360px;
  object-fit: contain; display: block;
}
/* 푸터는 헤더보다 한 단계 작게 (헤더 크기에 비례) */
.site-footer .logo-img { height: calc(var(--logo-h) * 0.78); max-width: 220px; }
.footer-brand .logo-img { height: calc(var(--logo-h) * 0.58); max-width: 160px; }

/* 카테고리(메뉴)는 우측 검색 옆에 붙습니다 */
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 13px; border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 500; color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current='page'], .nav a.is-active { color: var(--brand-accent); font-weight: 600; }

/* [로고] ─── [카테고리] [검색] [CTA] */
.header-actions {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  min-width: 0;   /* 좁은 폭에서 우측 묶음이 로고를 밀어내지 않도록 */
}

.search-inline {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.search-inline:focus-within { border-color: var(--brand-accent); background: var(--surface); }
.search-inline svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-inline input {
  border: 0; background: transparent; outline: none;
  font: inherit; font-size: 0.875rem; width: 140px; color: var(--text);
}
.search-inline input::placeholder { color: var(--text-muted); }

/* 커스텀 CTA — GNB 우측 끝 */
.header-cta { white-space: nowrap; }
.header-cta.btn-sm { padding: 8px 16px; }

.hamburger { display: none; }

/* 모바일 드로어 */
.mobile-nav {
  display: none;
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
  background: var(--surface);
  padding: 24px;
  overflow-y: auto;
  animation: fade-in 160ms ease both;
}
.mobile-nav[data-open='true'] { display: block; }
.mobile-nav a {
  display: block; padding: 15px 4px;
  font-size: 1.0625rem; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a.is-active { color: var(--brand-accent); }
@keyframes fade-in { from { opacity: 0; } }

/* --- 히어로 -------------------------------------------------- */
.hero { padding: calc(56px * var(--density)) 0 calc(40px * var(--density)); }
.hero__intro { max-width: 640px; margin-bottom: calc(36px * var(--density)); }
.hero__intro h1 {
  font-size: clamp(1.875rem, 1.2rem + 2.6vw, 2.875rem);
  margin-bottom: 12px;
}
.hero__intro p { color: var(--text-muted); font-size: 1.0625rem; margin: 0; }

.featured-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-gap: var(--grid-gap);
  gap: var(--grid-gap);
}
.featured-grid__side { display: grid; grid-gap: var(--grid-gap); gap: var(--grid-gap); align-content: start; }

/* --- 히어로 카드 -----------------------------------------------
 * 히어로는 카드 껍데기(배경·보더·그림자) 없이 썸네일 + 텍스트로 구성합니다.
 *   data-variant="single"   → 썸네일 옆(가로)에 메타·제목·요약
 *   data-variant="featured" → 썸네일 아래(세로)에 메타·제목·요약
 * ----------------------------------------------------------- */
.card-feature {
  display: block; position: relative;
  background: transparent; border: 0; box-shadow: none;
  border-radius: 0; overflow: visible;
  transition: transform var(--t);
}
.card-feature .thumb { border-radius: var(--radius-media); }   /* 비율은 전역 16:9 */
.card-feature__body { padding: 0; }
.card-feature h2 {
  font-size: clamp(1.375rem, 1rem + 1.15vw, 1.875rem);
  margin: 0 0 12px;
  line-height: 1.35;
}
.card-feature p {
  color: var(--text-muted); margin: 0;
  font-size: 0.9375rem; line-height: 1.7;
}
.card-feature:hover h2 { color: var(--brand-accent); }
.card-feature:hover .thumb { transform: translateY(-2px); }
.card-feature .thumb { transition: transform var(--t); }

/* featured — 썸네일 위, 텍스트 아래 */
.card-feature[data-variant='featured'] .card-feature__body { padding-top: calc(var(--card-pad) * 0.9); }

/* single — 썸네일 옆(가로 2열) */
.card-feature[data-variant='single'] {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  grid-gap: calc(var(--grid-gap) * 1.4);
  gap: calc(var(--grid-gap) * 1.4);
  align-items: start;   /* 우측 정보 영역은 상단 정렬 */
}
.card-feature[data-variant='single'] h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.125rem);
}
.card-feature[data-variant='single'] p { font-size: 1rem; }

/* --- 히어로 사이드 카드 (요약 포함, 세로) ------------------------ */
.card-hero-side {
  display: block;
  background: transparent; border: 0; box-shadow: none;
}
.card-hero-side .thumb {
  border-radius: var(--radius-media);   /* 비율은 전역 16:9 */
  transition: transform var(--t);
}
.card-hero-side:hover .thumb { transform: translateY(-2px); }
.card-hero-side:hover h3 { color: var(--brand-accent); }
.card-hero-side__body { padding-top: calc(var(--card-pad) * 0.65); }
.card-hero-side h3 {
  font-size: 1.0625rem; line-height: 1.45;
  margin: 0 0 8px;
}
.card-hero-side p {
  margin: 0; font-size: 0.8125rem; line-height: 1.65;
  color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* --- 히어로 메타 (카테고리 | 날짜) ------------------------------ */
.hero-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px;
  font-size: 0.8125rem; color: var(--text-muted);
}
.hero-meta__cat { color: var(--brand-accent); font-weight: 700; }
.hero-meta__sep {
  width: 1px; height: 11px;
  background: var(--border-strong); flex-shrink: 0;
}
.card-hero-side .hero-meta { margin-bottom: 8px; font-size: 0.75rem; }

/* --- 메타 ---------------------------------------------------- */
.meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 0.8125rem; color: var(--text-muted);
}
.meta__dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; flex-shrink: 0; }

/* --- 목록 섹션 ------------------------------------------------ */
.section { padding-block: calc(40px * var(--density)); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: calc(28px * var(--density));
  border-bottom: 1px solid var(--border); padding-bottom: 14px;
}
.section__head h2 { font-size: 1.375rem; }
.section__count { font-size: 0.875rem; color: var(--text-muted); }

/* --- 카테고리 필터 바 (사이드바 대체) --------------------------- */
.cat-filter-bar {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 calc(28px * var(--density));
  padding: 0;
}
.cat-filter-bar button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.cat-filter-bar button:hover { border-color: var(--text-muted); }
.cat-filter-bar button[aria-pressed='true'] {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--brand-accent-ink);
}
.cat-filter-bar .count {
  font-size: 0.75rem; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.cat-filter-bar button[aria-pressed='true'] .count { color: inherit; opacity: 0.8; }

/* --- 카드 그리드 --------------------------------------------
 * 열 수는 관리자에서 2·3·4 중 선택 → --home-cols 로 들어옵니다.
 * 태블릿 2열 / 모바일 1열은 자동 축소.
 * ----------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(var(--home-cols, 3), minmax(0, 1fr));
  grid-gap: var(--grid-gap);
  gap: var(--grid-gap);
}

.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card .thumb { border-radius: 0; }
.card__body { padding: var(--card-pad); display: flex; flex-direction: column; flex: 1 1; gap: 10px; }
.card__body h3 { font-size: 1.0625rem; }
.card__body p {
  margin: 0; font-size: 0.875rem; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card__body .meta { margin-top: auto; padding-top: 4px; }

/* --- 리스트형 레이아웃 (관리자 디자인 옵션) ---------------------- */
/* --- 히어로 변형 ---------------------------------------------
 *  single   : 큰 카드 1개
 *  featured : 큰 카드 1개 + 사이드 2개 (기본)
 *  triple   : 가로 3열
 * ----------------------------------------------------------- */
.featured-grid[data-style='single'] { grid-template-columns: minmax(0, 1fr); }
.featured-grid[data-style='triple'] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* --- 목록 카드 스타일 ----------------------------------------
 *  cards      : 배경 + 보더 (기본)
 *  borderless : 배경/보더 없이 썸네일 + 텍스트만
 *  list       : 가로 배치
 * ----------------------------------------------------------- */
[data-list='borderless'] .card {
  background: transparent; border: 0; box-shadow: none;
  border-radius: 0; overflow: visible;
}
[data-list='borderless'] .card:hover { transform: translateY(-2px); box-shadow: none; }
[data-list='borderless'] .card:hover h3 { color: var(--brand-accent); }
[data-list='borderless'] .card .thumb { border-radius: var(--radius-media); }
[data-list='borderless'] .card__body { padding: var(--card-pad) 0 0; }

[data-list='list'] .post-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 0; }
[data-list='list'] .card {
  flex-direction: row; align-items: center; gap: 20px;
  border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; box-shadow: none; background: transparent;
  padding: calc(var(--card-pad) * 0.8) 0;
}
[data-list='list'] .card:hover { transform: none; box-shadow: none; }
[data-list='list'] .card:hover h3 { color: var(--brand-accent); }
[data-list='list'] .card .thumb {
  width: 200px; flex-shrink: 0; aspect-ratio: 16 / 9;
  border-radius: var(--radius-media);
}
[data-list='list'] .card__body { padding: 0; }

/* 썸네일을 끄면 카드가 텍스트만 남습니다 */
[data-list='list'] .card:not(:has(.thumb)) { padding-block: calc(var(--card-pad) * 0.7); }

/* --- 카테고리별 섹션 모드 -------------------------------------- */
.cat-section + .cat-section { margin-top: var(--section-gap); }
.cat-section__more {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.875rem; font-weight: 600; color: var(--text-muted);
  white-space: nowrap;
}
.cat-section__more:hover { color: var(--brand-accent); }
.cat-section__more svg { width: 13px; height: 13px; }

/* --- 비공개 안내 화면 -------------------------------------------
 * 블로그 설정에서 "블로그 공개" 를 끄면 공개면이 이 화면으로 대체됩니다.
 * (관리자 미리보기 iframe 에서는 표시되지 않습니다)
 * ----------------------------------------------------------- */
.private-notice {
  min-height: 100dvh;
  display: grid; place-content: center; justify-items: center;
  text-align: center; grid-gap: 6px; gap: 6px;
  padding: 40px 24px;
}
.private-notice__icon {
  width: 64px; height: 64px; margin-bottom: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}
.private-notice h1 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); margin: 0; }
.private-notice p {
  margin: 10px 0 24px; color: var(--text-muted);
  font-size: 0.9375rem; line-height: 1.8;
}
.private-notice em { font-style: normal; color: var(--text); font-weight: 600; }

/* --- 개발용 관리자 진입 버튼 (우측 하단 플로팅) ------------------
 * 공개면의 헤더·드로어·푸터에는 관리자 링크가 없습니다.
 * 이 버튼은 데모/개발 편의를 위한 것입니다.
 * ----------------------------------------------------------- */
.dev-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--text); color: var(--bg);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18), 0 12px 32px rgba(0, 0, 0, 0.16);
  font-size: 0.875rem; font-weight: 600;
  transition: transform var(--t), opacity var(--t-fast);
  opacity: 0.55;
}
.dev-fab:hover { opacity: 1; transform: translateY(-2px); }
.dev-fab svg { width: 18px; height: 18px; }
@media (max-width: 767px) {
  .dev-fab { right: 16px; bottom: 16px; padding: 12px; }
  .dev-fab__label { display: none; }
}

/* --- 더 보기 / 페이지네이션 ------------------------------------ */
.load-more { display: grid; place-items: center; padding-top: calc(36px * var(--density)); }

/* --- 푸터 ---------------------------------------------------- */
.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: calc(52px * var(--density)) 28px;
}
/* 일반형: [브랜드 소개 + 바로가기] [뉴스레터] — 카테고리는 포함하지 않습니다 */
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1.1fr;
  grid-gap: calc(var(--grid-gap) * 1.6);
  gap: calc(var(--grid-gap) * 1.6);
  padding-bottom: 36px;
}
.site-footer[data-no-newsletter='true'] .footer-grid { grid-template-columns: 1fr; }

/* 단순형: 브랜드명 ─── Powered by WriteRun */
.site-footer[data-style='simple'] { padding-block: 28px; }
.site-footer[data-style='simple'] .footer-bottom { border-top: 0; padding-top: 0; }
.footer-brand {
  font-family: var(--font-heading);
  font-weight: 800; letter-spacing: 0.06em;
  color: var(--brand-accent); font-size: 1rem;
}
.footer-admin { margin-left: 10px; text-decoration: underline; }
.footer-grid h4 {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px;
}
.footer-grid p { font-size: 0.875rem; color: var(--text-muted); margin: 10px 0 0; max-width: 34ch; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; grid-gap: 9px; gap: 9px; }
.footer-links a { font-size: 0.875rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--brand-accent); }

.subscribe { display: flex; gap: 8px; margin-top: 12px; }
.subscribe input {
  flex: 1 1; min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; font-size: 0.875rem; color: var(--text);
}
.subscribe input:focus { outline: 2px solid var(--brand-accent); outline-offset: 1px; border-color: transparent; }

.social { display: flex; gap: 8px; margin-top: 18px; }
.social a {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); transition: all var(--t-fast);
}
.social a:hover { color: var(--brand-accent); border-color: var(--brand-accent); }
.social svg { width: 17px; height: 17px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  font-size: 0.8125rem; color: var(--text-muted);
}
.footer-bottom a:hover { color: var(--brand-accent); }
.powered { display: inline-flex; align-items: center; gap: 6px; }
.powered strong { color: var(--text); font-weight: 700; }

/* =============================================================
 * 4-B. 콘텐츠 뷰 (post.html)
 * ============================================================= */
.article-head {
  padding: calc(48px * var(--density)) 0 calc(28px * var(--density));
  max-width: var(--reading-width);
  margin-inline: auto;
  text-align: center;
}
.article-head h1 {
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 2.75rem);
  margin: 16px 0;
  letter-spacing: -0.028em;
}
.article-head .meta { justify-content: center; }

.article-cover {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
  margin-bottom: calc(44px * var(--density));
}
.article-cover .thumb { border-radius: var(--radius-media); }   /* 비율은 전역 16:9 */

/* 본문 + 좌·우 sticky 레일 --------------------------------------
 * 데스크톱: [좌 레일] [본문(가독폭)] [우 레일]
 * ≤1023px: 레일이 본문 아래로 내려가 스택됩니다.
 * ----------------------------------------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--reading-width)) minmax(0, 1fr);
  grid-gap: 32px;
  gap: 32px;
  align-items: start;
}
.article-layout > .prose      { grid-column: 2; grid-row: 1; }
.article-layout > .rail-left  { grid-column: 1; grid-row: 1; justify-self: end; }
.article-layout > .rail-right { grid-column: 3; grid-row: 1; justify-self: start; }

.rail {
  position: -webkit-sticky;
  position: sticky; top: calc(var(--header-h) + 28px);
  width: 100%; max-width: 260px;
  display: grid; grid-gap: 16px; gap: 16px;
}
/* 공유 레일 · 진행률처럼 좁은 위젯만 있는 레일 */
.rail[data-narrow='true'] { max-width: 56px; justify-items: center; }
.rail-left[data-narrow='true'] { justify-self: end; }

/* --- 위젯 공통 카드 --- */
.widget-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: calc(var(--card-pad) * 0.8);
  font-size: 0.875rem;
}
.widget-card h4 {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 12px;
}
.widget-card > p { margin: 0 0 14px; color: var(--text-muted); line-height: 1.6; font-size: 0.8125rem; }
.widget-card .btn { width: 100%; }

/* 목차 위젯은 카드 껍데기 없이 */
.toc.widget-card { background: transparent; border: 0; padding: 0; }

/* 추천 콘텐츠 */
.widget-list { list-style: none; margin: 0; padding: 0; display: grid; grid-gap: 12px; gap: 12px; }
.widget-list a { display: flex; gap: 10px; align-items: center; }
.wl-thumb {
  width: 64px; aspect-ratio: 16 / 9; flex-shrink: 0;
  border-radius: var(--radius-media);
  background-size: cover;
}
.wl-text { min-width: 0; }
.wl-text strong {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 0.8125rem; font-weight: 600; line-height: 1.45;
}
.wl-text small { color: var(--text-muted); font-size: 0.75rem; }
.widget-list a:hover strong { color: var(--brand-accent); }

/* 인기 글 */
.widget-rank { list-style: none; margin: 0; padding: 0; display: grid; grid-gap: 11px; gap: 11px; counter-reset: r; }
.widget-rank a { display: flex; gap: 10px; align-items: baseline; font-size: 0.8125rem; line-height: 1.45; }
.widget-rank .num { font-family: var(--font-mono); font-weight: 700; color: var(--brand-accent); flex-shrink: 0; }
.widget-rank a:hover { color: var(--brand-accent); }

/* 작성자 */
.widget-author { text-align: center; }
.widget-author .avatar {
  width: 52px; height: 52px; margin: 0 auto 10px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-accent-soft); color: var(--brand-accent);
  font-weight: 700; font-size: 1.125rem;
}
.widget-author h4 {
  display: block; text-transform: none; letter-spacing: -0.01em;
  font-size: 0.9375rem; color: var(--text); margin-bottom: 6px;
}
.widget-author .btn { justify-content: center; }

/* 구독 · CTA */
.widget-subscribe form { display: grid; grid-gap: 8px; gap: 8px; }
.widget-subscribe input {
  width: 100%; padding: 9px 12px; font: inherit; font-size: 0.8125rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
}
.widget-subscribe input:focus { outline: 2px solid var(--brand-accent); outline-offset: 1px; border-color: transparent; }
.widget-cta { background: var(--brand-accent-soft); border-color: transparent; }
.widget-cta h4 { text-transform: none; letter-spacing: 0.04em; color: var(--brand-accent); }

/* 공유 레일 (세로) */
.share-rail {
  display: grid; grid-gap: 6px; gap: 6px; justify-items: center;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.share-rail__btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 50%;
  color: var(--text-muted); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.share-rail__btn:hover { background: var(--surface-2); color: var(--text); }
.share-rail__btn[aria-pressed='true'] { color: var(--brand-accent); }
.share-rail__btn[aria-pressed='true'] svg { fill: currentColor; }

/* 읽기 진행률 (세로 막대) */
.progress-rail { display: grid; grid-gap: 8px; gap: 8px; justify-items: center; }
.progress-rail__track {
  width: 4px; height: 140px; border-radius: 999px;
  background: var(--border); overflow: hidden;
  display: flex; align-items: flex-start;
}
.progress-rail__fill { width: 100%; height: 0; background: var(--brand-accent); transition: height 90ms linear; }
.progress-rail__label { font-size: 0.6875rem; color: var(--text-muted); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* 목차 */
.toc { max-width: 240px; font-size: 0.875rem; }
.toc h4 {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; grid-gap: 2px; gap: 2px; border-left: 2px solid var(--border); }
.toc a {
  display: block; padding: 6px 0 6px 14px; margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--text-muted); line-height: 1.45;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--brand-accent); border-left-color: var(--brand-accent); font-weight: 600; }
.toc li.lvl-3 a { padding-left: 26px; font-size: 0.8125rem; }

/* 모바일 접이식 TOC */
.toc-mobile { display: none; margin-bottom: 28px; }
.toc-mobile summary {
  cursor: pointer; list-style: none;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9375rem;
  display: flex; align-items: center; justify-content: space-between;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary svg { width: 16px; height: 16px; transition: transform var(--t); }
.toc-mobile[open] summary svg { transform: rotate(180deg); }
.toc-mobile[open] summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; border-bottom: 0; }
.toc-mobile .toc {
  max-width: none; padding: 8px 16px 16px;
  border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--surface);
}
.toc-mobile .toc h4 { display: none; }

/* --- 본문 타이포그래피 세트 (§6-B) ------------------------------
 * 세로 리듬 규칙 (음수 마진 금지)
 *   문단 ↔ 문단      : 1.5em
 *   제목 위 여백     : h2 2.2em · h3 1.8em  (앞 내용과 확실히 분리)
 *   제목 ↔ 첫 문단   : 0.85em               (제목과 본문을 한 덩어리로 묶음)
 * 이전에는 h2 에 margin-bottom:-0.4em 이 걸려 있어 제목↔본문 간격이
 * 문단↔문단 간격보다 좁아졌고, 소제목이 본문에 붙어 보였습니다.
 * ------------------------------------------------------------- */
.prose { max-width: var(--reading-width); }
.prose > * + * { margin-top: 1.5em; }
.prose p {
  margin: 0; font-size: 1.0625rem;
  line-height: var(--lh-prose);
  letter-spacing: var(--tracking-prose);
  color: var(--text); word-break: keep-all;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.2em; margin-bottom: 0;
  letter-spacing: var(--tracking-prose);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.prose h3 {
  font-size: 1.1875rem;
  margin-top: 1.8em; margin-bottom: 0;
  letter-spacing: var(--tracking-prose);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
/* 제목 바로 다음 요소는 제목에 가깝게 붙입니다 */
.prose h2 + *, .prose h3 + * { margin-top: 0.85em; }

.prose blockquote {
  margin: 2.2em 0; padding: 4px 0 4px 24px;
  border-left: 3px solid var(--brand-accent);
  font-family: var(--font-heading);
  font-size: 1.1875rem; line-height: 1.65; font-weight: 500;
  letter-spacing: var(--tracking-prose);
  color: var(--text); font-style: italic;
}
.prose blockquote cite {
  display: block; margin-top: 12px;
  font-size: 0.875rem; font-style: normal; font-weight: 500;
  color: var(--text-muted);
}

.prose ul, .prose ol { margin: 0; padding-left: 1.4em; display: grid; grid-gap: 0.7em; gap: 0.7em; }
.prose li {
  font-size: 1.0625rem;
  line-height: var(--lh-prose);
  letter-spacing: var(--tracking-prose);
  padding-left: 0.25em;
}
.prose li::marker { color: var(--brand-accent); font-weight: 600; }
.prose ul li::marker { font-size: 1.1em; }

.prose figure { margin: 2.6em 0; }
.prose figure .thumb { border-radius: var(--radius-media); }   /* 비율은 전역 16:9 */
.prose figcaption {
  margin-top: 12px; text-align: center;
  font-size: 0.8125rem; color: var(--text-muted); line-height: 1.6;
}

.prose hr {
  margin: 3.2em auto; width: 64px; height: 0;
  border: 0; border-top: 2px solid var(--border-strong);
}

.prose code {
  font-family: var(--font-mono); font-size: 0.875em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 0.15em 0.4em; border-radius: 5px;
}
.prose pre {
  background: var(--text); color: #e9e6e2;
  padding: 20px 22px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 0.875rem; line-height: 1.7;
}
.prose pre code { background: transparent; border: 0; padding: 0; color: inherit; }

.prose strong { font-weight: 700; color: var(--text); }
.prose mark { background: var(--brand-accent-soft); color: inherit; padding: 0.1em 0.25em; border-radius: 3px; }

.callout {
  padding: 18px 20px;
  background: var(--brand-accent-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand-accent);
}
.callout p { font-size: 0.9375rem !important; line-height: 1.7 !important; margin: 0 !important; }

/* --- 글 액션 -------------------------------------------------- */
.article-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: calc(48px * var(--density));
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.action-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
}
.action-btn svg { width: 16px; height: 16px; }
.action-btn:hover { border-color: var(--text-muted); }
.action-btn[aria-pressed='true'] {
  background: var(--brand-accent-soft);
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}
.action-btn[aria-pressed='true'] svg { fill: currentColor; }
.action-btn .count { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.article-actions .spacer { margin-left: auto; }

/* 공유 채널 묶음 — 관리자에서 채널을 추가/제거합니다 */
.share-set { display: flex; gap: 6px; flex-wrap: wrap; }
.action-btn--icon { padding: 9px; border-radius: 50%; }
.action-btn--icon svg { width: 17px; height: 17px; }

/* 본문 하단 구독 밴드 */
.subscribe-band {
  display: grid; grid-template-columns: 1fr auto; grid-gap: 20px; gap: 20px; align-items: center;
  margin-top: calc(36px * var(--density));
  padding: calc(var(--card-pad) * 1.1);
  background: var(--brand-accent-soft);
  border-radius: var(--radius);
}
.subscribe-band h3 { font-size: 1.0625rem; margin-bottom: 5px; }
.subscribe-band p { margin: 0; font-size: 0.875rem; color: var(--text-muted); }
.subscribe-band .subscribe { margin-top: 0; min-width: 300px; }

/* --- 이전/다음 ------------------------------------------------ */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; grid-gap: 16px; gap: 16px;
  margin-top: calc(40px * var(--density));
}
.post-nav a {
  padding: 20px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.post-nav a:hover { border-color: var(--brand-accent); transform: translateY(-2px); }
.post-nav .dir {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.post-nav svg { width: 13px; height: 13px; }
.post-nav h4 { font-size: 0.9375rem; line-height: 1.5; }
.post-nav .next { text-align: right; }
.post-nav .next .dir { justify-content: flex-end; }
.post-nav a[aria-disabled='true'] { opacity: 0.35; pointer-events: none; }

/* =============================================================
 * 5. 관리자
 * ============================================================= */
body.admin {
  --sidebar-w: 248px;
  background: var(--surface-2);
}

.admin-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

/* --- 사이드 내비 ---------------------------------------------- */
.admin-side {
  position: -webkit-sticky;
  position: sticky; top: 0; height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  z-index: 60;
}
.admin-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.admin-brand .mark {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-accent); color: var(--brand-accent-ink);
  font-weight: 800; font-size: 0.9375rem; letter-spacing: 0.02em;
}
.admin-brand .name { font-weight: 700; font-size: 0.9375rem; line-height: 1.2; }
.admin-brand .sub { font-size: 0.75rem; color: var(--text-muted); }
.admin-brand .txt { min-width: 0; overflow: hidden; }
.admin-brand .txt > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.admin-nav { display: grid; grid-gap: 2px; gap: 2px; }
.admin-nav .group-label {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 16px 10px 7px;
}
.admin-nav button {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 11px;
  border: 0; background: transparent; border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 500; text-align: left;
  cursor: pointer; color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.admin-nav button svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav button:hover { background: var(--surface-2); color: var(--text); }
.admin-nav button[aria-current='true'] {
  background: var(--brand-accent-soft); color: var(--brand-accent); font-weight: 600;
}
.admin-nav button .label { white-space: nowrap; overflow: hidden; }

.admin-side__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.admin-side__foot .btn { width: 100%; }

/* --- 상단바 -------------------------------------------------- */
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-top {
  position: -webkit-sticky;
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding-inline: 26px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.admin-top h1 { font-size: 1.125rem; }
.admin-top .crumb { font-size: 0.8125rem; color: var(--text-muted); }
.admin-top .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.drawer-toggle { display: none; }

.admin-body { padding: 28px 26px 64px; flex: 1 1; min-width: 0; }
.panel { display: none; min-width: 0; animation: panel-in 220ms ease both; }
.panel[data-active='true'] { display: block; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }

.panel-head { margin-bottom: 24px; }
.panel-head h2 { font-size: 1.375rem; margin-bottom: 6px; }
.panel-head p { color: var(--text-muted); font-size: 0.9375rem; margin: 0; }

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.admin-card + .admin-card { margin-top: 20px; }
.admin-card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.admin-card__head h3 { font-size: 1.0625rem; }
.admin-card__head p { margin: 4px 0 0; font-size: 0.8125rem; color: var(--text-muted); }

/* --- 대시보드 ------------------------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-gap: 16px; gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat .label { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 10px; }
.stat .value { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.stat .delta {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px; font-size: 0.8125rem; font-weight: 600;
}
.stat .delta[data-trend='up']   { color: var(--success); }
.stat .delta[data-trend='down'] { color: var(--danger); }
.stat .delta .hint { color: var(--text-muted); font-weight: 400; }

.spark { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 8px; }
.spark .bar {
  flex: 1 1; border-radius: 5px 5px 2px 2px;
  background: var(--brand-accent-soft);
  position: relative; min-height: 6px;
  transition: background var(--t-fast);
}
.spark .bar:last-child { background: var(--brand-accent); }
.spark .bar:hover { background: var(--brand-accent); }
.spark .bar span {
  position: absolute; inset: auto 0 -22px 0; text-align: center;
  font-size: 0.6875rem; color: var(--text-muted);
}

.activity { list-style: none; margin: 0; padding: 0; display: grid; grid-gap: 2px; gap: 2px; }
.activity li { display: flex; gap: 13px; align-items: flex-start; padding: 12px 8px; border-radius: var(--radius-sm); }
.activity li:hover { background: var(--surface-2); }
.activity .ico {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--brand-accent-soft); color: var(--brand-accent);
}
.activity .ico svg { width: 15px; height: 15px; }
.activity .txt { font-size: 0.875rem; line-height: 1.55; }
.activity .time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; grid-gap: 20px; gap: 20px; align-items: start; }
.dash-grid > .admin-card + .admin-card { margin-top: 0; }

/* --- 툴바 (필터·검색) ----------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button {
  padding: 7px 14px; border: 0; background: transparent;
  border-radius: 6px; font-size: 0.8125rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.field-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 13px; min-width: 220px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface);
}
.field-search:focus-within { border-color: var(--brand-accent); }
.field-search svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.field-search input { border: 0; outline: none; background: transparent; font: inherit; font-size: 0.875rem; width: 100%; color: var(--text); }
.toolbar .grow { margin-left: auto; }

/* --- 테이블 -------------------------------------------------- */
/* min-width:0 이 없으면 표(min-width:720px)가 래퍼를 밀어내 페이지에 가로 스크롤이 생깁니다. */
.table-wrap {
  overflow-x: auto; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
table.data { width: 100%; border-collapse: collapse; min-width: 720px; }
table.data th, table.data td { padding: 13px 16px; text-align: left; }
table.data thead th {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid var(--border); transition: background var(--t-fast); }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .t-title { font-weight: 600; font-size: 0.9375rem; }
table.data .t-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
table.data .num { text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; font-size: 0.875rem; }
table.data .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
table.data td:last-child { text-align: right; }

/* --- 토글 스위치 ---------------------------------------------- */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 42px; height: 24px; flex-shrink: 0;
  background: var(--border-strong); border-radius: var(--radius-pill);
  position: relative; transition: background var(--t);
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--t);
}
.switch input:checked + .track { background: var(--brand-accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.switch .txt { font-size: 0.875rem; }

/* --- 정렬 리스트 (카테고리 · 메뉴) ------------------------------ */
.sortable { display: grid; grid-gap: 8px; gap: 8px; }
.sort-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.sort-item:hover { border-color: var(--border-strong); }
.sort-item[data-dragging='true'] { opacity: 0.4; }
.sort-item[data-over='true'] { border-color: var(--brand-accent); box-shadow: 0 0 0 3px var(--brand-accent-soft); }
.sort-item .handle {
  cursor: -webkit-grab;
  cursor: grab; color: var(--text-muted); display: grid; place-items: center;
  padding: 4px; border-radius: 5px; flex-shrink: 0; touch-action: none;
}
.sort-item .handle:active { cursor: -webkit-grabbing; cursor: grabbing; }
.sort-item .handle:hover { background: var(--surface-2); color: var(--text); }
.sort-item .handle svg { width: 16px; height: 16px; }
.sort-item .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sort-item .name { font-weight: 600; font-size: 0.9375rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-item .name-input {
  font: inherit; font-weight: 600; font-size: 0.9375rem;
  border: 1px solid var(--brand-accent); border-radius: 6px;
  padding: 4px 8px; background: var(--bg); color: var(--text); outline: none; min-width: 0;
}
.sort-item .slug { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }
.sort-item .tail { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sort-item .arrows { display: flex; flex-direction: column; gap: 1px; }
.sort-item .arrows button { padding: 1px 4px; line-height: 1; border-radius: 4px; border: 0; background: transparent; cursor: pointer; color: var(--text-muted); }
.sort-item .arrows button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.sort-item .arrows button:disabled { opacity: 0.25; cursor: default; }
.sort-item .arrows svg { width: 12px; height: 12px; display: block; }
.sort-item[data-hidden='true'] .name, .sort-item[data-hidden='true'] .slug { opacity: 0.45; }

.inline-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.inline-form input, .inline-form select {
  flex: 1 1; min-width: 140px;
  padding: 10px 13px; font: inherit; font-size: 0.875rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
}
.inline-form input:focus, .inline-form select:focus { outline: 2px solid var(--brand-accent); outline-offset: 1px; border-color: transparent; }

/* --- 폼 ------------------------------------------------------ */
/* display 를 지정하는 규칙들이 hidden 속성을 덮어쓰지 않도록 합니다.
   (.field / .field-row / .form-grid 는 display:grid 이므로 필수) */
[hidden] { display: none !important; }

.form-grid { display: grid; grid-gap: 18px; gap: 18px; }
.field { display: grid; grid-gap: 7px; gap: 7px; }
.field label { font-size: 0.8125rem; font-weight: 600; }
.field .desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }
.field input[type='text'], .field input[type='email'], .field select, .field textarea {
  padding: 10px 13px; font: inherit; font-size: 0.875rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); width: 100%;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--brand-accent); outline-offset: 1px; border-color: transparent;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 16px; gap: 16px; }

.addon { display: flex; }
.addon input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.addon .suffix {
  display: grid; place-items: center; padding-inline: 13px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8125rem; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap;
}

/* --- 디자인 수정 패널 ------------------------------------------ */
/* 좌: 편집 컨트롤 / 우: 실시간 미리보기 */
.design-layout { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); grid-gap: 20px; gap: 20px; align-items: start; }
.design-controls { min-width: 0; }
.editor-group { display: block; }
.editor-group > .admin-card:first-child { margin-top: 0; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform var(--t-fast);
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed='true'] { border-color: var(--text); }

.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type='color'] {
  width: 44px; height: 40px; padding: 2px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); flex-shrink: 0;
}
.color-row .hex {
  font-family: var(--font-mono); font-size: 0.8125rem;
  padding: 10px 12px; text-transform: uppercase; width: 110px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
}

.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type='range'] { flex: 1 1; accent-color: var(--brand-accent); min-width: 0; }
.range-row output {
  font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text);
  min-width: 48px; text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; font-weight: 600;
}

/* 5단계 눈금 — 슬라이더 폭에서 output(48px)과 gap(14px)을 뺀 영역에 맞춥니다. */
.range-ticks {
  display: flex; justify-content: space-between;
  margin-right: 62px; padding-inline: 2px; margin-top: -2px;
  font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border: 1px solid var(--border-strong);
  background: var(--surface); border-radius: var(--radius-pill);
  font-size: 0.8125rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--text-muted); }
.chip[aria-pressed='true'] {
  background: var(--brand-accent); border-color: var(--brand-accent); color: var(--brand-accent-ink);
}

/* --- 실시간 미리보기 ------------------------------------------- */
.preview-wrap { position: -webkit-sticky; position: sticky; top: 88px; }
.preview-frame {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow);
}
.preview-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.preview-bar .dots { display: flex; gap: 6px; }
.preview-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.preview-bar .url {
  flex: 1 1; text-align: center; font-size: 0.75rem; color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 4px 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preview-bar .sizes { display: flex; gap: 2px; }
.preview-bar .sizes button {
  padding: 5px; border: 0; background: transparent; border-radius: 5px;
  color: var(--text-muted); cursor: pointer; display: grid; place-items: center;
}
.preview-bar .sizes button:hover { background: var(--surface); color: var(--text); }
.preview-bar .sizes button[aria-pressed='true'] { background: var(--surface); color: var(--brand-accent); box-shadow: var(--shadow-sm); }
.preview-bar .sizes svg { width: 15px; height: 15px; }

/* -------------------------------------------------------------
 * 실시간 미리보기 — 실제 페이지를 iframe 으로 렌더
 * PC 는 뷰포트를 1920×1080 으로 잡고(=100% 배율로 레이아웃 계산),
 * transform: scale() 로 "보이는 크기"만 패널에 맞게 줄입니다.
 * ----------------------------------------------------------- */
.preview-meta {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-muted);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.preview-meta__sep { opacity: .5; }
.preview-meta__note { color: var(--text-muted); opacity: .8; }
.preview-meta__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* 항상 "화면에 맞춤" — 세로 스크롤만 생깁니다.
   높이는 사용자의 창 높이를 따라갑니다.
   (상단바 64px + 패널 여백 + 프레임 크롬(바 + 메타) ≈ 210px) */
.preview-viewport {
  height: calc(100dvh - 210px);
  min-height: 360px;
  overflow-y: auto; overflow-x: hidden;
  background: var(--surface-2);
  padding: 12px;
  display: flex; justify-content: center; align-items: flex-start;
}

/* 스케일된 iframe 이 차지하는 자리를 잡아 스크롤 범위를 맞춥니다 */
.preview-stage { position: relative; flex: 0 0 auto; }

.preview-iframe {
  display: block; border: 0;
  transform-origin: top left;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31,29,27,.06), 0 8px 28px rgba(31,29,27,.10);
}

/* 미리보기 페이지 전환 세그먼트 */
.preview-bar .preview-pages { flex-shrink: 0; }
.preview-bar .preview-pages button { padding: 5px 12px; font-size: 0.75rem; white-space: nowrap; }

/* 모바일 접이식 미리보기 (≤767px에서만 노출) */
.preview-sheet-toggle { display: none; }

/* --- 에디터 자리 ---------------------------------------------- */
.editor-placeholder {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 56px 24px; text-align: center; color: var(--text-muted);
  background: var(--surface);
}
.editor-placeholder svg { width: 34px; height: 34px; margin: 0 auto 14px; color: var(--border-strong); }
.editor-placeholder strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 1.0625rem; }
.editor-placeholder p { margin: 0; font-size: 0.875rem; }

/* --- 모달 (확인 다이얼로그) ------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(31, 29, 27, 0.42);
  display: grid; place-items: center; padding: 20px;
  animation: fade-in 140ms ease both;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 24px;
  width: min(420px, 100%);
  animation: modal-in 200ms cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } }
.modal h3 { font-size: 1.0625rem; margin-bottom: 8px; }
.modal p { color: var(--text-muted); font-size: 0.875rem; margin: 0 0 22px; line-height: 1.6; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* =============================================================
 * 6. 반응형
 * ============================================================= */

/* ---------- Tablet: 768–1023px ---------- */
@media (max-width: 1023px) {
  .container { padding-inline: 20px; }

  /* 공개면 — 2열 그리드, 축약 내비 (열 수 설정과 무관하게 자동 축소) */
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .featured-grid,
  .featured-grid[data-style='triple'] { grid-template-columns: 1fr; }
  .featured-grid[data-style='triple'] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured-grid__side { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .search-inline input { width: 96px; }
  .nav a { padding: 8px 10px; font-size: 0.875rem; }

  /* 콘텐츠 뷰 — TOC를 상단 접이식으로 */
  /* 레일은 본문 아래로 내려가 스택 (DOM 순서: prose → left → right) */
  .article-layout { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 28px; }
  .article-layout > .prose,
  .article-layout > .rail-left,
  .article-layout > .rail-right { grid-column: 1; grid-row: auto; justify-self: stretch; }

  .rail {
    position: static; max-width: var(--reading-width);
    margin-inline: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rail > * { grid-column: span 1; }
  /* 좁은 레일(공유·진행률)은 스택 시 가로로 눕힙니다 */
  .rail[data-narrow='true'] { max-width: var(--reading-width); justify-items: stretch; }
  .rail[data-narrow='true'] .share-rail {
    grid-auto-flow: column; justify-content: center;
    border-radius: var(--radius);
  }
  .progress-rail { display: none; }         /* 진행률 막대는 데스크톱 전용 */
  .toc.widget-card { display: none; }       /* 목차는 상단 접이식으로 대체 */

  .toc-mobile { display: block; width: 100%; max-width: var(--reading-width); }
  .toc-mobile .toc { display: block; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }

  /* 관리자 — 사이드바 아이콘화 */
  body.admin { --sidebar-w: 68px; }
  .admin-side { padding-inline: 10px; align-items: center; }
  .admin-side__foot { width: 100%; }
  .admin-brand { justify-content: center; padding-inline: 0; }
  .admin-brand .txt { display: none; }
  .admin-nav { width: 100%; }
  .admin-nav button { justify-content: center; padding-inline: 0; }
  .admin-nav button .label { display: none; }
  .admin-nav .group-label { text-align: center; font-size: 0.5625rem; padding-inline: 0; letter-spacing: 0.04em; }
  .admin-side__foot .btn .label { display: none; }
  .admin-side__foot .btn { padding-inline: 0; }

  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-grid > .admin-card + .admin-card { margin-top: 20px; }
  .design-layout { grid-template-columns: minmax(0, 1fr); }
  .preview-wrap { position: static; }
  .preview-viewport { height: calc(100dvh - 260px); min-height: 320px; }
  .preview-meta__note { display: none; }
}

/* ---------- Mobile: ≤767px ---------- */
@media (max-width: 767px) {
  /* 모바일에서는 로고를 36px 로 상한을 두고, 헤더 높이는 거기에 맞춥니다.
     (applyTheme 은 --logo-h 만 인라인으로 넣으므로 --header-h 는 여기서 재정의됩니다) */
  :root { --header-h: max(60px, calc(min(var(--logo-h), 36px) + 20px)); }
  .container { padding-inline: 16px; }

  /* 헤더 — 햄버거. CTA 는 유지하고 검색·관리자 링크만 숨깁니다. */
  .nav, .search-inline, .header-admin { display: none; }
  .logo-img { height: min(var(--logo-h), 36px); max-width: 150px; }
  .hamburger { display: inline-flex; }
  .header-actions { gap: 4px; }

  /* 1열 스택 */
  .post-grid,
  .featured-grid,
  .featured-grid[data-style='triple'],
  .featured-grid__side { grid-template-columns: minmax(0, 1fr); }

  /* 리스트형도 모바일에선 세로 스택 */
  [data-list='list'] .card { flex-direction: column; align-items: stretch; gap: 12px; }
  [data-list='list'] .card .thumb { width: 100%; }

  /* 카테고리 필터 — 줄바꿈 대신 가로 스크롤 */
  .cat-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -16px;
    padding-inline: 16px;
    scrollbar-width: none;
  }
  .cat-filter-bar::-webkit-scrollbar { display: none; }

  .hero { padding-top: calc(32px * var(--density)); }
  /* 히어로 single 은 모바일에서 세로 스택 (비율은 전역 16:9 그대로) */
  .card-feature[data-variant='single'] { grid-template-columns: minmax(0, 1fr); gap: 16px; }

  /* 콘텐츠 뷰 */
  .article-head { padding-top: calc(28px * var(--density)); text-align: left; }
  .article-head .meta { justify-content: flex-start; }
  .article-cover { padding-inline: 16px; }
  .prose p, .prose li { font-size: 1rem; }
  .prose blockquote { font-size: 1.0625rem; padding-left: 18px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .post-nav .next .dir { justify-content: flex-start; }
  .article-actions .spacer { margin-left: 0; width: 100%; height: 0; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  /* 레일 위젯 1열 */
  .rail { grid-template-columns: minmax(0, 1fr); }
  /* 구독 밴드 세로 스택 */
  .subscribe-band { grid-template-columns: 1fr; }
  .subscribe-band .subscribe { min-width: 0; }
  /* GNB — CTA 는 모바일에서도 유지, 관리자 링크만 숨김 */
  .header-cta { display: inline-flex; }
  [data-gnb='floating'] .site-header__inner {
    border-radius: var(--radius); padding-inline: 14px;
  }

  .toast-region { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: 0; max-width: none; }

  /* ---- 관리자: 사이드바 → 드로어 ---- */
  body.admin { --sidebar-w: 0px; }
  .admin-shell { grid-template-columns: minmax(0, 1fr); }

  .admin-side {
    position: fixed; inset: 0 auto 0 0;
    width: 264px; height: 100dvh;
    transform: translateX(-100%);
    transition: transform var(--t);
    padding: 20px 14px; align-items: stretch;
    box-shadow: var(--shadow-lg); z-index: 120;
  }
  .admin-side[data-open='true'] { transform: none; }
  .admin-brand { justify-content: flex-start; padding-inline: 8px; }
  .admin-brand .txt { display: block; }
  .admin-nav button { justify-content: flex-start; padding-inline: 11px; }
  .admin-nav button .label { display: inline; }
  .admin-nav .group-label { text-align: left; font-size: 0.6875rem; padding-inline: 10px; letter-spacing: 0.09em; }
  .admin-side__foot .btn .label { display: inline; }
  .admin-side__foot .btn { padding-inline: 18px; }

  .admin-scrim {
    position: fixed; inset: 0; z-index: 110;
    background: rgba(31, 29, 27, 0.4);
    animation: fade-in 140ms ease both;
  }
  .admin-scrim[hidden] { display: none; }

  .drawer-toggle { display: inline-flex; }
  .admin-top { padding-inline: 16px; gap: 10px; }
  .admin-top h1 { font-size: 1rem; }
  .admin-top .crumb { display: none; }
  .admin-top .actions .btn .label { display: none; }
  .admin-top .actions .btn { padding: 9px; }
  .admin-body { padding: 20px 16px 80px; }

  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat .value { font-size: 1.5rem; }
  .admin-card { padding: 18px 16px; }
  .field-row { grid-template-columns: 1fr; }
  .toolbar .grow { margin-left: 0; width: 100%; }
  .field-search { min-width: 0; width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1 1; }

  /* 디자인 미리보기 → 하단 접이식 시트 */
  .design-layout { grid-template-columns: minmax(0, 1fr); }
  .preview-wrap {
    position: fixed; inset: auto 0 0 0; z-index: 100;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 32px rgba(31, 29, 27, 0.14);
    border-radius: var(--radius) var(--radius) 0 0;
    transform: translateY(calc(100% - 52px));
    transition: transform var(--t);
    max-height: 84dvh;
  }
  .preview-wrap[data-open='true'] { transform: none; }
  .preview-sheet-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; height: 52px; padding-inline: 18px;
    border: 0; background: transparent; cursor: pointer;
    font-size: 0.875rem; font-weight: 700;
  }
  .preview-sheet-toggle svg { width: 16px; height: 16px; transition: transform var(--t); color: var(--text-muted); }
  .preview-wrap[data-open='true'] .preview-sheet-toggle svg { transform: rotate(180deg); }
  .preview-frame { border: 0; border-radius: 0; box-shadow: none; }
  .preview-viewport { height: min(420px, 52dvh); min-height: 0; padding: 8px; }
  .preview-bar .url { display: none; }
  .preview-meta { flex-wrap: wrap; }
  .preview-meta__actions { margin-left: 0; width: 100%; }
  /* 시트가 가리지 않도록 여백 확보 */
  #panel-design { padding-bottom: 56px; }
}

/* 작은 모바일 */
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
  .preview-bar .sizes { display: none; }
}

/* 인쇄 */
@media print {
  .site-header, .site-footer, .article-actions, .post-nav, .toc, .toc-mobile,
  .toast-region { display: none !important; }
  body { background: #fff; }
}

/* ── 히어로 배경 이미지 / 폭 (디자인 원본에 없던 추가 옵션) ── */
.hero--cover { background-size: cover; background-position: center; }
.hero--cover .hero__intro h1,
.hero--cover .hero__intro p { color: #fff; }
.hero[data-width='full'] { padding-inline: 0; }
.hero[data-width='full'] > div { max-width: none; padding-inline: clamp(16px, 5vw, 64px); }

