/* Static pages share the calculator's light surfaces and indigo palette.
   Source values: src/index.css; keep the React application unchanged. */
:root {
  color-scheme: light;
  --primary: #5440d6;
  --primary-hover: #4332b8;
  --primary-light: #f3f0ff;
  --nav-active-bg: #eef0ff;
  --nav-active-text: #3730a3;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --control-border: #cbd5e1;
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-panel: 16px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', 'Noto Sans KR', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
button, select { font: inherit; }
h1, h2, h3, h4, p, li, a, th, td { overflow-wrap: break-word; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.35; }
p, li { text-wrap: pretty; }
:lang(ko) :is(h1, h2, h3, h4, p, li, a, span, th, td, div) { word-break: keep-all; }
:lang(ja) { line-break: strict; }
:lang(ja) :is(h1, h2, h3, h4, .callout-title, .faq-q) { word-break: auto-phrase; text-wrap: wrap; }
:lang(de) :is(p, li) {
  hyphens: auto;
  -webkit-hyphenate-limit-before: 6;
  -webkit-hyphenate-limit-after: 6;
  hyphenate-limit-chars: 14 6 6;
}
:lang(de) h1 { hyphens: auto; hyphenate-limit-chars: 14 6 6; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
::selection { color: var(--nav-active-text); background: var(--nav-active-bg); }

/* Match the home's full-width header and its 1400px inner measure. */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(84, 64, 214, 0.05);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.45rem;
  color: var(--primary);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1;
}
.brand-icon { display: block; width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; margin: 0 auto 0 1.5rem; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 2px 0.8rem 0;
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active, .mobile-menu a[aria-current] {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
}
.header-actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.lang-select-wrapper { position: relative; display: inline-flex; align-items: center; }
.globe-icon { position: absolute; left: 0.55rem; pointer-events: none; color: var(--text-muted); }
#lang-select {
  appearance: none;
  height: 36px;
  padding: 0 1.5rem 0 1.85rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
#lang-select:hover { background: var(--bg-main); }
.lang-select-arrow { position: absolute; right: 0.45rem; width: 12px; height: 12px; pointer-events: none; color: var(--text-muted); }
.btn-calc, .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 40px;
  padding: var(--space-1) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--bg-card);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s ease;
}
.btn-calc:hover { background: var(--primary-hover); color: var(--bg-card); }
.header-actions > .btn-calc { min-height: 36px; padding: 0 0.85rem; font-size: 0.82rem; white-space: nowrap; }
.mobile-menu { display: none; }

.container { width: 100%; max-width: 1080px; padding: 0 var(--space-4); margin: var(--space-5) auto var(--space-6); flex: 1; }
.hero-card {
  padding: var(--space-6) var(--space-5);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-panel);
  background: var(--bg-card);
}
.hero-title, .article-section h1 { margin-bottom: var(--space-3); font-size: 2.25rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.25; }
.hero-desc { max-width: 75ch; color: var(--text-muted); font-size: 1.05rem; }
.section-card, .article-section, .contact-card, .toc-card {
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  min-width: 0;
}
:is(.section-card, .article-section, .contact-card) h2 {
  margin: var(--space-5) 0 var(--space-3);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
:is(.section-card, .article-section, .contact-card) > h2:first-child { margin-top: 0; }
:is(.section-card, .article-section) h3 { margin: var(--space-4) 0 var(--space-2); font-size: 1.125rem; }
:is(.section-card, .article-section, .contact-card) p { margin-bottom: var(--space-3); color: var(--text-body); }
:is(.section-card, .article-section, .contact-card) > p:last-child { margin-bottom: 0; }
:is(.section-card, .article-section) :is(ul, ol) { margin: var(--space-3) 0 var(--space-4); padding-left: var(--space-4); color: var(--text-body); }
:is(.section-card, .article-section) li { margin-bottom: var(--space-1); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-4) 0; }
/* Inner content uses open rows, leaving a single outer card. */
.feature-box, .info-box { min-width: 0; padding: var(--space-3) 0; border-top: 1px solid var(--border-color); }
.feature-header, .info-header, .callout-header { display: flex; align-items: center; gap: var(--space-1); margin-bottom: var(--space-2); }
.feature-header svg, .info-header svg, .callout-header svg { flex-shrink: 0; color: var(--primary); }
.feature-header h4, .info-header h4 { font-size: 1.05rem; }
.feature-box p, .info-box p { margin-bottom: 0; color: var(--text-muted); }
.detail-guide-link { display: block; color: var(--text-main); text-decoration: none; }
.detail-guide-link:hover strong { color: var(--primary); text-decoration: underline; }
.detail-guide-link strong { display: block; margin-bottom: var(--space-1); line-height: 1.5; text-wrap: balance; }
.lang-badge { display: inline-block; padding: 0 var(--space-1); border-radius: var(--radius-control); background: var(--nav-active-bg); color: var(--nav-active-text); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.callout, .note-box, .translation-notice { padding: var(--space-3) var(--space-4); margin: var(--space-4) 0; border-radius: var(--radius-control); background: var(--primary-light); color: var(--nav-active-text); }
.callout-title { font-weight: 700; }
.callout p, .note-box p { margin-bottom: var(--space-1); color: inherit; }
.callout p:last-child, .note-box p:last-child { margin-bottom: 0; }
.toc-title { font-weight: 700; margin-bottom: var(--space-3); }
.toc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1) var(--space-4); list-style: none; }
.toc-list a { display: block; padding: var(--space-1) 0; text-decoration: none; }
.toc-list a:hover { text-decoration: underline; }
.table-wrapper { width: 100%; overflow-x: auto; margin: var(--space-4) 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: top; }
th { background: var(--bg-main); font-weight: 700; }
td { color: var(--text-body); }
tr:last-child td { border-bottom: 0; }
.last-updated { display: inline-block; margin-bottom: var(--space-4); color: var(--text-muted); font-size: 0.85rem; }
.contact-email { display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%; margin: var(--space-3) 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 700; text-decoration: none; }
.contact-email svg { flex-shrink: 0; }
.contact-email:hover { background: var(--primary-light); text-decoration: underline; }
.contact-label, .contact-note { color: var(--text-muted); }
.contact-details { margin: var(--space-4) 0; }
.contact-note { margin-top: var(--space-2); font-size: 0.9rem; }

/* Keep the existing always-visible FAQ answers, with the home's row styling. */
.faq-item { padding: var(--space-4); border: 1px solid var(--border-color); background: var(--bg-card); }
.faq-item + .faq-item { border-top: 0; }
.hero-card + .faq-item { border-radius: var(--radius-card) var(--radius-card) 0 0; }
.faq-item:last-child { border-radius: 0 0 var(--radius-card) var(--radius-card); }
.faq-q { margin-bottom: var(--space-2); color: var(--text-main); font-size: 1rem; font-weight: 700; line-height: 1.5; text-wrap: pretty; }
.faq-a { color: var(--text-muted); }
.faq-a p { margin-bottom: var(--space-2); }
.faq-guide-link { font-size: 0.9rem; }
.q-tag { color: var(--primary); }
.btn-cta-lg { min-height: 48px; padding: var(--space-2) var(--space-5); font-size: 1rem; }

.footer { margin-top: auto; padding: var(--space-5) var(--space-4); border-top: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-muted); font-size: 0.85rem; }
.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.footer-links a { color: var(--text-muted); font-weight: 500; text-decoration: none; }
.footer-links a:hover, .footer-links a.active { color: var(--primary); text-decoration: underline; }

@media (max-width: 1100px) {
  .header-inner > .nav-links, .header-actions > .btn-calc { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu summary { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--control-border); border-radius: var(--radius-control); color: var(--text-body); cursor: pointer; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu[open] summary { background: var(--nav-active-bg); color: var(--nav-active-text); }
  .mobile-menu nav { position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100dvh - 65px); overflow-y: auto; padding: var(--space-3) var(--space-4) var(--space-4); border-bottom: 1px solid var(--border-color); background: var(--bg-card); box-shadow: 0 10px 20px -5px rgb(0 0 0 / 0.1); }
  .mobile-menu nav a { display: flex; padding: var(--space-2) var(--space-3); margin-bottom: var(--space-1); border-radius: var(--radius-control); text-decoration: none; font-weight: 600; }
  .mobile-menu nav a:hover { background: var(--bg-main); }
  .mobile-menu nav .btn-calc { background: var(--primary); color: var(--bg-card); }
}
@media (max-width: 768px) {
  .header-inner { padding: 0.75rem 1rem; gap: 0.5rem; }
  .brand { gap: 0.5rem; font-size: 1.05rem; }
  .brand-icon { width: 17px; height: 17px; }
  .header-actions { gap: 0.4rem; }
  #lang-select { height: 34px; padding: 0 1.15rem 0 1.45rem; font-size: 0.76rem; }
  .globe-icon { left: 0.45rem; width: 12px; height: 12px; }
  .lang-select-arrow { right: 0.4rem; }
  .mobile-menu summary { width: 34px; height: 34px; }
  .mobile-menu nav { padding: var(--space-3); max-height: calc(100dvh - 59px); }
  .container { padding: 0 var(--space-3); margin: var(--space-4) auto var(--space-5); }
  .hero-card { padding: var(--space-5) var(--space-4); }
  .hero-title, .article-section h1 { font-size: 1.75rem; }
  .hero-desc { font-size: 1rem; }
  .section-card, .article-section, .contact-card, .toc-card, .faq-item { padding: var(--space-4); }
  :is(.section-card, .article-section, .contact-card) h2 { font-size: 1.25rem; }
  .grid-2, .toc-list { grid-template-columns: minmax(0, 1fr); }
  .callout, .note-box { padding: var(--space-3); }
  .btn-cta-lg { width: 100%; padding: var(--space-2) var(--space-3); }
  th, td { padding: var(--space-2) var(--space-1); }
  .footer { padding: var(--space-5) var(--space-3); }
}
@media (max-width: 360px) {
  .hero-card, .section-card, .article-section, .contact-card, .toc-card, .faq-item { padding: var(--space-4) var(--space-3); }
  .hero-title, .article-section h1 { font-size: 1.5rem; }
  .contact-email { padding: var(--space-2) var(--space-1); font-size: 0.92rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
