/**
 * Utilities CSS
 * ユーティリティクラス - 単一の機能を提供する小さなクラス群
 * 高橋運輸興業 Webサイトリニューアル
 *
 * このファイルは base.css で定義されたCSS変数を使用します。
 * 新しいCSS変数を追加する場合は base.css を編集してください。
 */

/* ===================================
   スペーシングユーティリティ
   =================================== */

/* マージン */
.m-0 { margin: 0; }

/* マージン - Bottom */
.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }   /* 8px */
.mb-sm { margin-bottom: var(--space-sm); }   /* 16px */
.mb-md { margin-bottom: var(--space-md); }   /* 24px */
.mb-lg { margin-bottom: var(--space-lg); }   /* 32px */
.mb-xl { margin-bottom: var(--space-xl); }   /* 40px */
.mb-2xl { margin-bottom: var(--space-2xl); } /* 64px */

/* マージン - Top */
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }   /* 8px */
.mt-sm { margin-top: var(--space-sm); }   /* 16px */
.mt-md { margin-top: var(--space-md); }   /* 24px */
.mt-lg { margin-top: var(--space-lg); }   /* 32px */
.mt-xl { margin-top: var(--space-xl); }   /* 40px */
.mt-2xl { margin-top: var(--space-2xl); } /* 64px */

/* マージン - Y軸（上下） */
.my-0 { margin-top: 0; margin-bottom: 0; }
.my-xs { margin-top: var(--space-xs); margin-bottom: var(--space-xs); }
.my-sm { margin-top: var(--space-sm); margin-bottom: var(--space-sm); }
.my-md { margin-top: var(--space-md); margin-bottom: var(--space-md); }
.my-lg { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }
.my-xl { margin-top: var(--space-xl); margin-bottom: var(--space-xl); }

/* マージン - X軸（左右） */
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-xs { margin-left: var(--space-xs); margin-right: var(--space-xs); }
.mx-sm { margin-left: var(--space-sm); margin-right: var(--space-sm); }
.mx-md { margin-left: var(--space-md); margin-right: var(--space-md); }

/* パディング */
.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* パディング - Y軸（上下） */
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

/* パディング - X軸（左右） */
.px-0 { padding-left: 0; padding-right: 0; }
.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }

/* パディング - Top/Bottom個別 */
.pb-xs { padding-bottom: var(--space-xs); }
.pb-sm { padding-bottom: var(--space-sm); }
.pb-md { padding-bottom: var(--space-md); }
.pb-lg { padding-bottom: var(--space-lg); }
.pb-xl { padding-bottom: var(--space-xl); }

.pt-xs { padding-top: var(--space-xs); }
.pt-sm { padding-top: var(--space-sm); }
.pt-md { padding-top: var(--space-md); }
.pt-lg { padding-top: var(--space-lg); }
.pt-xl { padding-top: var(--space-xl); }

/* ===================================
   テキストユーティリティ
   =================================== */

/* テキストカラー */
.text-primary { color: var(--primary-blue); }
.text-secondary { color: var(--secondary-blue); }
.text-muted { color: var(--text-secondary); }
.text-white { color: white; }
.text-inherit { color: inherit; }
.text-dark { color: #333333; }
.text-warning { color: #856404; }

/* テキストサイズ */
.text-xs { font-size: 0.75rem; }   /* 12px */
.text-sm { font-size: 0.875rem; }  /* 14px */
.text-base { font-size: 1rem; }    /* 16px */
.text-lg { font-size: 1.125rem; }  /* 18px */
.text-xl { font-size: 1.25rem; }   /* 20px */
.text-2xl { font-size: 1.5rem; }   /* 24px */
.text-3xl { font-size: 1.875rem; } /* 30px */

/* フォントウェイト */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* 行高 */
.leading-none { line-height: 1; }
.leading-tight { line-height: 1.2; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.6; }
.leading-loose { line-height: 1.8; }
.leading-2 { line-height: 2; }

/* テキスト配置 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-end { text-align: right; }
.text-justify { text-align: justify; }

/* テキスト装飾 */
.text-underline { text-decoration: underline; }
.text-line-through { text-decoration: line-through; }
.text-no-underline { text-decoration: none; }

/* ===================================
   レイアウトユーティリティ
   =================================== */

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.align-stretch { align-items: stretch; }
.align-baseline { align-items: baseline; }

/* Flexbox 複合 */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Flex utilities */
.flex-grow-1 {
  flex-grow: 1;
}

/* Gap */
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Align */
.align-center { align-items: center; }

/* ===================================
   グリッドシステム（Phase 3追加 - BEMスタイル）
   =================================== */

/* 基本グリッド */
.grid {
  display: grid;
  gap: 1rem; /* デフォルトgap */
}

/* カラム数指定 */
.grid--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* レスポンシブauto-fit */
.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Gapバリエーション */
.grid--gap-sm { gap: 0.5rem; }
.grid--gap-md { gap: 1rem; }
.grid--gap-lg { gap: 2rem; }

/* Width */
.w-100 { width: 100%; }
.w-auto { width: auto; }
.w-50 { width: 50%; }
.w-66 { width: 66%; }

/* Max Width */
.max-w-full { max-width: 100%; }
.max-w-sm { max-width: 600px; }
.max-w-md { max-width: 800px; }

/* Height */
.h-auto { height: auto; }
.h-full { height: 100%; }

/* ===================================
   背景・ボーダーユーティリティ
   =================================== */

/* 背景色 */
.bg-white { background-color: white; }
.bg-primary { background-color: var(--primary-blue); }
.bg-secondary { background-color: var(--secondary-blue); }
.bg-light-blue { background-color: var(--light-blue); }
.bg-gray { background-color: var(--bg-gray); }
.bg-transparent { background-color: transparent; }

/* ボーダー */
.border { border: 1px solid #e0e0e0; }
.border-top { border-top: 1px solid #e0e0e0; }
.border-bottom { border-bottom: 1px solid #e0e0e0; }
.border-left { border-left: 1px solid #e0e0e0; }
.border-right { border-right: 1px solid #e0e0e0; }
.border-0 { border: none; }

/* 角丸 */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: 2px; }
.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 10px; }
.rounded-full { border-radius: 9999px; }

/* .img-rounded は components.css の .img--rounded に統一 */

/* 影 */
.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ===================================
   その他のユーティリティ
   =================================== */

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }

/* Position */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* リスト（components.cssのリストシステムに統合） */

/* ===================================
   レスポンシブユーティリティ
   =================================== */

@media (max-width: 768px) {
  /* モバイル専用表示 */
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }

  /* モバイル用スペーシング調整 */
  .mb-md-sm { margin-bottom: var(--space-sm) !important; }
  .mb-md-md { margin-bottom: var(--space-md) !important; }
  .mb-md-lg { margin-bottom: var(--space-lg) !important; }
  .p-md-sm { padding: var(--space-sm) !important; }
  .p-md-md { padding: var(--space-md) !important; }

  /* モバイル用グリッド */
  .grid-md-1 {
    grid-template-columns: 1fr !important;
  }

  /* モバイル用テキストサイズ */
  .text-md-sm { font-size: 0.875rem !important; }
  .text-md-base { font-size: 1rem !important; }
}

/* PC専用 */
@media (min-width: 769px) {
  .d-pc-none { display: none !important; }
  .d-pc-block { display: block !important; }
}