/*
 * Components Styles
 * Buttons, Sliders, etc.
 */

/* ==========================================================================
   ボタンコンポーネント
   ========================================================================== */

/**
 * ボタンコンポーネントの基本スタイル
 * 
 * @description
 * - ホバー時に左から右へ緑色が広がるアニメーション
 * - テキストは白色に変化
 * - 矢印アイコンは常に緑色
 * 
 * @note
 * - お知らせ一覧へボタンは右端に配置
 * - アニメーションは0.3秒で完了
 */

/* ボタンの基本スタイル */
.btn-more {
  /* レイアウト */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 16px 24px;
  width: fit-content;
  position: relative;
  overflow: hidden;
  margin: 0 auto;

  /* テキスト */
  font-family: "Noto Serif JP", serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  color: #231815;

  /* ボーダー */
  border: 1px solid #231815;

  /* トランジション */
  transition: all 0.3s ease;

  /* 背景グラデーション */
  background: linear-gradient(to right, #1FAF38 0%, #1FAF38 50%, transparent 50%, transparent 100%);
  background-size: 200% 100%;
  background-position: 100% 0;
}

.btn-more .btn-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #1FAF38;

  /* レイアウト */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.btn-more .btn-arrow {
  background-image: url("../images/more-arrow.svg");
  /* パス修正 */
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
}

/* お知らせ一覧へボタンの特別な配置 (これは home.css に移す方が良いかも) */
.news-section .btn-more {
  margin-right: 0;
  margin-left: auto;
}

/* サブフッターの円形矢印ボタン */
.circle-arrow-btn {
  display: inline-block;
  /* displayは変更なし */
  /* 必要なら margin-left: auto; などで右寄せを確実にする */
}

.circle-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid #1FAF38;
  position: relative;
  transition: transform 0.3s ease;
}

/* SVG要素のスタイル調整 */
.circle-arrow svg {
  width: 25px;
  height: auto;
}

.circle-arrow svg path {
  fill: #1FAF38;
}

/* ==========================================================================
   スライダーコンポーネント
   ========================================================================== */

/* トップページのスライダー */
.top-slider {
  position: relative;
  width: 100%;
  height: 100vh;
  /* clampから元の100vhに戻す */
  overflow: hidden;
}

.slider-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 1;
}

.slider-item.active {
  opacity: 1;
  z-index: 2;
}

.slider-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.slider-content {
  position: absolute;
  top: 80%;
  color: #ffffff;
  z-index: 4;
  width: 80%;
  left: 50%;
  transform: translateX(-50%);
  /* 中央配置を確実に */
  max-width: 1200px;
  /* 最大幅を制限 */
}

/**
 * .slider-title
 * トップスライダーのタイトルテキスト
 * 画面幅360px〜1920pxでフォントサイズが24px〜48pxで可変
 * @仕様 clamp(1.5rem, calc(1.5rem + 1.5 * ((100vw - 22.5rem) / 97.5)), 3rem)
 */
.slider-title {
  font-family: "Noto Serif JP", serif;
  font-weight: 900;
  font-size: clamp(1.5rem, calc(1.5rem + 1.5 * ((100vw - 22.5rem) / 97.5)), 3rem);
  letter-spacing: 0.05em;
  margin-bottom: 30px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 採用情報セクションの画像スクローラー */
.recruit-image-scroller {
  display: flex;
  /* (画像幅 + gap) * 3枚 * 2セット */
  width: calc(3 * (500px + 70px) * 2);
  gap: 70px;
  /* 画像間のgap */
  animation: scroll-recruit-images 20s linear infinite;
}

/* 無限スクロールアニメーション */
@keyframes scroll-recruit-images {
  0% {
    transform: translateX(0);
  }

  100% {
    /* 画像3枚分の幅 + gap3つ分 を移動 */
    transform: translateX(calc(-1 * (3 * (500px + 70px))));
  }
}

/* ==========================================================================
   その他のコンポーネント
   ========================================================================== */

/* TOPへ戻るボタン */
.to-top-btn {
  position: fixed;
  right: clamp(1.25rem, 0.446rem + 3.57vw, 3.125rem);
  bottom: 50px;
  width: clamp(5rem, 4.464rem + 2.38vw, 6.25rem);
  height: clamp(5rem, 4.464rem + 2.38vw, 6.25rem);
  background-color: transparent;
  /* 背景を透明に */
  border: 3px solid #8B5A2B;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  cursor: pointer;
  transition: border-color 0.4s ease;
  /* 枠線色の変化は少し遅らせる */
}

/* ホバー時の背景色アニメーション用疑似要素 */
.to-top-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #8B5A2B;
  border-radius: 50%;
  transform: scale(0);
  /* 初期状態は非表示 */
  transition: transform 0.3s ease;
  /* 背景色変化のアニメーション */
  z-index: -1;
  /* SVGより後ろ */
}

/* TOPへ戻るボタン内のSVGスタイル */
.to-top-btn svg {
  width: 16px;
  /* SVGの表示サイズ */
  height: 37px;
  transition: fill 0.3s ease;
  /* 色変化のアニメーション */
}

.to-top-btn svg path {
  fill: #231815;
  /* 通常時の色 */
}

/* ==========================================================================
   セクションヘッダーコンポーネント (事業内容ページ用)
   ========================================================================== */

/**
 * セクションヘッダー (`template-parts/service-section-header.php`)
 *
 * @description
 * - 左側に緑色の装飾線、右側に日本語タイトルを表示
 * - Figmaデザインに基づいたフォント、色、マージンを設定
 */

.service-section-header {
  display: flex;
  /* 線とタイトルを横並びに */
  align-items: center;
  /* 中央揃え */
  gap: 20px;
  /* 線とタイトルの間隔 */
  margin-bottom: 40px;
  /* セクションヘッダーとコンテンツ間のマージン */
}

.service-section-header__line {
  width: clamp(0.625rem, 0.481rem + 0.64vw, 1.25rem);
  height: clamp(1.563rem, 1.202rem + 1.6vw, 3.125rem);
  background-color: #1FAF38;
  /* 緑色 */
}

.service-section-header__title {
  font-family: "Noto Serif JP", serif;
  font-weight: 600;
  /* SemiBold */
  font-size: clamp(1.5rem, 1.154rem + 1.54vw, 3rem);
  line-height: 1.2;
  letter-spacing: 0.05em;
  color: #000000;
  margin: 0;
  /* デフォルトのマージンをリセット */
}

.service-section-header__subtitle {
  font-family: "Noto Serif JP", serif;
  /* サブタイトルフォントを仮設定 */
  font-weight: 400;
  font-size: 20px;
  /* 仮 */
  line-height: 1.2;
  letter-spacing: 0.05em;
  color: #555555;
  /* 仮 */
  white-space: nowrap;
  /* サブタイトルが改行されないように */
  margin-left: auto;
  /* タイトルと線を左に寄せ、サブタイトルを右に寄せる */
}

/* =============================
 * CTAボタン（共通レイアウト・ホバーアクション）
 * ============================= */
.cta-button {
  display: inline-block;
  background: #1FAF38;
  color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 32px;
  font-weight: 900;
  border-radius: 20px;
  padding: 40px 100px;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(.4, 2, .6, 1), box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  margin: 0 auto;
}

@media (max-width: 991px) {
  .cta-button {
    font-size: 18px;
    padding: 20px 32px;
  }
}

/* ===========================================================================
   汎用ボタンコンポーネント
   =========================================================================== */
/**
 * .button-component
 *
 * @description
 * - サイト全体で使える汎用ボタンの基本スタイル
 * - Figmaデザイン準拠
 * - テンプレートパーツ（cta-button.php等）で利用
 *
 * @仕様
 * - 緑色背景・白文字・角丸
 * - 太字・大きめフォント
 * - ホバー時に拡大＆シャドウ強調
 * - Noto Sans JP, sans-serif
 * - レスポンシブは各ページで調整
 */
.button-component {
  display: inline-block;
  background: #1FAF38;
  color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(1.125rem, 0.75rem + 1.67vw, 2rem);
  font-weight: 900;
  border-radius: 20px;
  padding: 40px clamp(1.25rem, -0.893rem + 9.52vw, 6.25rem);
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(.4, 2, .6, 1), box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  margin: 0 auto;
}

/* PCデバイスのみのホバーエフェクト */
@media (hover: hover) and (pointer: fine) {

  /* ホバー時のスタイル */
  .btn-more:hover {
    color: #ffffff;
    border-color: #1FAF38;
    background-position: 0 0;
  }

  /* ホバー時の円拡大アニメーション */
  .circle-arrow-btn:hover .circle-arrow {
    transform: scale(1.3);
  }

  /* ホバー時のスタイル */
  .to-top-btn:hover::before {
    transform: scale(1.03);
    /* 背景色を全面に表示 */
  }

  .to-top-btn:hover svg path {
    fill: #FFFFFF;
    /* ホバー時の矢印の色 */
  }

  /* TOPへ戻るボタン:hover SVG */
  .to-top-btn:hover svg path {
    fill: #ffffff;
    /* ホバー時にSVGの色を白に */
  }

  .cta-button:hover,
  .cta-button:focus {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  }

  .button-component:hover,
  .button-component:focus {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  }
}

/* タッチデバイス用の無効化 */
@media (hover: none) {
  .btn-more:hover {
    color: inherit;
    border-color: #231815;
    background-position: 100% 0;
  }

  .circle-arrow-btn:hover .circle-arrow {
    transform: none;
  }

  .to-top-btn:hover::before {
    transform: scale(0);
  }

  .to-top-btn:hover svg path {
    fill: #231815;
  }

  .cta-button:hover,
  .cta-button:focus,
  .button-component:hover,
  .button-component:focus {
    transform: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  }
}