/* ==========================================
   base.css
   - Reset（最小限）
   - Tokens 読み込み
   - html/body ベース
   - タイポグラフィの初期設定
========================================== */

/* Layer order declaration */
@layer reset, tokens, base, theme, layout, components, contents, page, utilities;

@import url("./foundation/reset.css") layer(reset);
@import url("./foundation/tokens.css") layer(tokens);
@import url("./foundation/theme.css") layer(theme);
@import url("./foundation/layout.css") layer(layout);

@layer base {
  html {
    -webkit-text-size-adjust: 100%;
  }
  html,
  body {
    font-family: var(--font-family-normal);
    color: var(--color-black);
    scroll-behavior: smooth;
  }

  :where(p) {
    font-size: var(--font-size-md);
    line-height: var(--line-height-md);
  }

  :where(hr) {
    margin-top: var(--space-30);
    border: 0;
    border-top: 1px solid var(--color-subtler);
  }
  @media (max-width: 767px) {
    :where(hr) {
      margin-top: var(--space-20);
    }
  }

  :where(ul, ol, dl) {
    font-size: var(--font-size-contents-list);
    line-height: var(--line-height-contents-list);
  }

  :where(h3) {
    font-weight: 700;
    font-size: var(--font-size-h3);
    line-height: var(--line-height-h3);
  }

  :where(a) {
    word-wrap: break-word;
  }

  :where(a):not([class]) {
    color: var(--color-category-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  :where(sup) {
    font-size: var(--font-size-09);
    vertical-align: super;
  }

  /* hover */
  @media (any-hover: hover) {
    :where(a):hover {
      text-decoration: none;
    }
  }

  :where(figure) {
    margin: 0;
  }

  :where(figure) > div {
    padding: var(--space-22) var(--space-38);
    background-color: var(--color-white);
    border-radius: var(--radius-8);
  }
  @media (max-width: 767px) {
    :where(figure) > div {
      padding: var(--space-08) var(--space-20);
    }
  }

  :where(figure) > div > img {
    margin-inline: auto;
  }

  :where(figcaption) {
    margin-top: var(--space-20);
  }
}
