/* ============================================================
   EWA Base — reset + 全域排版基礎
   放在 tokens.css 之後、components.css 之前載入。
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--ewa-white);
  color: var(--ewa-ink);
  font-family: var(--ewa-font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

section { scroll-margin-top: var(--ewa-nav-h); }

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

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

button { font-family: inherit; }

input:focus, textarea:focus { outline: none; }
textarea { resize: none; }
input::placeholder, textarea::placeholder { color: var(--ewa-ink-3); font-weight: 400; }

::selection { background: var(--ewa-gold); color: #fff; }

/* 通用細捲軸（沿用官網 journal-scroll 樣式） */
.ewa-scroll { scrollbar-width: thin; scrollbar-color: var(--ewa-gold) transparent; }
.ewa-scroll::-webkit-scrollbar { width: 4px; }
.ewa-scroll::-webkit-scrollbar-track { background: transparent; }
.ewa-scroll::-webkit-scrollbar-thumb { background: var(--ewa-gold-soft); border-radius: 2px; }
.ewa-scroll::-webkit-scrollbar-thumb:hover { background: var(--ewa-gold); }

/* 內容置中容器 */
.ewa-container {
  width: 100%;
  max-width: var(--ewa-maxw);
  margin-inline: auto;
  padding-inline: var(--ewa-gutter);
}

/* 常用動畫 */
@keyframes ewaFadeUp { from { opacity: 0; transform: translateY(38px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ewaFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 無障礙 a11y ---------- */
/* 跳至主內容（鍵盤/螢幕閱讀器） */
.ewa-skip { position: absolute; left: 12px; top: -60px; z-index: 999;
  background: var(--ewa-ink); color: #fff; padding: 10px 18px; border-radius: 4px;
  letter-spacing: .08em; transition: top .2s ease; }
.ewa-skip:focus { top: 12px; }

/* 鍵盤焦點可見（滑鼠點擊不顯示） */
:focus-visible { outline: 2px solid var(--ewa-gold); outline-offset: 3px; }

/* 螢幕閱讀器專用文字 */
.ewa-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 尊重使用者「減少動態」偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
