/* page-53.css  ★2025-07-24 改訂版（3D Loading＋事業内容2列化・視覚強化） */

/* ───── Google Fonts ───── */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

/* ───── ルート変数 ───── */
:root {
  --accent          : #2188ff;
  --radius          : 14px;
  --bg              : #f5f7fb;
  --card            : #ffffff;
  --fg              : #000;
  --shadow          : 0 8px 20px rgba(0,0,0,.15);
  --grad            : linear-gradient(135deg,#56ccf2 0%,#2f80ed 100%);
  --special-grad    : linear-gradient(135deg,#00B09B 0%,#96C93D 100%);

  /* Loading Screen 用 */
  --primary-color     : #00e5ff;
  --secondary-color   : #ff00ff;
  --accent-color      : #00ff99;
  --background-color  : #000000;
}

/* ───── リセット ───── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; min-height: 100vh; overflow-x: hidden; }

/* ───── 3D Loading Screen ───── */
body.loading-active { overflow: hidden; }

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--background-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  perspective: 800px;
  font-family: 'Orbitron', sans-serif;
}

.loader-3d {
  position: relative;
  width: 100px;
  height: 100px;
  transform-style: preserve-3d;
  animation: rotateCube 2s linear infinite;
}

.loader-3d .cube-face {
  position: absolute;
  width: 100px;
  height: 100px;
  background: var(--grad);
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px var(--accent);
  opacity: 0.9;
}

.loader-3d .cube-face.front  { transform: translateZ(50px); }
.loader-3d .cube-face.back   { transform: rotateY(180deg) translateZ(50px); }
.loader-3d .cube-face.right  { transform: rotateY( 90deg) translateZ(50px); }
.loader-3d .cube-face.left   { transform: rotateY(-90deg) translateZ(50px); }
.loader-3d .cube-face.top    { transform: rotateX( 90deg) translateZ(50px); }
.loader-3d .cube-face.bottom { transform: rotateX(-90deg) translateZ(50px); }

@keyframes rotateCube {
  0%   { transform: rotateX(0deg)   rotateY(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

.loading-text {
  margin-top: 20px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  text-shadow: 0 0 8px #fff;
  animation: blink 1.5s infinite ease-in-out;
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75%       { opacity: 0.4; }
}

/* ───── スクロールバー非表示 ───── */
.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* ───── ヒーローセクション ───── */
#hero { position: relative; width: 100%; height: 100vh; overflow: hidden; }
#hero video {
  position: absolute; top: 50%; left: 50%;
  width: 100%; height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover; border: none;
}
/* ヒーロースライドショー */
.hero-slideshow {
  display: none; opacity: 0;
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden; transition: opacity .5s ease-in-out;
}
.hero-slideshow .hero-slide {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1s ease-in-out;
}
.hero-slideshow .hero-slide:first-child { opacity: 1; }
@media(max-width:1024px){ #hero{ height: 70vh;} }
@media(max-width:768px) { #hero{ height: 50vh;} }
@media(max-width:480px) { #hero{ height: 40vh;} }

/* ───── ニューススライダー ───── */
.fsrs4pv_content { flex: 1; display: flex; justify-content: center; align-items: center; }

/* ▼▼▼ 修正：高さ可変にして下方向へ拡張、オーバーフローを許可 ▼▼▼ */
.fsrs4pv_slider  {
  position: relative;
  width: 100vw;
  min-height: 60vh;   /* 既存の見た目は維持しつつ… */
  height: auto;       /* …必要に応じて下へ広がる */
  overflow: visible;  /* 下方向へのはみ出しを許可 */
  z-index: 1001;
}
/* ▲▲▲ 修正ここまで ▲▲▲ */

.fsrs4pv_slides  {
  display: flex; gap: 10px;
  /* ▼ 修正：中身の高さに追従 */
  height: auto;
  cursor: grab; user-select: none;
  align-items: stretch; /* 各スライドを等しく伸ばす基準 */
}
.fsrs4pv_slides:active { cursor: grabbing; }

.fsrs4pv_slide {
  flex: 0 0 calc((100% - 10px) / 2);
  display: flex; flex-direction: column;
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  background: #fff; /* カード下部も白に統一 */
  height: auto; /* スライド自身も可変 */
}

.fsrs4pv_slide_img {
  /* 画像エリアを固定高＋縮まない。テキストが増えても画像は維持 */
  flex: 0 0 auto;
  height: 320px;           /* PC基準の見栄え */
  overflow: hidden;
  flex-shrink: 0;
}
.fsrs4pv_slide_img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ▼ 修正：タイトル（テキスト）部は最低高さを統一し、超えたら下へ拡張 */
/* ▼ 枠線（ボーダー）を削除 */
.fsrs4pv_slide_txt {
  display: flex; justify-content: center; align-items: center;
  background: #fff;
  border-bottom-left-radius: 16px; border-bottom-right-radius: 16px;
  color: #000; font-size: 1.5rem; text-align: center;

  padding: 16px;             /* 可読性向上 */
  line-height: 1.5;
  min-height: 120px;         /* ★ タイトル高さの統一（2行程度） */
  height: auto;              /* 必要に応じて伸長 */
}

/* 既存ブレークポイントを尊重しつつ、画像固定高のみ調整 */
@media(max-width:1024px){
  .fsrs4pv_slide{ flex: 0 0 calc((100% - 20px) / 3); }
  .fsrs4pv_slide_img { height: 260px; }  /* タブレット：少し低め */
  .fsrs4pv_slide_txt { min-height: 110px; }
}
@media(max-width:768px){
  .fsrs4pv_slides{ gap: 8px; }
  .fsrs4pv_slide { flex: 0 0 100%; }
  .fsrs4pv_slide_img { height: 220px; }  /* モバイル：さらに低め */
  .fsrs4pv_slide_txt { min-height: 100px; }
}

/* ───── 事業内容セクション ───── */
.business-section {
  background: transparent;
  padding: 100px 0;
  color: #333;
  position: relative;
  overflow: hidden;
}
.business-section .container {
  max-width: 1400px;
  width: calc(100% - 40px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.business-section .section-header {
  text-align: center;
  margin-bottom: 50px;
  text-shadow: 1px 1px 3px rgba(0,0,0,.1);
}
.business-section .section-title {
  font-size: 3.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #0d47a1;
  text-shadow: 2px 2px 4px rgba(0,0,0,.2);
  font-family: 'Montserrat', sans-serif;
}
.business-section .section-description {
  font-size: 1.4rem;
  color: #555;
  margin-top: 10px;
  font-family: 'Montserrat', sans-serif;
  text-align: center;
}

/* —— 2 列レイアウト（≥1025px）—— */
.business-section .row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  width: 100%;
  justify-items: stretch;
}
@media(max-width:1024px){
  .business-section .row { grid-template-columns: 1fr; }
}

/* —— カード —— */
.business-section .service-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 32px 28px 40px;
  background: rgba(255,255,255,.92);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.1);
  transition: transform .35s, box-shadow .35s;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.business-section .service-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 32px rgba(0,0,0,.18);
}
.business-section .service-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg,transparent 0%,rgba(33,136,255,.15) 50%,transparent 100%);
  opacity: .65;
  pointer-events: none;
  transition: opacity .35s;
}
.business-section .service-item:hover::before { opacity: .85; }

/* —— 見出し & テキスト —— */
.business-section .icon-wrap {
  font-size: 4rem;
  margin-bottom: 18px;
}
.business-section .service-item.dispatch .icon-wrap { color: #00bcd4; }   /* 客先常駐派遣 */
.business-section .service-item.contract .icon-wrap { color: #ff7043; }    /* 請負 */

.business-section .service-title {
  font-size: clamp(1.6rem, 2.2vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
  font-family: 'Montserrat', sans-serif;
}
.business-section .service-text {
  font-size: 1.05rem;
  line-height: 1.7;
  text-align: center;
  margin-bottom: 24px;
  font-family: 'Montserrat', sans-serif;
}

/* —— 業界アイコン行 —— */
.industry-icons {
  display: flex;
  justify-content: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.industry-icons li {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.8rem;
}
.industry-icons span {
  margin-top: 6px;
  font-size: .78rem;
  font-weight: 600;
}

/* ───── Back-to-Top – Compact Stylish ver. ───── */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px) scale(.9);
  transition:
    opacity   .3s ease,
    transform .3s cubic-bezier(.19,1,.22,1),
    box-shadow .3s,
    background .4s;
}
/* 矢印アイコン */
.back-arrow {
  width: 22px;
  height: 22px;
  transition: transform .35s ease;
}
/* 光沢ハイライト */
.back-to-top::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
              rgba(255,255,255,.25) 0%, rgba(255,255,255,0) 60%);
  transition: opacity .35s;
  pointer-events: none;
}
/* ホバー演出 */
.back-to-top:hover { box-shadow: 0 10px 24px rgba(33,136,255,.45); }
.back-to-top:hover::before { opacity: .55; }
.back-to-top:hover .back-arrow { transform: translateY(-3px); }
/* 表示タイミング */
body.scrolled .back-to-top {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ───────── Business Slider Rework ───────── */
/* ───────── Business Slider Rework – Synced ver. ───────── */

/* ① 旧 keyframes アニメーションを停止 --------------------- */
.dispatch .img-container img,
.contract .img-container img {
  animation: none !important;
}

/* ② 共通レイアウト -------------------------------------- */
.img-container {
  position: relative;
  width: 100%;
  height: 220px;           /* PC 基準高さ */
  overflow: hidden;
}
.img-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;              /* GSAP で制御 */
  transform: scale(1.08);  /* わずかにズームアウト開始 */
}

/* ③ 初期表示 – 1 枚目だけ見せておく（JS 実行前のチラツキ防止） */
.img-container img:first-child {
  opacity: 1;
  transform: scale(1);
}

/* ④ 既存レスポンシブ高さ ------------------------------- */
@media (max-width: 768px) { .img-container { height: 180px; } }
@media (max-width: 480px) { .img-container { height: 150px; } }

/* ───── 追加：fx2s テキスト位置を下に下げる（他要素は未変更） ───── */
.fx2s__copy{
  /* 下げ幅は必要に応じて調整してください */
  --fx2s-copy-shift-y: clamp(50px, 3vw, 40px);
  translate: 0 var(--fx2s-copy-shift-y);
}
@media (max-width: 768px){
  .fx2s__copy{
    --fx2s-copy-shift-y: clamp(16px, 8vw, 96px);
  }
}

/* ───── 追加：fx2s__title を一行化＆自動リサイズ（レスポンシブ対応） ───── */
/* コンテナクエリ基準を付与（cqi/cqw による内幅基準の算出を可能に） */
#fx2s-intro .fx2s__copy{ container-type: inline-size; }

/* 1行固定 + はみ出し防止 + 自動縮小（フォールバック → cqi 優先） */
#fx2s-intro .fx2s__title{
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: clip;
  /* まずはフォールバック（旧ブラウザ用） */
  font-size: clamp(12px, 3.0vmin, 28px) !important;
  /* コンテナ幅に収める自動調整（18 はおおよその文字数） */
  font-size: clamp(12px, min(3.0vmin, calc(98cqi / 18)), 28px) !important;
}

@media (max-width: 768px){
  #hero .hero-slideshow .hero-headline h1 { font-size: clamp(34px, 7.2vw, 96px) !important; }
  #hero .hero-slideshow .hero-headline p  { font-size: clamp(20px, 3.2vw, 44px) !important; }
}
