/* ==========================================================================
   MANNAKA CRAFT — リセット & 基本スタイル
   配置: /wp-content/themes/{theme}/assets/css/base.css
   読み込み順: tokens.css → base.css → components.css → layout.css → style.css

   カラー・サイズ・余白は必ず tokens.css の変数を使う。直値を書かないこと。
   body のフォント指定は tokens.css の BASE ブロックが持っているため
   ここでは重複させない。
   ========================================================================== */

/* --------------------------------------------------------------------------
   BOX SIZING
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}


/* --------------------------------------------------------------------------
   MARGIN / PADDING 初期化
   余白はコンポーネント側で明示的に付ける
   -------------------------------------------------------------------------- */
body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
dl, dd,
ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}


/* --------------------------------------------------------------------------
   ROOT / BODY
   -------------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 固定ヘッダー分だけアンカー位置をずらす */
  scroll-padding-top: var(--header-h);
}

body {
  min-height: 100svh;
  text-rendering: optimizeSpeed;
  overflow-wrap: anywhere;
  word-break: normal;
  line-break: strict;
}

@media (max-width: 767px) {
  html { scroll-padding-top: var(--header-h-sp); }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* --------------------------------------------------------------------------
   見出し
   サイズはコンポーネント側で指定する。ここでは継承だけ整える
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: var(--fw-medium);
  line-height: var(--lh-150);
}


/* --------------------------------------------------------------------------
   リンク
   -------------------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}

a:hover {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   画像・メディア
   -------------------------------------------------------------------------- */
img,
picture,
video,
canvas,
svg,
iframe {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

svg {
  fill: currentColor;
}


/* --------------------------------------------------------------------------
   フォーム要素
   -------------------------------------------------------------------------- */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  margin: 0;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
          appearance: none;
}

textarea {
  resize: vertical;
}

input,
textarea,
select {
  width: 100%;
  padding: var(--sp-12) var(--sp-16);
  background: var(--c-bg);
  border: 1px solid var(--c-border-gray);
  border-radius: var(--radius);
  -webkit-appearance: none;
          appearance: none;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  -webkit-appearance: auto;
          appearance: auto;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--c-accent);
}

::placeholder {
  color: var(--c-text-weak);
  opacity: 1;
}


/* --------------------------------------------------------------------------
   テーブル
   -------------------------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: var(--fw-medium);
}


/* --------------------------------------------------------------------------
   その他
   -------------------------------------------------------------------------- */
hr {
  border: 0;
  border-top: 1px solid var(--c-border);
}

address {
  font-style: normal;
}

small {
  font-size: var(--fs-12);
}

[hidden] {
  display: none !important;
}


/* --------------------------------------------------------------------------
   アクセシビリティ用ユーティリティ
   -------------------------------------------------------------------------- */
.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
