/*
  TSURI ONE ベース

  クラスの付いていない素の要素 (html / body / 見出し / リンク / 表 / フォーカス) の既定。
  tokens.css の次、components.css の前に読み込む。
  個別 CSS に要素セレクタを書くとページを問わず全体に効いてしまうため、要素への指定はこのファイルに集約する
  (個別 CSS ではクラスにスコープする)。部品の見た目は components.css の .th-* が持つ。
*/

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

/* hidden 属性は必ず効かせる。ブラウザ既定の [hidden] { display: none } は作者スタイルより弱いので、
   .th-segment / .th-btn / .th-badge のように display を持つ部品に付けると隠れなくなる */
[hidden] {
  display: none !important;
}

html {
  font-size: 100%;   /* 100% = 16px */
}

/* padding-top は fixed-top の nav ぶん、flex はフッターを下端まで押し下げるため */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--th-nav-height);
  font-family: var(--th-font-body);
  font-size: var(--th-font-size-base);
  line-height: var(--th-line-height);
  color: var(--th-color-text);
  background-color: var(--th-color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- 見出し --- */
/* 素の見出しの既定。ページ見出し・節見出しは .th-page-title / .th-h2 / .th-h3 を使う。
   大きさは Bootstrap の既定 (h1 41px / h2 32px の可変) ではなく、スタイルガイドの段階に合わせる。
   800 で使う書体なので、同じ px でも Bootstrap の 500 より大きく見える。
   h4〜h6 は「小さい見出しがほしい」ときに選ばれているので、段階は潰さず 1 段ずつ下げる。
   クラスで大きさを決めている箇所 (Bootstrap の .h4 / .h5 や各 CSS の見出しクラス) は、
   クラスのほうが要素セレクタより優先されるのでここの値に影響されない */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--th-font-heading);
  font-weight: 800;
  line-height: 1.4;
  color: var(--th-color-heading);
}

h1 { font-size: var(--th-font-size-2xl); }    /* 32px (.th-page-title は 34px) */

h2 { font-size: var(--th-font-size-lg); }     /* 20px (.th-h2 は 18px + 下罫線) */

h3 { font-size: 18px; }

h4 { font-size: var(--th-font-size-base); }   /* 16px */

h5 { font-size: 15px; }                       /* .modal-title など。.th-modal 適用後は 16px */

h6 { font-size: var(--th-font-size-sm); }     /* 14px */

/* --- リンク --- */
a {
  color: var(--th-color-link);
}

/* --- 表 --- */
/* 旧 rod/list.css の table / th / td をここへ集約したもの。
   一覧の表は .th-table に置き換えていくので、これはまだ置き換えていない表 (単位換算・糸巻量・メーカー等) の下敷き */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--th-color-surface);
  font-size: var(--th-font-size-sm);
}

th,
td {
  padding: 8px 14px;
  border-bottom: var(--th-border-inner);
  text-align: center;
  vertical-align: middle;
}

thead th {
  font-weight: 700;
  color: #fff;
  background-color: var(--th-brand-800);
}

/* --- フォーカス --- */
/* 旧 style.css の * { outline: none } を廃止。キーボード操作のときだけ輪郭を出す */
:focus-visible {
  outline: 2px solid var(--th-color-focus);
  outline-offset: 2px;
}
