/* =====================================================================
   土台のスタイル（触らない）
   見た目・レイアウト・アニメーションはすべて css/theme.css に書く。
   ここには「どのデザインでも共通で必要な仕組み」だけを置いている。
   ===================================================================== */

/* ---------- リセット ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body,
h1,
h2,
p,
ul,
dl,
dd {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

/* ---------- 画面の切り替え（.is-active の画面だけ表示） ---------- */
.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

[hidden] {
  display: none !important;
}

/* ---------- 画像が未着のときのプレースホルダー ----------
   app.js が読み込み失敗時に .is-missing を付ける。置くべきファイル名を表示する */
.media {
  position: relative;
}

.media.is-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 16px;
  background: #d9d9d9;
  color: #555;
  font-size: 14px;
  text-align: center;
  word-break: break-all;
}

.media.is-missing img {
  display: none;
}

.media.is-missing::after {
  content: "画像未着: " attr(data-label);
}

/* ---------- アクセシビリティ ---------- */
:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 3px;
}

/* 「動きを減らす」設定の人にはアニメーションを実質オフにする */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
