/* ── Retro design system — matches main app retro.css ── */
:root {
  --rc-bg:           #f0efe8;
  --rc-surface:      #f8f7f2;
  --rc-border:       #c0bab2;
  --rc-border-dk:    #8a857c;
  --rc-text:         #1a1a16;
  --rc-muted:        #5a5a52;
  /* --rc-label darkened from #7a7a70 (3.4:1) → #6a6a5e (~4.6:1)
     so small captions still pass WCAG AA on --rc-bg.            */
  --rc-label:        #6a6a5e;
  --rc-hover:        #e8e3d8;
  --rc-accent-coral: #c85a3a;
  --rc-highlight-txt:#1a3d6b;

  --font-body: Georgia, 'Times New Roman', 'Noto Serif KR', serif;
  --font-ui:   system-ui, -apple-system, 'Pretendard Variable', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --text-primary:   #1a1a16;
  --text-secondary: #5a5a52;
  --accent: #8a857c;
}

html[lang="ko"] { font-size: 93%; word-break: keep-all; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-ui);
  background: var(--rc-bg);
  color: var(--rc-text);
  line-height: 1.65;
  scrollbar-gutter: stable;
}

/* ── Layout ── */
.content-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}
.content-wrapper--wide {
  max-width: 1100px;
  padding: 0 20px;
}

/* ── Reading progress bar ── */
.reading-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--rc-accent-coral);
  z-index: 9999;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ── TOC ── */
.article-toc {
  margin: 20px 0 24px;
  padding: 12px 14px;
  border-left: 2px solid var(--rc-border-dk);
  background: var(--rc-surface);
  border-top: 1px solid var(--rc-border);
  border-bottom: 1px solid var(--rc-border);
  border-right: 1px solid var(--rc-border);
}
.toc-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rc-label);
  margin-bottom: 8px;
}
.toc-list {
  list-style: decimal;
  padding-left: 18px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toc-link {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--rc-muted);
  text-decoration: none;
  transition: color 0.1s;
}
.toc-link:hover { color: var(--rc-text); }
.toc-link--active { color: var(--rc-text); font-weight: 600; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--rc-bg);
  border-bottom: 2px solid var(--rc-border-dk);
}
.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 44px;
  gap: 4px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 16px;
}
.logo-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: bold;
  color: var(--rc-text);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.header-tabs {
  display: flex;
  align-items: stretch;
  flex: 1;
  gap: 0;
}
.header-tab {
  padding: 0 2px;
  margin: 0 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  color: var(--rc-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  line-height: 42px;
  letter-spacing: 0.01em;
  transition: color 0.1s;
}
.header-tab:hover { color: var(--rc-text); }
.header-tab:focus-visible {
  outline: 2px solid var(--rc-accent-coral);
  outline-offset: 2px;
  border-radius: 1px;
}
.header-tab.active {
  color: var(--rc-text);
  font-weight: 700;
  border-bottom-color: var(--rc-text);
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}
.lang-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--rc-border);
  background: var(--rc-bg);
  color: var(--rc-text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 22px 4px 10px;
  cursor: pointer;
  border-radius: 0;
  outline: none;
  line-height: 1;
  height: 28px;
  transition: border-color 0.1s;
}
.lang-select:hover, .lang-select:focus-visible { border-color: var(--rc-border-dk); }
.lang-select:focus-visible {
  outline: 2px solid var(--rc-accent-coral);
  outline-offset: 1px;
}
@media (max-width: 640px) {
  .lang-select { height: 32px; font-size: 12px; padding: 4px 24px 4px 12px; }
}
.lang-select-chevron {
  position: absolute;
  right: 6px;
  pointer-events: none;
  color: var(--rc-muted);
}
.nav-cta {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--rc-border);
  background: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--rc-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  transition: border-color 0.1s;
}
.nav-cta svg { flex-shrink: 0; }
.nav-cta:hover { border-color: var(--rc-border-dk); }
.nav-cta:focus-visible {
  outline: 2px solid var(--rc-accent-coral);
  outline-offset: 2px;
}
.footer-link:focus-visible {
  outline: 2px solid var(--rc-accent-coral);
  outline-offset: 2px;
  border-radius: 1px;
}

/* Mobile */
@media (max-width: 640px) {
  .header-tabs { display: none; }
}

/* ── Footer ── */
.site-footer {
  background: var(--rc-bg);
  border-top: 2px solid var(--rc-border-dk);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 16px;
}
.footer-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px 32px;
  margin-bottom: 20px;
}
.footer-brand {}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.footer-brand-name {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: bold;
  color: var(--rc-text);
}
.footer-tagline {
  font-size: 11px;
  color: var(--rc-label);
  line-height: 1.6;
  margin-bottom: 8px;
}
.footer-col-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rc-label);
  margin-bottom: 8px;
  font-family: var(--font-ui);
}
.footer-col-list { list-style: none; }
.footer-link {
  display: block;
  padding: 2px 0;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--rc-muted);
  text-decoration: none;
  transition: color 0.1s;
}
.footer-link:hover { color: var(--rc-text); }
.footer-bottom {
  border-top: 1px solid var(--rc-border);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}
.footer-copy { font-size: 10px; color: var(--rc-label); }

/* ── Article ── */
article.content-page {
  padding: 32px 0 64px;
}
article.content-page h1 {
  font-family: var(--font-body);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--rc-text);
}
article.content-page .meta {
  font-size: 11px;
  color: var(--rc-label);
  font-family: var(--font-mono);
  margin-bottom: 24px;
  letter-spacing: 0.04em;
}
article.content-page h2 {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: bold;
  margin: 32px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--rc-border);
  color: var(--rc-text);
}
article.content-page > h2:first-of-type,
article.content-page .article-toc + h2,
article.content-page .chart-cta-box + h2 {
  border-top: none; padding-top: 0;
}
article.content-page h3 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  margin: 20px 0 6px;
  color: var(--rc-text);
}
article.content-page p {
  margin-bottom: 14px;
  font-size: 0.97rem;
  color: var(--rc-text);
  line-height: 1.75;
}
article.content-page ul, article.content-page ol {
  margin: 6px 0 14px 20px;
}
article.content-page li { margin-bottom: 5px; font-size: 0.95rem; }
article.content-page strong { font-weight: 700; }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--rc-label);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.breadcrumb a { color: var(--rc-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--rc-text); }
.breadcrumb span { color: var(--rc-border-dk); }

/* ── CTA Box (inline in article) ── */
.chart-cta-box {
  border-left: 3px solid var(--rc-border-dk);
  background: var(--rc-surface);
  border-top: 1px solid var(--rc-border);
  border-right: 1px solid var(--rc-border);
  border-bottom: 1px solid var(--rc-border);
  padding: 14px 16px;
  margin: 24px 0;
}
.chart-cta-box p { color: var(--rc-muted); font-size: 12px; margin-bottom: 10px; }
.chart-cta-box a {
  display: inline-block;
  background: var(--rc-text);
  color: var(--rc-surface);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  padding: 5px 14px;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.chart-cta-box a:hover { background: #333; }
.chart-cta-box h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--rc-text);
}

/* ── Post-footer CTA ── */
.post-chart-cta {
  border: 1px solid var(--rc-border-dk);
  background: var(--rc-hover);
  padding: 16px 20px;
  margin: 32px 0 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.post-chart-cta-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: bold;
  color: var(--rc-text);
  margin-bottom: 3px;
}
.post-chart-cta-desc {
  font-size: 11px;
  color: var(--rc-muted);
  margin: 0;
}
.post-chart-cta-btn {
  display: inline-block;
  background: var(--rc-text);
  color: var(--rc-surface);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  padding: 6px 14px;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.post-chart-cta-btn:hover { background: #333; }

/* ── PDF Teaser ── */
.pdf-teaser {
  border: 1px solid var(--rc-border);
  padding: 14px 16px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--rc-surface);
}
.pdf-teaser-text h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 3px;
}
.pdf-teaser-text p { font-size: 11px; color: var(--rc-muted); margin: 0; }
.pdf-teaser a {
  flex-shrink: 0;
  background: var(--rc-text);
  color: var(--rc-surface);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  padding: 6px 14px;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pdf-teaser a:hover { background: #333; }

/* ── FAQ ── */
.faq-section { margin-top: 32px; }
details { border-bottom: 1px solid var(--rc-border); padding: 10px 0; }
summary {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--rc-text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+';
  font-size: 1rem;
  font-weight: 400;
  color: var(--rc-border-dk);
  flex-shrink: 0;
}
details[open] summary::after { content: '−'; }
details p { padding: 10px 0 4px; font-size: 0.9rem; color: var(--rc-muted); }

/* ── Related Articles ── */
.related-articles {
  margin-top: 32px;
  border-top: 2px solid var(--rc-border-dk);
  padding-top: 12px;
}
.related-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rc-muted);
  margin-bottom: 8px;
}
.related-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.related-card {
  display: grid;
  grid-template-columns: 90px 1fr 60px;
  gap: 0 8px;
  align-items: baseline;
  padding: 6px 8px;
  border: 1px solid var(--rc-border);
  border-top: none;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}
.related-card:first-child { border-top: 1px solid var(--rc-border); }
.related-card:hover { background: var(--rc-hover); }
.related-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rc-label);
  white-space: nowrap;
}
.related-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--rc-text);
  line-height: 1.4;
}
.related-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rc-label);
  white-space: nowrap;
  text-align: right;
}
