/* qrmate.net のページの配色。名前と値は docs/design.md の画面の配色（src/theme/colors.ts）と同じにし、使い分けもアプリに合わせる（テストで確かめる）。
   background は地、surface はカード、divider は区切り線と画像の縁、outline は押せる部品の縁、textPrimary は見出しと本文、textSecondary は添え書き、accent はボタンとリンク。
   配色は端末の設定に合わせ、設定が取れないときは、アプリと同じく暗い配色にする */
:root {
  color-scheme: dark light;
  --background: #0B0D1A;
  --surface: #192036;
  --divider: #33384A;
  --outline: #676E86;
  --textPrimary: #F2F3F5;
  --textSecondary: #C6C9CE;
  --accent: #1896DF;
}

@media (prefers-color-scheme: light) {
  :root {
    --background: #F4F6FA;
    --surface: #FFFFFF;
    --divider: #D9DEE8;
    --outline: #858B9C;
    --textPrimary: #0B0D1A;
    --textSecondary: #5B6275;
    --accent: #1273B8;
  }
}

/* 文字の大きさは rem（17px を 1）で書く。iOS のブラウザでは、端末の文字の大きさの設定に合わせる（-apple-system-body。標準の大きさで 17px）。
   Mac の Safari も -apple-system-body を読むが Mac の本文の大きさ（17px より小さい）になるので、iOS にだけある -webkit-touch-callout で絞る
   （docs/design.md の「文字の長さと大きさ」） */
html {
  font-size: 17px;
}

@supports (-webkit-touch-callout: none) {
  html {
    font: -apple-system-body;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--textPrimary);
  font-family: -apple-system, system-ui, sans-serif;
  /* 1 行に入らない長い語（ロシア語の見出しなど）は、画面の外に出さず語の途中で折る（アプリと同じ） */
  overflow-wrap: anywhere;
}

main {
  box-sizing: border-box;
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 見出しは、アプリの見出しと同じく、標準の大きさの 1.5 倍（src/theme/font-scale.ts の HEADING_MAX_FONT_SCALE）で止める（テストで確かめる） */
h1 {
  margin: 0;
  font-size: min(1.647rem, 42px);
}

p {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  font-size: 1rem;
  line-height: 1.353;
}

/* ボタンの下に添える一文。地を付けず、アプリの添え書きと同じく控えめな文字にする */
p.note {
  padding: 0 16px;
  background: none;
  color: var(--textSecondary);
  font-size: 0.882rem;
  line-height: 1.333;
}

p:empty {
  display: none;
}

#actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* アプリのボタンと同じ形（src/components/button.tsx）。地のあるボタンの文字は background の色にする */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  color: var(--background);
}

.button:active {
  opacity: 0.5;
}

/* 上の帯（トップページ・プライバシーポリシー・テスターの募集のページ）。アイコンと名前を左に、言語を切り替えるメニュー（language.js）を右に置く */
.site-header {
  box-sizing: border-box;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 1.176rem;
  font-weight: 700;
}

.site-header img {
  border-radius: 10px;
}

/* トップページ以外では、アイコンと名前をトップページへのリンクにする */
.site-header .home {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

/* プライバシーポリシーのページでは、帯も本文（main）と同じ幅にそろえる */
body:not(.landing) .site-header {
  max-width: 480px;
  padding: 20px 16px 0;
}

/* 言語を切り替えるメニュー。アプリの選ぶ欄と同じく、カードの地に押せる部品の縁を付ける */
.language-menu {
  margin-left: auto;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--outline);
  border-radius: 12px;
  background: var(--surface);
  color: var(--textPrimary);
  font: inherit;
  /* iOS は 16px より小さい入力欄を押すとページを拡大するので、端末の文字を小さくしていても 16px を下回らせない */
  font-size: max(1rem, 16px);
  font-weight: 400;
}

/* プライバシーポリシーのページ（privacy.html）。節ごとに地を付け、中の段落には地を付けない */
.policy section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
}

/* 帯の下から始めるので、上の余白を詰める */
.policy {
  padding-top: 8px;
}

.policy h2 {
  margin: 0;
  font-size: min(1.176rem, 30px);
  line-height: 1.25;
}

.policy section p {
  padding: 0;
  background: none;
}
