/* ==========================================================================
   두 문호 프로젝트 — 공용 스타일
   따뜻한 종이 질감의 문학 아카이브 톤. 섹션마다 --accent 색만 바뀐다.
   ========================================================================== */

:root {
  --bg: #f6f1e6;
  --bg-soft: #efe7d6;
  --card-bg: #fffdf8;
  --ink: #2a2420;
  --ink-soft: #5c5248;
  --ink-faint: #8a7f70;
  --border: #ddd2bd;
  --accent: #7a5c3e;
  --accent-ink: #ffffff;
  --shadow: 0 10px 30px rgba(42, 36, 32, 0.08);
  --shadow-lg: 0 20px 50px rgba(42, 36, 32, 0.14);
  --radius: 14px;
  --serif: "Noto Serif KR", "KoPub Batang", "Batang", serif;
  --sans: "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;

  /* 확장 별칭 — 기존 변수와 동일한 값을 가리키는 의미 기반 이름.
     새 컴포넌트(검색, 비교 블록 등)는 아래 별칭을 사용해 톨스토이/도스토예프스키
     구역별 강조색을 일관되게 참조한다. */
  --paper: var(--bg);
  --paper-soft: var(--bg-soft);
  --muted: var(--ink-faint);
  --line: var(--border);
  --gold-accent: #b4894f;
  --tolstoy-accent: #45573f;
  --dostoevsky-accent: #6e2a2f;
  --nav-height: 64px;
}

body[data-theme="tolstoy"] {
  --accent: #45573f;
  --accent-2: #8a6d3b;
}
body[data-theme="dostoevsky"] {
  --accent: #6e2a2f;
  --accent-2: #8a6d3b;
}
body[data-theme="intro"] {
  --accent: #7a5c3e;
  --accent-2: #45573f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 앵커/해시 이동 시 고정 내비게이션에 제목이 가리지 않도록 여백 확보 */
.chapter-header,
.chapter-body p,
.chapter-body blockquote,
.chapter-body .meta-note,
h1, h2, h3,
[id] {
  scroll-margin-top: calc(var(--nav-height) + 18px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 상단 내비게이션 ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 241, 230, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.15em;
}
.nav-links { display: flex; gap: 22px; font-size: 0.92rem; }
.nav-links a { color: var(--ink-soft); border-bottom: 1px solid transparent; padding-bottom: 3px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.nav-links a[aria-current="page"] { font-weight: 700; }

.nav-tools { display: flex; align-items: center; gap: 6px; }
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-icon-btn:hover { background: var(--bg-soft); color: var(--accent); border-color: var(--border); }
.nav-icon-btn svg { width: 19px; height: 19px; }
.nav-search-btn { display: flex; align-items: center; gap: 8px; width: auto; padding: 0 14px 0 12px; border: 1px solid var(--border); border-radius: 999px; }
.nav-search-btn .kbd-hint {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-faint);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}
.nav-toggle { display: none; }

/* ---------- 읽기 진행률 표시줄 ---------- */
.reading-progress {
  position: sticky;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 49;
  pointer-events: none;
}
.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold-accent));
  transition: width 0.1s linear;
}
body:not([data-track-progress]) .reading-progress { display: none; }

/* ---------- 맨 위로 플로팅 버튼 ---------- */
.back-to-top-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--accent);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
}
.back-to-top-fab.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top-fab svg { width: 20px; height: 20px; }

/* 검색/앵커 이동 후 짧게 강조되는 대상 표시 */
.search-target-flash {
  animation: search-flash 2.2s ease-out;
  border-radius: 6px;
}
@keyframes search-flash {
  0% { background: color-mix(in srgb, var(--gold-accent) 35%, transparent); }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .search-target-flash { animation: none; background: color-mix(in srgb, var(--gold-accent) 30%, transparent); }
}

/* ---------- 히어로 ---------- */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.35;
  margin: 0 0 22px;
  font-weight: 700;
}
.hero p.lead {
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.9;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---------- 섹션 공통 ---------- */
.section { padding: 72px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0 0 14px; }
.section-head p { color: var(--ink-soft); }

/* ---------- 카드 그리드 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.card .card-num {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
}
.card .card-part {
  font-size: 0.76rem;
  color: var(--ink-faint);
}
.card h3 { margin: 2px 0 4px; font-size: 1.15rem; line-height: 1.5; }
.card p.excerpt {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.75;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .card-read {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}
.card .card-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
}

/* ---------- 숫자 통계 줄 ---------- */
.stat-row {
  display: flex;
  justify-content: center;
  gap: 56px;
  flex-wrap: wrap;
  padding: 48px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.stat { text-align: center; }
.stat .num { font-size: 2.2rem; font-weight: 700; color: var(--accent); font-family: "Helvetica Neue", Arial, sans-serif; }
.stat .label { font-size: 0.85rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------- 인용구 ---------- */
.pull-quote {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.3rem;
  line-height: 1.9;
  color: var(--ink);
  padding: 8px 0 0;
}
.pull-quote::before { content: "“"; }
.pull-quote::after { content: "”"; }

/* ---------- 푸터 ---------- */
.site-footer {
  padding: 48px 0 72px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.site-footer a { color: var(--accent); }
.back-to-top { display: inline-block; margin-top: 14px; }

/* ==========================================================================
   상세(장) 페이지
   ========================================================================== */
.chapter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.chapter-nav .crumbs { color: var(--ink-faint); }
.chapter-nav .crumbs a { color: var(--ink-soft); }
.chapter-nav .crumbs a:hover { color: var(--accent); }

.chapter-header { padding: 56px 0 28px; text-align: center; }
.chapter-header .book-label {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.chapter-header h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0; }

.chapter-figure { max-width: 760px; margin: 0 auto 40px; }
.chapter-figure img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.chapter-figure figcaption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 10px;
}

.chapter-body {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.08rem;
  line-height: 2.05;
}
.chapter-body p { margin: 0 0 1.6em; text-indent: 1em; }
.chapter-body p:first-of-type { text-indent: 0; }
.chapter-body blockquote {
  margin: 2em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}
.chapter-body .meta-note {
  max-width: 680px;
  margin: 0 auto 40px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.85;
}
.chapter-body .meta-note h4 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.chapter-body .meta-note ul { margin: 0; padding-left: 18px; }

.chapter-footnotes {
  max-width: 680px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--ink-faint);
  line-height: 1.8;
}
.chapter-footnotes a { color: var(--accent); word-break: break-all; }

.chapter-pager {
  max-width: 760px;
  margin: 64px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pager-btn {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--card-bg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.pager-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.pager-btn .dir { font-size: 0.75rem; color: var(--ink-faint); letter-spacing: 0.1em; text-transform: uppercase; font-family: "Helvetica Neue", Arial, sans-serif; }
.pager-btn .title { margin-top: 6px; font-weight: 600; }
.pager-btn.next { text-align: right; }
.pager-btn.disabled { opacity: 0.35; pointer-events: none; }

.toc-panel {
  max-width: 760px;
  margin: 0 auto 8px;
}
.toc-panel details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 4px 20px;
}
.toc-panel summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
}
.toc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 14px;
  padding: 4px 0 18px;
  font-size: 0.88rem;
}
.toc-list a { color: var(--ink-soft); }
.toc-list a.current { color: var(--accent); font-weight: 700; }
.toc-list a:hover { color: var(--accent); }

/* ==========================================================================
   두 저자 비교 블록 — 좌우 대비 컴포넌트 (본문 의미 훼손 없이 기존 문단을 감쌀 때만 사용)
   ========================================================================== */
.compare-block {
  max-width: 820px;
  margin: 40px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-side {
  background: var(--card-bg);
  padding: 26px 26px;
}
.compare-side .compare-label {
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 700;
}
.compare-side.side-tolstoy .compare-label { color: var(--tolstoy-accent); }
.compare-side.side-dostoevsky .compare-label { color: var(--dostoevsky-accent); }
.compare-side p { margin: 0; font-size: 0.98rem; line-height: 1.85; color: var(--ink-soft); }

/* ==========================================================================
   본문 검색
   ========================================================================== */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 24, 18, 0.5);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 9vh 16px 16px;
}
.search-overlay.open { display: flex; }
.search-modal {
  width: min(640px, 100%);
  max-height: 76vh;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.search-field svg { width: 19px; height: 19px; color: var(--ink-faint); flex-shrink: 0; }
.search-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
}
.search-field input::placeholder { color: var(--ink-faint); }
.search-close {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 7px;
  padding: 3px 9px;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-faint);
  cursor: pointer;
  flex-shrink: 0;
}
.search-close:hover { color: var(--accent); border-color: var(--accent); }
.search-status {
  padding: 8px 18px;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border);
}
.search-results { overflow-y: auto; padding: 8px; }
.search-empty { padding: 32px 18px; text-align: center; color: var(--ink-faint); font-size: 0.92rem; }
.search-result {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.search-result + .search-result { margin-top: 2px; }
.search-result:hover, .search-result.active { background: var(--bg-soft); }
.search-result .sr-path {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.search-result .sr-title { font-weight: 700; margin-bottom: 3px; }
.search-result .sr-snippet { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.6; }
.search-result mark { background: color-mix(in srgb, var(--gold-accent) 45%, transparent); color: inherit; border-radius: 2px; }
.search-loading { padding: 32px 18px; text-align: center; color: var(--ink-faint); font-size: 0.9rem; }

/* ---------- 반응형 ---------- */
@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
  }
  .nav-search-btn .kbd-hint { display: none; }
  .nav-search-btn { width: 40px; padding: 0; justify-content: center; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a { padding: 14px 24px; border-bottom: 1px solid var(--border); }
  .site-nav { position: sticky; }
}

@media (max-width: 640px) {
  .hero { padding: 64px 0 48px; }
  .chapter-pager { grid-template-columns: 1fr; }
  .pager-btn.next { text-align: left; }
  .compare-block { grid-template-columns: 1fr; }
  .back-to-top-fab { right: 14px; bottom: 14px; }
  .search-overlay { padding: 4vh 10px 10px; }
}

/* hub-return-navigation */
@media(min-width:821px){.nav-links{gap:14px;font-size:.86rem}}


/* ==========================================================================
   전자책처럼 넘기기 — 본문 장 페이지
   띠는 장식이 아니라 마우스가 들어왔을 때만 살짝 떠오르는 표시다.
   pointer-events:none 이라 아래에 있는 링크·버튼·본문 선택을 가로막지 않는다.
   ========================================================================== */
.page-turn-strip {
  position: fixed; left: 0; right: 0; bottom: 0; height: 60px;
  z-index: 30; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.18s ease;
  background: linear-gradient(to top, rgba(246, 241, 230, 0.96), rgba(246, 241, 230, 0));
}
.page-turn-strip.ready { opacity: 1; }
.page-turn-cue {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 15px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--accent);
  font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0.04em;
  box-shadow: var(--shadow);
  animation: page-turn-rise 0.9s ease-in-out infinite alternate;
}
.page-turn-cue svg { width: 15px; height: 15px; }
@keyframes page-turn-rise { from { transform: translateY(2px); } to { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .page-turn-cue { animation: none; } }

.reader-pref { max-width: 680px; margin: 26px auto 0; text-align: center; }
.reader-pref.standalone { margin: 8px auto 44px; padding: 0 24px; }
.page-turn-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px; border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--ink-faint);
  font-family: var(--sans); font-size: 0.76rem; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.page-turn-toggle:hover { color: var(--accent); border-color: var(--accent); }
.page-turn-switch {
  width: 26px; height: 14px; border-radius: 999px;
  background: var(--border); position: relative; transition: background 0.15s ease;
}
.page-turn-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--card-bg); transition: transform 0.15s ease;
}
.page-turn-toggle[aria-pressed="true"] .page-turn-switch { background: var(--accent); }
.page-turn-toggle[aria-pressed="true"] .page-turn-switch::after { transform: translateX(12px); }
.page-turn-note {
  margin: 10px 0 0; color: var(--ink-faint);
  font-family: var(--sans); font-size: 0.74rem; line-height: 1.7;
}
.page-turn-toggle[aria-pressed="false"] ~ .page-turn-note { opacity: 0.45; }

.page-turn-toast {
  position: fixed; left: 50%; bottom: 82px; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px); padding: 11px 17px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--card-bg); box-shadow: var(--shadow-lg);
  font-family: var(--sans); font-size: 0.82rem; color: var(--ink-soft);
  opacity: 1; transition: opacity 0.5s ease;
}
.page-turn-toast.fade { opacity: 0; }
.page-turn-toast button {
  border: 0; background: transparent; color: var(--accent);
  font-family: var(--sans); font-size: 0.82rem; font-weight: 700; cursor: pointer; padding: 0;
}
@media (max-width: 700px) { .page-turn-toast { font-size: 0.76rem; gap: 9px; bottom: 76px; } }

/* ==========================================================================
   nav-title-wrap-fix — 상단 내비게이션
   폭이 좁아질 때 「카라마조프가」가 「카라마조프」/「가」처럼 낱말 중간에서
   쪼개지던 문제를 없앤다. 제목은 통째로 유지하고, 자리가 모자라면
   링크 묶음이 통째로 아랫줄로 내려간다.
   ========================================================================== */
.brand small { display: none; }          /* 부제는 자리만 차지해 뺐다 — 되살리려면 이 줄만 지우면 된다 */
.brand { white-space: nowrap; line-height: 1.25; }
.nav-links a { white-space: nowrap; }    /* 제목은 어떤 폭에서도 한 줄 */

@media (min-width: 821px) {
  .site-nav .wrap {
    height: auto;
    min-height: 64px;
    padding-top: 9px;
    padding-bottom: 9px;
    gap: 18px;
    flex-wrap: nowrap;
  }
  .nav-links {
    flex-wrap: wrap;                     /* 모자라면 항목 단위로 줄바꿈 */
    justify-content: flex-end;
    row-gap: 4px;
    flex: 1 1 auto;
    min-width: 0;                        /* 줄바꿈이 일어나도록 최소폭 제한을 푼다 */
  }
  .brand, .nav-tools { flex: 0 0 auto; }
}

/* --nav-height 는 site.js 가 내비의 실제 높이를 재어 넣는다(두 줄이 되면 자동으로 커진다). */

