/* =============================================================================
   base.css — 全域 reset 與元素排版
   -----------------------------------------------------------------------------
   從 components.css §0 拆出。只有元素／屬性／萬用選擇器；所有數值取自 tokens.css。
   僅供「沒有自帶 reset」的頁面載入（例如 index.php）。
   已使用 Tailwind Preflight 的頁面（例如 docs/plans/news.php）不要載入本檔，
   改只載 tokens.css + components.css，避免與 Preflight 疊加造成位移。
   載入順序：tokens.css → base.css → components.css。
   ============================================================================= */

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

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

body {
  margin: 0;
  background: var(--ds-color-page);
  /* text-primary 專供 Heading；預設內文一律用 text-secondary（Body） */
  color: var(--ds-color-text-secondary);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-body-md-size);
  line-height: var(--ds-text-body-md-line);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1 {
  font-size: var(--ds-text-display-hero-size);
  line-height: var(--ds-text-display-hero-line);
  font-weight: var(--ds-text-display-hero-weight);
  letter-spacing: var(--ds-tracking-hero);
  text-wrap: balance;
}

h2 {
  font-size: var(--ds-text-headline-lg-size);
  line-height: var(--ds-text-headline-lg-line);
  font-weight: var(--ds-text-headline-lg-weight);
  letter-spacing: var(--ds-tracking-headline);
  text-wrap: balance;
}

h3 {
  font-size: var(--ds-text-headline-md-size);
  line-height: var(--ds-text-headline-md-line);
  font-weight: var(--ds-text-headline-md-weight);
  letter-spacing: var(--ds-tracking-sub);
}

h4 {
  font-size: var(--ds-text-headline-sm-size);
  line-height: var(--ds-text-headline-sm-line);
  font-weight: var(--ds-text-headline-sm-weight);
}

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

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

address { font-style: normal; }

[hidden] { display: none !important; }

/* 表單控制項預設不繼承字體，統一拉回全站 stack */
button,
input,
select,
textarea { font-family: inherit; }

button {
  color: inherit;
  cursor: pointer;
}
