/* ============================================================
   Foundation: Base
   リセットとベーススタイル
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-body-fluid);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: var(--line-height-relaxed);
  -webkit-font-smoothing: antialiased;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

/* 上の全称リセット margin:0 が dialog の UA 既定 margin:auto を潰し、
   modal が中央ではなく左上へ張り付く。dialog だけ auto へ戻す。 */
dialog {
  margin: auto;
}

/* UA 既定の [hidden]{display:none} は詳細度 0,1,0 で、
   component/project 層の class が持つ display:flex / inline-flex に負ける。
   その結果 hidden を立てた要素がそのまま見えていた（凡例の「失敗 0件」、
   本文が空の注釈が ⓘ だけ残る等）。hidden は常に隠すという前提を復活させる。 */
[hidden] {
  display: none !important;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* フォーカスリング（a11y） */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
