/* =========================================================
   リニューアル用の追加・上書きスタイル
   既存の css/style.css を読み込んだ後に適用される（functions.php で読み込み順を制御）。
   ・トップページ：メインビジュアルのスライダーを動画に差し替えたための調整
   ・求人情報ページ：職種ナビ／先輩職員の声モーダルなど

   ※ style.css と違い sass からのコンパイル対象ではない（このファイルを直接編集する）。
     max() や CSS カスタムプロパティを素のまま書きたいため、gulp/sass を通していない。
   ========================================================= */

/* メインビジュアル：動画
   初期表示で「ヘッダ＋メニューを除いた画面高さいっぱい」、横は画面いっぱい。
   ヘッダ100px＋グローバルメニュー60px＝160px を差し引く。 */
:root {
  --mv-offset: 160px;
}

#main-visual {
  background-color: #000;
  width: 100%;
}

/* .inner の max-width:1600px 制約を外して全幅に */
#main-visual .inner {
  max-width: none;
  width: 100%;
}

#main-visual .main-visual-movie {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--mv-offset));
  min-height: 320px;
  overflow: hidden;
  background: #000;
}

/* -------------------------------------------------------------
   トップページ没入表示（top-immersive）
   ヘッダ＋メニューを動画に重ねる固定オーバーレイにし、
   3秒操作がないと上へスライドして消える（JSで .nav-hidden を付与）。
   ------------------------------------------------------------- */
body.top-immersive #top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  transition: transform 0.45s ease;
  will-change: transform;
}
/* メニューが背景透過だと動画に重なった時に読みにくいので下地を敷く */
body.top-immersive #top-bar #header {
  background: rgba(255, 255, 255, 0.95);
}
/* 非表示時：バー全体を自身の高さぶん上へスライド（高さに依存せず隠れる） */
body.top-immersive.nav-hidden #top-bar {
  transform: translateY(-100%);
}
/* ヘッダ＋メニューは固定オーバーレイなので、動画は画面高さいっぱい */
body.top-immersive #main-visual .main-visual-movie {
  height: 100vh;
}

/* スマホ表示：縦スペースに余裕があるので通常レイアウトにする
   ・メイン動画は幅いっぱい／高さはなり（16:9）
   ・ヘッダ＋メニューは固定解除し、最初から表示したまま（自動非表示なし） */
@media only screen and (max-width: 780px) {
  body.top-immersive #top-bar {
    position: static;
    transform: none !important;
  }
  body.top-immersive #main-visual .main-visual-movie {
    height: auto;
    /* 動画は 16:9 の高さ（.movie-frame）で決まるので、
       min-height を残すと動画より背が高くなり下に黒余白が出る */
    min-height: 0;
  }
}

#main-visual .movie-frame {
  position: absolute;
  inset: 0;
}

/* 16:9 の動画を、余白なくエリア全体に敷き詰める（cover相当） */
#main-visual .movie-frame iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max(100vw, 177.78vh);   /* 16/9 * 100vh */
  height: max(56.25vw, 100vh);   /* 9/16 * 100vw */
  border: 0;
  display: block;
  pointer-events: none;          /* コントロールは非表示・操作させない */
}

/* スマホ：cover をやめて動画をエリア幅にフィットさせる（左右の見切れ防止）。
   .movie-frame 自体を 16:9 にし、iframe はその中に 100% で収める。
   ※ベースの cover ルールより後ろに置くことで確実に上書きする */
@media only screen and (max-width: 780px) {
  #main-visual .movie-frame {
    position: relative;
    inset: auto;
    width: 100%;
    aspect-ratio: 16 / 9;
  }
  #main-visual .movie-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    height: 100%;
  }
}

/* 音声 ON/OFF ボタン（右下） */
#main-visual .mv-mute-btn {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 6;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
#main-visual .mv-mute-btn:hover {
  background: #00A99D;
  border-color: #00A99D;
}
#main-visual .mv-mute-btn:active {
  transform: scale(0.94);
}

@media only screen and (max-width: 780px) {
  :root {
    --mv-offset: 200px;
  }
  #main-visual .mv-mute-btn {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
  }
}

/* キャッチコピーを動画の上に重ねる */
#main-visual .main-visual-movie h2 {
  position: absolute;
  top: 40px;
  left: 50px;
  z-index: 5;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

#main-visual .main-visual-movie h2 strong {
  color: #FCEE21;
}

#main-visual .main-visual-movie h2 .sub {
  font-size: 1.625rem;
}

#main-visual .main-visual-movie h2 .main {
  display: block;
  font-size: 3.25rem;
  line-height: 1.2;
}

@media only screen and (max-width: 780px) {
  #main-visual .main-visual-movie h2 {
    top: 8px;
    left: 8px;
  }
  #main-visual .main-visual-movie h2 .sub {
    font-size: 0.75rem;
    width: 70%;
    line-height: 120%;
    display: inline-block;
  }
  #main-visual .main-visual-movie h2 .main {
    font-size: 1rem;
  }
}

/* =========================================================
   求人情報ページ
   ========================================================= */

/* アンカーリンクのスムーススクロール */
html {
  scroll-behavior: smooth;
}

/* 職種切り替えボタン */
.recruit-nav {
  /* 画面上部までスクロールしたら固定 */
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 10px 0 50px;
  padding: 12px 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.recruit-nav-btn {
  flex: 1 1 240px;
  max-width: 360px;
  text-align: center;
  padding: 18px 20px;
  background: #00A99D;
  color: #fff;
  font-size: 1.25rem;
  font-weight: bold;
  border-radius: 6px;
  line-height: 1.3;
  transition: background 0.2s, transform 0.1s;
}
.recruit-nav-btn:hover {
  background: #008b81;
  text-decoration: none;
  transform: translateY(-2px);
}
.recruit-nav-btn span {
  display: block;
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

/* スマホ・タブレット：ボタン・余白・文字を小さくして横並びを維持
   （固定の MENU バー〈#global-menu〉の下に貼り付ける） */
@media only screen and (max-width: 780px) {
  .recruit-nav {
    top: 48px;
    gap: 6px;
    flex-wrap: nowrap;
    margin: 8px 0 32px;
    padding: 8px 0;
  }
  .recruit-nav-btn {
    flex: 1 1 0;
    max-width: none;
    padding: 8px 4px;
    font-size: 0.8rem;
    border-radius: 5px;
    line-height: 1.2;
  }
  .recruit-nav-btn span {
    font-size: 0.6rem;
    letter-spacing: 0;
  }
}

/* 職種セクション */
.recruit-job {
  margin-bottom: 80px;
  scroll-margin-top: 20px;
}
.recruit-job .section-title .alphabet {
  display: block;
  font-size: 0.9rem;
  color: #00A99D;
  letter-spacing: 0.15em;
  margin-top: 4px;
}
.recruit-lead {
  margin-bottom: 40px;
  line-height: 1.9;
}
.recruit-lead p {
  margin: 0 0 1em;
}
.recruit-subtitle {
  font-size: 1.35rem;
  border-left: 5px solid #00A99D;
  padding-left: 12px;
  margin: 40px 0 20px;
}
.recruit-schedule {
  margin: 0 0 20px;
  text-align: center;
}
.recruit-schedule img {
  max-width: 100%;
  height: auto;
  border: 1px solid #e4e7eb;
  border-radius: 6px;
}

/* 先輩職員の声：カード一覧 */
.recruit-voice {
  scroll-margin-top: 20px;
}
.recruit-voice-lead {
  margin-bottom: 30px;
}
.voice-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.voice-card {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: box-shadow 0.2s, transform 0.1s;
}
.voice-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}
.voice-card-img {
  display: block;
  aspect-ratio: 4 / 3;
  background: #F2F2F2;
  overflow: hidden;
}
.voice-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.voice-card-info {
  display: block;
  padding: 14px 16px 18px;
}
.voice-card-cat {
  display: inline-block;
  background: #00A99D;
  color: #fff;
  padding: 3px 10px;
  font-size: 0.7rem;
  border-radius: 3px;
  margin-bottom: 6px;
}
.voice-card-name {
  display: block;
  font-size: 1.2rem;
  font-weight: bold;
}
.voice-card-profile {
  display: block;
  font-size: 0.85rem;
  color: #616e7c;
  margin-top: 2px;
}

/* モーダル */
.voice-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  padding: 24px;
  overflow-y: auto;
}
.voice-modal.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.voice-modal-inner {
  position: relative;
  background: #fff;
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  margin: 40px auto;
  padding: 40px 32px 32px;
}
.voice-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 2rem;
  line-height: 1;
  color: #616e7c;
  cursor: pointer;
}
.voice-modal-close:hover {
  color: #00A99D;
}
/* モーダル内は元テーマの .voice-box / .qa スタイルを流用しつつ整える */
.voice-modal-body .voice-box {
  padding: 20px;
  background: #F2F2F2;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.voice-modal-body .voice-box .image img {
  max-width: 180px;
  height: auto;
}
.voice-modal-body .voice-box .text .cat {
  display: inline-block;
  background: #00A99D;
  color: #fff;
  padding: 5px 10px;
  font-size: 0.7rem;
  border-radius: 3px;
  margin: 0 0 6px;
}
.voice-modal-body .voice-box .text .name {
  margin: 0 0 4px;
  font-size: 1.3rem;
}
.voice-modal-body .voice-box .text .profile {
  margin: 0;
  color: #616e7c;
}
.voice-modal-body .qa .image {
  float: right;
  max-width: 240px;
  padding: 0 0 20px 20px;
}
.voice-modal-body .qa .image img {
  max-width: 100%;
  height: auto;
}
.voice-modal-body .qa dl dt {
  font-size: 1.1rem;
  font-weight: bold;
  color: #00A99D;
  margin-bottom: 4px;
}
.voice-modal-body .qa dl dd {
  margin: 0 0 1.2em;
}

@media only screen and (max-width: 780px) {
  .voice-modal-body .voice-box {
    flex-direction: column;
    text-align: center;
  }
  .voice-modal-body .qa .image {
    float: none;
    max-width: 100%;
    padding: 0 0 16px;
  }
}

/* -------------------------------------------------------------
   ページタイトルのヘッダ画像（#page-title）
   画像をエリア幅いっぱいに広げ、上下は中央揃え・はみ出しは切り取り。
   ------------------------------------------------------------- */
#page-title .inner .image {
  overflow: hidden;
  height: 224px;
}
#page-title .inner .image img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 横幅いっぱい。比率は保ったまま */
  object-position: center;/* 上下は中央、はみ出し分を切り取り */
  max-width: none;
}
/* タブレット・スマホ（既存 CSS の切替点に合わせる） */
@media only screen and (max-width: 780px) {
  #page-title .inner .image {
    height: 112px;
  }
  #page-title .inner .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
}
