/*
 * BCOOL Base Theme - utilities.css
 * =========================================
 * 再利用可能な汎用クラス集。
 * 構造・レイアウトは main.css、案件個別のスタイルは custom/ に入れる。
 *
 * 命名規則：.bcool- プレフィックス（WordPressコアとの衝突防止）
 * =========================================
 */

/* =========================================
   表示切り替え
   ========================================= */
@media (min-width: 769px) {
  .show-on-mobile { display: none !important; }
}

@media (max-width: 768px) {
  .hide-on-mobile { display: none !important; }
}

/* =========================================
   見出しアクセント
   ========================================= */

/* h2・h3直下に短いアクセントライン */
.bcool-heading-line::after {
  content: '';
  display: block;
  width: 2rem;
  height: 3px;
  background-color: var(--wp--preset--color--accent);
  margin-top: 0.5rem;
}

/* =========================================
   セクションタイトル
   ========================================= */

/* h2に下線アクセント（中央寄せ向け） */
.bcool-section-title {
  text-align: center;
}

.bcool-section-title::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 3px;
  background-color: var(--wp--preset--color--accent);
  margin: 0.5rem auto 0;
}

/* =========================================
   カードグリッド
   ========================================= */

/* 3列カードグリッド */
.bcool-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 3vw, 1.5rem);
}

@media (max-width: 768px) {
  .bcool-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .bcool-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================
   ボタン
   ========================================= */

/* ゴーストボタン（透明背景・枠線） */
.bcool-btn-ghost {
  display: inline-block;
  padding: 0.65em 1.75em;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: transparent;
  color: var(--wp--preset--color--primary);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.bcool-btn-ghost:hover {
  background-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--contrast);
}

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

.bcool-text-center { text-align: center; }
.bcool-text-left   { text-align: left; }
.bcool-text-right  { text-align: right; }

.bcool-text-sm     { font-size: var(--wp--preset--font-size--sm); }
.bcool-text-xs     { font-size: var(--wp--preset--font-size--xs); }

.bcool-text-muted  { color: var(--wp--preset--color--text-light); }
.bcool-text-accent { color: var(--wp--preset--color--accent); }

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

.bcool-mt-0 { margin-top: 0 !important; }
.bcool-mb-0 { margin-bottom: 0 !important; }

/* =========================================
   区切り線
   ========================================= */

.bcool-divider {
  border: none;
  border-top: 1px solid var(--wp--preset--color--base-3);
  margin: 2rem 0;
}

/* =========================================
   見出しブロックスタイル（register_block_style）
   is-style-* クラスはエディタから選択して適用する。
   同じスタイル名を h2〜h5 に使うと、レベルに応じて
   自動的に視覚的な重み差をつける。
   ========================================= */

/* ------------------------------------------
   左バー（is-style-bcool-h-bar）
   h2: primary 4px / h3: accent 3px / h4,h5: base-3 2px
   ------------------------------------------ */
.wp-block-heading.is-style-bcool-h-bar {
  padding-left: 0.75em;
  border-left: 4px solid var(--wp--preset--color--primary);
}
h3.wp-block-heading.is-style-bcool-h-bar {
  border-left-width: 3px;
  border-left-color: var(--wp--preset--color--accent);
}
h4.wp-block-heading.is-style-bcool-h-bar,
h5.wp-block-heading.is-style-bcool-h-bar {
  border-left-width: 2px;
  border-left-color: var(--wp--preset--color--base-3);
}

/* ------------------------------------------
   下線（is-style-bcool-h-line）
   h2: グレー全幅 + アクセント短線 / h3: アクセント1px / h4,h5: ダッシュ
   ------------------------------------------ */
.wp-block-heading.is-style-bcool-h-line {
  padding-bottom: 0.45em;
  border-bottom: 1px solid var(--wp--preset--color--base-3);
  position: relative;
}
h2.wp-block-heading.is-style-bcool-h-line {
  border-bottom-width: 2px;
}
h2.wp-block-heading.is-style-bcool-h-line::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 3rem;
  height: 2px;
  background-color: var(--wp--preset--color--accent);
}
h3.wp-block-heading.is-style-bcool-h-line {
  border-bottom-color: var(--wp--preset--color--accent);
}
h4.wp-block-heading.is-style-bcool-h-line,
h5.wp-block-heading.is-style-bcool-h-line {
  border-bottom-style: dashed;
}

/* ------------------------------------------
   塗り（is-style-bcool-h-fill）
   h2: primary 背景 / h3: accent-light + 左ボーダー / h4,h5: base-2 背景
   ------------------------------------------ */
.wp-block-heading.is-style-bcool-h-fill {
  padding: 0.45em 1em;
  border-radius: 2px;
}
h2.wp-block-heading.is-style-bcool-h-fill {
  background-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--contrast) !important;
}
h3.wp-block-heading.is-style-bcool-h-fill {
  background-color: var(--wp--preset--color--accent-light);
  color: var(--wp--preset--color--primary) !important;
  border-left: 3px solid var(--wp--preset--color--accent);
}
h4.wp-block-heading.is-style-bcool-h-fill,
h5.wp-block-heading.is-style-bcool-h-fill {
  background-color: var(--wp--preset--color--base-2);
  color: var(--wp--preset--color--text) !important;
}

/* ------------------------------------------
   ラベル（is-style-bcool-h-label）
   ::before で縦バーを前置き。h2: 8px / h3: 6px / h4,h5: 4px
   ------------------------------------------ */
.wp-block-heading.is-style-bcool-h-label {
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.wp-block-heading.is-style-bcool-h-label::before {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 1.2em;
  border-radius: 2px;
}
h2.wp-block-heading.is-style-bcool-h-label::before {
  width: 8px;
  background-color: var(--wp--preset--color--primary);
}
h3.wp-block-heading.is-style-bcool-h-label::before {
  width: 6px;
  background-color: var(--wp--preset--color--accent);
}
h4.wp-block-heading.is-style-bcool-h-label::before,
h5.wp-block-heading.is-style-bcool-h-label::before {
  width: 4px;
  background-color: var(--wp--preset--color--base-3);
}

/* =========================================
   案件追加クラス（下に随時追記）
   =========================================
   追加時は CLAUDE.md のクラス一覧も更新すること
   ========================================= */
