/**
 * reset.css — モダンCSSリセット
 *
 * ブラウザ・機種ごとの既定スタイル差（マージン・フォント・フォーム等）を
 * ならし、テーマCSS(style.css)を当てる前の共通の土台をつくる。
 * ※本ファイルはテーマCSSより「先」に読み込むこと（inc/enqueue.php で依存指定）。
 *
 * 方針:
 *   ブラウザ差の大きい既定装飾（button / フォーム / フォーカスリング等）は
 *   ここで確実に消し、見た目はテーマ側（_common.scss / _form.scss）で与える。
 *   見出しの文字サイズなど「差が小さく実害のない既定値」は残す。
 *
 * 目次:
 *   1. ボックスモデル・余白
 *   2. ルート要素・本文
 *   3. テキスト
 *   4. メディア
 *   5. リスト・テーブル・区切り線
 *   6. フォーム・ボタン
 *   7. フォーカス表示
 *   8. アクセシビリティ
 */

/* =========================================================
   1. ボックスモデル・余白
   ========================================================= */

/* box-sizing を全要素で統一 */
*,
*::before,
*::after {
	box-sizing: border-box;
}

/* 既定マージンを除去 */
* {
	margin: 0;
}

/* =========================================================
   2. ルート要素・本文
   ========================================================= */

html {
	-webkit-text-size-adjust: 100%; /* iOS 横向き時の文字サイズ自動拡大を無効化 */
	text-size-adjust: 100%;
	-moz-tab-size: 4;
	tab-size: 4;
}

body {
	min-height: 100vh;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* =========================================================
   3. テキスト
   ========================================================= */

/* 見出し・本文の折り返しを最適化 */
h1, h2, h3, h4, h5, h6 {
	line-height: 1.2;
	text-wrap: balance;
}
p, li, figcaption {
	text-wrap: pretty;
}

/* 長い単語による横スクロールを抑制 */
h1, h2, h3, h4, h5, h6, p {
	overflow-wrap: break-word;
}

/* リンクの既定装飾を素に戻す（テーマ側で再指定） */
a {
	color: inherit;
	text-decoration: none;
}

/* 上付き・下付き文字が行の高さを押し広げるのを防ぐ */
sub, sup {
	font-size: 75%;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}
sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* 等幅フォントのサイズがブラウザ既定で縮む問題を回避 */
code, kbd, samp, pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1em;
}

/* Firefox で太字が b/strong に付かない差を吸収 */
b, strong {
	font-weight: bolder;
}

/* 各社バラバラな下線の引き方を統一 */
abbr[title] {
	text-decoration: underline dotted;
}

/* =========================================================
   4. メディア
   ========================================================= */

/* メディア要素をブロック化し、はみ出しを防止 */
img, picture, video, canvas, svg {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ※ svg には fill を指定しない。
   本テーマのアイコンは fill="none" stroke="currentColor" をHTML属性で指定しており、
   プレゼンテーション属性はCSSより弱いため、ここで fill を書くと線画が塗り潰される。 */

/* iframe（地図埋め込み等）の既定枠線を除去 */
iframe {
	border: 0;
}

/* =========================================================
   5. リスト・テーブル・区切り線
   ========================================================= */

/* リストの既定マーカー・余白を除去（本文中の ul/ol はテーマ側で復元する） */
ul, ol {
	list-style: none;
	padding: 0;
}

/* 定義リストの既定インデントを除去 */
dd {
	margin-left: 0;
}

/* テーブルの罫線・文字揃えをまとめる（th の中央寄せ・太字差を解消） */
table {
	border-collapse: collapse;
	border-spacing: 0;
	text-indent: 0;
}
th {
	text-align: left;
	font-weight: inherit;
}

/* 区切り線の見た目を統一（Firefox の color 継承・高さの差を解消） */
hr {
	height: 0;
	color: inherit;
	border: 0;
	border-top: 1px solid currentColor;
	opacity: 0.2;
}

/* =========================================================
   6. フォーム・ボタン
   ブラウザ差が最も大きい領域。既定装飾を消し、
   見た目はテーマ側（_form.scss）で与える。
   ========================================================= */

/* フォント・色を継承させる（Safari/Firefox は既定でシステムフォントを使う） */
input, button, textarea, select, optgroup {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

/* 入力欄・選択欄の既定装飾（角丸・影・矢印）を除去 */
input, textarea, select {
	appearance: none;
	-webkit-appearance: none;
	background-color: transparent;
	border: 0;
	border-radius: 0;
	margin: 0;
}

/* iOS Safari の内側の影を除去 */
input, textarea {
	background-clip: padding-box;
}

/* テキストエリアは縦方向のみリサイズ可・下の余白を除去 */
textarea {
	display: block;
	resize: vertical;
}

/* ボタンを完全な無装飾に戻す（見た目は .okm-btn 等で与える） */
button,
[type="button"],
[type="submit"],
[type="reset"] {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	border-radius: 0;
	padding: 0;
	text-align: inherit;
	cursor: pointer;
}

/* 無効時のカーソルを統一 */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
	cursor: not-allowed;
}

/* Firefox の内側の点線フォーカス枠を除去 */
::-moz-focus-inner {
	border: 0;
	padding: 0;
}

/* Safari の検索欄・スピナーの独自UIを除去 */
[type="search"] {
	-webkit-appearance: textfield;
	outline-offset: -2px;
}
::-webkit-search-decoration,
::-webkit-search-cancel-button {
	-webkit-appearance: none;
}
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
	height: auto;
}

/* ファイル選択ボタンにフォントを継承させる */
::-webkit-file-upload-button {
	-webkit-appearance: button;
	font: inherit;
}

/* fieldset / legend の既定枠・食い込みを除去 */
fieldset {
	min-width: 0;
	padding: 0;
	border: 0;
}
legend {
	padding: 0;
}

/* プレースホルダの色差（Firefox は不透明度が下がる）を解消 */
::placeholder {
	color: currentColor;
	opacity: 0.5;
}

/* チェックボックス・ラジオは既定UIを残す（上の input 一括リセットを打ち消す）。
   自前描画は必要になった箇所で個別に行う。 */
[type="checkbox"],
[type="radio"] {
	appearance: auto;
	-webkit-appearance: auto;
	background-color: revert;
	border: revert;
	cursor: pointer;
}

/* =========================================================
   7. フォーカス表示
   キーボード操作時のみ、統一したフォーカスリングを出す。
   （マウスクリック時には出さず、見た目のノイズを避ける）
   ========================================================= */

:focus-visible {
	outline: 2px solid var(--okm-green-d, #05641e);
	outline-offset: 2px;
}

/* マウス操作時の既定アウトラインは抑制 */
:focus:not(:focus-visible) {
	outline: none;
}

/* =========================================================
   8. アクセシビリティ
   ========================================================= */

/* hidden 属性を確実に効かせる */
[hidden] {
	display: none !important;
}

/* アニメーション低減設定を尊重 */
@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;
	}
}
