/* ═══════════════════════════════════════════
   Base — Reset, Typography, Korean Fallback
   ═══════════════════════════════════════════ */

/* ── Minimal Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--line-height-base);
  color: var(--color-black);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif-display);
  line-height: var(--line-height-heading);
  font-weight: var(--font-weight-bold);
  word-break: keep-all;
}

h1 { font-size: var(--heading-xl); }
h2 { font-size: var(--heading-lg); }
h3 { font-size: var(--heading-md); }
h4 { font-size: var(--heading-sm); }
h5 { font-size: var(--heading-xs); }
h6 { font-size: var(--heading-xs); }

/* Korean serif fallback: Playfair Display has no Korean glyphs,
   so Korean text falls through to Noto Serif KR automatically
   via the font-family stack in tokens.css */

p {
  margin-bottom: var(--space-base);
  line-height: var(--line-height-base);
}

/* Article body text — serif for readability */
.entry-content,
.post-body {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  line-height: 1.8;
}

/* ── Links ── */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Lists ── */
ul, ol {
  padding-left: var(--space-md);
}

/* ── Selection ── */
::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Screen Reader Only ── */
.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;
}

/* ── Utility: Heading font classes ── */
.heading--xxl { font-size: var(--heading-xxl); font-family: var(--font-serif-display); line-height: var(--line-height-heading); }
.heading--xl  { font-size: var(--heading-xl);  font-family: var(--font-serif-display); line-height: var(--line-height-heading); }
.heading--lg  { font-size: var(--heading-lg);  font-family: var(--font-serif-display); line-height: var(--line-height-heading); }
.heading--md  { font-size: var(--heading-md);  font-family: var(--font-serif-display); line-height: var(--line-height-heading); }
.heading--sm  { font-size: var(--heading-sm);  font-family: var(--font-serif-display); line-height: var(--line-height-snug); }
.heading--xs  { font-size: var(--heading-xs);  font-family: var(--font-sans); font-weight: var(--font-weight-bold); text-transform: uppercase; letter-spacing: 0.05em; }

.text--sm { font-size: var(--text-sm); line-height: var(--line-height-tight); }
.text--md { font-size: var(--text-md); }

.has-font-serif { font-family: var(--font-serif); }
.has-font-sans  { font-family: var(--font-sans); }
