/* ============================================
   「フジタってどんな会社？」下層記事 共通テンプレートCSS
   FUJITA築育サイト

   このCSSは記事ページ全てで共通。記事ごとの差分はPHP側のデータ配列のみ。
   work-article.cssと同じ構造（MV・白カードコンテナ・関連リンクGrid）を流用し、
   コンテンツブロックはB（heading+image+body）/F（キャラ+見出し横並び）/
   G（画像3枚横並び）の3タイプに対応。
   ============================================ */

.is-pc-only { display: block !important; }
.is-sp-only { display: none !important; }

.tobira-hero {
  position: relative;
  width: 100%;
  height: 832px;
  background: #DAF2FF;
  overflow: hidden;
  z-index: 0;
}

.tobira-hero__bg-bottom {
  position: absolute;
  left: 0;
  right: 0;
  top: 603px;
  bottom: 0;
  background: #0F825D;
  z-index: 0;
}

.tobira-frame {
  position: relative;
  width: 100%;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  z-index: 1;
}

.tobira-frame img,
.tobira-frame > * {
  position: absolute;
}

.tobira-cloud { z-index: 1; }
.tobira-illust { z-index: 1; }

.tobira-baloon {
  width: 32px;
  z-index: 1;
  animation: mv-float-y 3s ease-in-out infinite;
}

@keyframes mv-float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* MVタイトル・サブテキスト（カテゴリ共通） */
/* 見出し＋導入文ラッパー（共通クラス.mv-textblockはstyle.cssに定義。ここではtopのみ） */
.mv-textblock {
  top: 131px;
}

.company-mv-title {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 900;
  text-align: center;
  background: linear-gradient(125.5deg, #0E845C 9.5%, #0867AE 94.8%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: clamp(32px, 4.6875vw, 60px);
  line-height: 1.5;
  letter-spacing: 0.05em;
  white-space: nowrap;
  z-index: 2;
}

.company-mv-desc {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 700;
  color: #414141;
  text-align: center;
  font-size: clamp(16px, 2.03125vw, 26px);
  letter-spacing: 0.1em;
  line-height: 1.4;
  white-space: nowrap;
  z-index: 2;
}

/* 記事ヘッダー：カテゴリラベル＋記事タイトル（緑背景に重なる白文字） */
.company-header__label {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 700;
  color: #fff;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  z-index: 2;
}

.company-header__title {
  margin: 0;
  transform: translateX(-50%);
  font-family: var(--font-main);
  font-weight: 900;
  color: #fff;
  text-align: center;
  font-size: clamp(24px, 3.59375vw, 46px);
  letter-spacing: 0.1em;
  line-height: 1.3;
  white-space: nowrap;
  max-width: 90%;
  z-index: 2;
}

/* イラスト装飾エリアの背景楕円 */
.tobira-illust-ellipse {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #0F825D;
  z-index: 0;
}

.tobira-illust-ellipse.is-pc-only {
  top: 402.6px;
  width: max(1894px, calc(100vw + 200px));
  height: 352px;
}

.tobira-illust-ellipse.is-sp-only {
  top: 325.5px;
  width: max(507px, calc(100vw + 100px));
  height: 148px;
}

/* ============ メインコンテンツ：緑背景の上に白カードが少し重なる ============ */
.company-content {
  position: relative;
  z-index: 1;
  background: #0F825D;
  padding-bottom: 80px; /* Grid〜フッター間の余白 */
}

.tobira-grass {
  position: absolute;
  z-index: 1;
}

/* Container：白カード。MVに少し重なる */
.company-container {
  position: relative;
  z-index: 2;
  width: 996px;
  max-width: calc(100% - 40px);
  margin: -161px auto 0; /* Container(671px)がMV(832px)に重なる分 */
  padding: 100px 157px 100px;
  background: #fff;
  border-radius: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 60px;
  overflow: hidden;
}

/* Company Contents 共通 */
.company-block {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* タイプK：テキスト＋画像(または写真ペア)のグループ。company/historyの再構成用 */
.company-block--k {
  gap: 30px;
  margin-bottom: 40px;
}

.company-block__heading {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 28px;
  color: #000;
  letter-spacing: 0.1em;
  line-height: 1.15;
}

.company-block__img {
  border-radius: 0;
  overflow: hidden;
}

.company-block__img img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* タイプD：縦2段の画像（横並び画像を1組として扱う場合用） */
.company-block__img-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* タイプJ：画像＋テキスト横並び（image_sideでleft/right切り替え。SPは画像が上・テキストが下） */
.company-chara {
  display: flex;
  align-items: center;
  gap: 40px;
}

.company-chara--reverse {
  flex-direction: row-reverse;
}

.company-chara__img {
  flex: 0 0 40%;
}

.company-chara__img img {
  display: block;
  width: 100%;
  height: auto;
}

.company-chara__text {
  flex: 1 1 auto;
}

.company-chara__intro {
  margin: 0 0 16px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 28px;
  color: #0E845C;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.company-chara__body {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 18px;
  color: #000;
  letter-spacing: 0.1em;
  line-height: 1.78;
}

.company-block__body {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 18px;
  color: #000;
  letter-spacing: 0.1em;
  line-height: 1.78;
}

.company-block__body a {
  color: #0867AE;
  text-decoration: underline;
}

.company-block__linkbanner {
  display: block;
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  transition: opacity var(--transition);
}

.company-block__linkbanner img {
  display: block;
  width: 100%;
  height: auto;
}

.company-block__linkbanner:hover {
  opacity: 0.85;
}

.company-block__linktext {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 18px;
  color: #0867AE;
  text-decoration: underline;
  letter-spacing: 0.05em;
}

/* タイプF：キャラクターイラスト＋見出しの横並び */
.company-block--f .company-block {
  flex-direction: row;
  align-items: center;
  gap: 24px;
}

/* タイプG：画像3枚横並び（gap:22px。SPは縦積みに可変） */
.company-imgrow {
  display: flex;
  gap: 22px;
}

.company-imgrow__item {
  flex: 1 1 0;
}

.company-imgrow__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* タイプH：人物写真2枚横並び＋caption（SPも横並び維持） */
.company-photopair {
  display: flex;
  gap: 22px;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}

.company-photopair__item {
  flex: 1 1 0;
}

.company-photopair__item img {
  display: block;
  width: 100%;
  height: auto;
}

.company-photopair__caption {
  margin: 8px 0 0;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 16px;
  color: #414141;
  text-align: center;
  letter-spacing: 0.05em;
}

/* 関連リンク Grid（3×2） */
.company-links {
  position: relative;
  z-index: 2;
  width: 742px;
  max-width: calc(100% - 40px);
  margin: 120px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 239.3px));
  justify-content: center;
  gap: 10px 12px;
}

.company-links__card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  background: #fff;
  border: 2px solid var(--color-green);
  border-radius: 20px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 18px;
  color: #0E845C;
  text-align: center;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 0 12px;
  box-sizing: border-box;
  transition: border-color var(--transition), border-width var(--transition);
}

.company-links__card:hover {
  opacity: 1;
  border: 4px solid orange;
}

/* けんぞーくん＋戻るボタン（fixed・常時表示） */
.tobira-guide {
  position: fixed;
  bottom: 20%; /* フッターのロゴ・テキストと被らないよう引き上げ（PC向け。SPは下部メディアクエリで別途上書き） */
  left: var(--space-md);
  z-index: 3;
  width: 115px;
  height: 216px;
}

.tobira-guide__char {
  position: absolute;
  left: 50%;
  bottom: 64px;
  width: 115px;
  transform: translateX(-50%);
  display: none;
}

.tobira-guide__char.is-active {
  display: block;
}

.tobira-guide__btn {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 108px;
  border: 4px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(95deg, #0E845C 9.49%, #0867AE 94.76%) border-box;
  color: #0E845C;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tobira-guide__btn-line {
  display: block;
}

/* -----------------------------------------------
   レスポンシブ（768px以下 = SP）
   PCデザインをそのまま縮小する方針。装飾は簡略化、
   本文・タイムラインは可読性優先で調整。
----------------------------------------------- */
@media screen and (max-width: 768px) {
  .is-pc-only { display: none !important; }
  .is-sp-only { display: block !important; }

  .tobira-hero {
    height: 952px;
  }

  .tobira-hero__bg-bottom {
    top: 412px;
  }

  .tobira-frame {
    max-width: 390px;
  }

  /* SPは見出し＋導入文の開始位置を調整（旧#page-mv-titleのtop:85pxをラッパーへ移設） */
  .mv-textblock {
    top: 85px;
  }

  /* タイプJ：SPは画像が上・テキストが下（image_sideのleft/right指定に関わらず統一） */
  .company-chara,
  .company-chara--reverse {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .company-chara__img {
    flex: none;
  }

  .company-chara__intro {
    font-size: 22px;
  }

  .company-chara__body {
    font-size: 16px;
  }

  .company-mv-title.is-sp-only {
    transform: translateX(-50%);
    font-size: clamp(20px, 8.5vw, 32px);
    line-height: 1.3;
    white-space: normal;
    width: 90%;
  }

  .company-mv-desc.is-sp-only {
    transform: translateX(-50%);
    font-size: clamp(14px, 5.641vw, 16px);
    white-space: normal;
  }

  .company-header__label.is-sp-only {
    transform: translateX(-50%);
  }

  .company-header__title.is-sp-only {
    font-size: 24px;
    white-space: nowrap;
  }

  .company-container {
    width: 100%;
    max-width: calc(100% - 24px);
    margin-top: -413px; /* hero(952px)に対して再計算した重なり量 */
    padding: 40px 24px;
    gap: 60px;
  }

  .company-block {
    gap: 20px;
  }

  .company-block__heading {
    font-size: 20px;
  }

  .company-block__body {
    font-size: 16px;
    line-height: 1.7;
  }

  /* タイプG：SPは縦積みに変更 */
  .company-imgrow {
    flex-direction: column;
  }

  .company-links {
    width: 100%;
    max-width: calc(100% - 24px);
    margin-top: 60px;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .company-links__card {
    height: auto;
    min-height: 64px;
    padding: 10px;
    font-size: 15px;
  }

  .tobira-guide {
    bottom: var(--space-sm);
    left: var(--space-sm);
    width: 73px;
    height: 137px;
  }

  .tobira-guide__char {
    width: 73px;
    bottom: 40px;
  }

  .tobira-guide__btn {
    width: 68px;
    height: 68px;
    border-width: 3px;
    font-size: 10px;
  }
}
