/* =====================================================================
   Design System 1.0 - Global Styles
   ---------------------------------------------------------------------
   リセット・基本タイポグラフィ・共通レイアウト・タイポクラス。
   個別の見た目調整は基本ここではなく variables.css を編集してください。
   ===================================================================== */

/* --- Reset ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-weight: var(--font-weight-regular);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
}

ul {
  padding-left: var(--space-5);
}

/* --- Typography クラス --------------------------------------------
   使えるのは H1/H2/H3/Body/Caption の5種類のみ。
   ------------------------------------------------------------------- */
.h1,
h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-h1);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-dark);
}

.h2,
h2 {
  font-size: var(--font-size-h2);
  line-height: var(--line-height-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-dark);
}

.h3,
h3 {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-h3);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.body {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-weight: var(--font-weight-regular);
}

.caption {
  font-size: var(--font-size-caption);
  line-height: var(--line-height-caption);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.02em;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-secondary);
}

.text-error {
  color: var(--color-error);
}

/* --- 共通レイアウト（モバイルファースト） --------------------------
   全ページ共通の「画面」構造。
   .app-shell  = 画面全体（中央寄せ・最大幅制限）
   .app-main   = スクロール領域
   ------------------------------------------------------------------- */
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--layout-max-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  background-color: var(--color-background);
  position: relative;
}

.app-main {
  flex: 1;
  padding: var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* 固定フッターがあるページで、コンテンツがフッターに隠れないための余白 */
.app-main--with-footer {
  padding-bottom: var(--space-7);
}

/* --- ユーティリティ（最小限） -------------------------------------- */
.stack-2 { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-3 { display: flex; flex-direction: column; gap: var(--space-3); }
.stack-4 { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-5 { display: flex; flex-direction: column; gap: var(--space-5); }

.text-center { text-align: center; }

/* Material Symbols アイコンをテキストと縦位置を揃える */
.material-symbols-outlined {
  vertical-align: middle;
  user-select: none;
}

.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: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- タブレット以上でも読みやすく（レスポンシブ） ------------------ */
@media (min-width: 600px) {
  .app-shell {
    box-shadow: var(--shadow-card);
  }
}
