/**
 * Components CSS (新版・コンパクト版)
 * 汎用コンポーネント - 再利用可能なUIパーツ
 * 高橋運輸興業 Webサイトリニューアル
 *
 * このファイルはサイト全体で使用する汎用コンポーネントのみを含みます。
 * ページ固有のスタイルは pages/ ディレクトリ内に分離されています。
 */

/* ===================================
   カードコンポーネント
   汎用的なカード表示用
   =================================== */

/* 基本カード */
.card {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
}

/* サイズバリエーション */
.card--sm {
  padding: 0.5rem;
}

.card--md {
  padding: 1rem;
}

.card--lg {
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

/* カラーバリエーション */
.card--highlight {
  background: var(--light-blue);
}

.card--gray {
  background: var(--bg-gray);
}

/* 影なしカード */
.card--shadow-none {
  box-shadow: none;
}

/* ===================================
   ボタンコンポーネント
   アクション用ボタン
   =================================== */

/* 基本ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  text-align: center;
  line-height: 1;
}

/* プライマリボタン（赤） */
.btn-primary {
  background: var(--accent-red);
  color: var(--text-white);
  border: none;
}

.btn-primary:hover {
  background: #d91d33;
  transform: translateY(-2px);
}

/* セカンダリボタン */
.btn-secondary {
  background: transparent;
  color: var(--text-white);
  border: 2px solid var(--text-white);
}

.btn-secondary:hover {
  background: var(--text-white);
  color: var(--primary-blue);
}

/* アウトラインボタン（白背景用） */
.btn-outline {
  background: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.btn-outline:hover {
  background: var(--primary-blue);
  color: var(--text-white);
}

/* セカンダリボタン（青） */
.btn-secondary-lg {
  display: inline-block;
  background: var(--secondary-blue);
  color: white;
  font-size: 1.1rem;
  padding: 1rem 2.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: all var(--transition);
}

.btn-secondary-lg:hover {
  background: #5a69c9;
  transform: translateY(-2px);
  color: white;
}

/* ボタンサイズ */
.btn-lg {
  padding: 1rem 3rem;
  font-size: 1.1rem;
}

/* ホワイトボタン */
.btn-white {
  background: white;
  color: var(--primary-blue);
  border: 2px solid white;
}

.btn-white:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

/* ===================================
   バッジコンポーネント
   ラベルやステータス表示
   =================================== */

/* 基本バッジ */
.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
}

/* バッジカラー */
.badge-light {
  background-color: var(--light-blue);
  color: var(--heading-primary);
}

/* ===================================
   画像コンポーネント
   汎用画像クラス
   =================================== */

/* 基本画像 */
.img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 画像モディファイア */
.img--responsive {
  width: 100%;
  height: auto;
  display: block;
}

.img--cover {
  width: 100%;
  object-fit: cover;
}

.img--contain {
  width: 100%;
  object-fit: contain;
  display: block;
}

/* 形状モディファイア */
.img--rounded {
  border-radius: var(--border-radius);
}

.img--rounded-lg {
  border-radius: var(--border-radius-lg);
}

.img--circle {
  border-radius: 50%;
}

/* サイズモディファイア */
.img--sm {
  width: 150px;
  height: auto;
}

.img--md {
  width: 200px;
  height: auto;
}

.img--lg {
  width: 300px;
  height: auto;
}

.img--thumbnail {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--border-radius);
}

/* 特殊な画像調整用 */
.img--crop-horizontal {
  width: 300px;
  height: auto;
  object-fit: cover;
  object-position: center;
  aspect-ratio: 4/3;
  border-radius: 5px;
}

/* 画像ギャラリー */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.image-gallery img {
  border-radius: var(--border-radius);
}

/* 画像カード */
.image-card {
  background: white;
  padding: 0.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
}

.image-card__img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  display: block;
  border-radius: var(--border-radius);
}

/* 写真ギャラリー用画像（最大幅制限付き） */
.img--gallery {
  width: 100%;
  max-width: 350px;
  height: auto;
  object-fit: cover;
  border-radius: var(--border-radius-lg);
  margin: 0 auto;
  display: block;
}

/* ===================================
   アイコンコンポーネント
   =================================== */

/* 円形アイコンコンテナ */
.icon-circle {
  width: 60px;
  height: 60px;
  background: var(--secondary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5em;
  flex-shrink: 0;
}

.icon-circle-center {
  margin: 0 auto 1rem;
}

/* ===================================
   テーブルコンポーネント
   =================================== */

/* カスタムテーブル */
.table-custom {
  width: 100%;
  border-collapse: collapse;
}

.table-custom th {
  background-color: var(--light-blue);
  color: var(--heading-primary);
  padding: 1rem;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table-custom td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  line-height: var(--leading-relaxed);
}

.table-custom a {
  color: var(--secondary-blue);
  text-decoration: underline;
}

.table-custom a:hover {
  color: var(--primary-blue);
}

/* ===================================
   リストコンポーネント
   =================================== */

/* 基本リスト */
.list {
  line-height: var(--leading-relaxed);
  margin-bottom: 1rem;
}

/* リストバリエーション */
.list--unstyled {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list--spaced {
  line-height: 2;
}

.list--spaced-lg {
  line-height: 2.5;
}

/* チェックリスト */
.list--check {
  list-style: none;
  padding-left: 0;
}

.list--check li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.list--check li::before {
  content: "✓";
  color: var(--secondary-blue);
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* 番号付きリスト */
.list--numbered {
  list-style-type: decimal;
  padding-left: 2rem;
}

/* ディスクリスト */
.list--disc {
  list-style-type: disc;
  padding-left: 2rem;
}

/* リストアイテムのスペーシング */
.list--item-spaced li {
  margin-bottom: 1.5rem;
}

.list--item-compact li {
  margin-bottom: 0.5rem;
}

/* ===================================
   フォームコンポーネント
   =================================== */

/* フォームグループ */
.form-group {
  margin-bottom: 1.5rem;
}

/* フォームラベル */
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--heading-secondary);
}

/* フォーム入力 */
.form-input,
.form-textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--secondary-blue);
}

.form-textarea {
  resize: vertical;
  min-height: 150px;
}

/* 必須マーク */
.text-required {
  color: #e74c3c;
  font-weight: 600;
}

/* ===================================
   セクションコンポーネント
   =================================== */

/* コンテンツセクション */
.content-section {
  padding: 2rem;
  margin-bottom: 2rem;
}

/* ===================================
   見出しコンポーネント
   =================================== */

/* 階層別見出し */
.heading-2 {
  font-size: 2rem;
  color: var(--heading-primary);
  font-weight: 600;
  margin-bottom: 1.2rem;
  line-height: 1.4;
}

.heading-3 {
  font-size: 1.5rem;
  color: var(--heading-primary);
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.heading-4 {
  font-size: 1.2rem;
  color: var(--heading-secondary);
  font-weight: 600;
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.heading-5 {
  font-size: 1rem;
  color: var(--heading-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* 見出し装飾 */
.heading--center {
  text-align: center;
}

.heading--white {
  color: var(--text-white);
}

.heading--border-left {
  padding-left: 1rem;
  border-left: 4px solid var(--primary-blue);
}

.heading--underline {
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--light-blue);
}

/* 段落コンポーネント */
.section-paragraph {
  line-height: var(--leading-loose);
  margin-bottom: 2rem;
}

.section-paragraph:last-child {
  margin-bottom: 0;
}

/* サービスセクション（搬出入据付・オフィス移転ページ用） */
.service-section .card--lg {
  padding: 2.5rem 2rem;
}

/* ===================================
   ボックスコンポーネント
   =================================== */

/* CTAボックス */
.box-cta {
  background-color: var(--light-blue);
  padding: 3rem 2rem;
  border-radius: var(--border-radius-xl);
  text-align: center;
  margin-top: 4rem;
}

/* 情報ボックス */
.box-info {
  background-color: var(--bg-gray);
  padding: 1.5rem;
  border-radius: var(--border-radius-lg);
  margin-top: 2rem;
}

/* スクロール可能ボックス */
.box-scroll {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  background-color: var(--bg-gray);
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  line-height: var(--leading-relaxed);
}

.box-scroll--tall {
  max-height: 300px;
}

.box-scroll--no-limit {
  max-height: none;
  overflow-y: visible;
}

/* ===================================
   ニュースコンポーネント
   =================================== */

/* ニュースセクション */
.news {
  padding: 4rem 0;
  background: var(--bg-white);
}

/* 最新情報ブロック（お知らせ・ブログ） */
.latest-info-block {
  max-width: var(--max-width-narrow);
  margin: 0 auto 2.5rem;
}

.latest-info-block:last-child {
  margin-bottom: 0;
}

.latest-info-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.latest-info-block .news-list {
  margin: 0;
}

.news-list {
  max-width: var(--max-width-narrow);
  margin: 3rem auto 0;
}

/* トップページお知らせリンク */
.news .news-list .news-item {
  background: var(--bg-white);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 2rem;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.news .news-list .news-item:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.news .news-list .news-date {
  min-width: 100px;
}

.news .news-list .news-title {
  flex: 1;
  color: var(--text-primary);
}

/* お知らせ・ブログ一覧ページ共通 */
.page-content .news-list .news-item {
  background: var(--bg-white);
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

/* お知らせ・ブログ共通レイアウト */
.news-item-layout {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.news-item-content {
  flex: 1 1 250px;
  min-width: 250px;
  max-width: 100%;
}

/* お知らせ・ブログ本文の最後の余白を削除 */
.news-item-content .wp-content > *:last-child {
  margin-bottom: 0;
}

/* お知らせ・ブログ共通 日付バッジ */
.page-content .news-list .news-date {
  background-color: var(--light-blue);
  color: var(--heading-primary);
  padding: 0.35rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
  line-height: 1.4;
}

/* お知らせ・ブログ共通 タイトル */
.page-content .news-list .news-title {
  color: var(--heading-primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ===================================
   サービスコンポーネント
   =================================== */

/* サービスセクション */
.services {
  padding: 4rem 0;
  background: var(--bg-white);
}

/* サービスカード */
.service-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.service-image {
  height: 200px;
  background: var(--light-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-body {
  padding: 1.5rem;
}

.service-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: var(--leading-relaxed);
  margin-bottom: 1rem;
}

.service-link {
  display: inline-block;
  color: var(--secondary-blue);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 2px solid var(--secondary-blue);
  border-radius: var(--border-radius);
  transition: all var(--transition);
}

.service-link:hover {
  background: var(--secondary-blue);
  color: var(--text-white);
}

/* ===================================
   その他のコンポーネント
   =================================== */

/* 定義リスト */
.definition-list {
  line-height: var(--leading-loose);
  margin: 0;
}

.definition-list dt {
  float: left;
  width: 150px;
  font-weight: 600;
  clear: left;
}

.definition-list dd {
  margin-left: 150px;
  margin-bottom: 0.5rem;
}

/* フッターテキスト */
.footer-text {
  text-align: right;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
}

/* 電話番号表示 */
.phone-number-display {
  font-size: 2.2rem;
  font-weight: bold;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

/* メッセージ・アラート */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-lg);
  /* margin-bottomは各使用箇所でユーティリティクラスを指定 */
}

.alert--info {
  background-color: var(--bg-light);
  border: 1px solid #d9ddee;
  color: var(--heading-primary);
}

.alert--success {
  background-color: var(--light-blue);
  border: 1px solid #c8cde8;
  color: var(--heading-primary);
}

.alert--warning {
  background-color: #fff3cd;
  border: 1px solid #f5e5a0;
  color: #856404;
}

/* ===================================
   レスポンシブ対応
   =================================== */

@media (max-width: 768px) {
  /* カード */
  .card--lg {
    padding: 1.5rem;
  }

  /* テーブル */
  .table-custom th,
  .table-custom td {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }

  /* アイコン */
  .icon-circle {
    width: 50px;
    height: 50px;
    font-size: 1.2em;
  }

  /* ボタン */
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  /* 見出し */
  .heading-2 {
    font-size: 1.75rem;
  }

  .heading-3 {
    font-size: 1.3rem;
  }

  .heading-4 {
    font-size: 1.1rem;
  }

  /* 電話番号 */
  .phone-number-display {
    font-size: 1.8rem;
  }

  /* ニュースレイアウト（モバイル） */
  .news-item-layout {
    flex-direction: column;
    gap: 0.75rem;
  }

  .news-item-content {
    flex: 1 1 auto;
    min-width: 100%;
  }

  .page-content .news-list .news-item {
    padding: 1.5rem;
  }

  .page-content .news-list .news-date {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  /* スクロールボックス */
  .box-scroll {
    max-height: none;
    overflow-y: visible;
  }
}