/**
 * base.css
 * リセット、html/body、見出し等の基本スタイル。
 * 読み込み順: tokens → base → common → components → pages
 */

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

img, picture, svg {
    display: block;
    max-width: 100%;
}

ul, ol {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* fieldset はブラウザ標準で枠線と内部余白を持つため、明示的にリセットする。
   リセットしないと、legend（見出し）の直下に意図しない罫線が表示される。 */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
    min-width: 0;
}

legend {
    padding: 0;
    display: block;
    width: 100%;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

/* -----------------------------------------------------------------
 * ルート・基本設定
 * ----------------------------------------------------------------- */
html {
    /* ブラウザの文字サイズ設定に追随させるため px 固定にしない */
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-base);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    letter-spacing: var(--ls-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    /* フルブリード要素（100vw使用）が、スクロールバー幅を含む関係で
       ごくわずかに画面幅からはみ出すことがあるため、横スクロールの発生を防ぐ。
       意図しない要素の横溢れも同時に隠れる点に留意しつつ、フルブリード表現を
       安全に使うための標準的な対策として設定する。 */
    overflow-x: hidden;
}

/* -----------------------------------------------------------------
 * 見出し
 * ----------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-heading);
    /* 和文の禁則処理 */
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.fs-display {
    font-size: var(--fs-display);
    line-height: var(--lh-display);
}

.fs-h1 {
    font-size: var(--fs-h1);
    line-height: var(--lh-h1);
}

.fs-h2 {
    font-size: var(--fs-h2);
    line-height: var(--lh-h2);
}

.fs-h3 {
    font-size: var(--fs-h3);
    line-height: var(--lh-h3);
}

.fs-small {
    font-size: var(--fs-small);
    line-height: var(--lh-small);
}

.fs-caption {
    font-size: var(--fs-caption);
    line-height: var(--lh-caption);
}

/* 明朝体アクセント（メインビジュアルのキャッチコピー・セクション見出しの一部のみ） */
.font-accent {
    font-family: var(--font-accent);
}

/* -----------------------------------------------------------------
 * フォーカス表示（アクセシビリティ）
 * ----------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* -----------------------------------------------------------------
 * コンテナ
 * ----------------------------------------------------------------- */
.container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--gutter-sp);
}

.container--narrow {
    max-width: var(--container-narrow);
}

@media (min-width: 768px) {
    .container {
        padding-inline: var(--gutter-tb);
    }
}

@media (min-width: 1024px) {
    .container {
        padding-inline: var(--gutter-pc);
    }
}

/* -----------------------------------------------------------------
 * モーション低減設定
 * ----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
