/*
 * 基本：色、フォント、ブラウザのリセット。ほかの CSS ファイルはすべてここで決めた変数を使うので、
 * ここで色を変えるとサイト全体の色が変わる。
 *
 * CSS ファイルは inc/setup.php（rcs_css_files）に書いた順に読み込まれる。
 * @media で使う画面幅：400px、640px（タブレット）、768px、1024px（パソコン）。
 */

/*
 * 色とフォント。色は Catppuccin（https://catppuccin.com/）のライトテーマ「Latte」から取っている。
 * 変数の名前（navy、accent など）は以前の配色のときのまま。ロゴ画像の紺（#000064）は会社の色なので変えていない。
 */
:root {
  --color-navy-950: #4c4f69; /* Latte Text：見出し、ボタン、紺の帯、フッター */
  --color-navy-900: #4c4f69;
  --color-navy-800: #5c5f77; /* Subtext 1 */
  --color-navy-700: #6c6f85; /* Subtext 0 */
  --color-accent-600: #1e66f5; /* Blue */
  --color-accent-500: #7287fd; /* Lavender */
  --color-accent-300: #b4befe; /* Lavender を明るくした色（紺の帯の上の英字など） */
  --color-accent-50: #e8ebfb; /* Lavender のごく淡い色（ページ上部の背景など） */
  --color-sky-400: #04a5e5; /* Sky */
  --color-yellow: #df8e1d; /* Yellow。差し色。見出しの点、写真の影など、少しだけ使う */
  --color-yellow-soft: #f8e1b5; /* Yellow の淡い色。ボタンのホバー（紺の文字が読みやすいよう淡くしている） */
  --color-ink: #4c4f69; /* 本文の文字（Text） */
  --color-muted: #6c6f85; /* 補足の文字（Subtext 0） */
  --color-line: #ccd0da; /* 枠線（Surface 0） */
  --color-surface: #e6e9ef; /* 薄いグレーの背景（Mantle） */
  --color-white: #ffffff;
  --color-error: #d20f39; /* Red。入力の誤り、フォームの「必須」の札 */

  --font-sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --font-en: "Inter", "Noto Sans JP", sans-serif;
  --font-display: "Montserrat", "Inter", sans-serif; /* 大きな英字の見出し */

  --radius-small: 0.5rem; /* 小さい写真、入力欄 */
  --radius-large: 1rem; /* カード、写真、地図 */
  --radius-round: 9999px; /* ボタン、タグ */

  --header-height: 4.5rem; /* 640px 以上では 5rem（下を参照） */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 640px) {
  :root {
    --header-height: 5rem;
  }
}

/* ブラウザのリセット：ブラウザ独自の余白やリストの点を消す。:where() でこのルールを弱くしておく。 */
:where(*, ::before, ::after) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  /* ページ内リンクの移動先が固定ヘッダーに隠れないようにする */
  scroll-padding-top: 6rem;
}

:where(h1, h2, h3, h4, h5, h6) {
  font-size: inherit;
  font-weight: inherit;
}

:where(a) {
  color: inherit;
  text-decoration: inherit;
}

:where(b, strong) {
  font-weight: bolder;
}

:where(small) {
  font-size: 80%;
}

:where(table) {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

:where(ol, ul, menu) {
  list-style: none;
}

:where(img, svg, video, canvas, audio, iframe, embed, object) {
  display: block;
  vertical-align: middle;
}

:where(img, video) {
  max-width: 100%;
  height: auto;
}

:where(button, input, select, optgroup, textarea) {
  font: inherit;
  font-feature-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  border-radius: 0;
  background-color: transparent;
  opacity: 1;
}

:where(textarea) {
  resize: vertical;
}

:where([hidden]) {
  display: none !important;
}

/* ページ */
body {
  background: var(--color-white);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-feature-settings: "palt";
  line-height: 1.9;
  letter-spacing: 0.02em;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 日本語の見出しを文節で改行する（Chrome/Edge。ほかのブラウザはふつうの改行） */
h1,
h2,
h3 {
  word-break: auto-phrase;
}

::selection {
  background: var(--color-accent-300);
  color: var(--color-navy-950);
}

/* 短いページでもフッターを一番下に置く */
.site-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
}

/* 読み上げソフト専用の文字 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* "本文へスキップ"：Tab キーでたどり着くまで隠しておく */
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 60;
  border-radius: 0.25rem;
  background: var(--color-white);
  padding: 0.5rem 1rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
