/* ============================================
   「仕事を知ろう！」下層記事 共通テンプレートCSS
   FUJITA築育サイト

   このCSSは記事ページ全てで共通。記事ごとの差分はPHP側のデータ配列のみ。
   PCデザインのみ支給のため、SPはレイアウトを縮小・調整する形にしている
   （装飾は簡略化、本文・タイムラインは可読性を優先して調整）。
   ============================================ */

.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;
}

.work-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;
}

.work-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;
}

/* 記事ヘッダー：カテゴリラベル＋記事タイトル（緑背景に重なる白文字） */
.work-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;
}

.work-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;
}

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

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

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

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

.work-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;
}

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

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

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

.work-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;
}

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

/* タイプC：Q&Aアイコン型の見出し行 */
.work-block__wraptitle {
  display: flex;
  align-items: center;
  gap: 15px;
}

.work-block__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: #EDF9F5;
  border-radius: 50%;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 30px;
  color: #0E845C;
}

.work-block__wraptitle .work-block__heading {
  flex: 1 1 auto;
}

/* タイプA：box_title（見出しと本文の間の小見出し） */
.work-box__title {
  margin: 0 0 12px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 24px;
  color: #000;
  letter-spacing: 0.1em;
  line-height: 1.4;
}

/* タイプC：タイムライン */
.work-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-left: 0;
}

.work-timeline::before {
  content: '';
  position: absolute;
  left: 53px;
  top: 53px;
  bottom: 53px;
  width: 2px;
  background: #0E845C;
  z-index: 0;
}

.work-timeline__entry {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 24px;
}

.work-timeline__circle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 106px;
  height: 106px;
  border-radius: 50%;
  font-family: var(--font-main);
  text-align: center;
  box-sizing: border-box;
}

.work-timeline__circle--time {
  background: #fff;
  border: 2px solid #0E845C;
  color: #0E845C;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: 0.05em;
}

.work-timeline__circle--state {
  background: #EDF9F5;
  color: #0E845C;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.1em;
}

.work-timeline__text {
  flex: 1 1 auto;
}

.work-timeline__title {
  margin: 0 0 8px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 24px;
  color: #0E845C;
  letter-spacing: 0.1em;
}

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

/* 関連リンク Grid（3×2） */
.work-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;
}

.work-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);
}

.work-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:97.3pxをラッパーへ移設） */
  .mv-textblock {
    top: 97px;
  }

  .work-mv-title.is-sp-only {
    transform: translateX(-50%);
    font-size: clamp(24px, 10.256vw, 40px);
    line-height: 1.25;
    white-space: nowrap;
  }

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

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

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

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

  .work-block {
    gap: 20px;
  }

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

  .work-block__body,
  .work-timeline__body {
    font-size: 16px;
    line-height: 1.7;
  }

  .work-box__title {
    font-size: 19px;
  }

  /* タイムラインはSPで縦並び（circleの上にテキスト）に変更 */
  .work-timeline {
    gap: 30px;
  }

  .work-timeline::before {
    left: 35px;
  }

  .work-timeline__entry {
    align-items: flex-start;
    gap: 16px;
  }

  .work-timeline__circle {
    width: 70px;
    height: 70px;
  }

  .work-timeline__circle--time {
    font-size: 18px;
  }

  .work-timeline__circle--state {
    font-size: 14px;
  }

  .work-timeline__title {
    font-size: 19px;
  }

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

  .work-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;
  }
}
