/* ==========================================================================
   PROJECTS Section (2-Header / 4-Grid)
   ========================================================================== */

.project-wrapper {
  width: 100%;
  /* 全体を包む枠線や影をつけるならここ */
  /* box-shadow: var(--shadow-lg); border-radius: var(--radius-lg); overflow: hidden; */
}

/* --- 事業紹介カードのレイアウト調整 --- */
.project-headers-row {
  display: flex;
  gap: 30px;
  margin-bottom: 30px;
}

.p-header {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s;
  border-radius: 10px;
}

.p-header:hover {
  transform: translateY(-5px);
}

/* 画像エリア */
.p-header__img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
}

/* テキストを包む要素（余白を統一） */
.p-header__inner {
  padding: 30px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  border-top: 5px solid transparent; /* 色の線用 */
}

.p-header__en {
  font-family: var(--font-en);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #999;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.p-header__jp {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: block;
}

.p-header__desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #666;
  flex-grow: 1; /* テキスト量にかかわらずボタンの位置を揃える */
}

/* 各事業のアクセントカラー（ボーダー） */
.p-header--labor {
  border-top-color: var(--color-labor);
}
.p-header--grassroots {
  border-top-color: var(--color-grassroots);
}
.p-header--training {
  border-top-color: var(--color-training);
}
.p-header--pr {
  border-top-color: var(--color-pr);
}

/* スマホ対応 */
@media (max-width: 900px) {
  .project-headers-row {
    flex-direction: column;
  }
}

.c-btn--outline {
  /* ベースはMSFボタンと同じ構造 */
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 260px;
  padding: 10px 20px 10px 30px;

  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

.c-btn--outline .btn-icon {
  /* アイコン部分は透明背景で枠線なし */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #fff;
  color: var(--navy);
  border-radius: 50%;
  font-size: 0.9rem;
}

.c-btn--outline:hover {
  background: #fff;
  color: var(--navy);
}

@media (max-width: 900px) {
  .c-btn--outline {
    width: 240px; /* 少しスリムに */
  }
}

@media (max-width: 768px) {
  /* ボタン本体 */
  .c-btn--outline,
  .c-btn--msf {
    width: 100%; /* スマホでは幅いっぱい */
    max-width: 300px; /* でも広がりすぎないように */
    padding: 10px 15px 10px 25px;
  }

  .c-btn--outline .btn-icon {
    width: 32px;
    height: 32px;
  }
}

/* --- 下段：画像グリッド行 --- */
.project-images-row {
  display: flex;
  width: 100%;
  height: 450px; /* 画像エリアの高さ */
}

/* 個別のカード（4分割） */
.p-card {
  width: 25%; /* 4分割 */
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  /* カード間の白い線を少し入れる（お好みで0でもOK） */
}

.p-card2 {
  width: 50%; /* 4分割 */
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  /* カード間の白い線を少し入れる（お好みで0でもOK） */
}

.p-card:last-child {
  border-right: none;
}

/* 背景画像 */
.p-card__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
  z-index: 1;
}

/* オーバーレイ（通常時の色） */
.p-card__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3); /* 最初は薄暗く */
  z-index: 2;
  transition: background 0.4s ease;
}

/* コンテンツ */
/* --- プロジェクトカード内のコンテンツ --- */
.p-card__content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 20px;
  width: 100%;
  transition: transform 0.4s ease;

  /* ボタンを中央に配置 */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.p-card__content .sub {
  display: block;
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.9;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.p-card__content .title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

/* --- 詳細ボタン（初期状態は隠す） --- */
.p-card-btn {
  margin-top: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;

  /* カード内用にサイズ調整 */
  width: 200px;
  padding: 10px 20px 10px 30px;
  font-size: 0.8rem;
}

/* =========================================
   ホバーアクション
   ========================================= */

/* 1. 画像ズーム */
.p-card:hover .p-card__bg {
  transform: scale(1.1);
}

.p-card2:hover .p-card__bg {
  transform: scale(1.1);
}

/* 2. オーバーレイを濃くする（テーマカラー反映） */
.p-card--navy:hover .p-card__overlay {
  background: rgba(15, 45, 84, 0.85);
}
.p-card--orange:hover .p-card__overlay {
  background: rgba(198, 40, 40, 0.85);
}

/* 3. テキスト全体を少し上に移動 */
.p-card:hover .p-card__content {
  transform: translateY(-10px);
}

/* 4. ボタンを出現させる（色は変えず枠線のまま） */
.p-card:hover .p-card-btn {
  opacity: 1;
  transform: translateY(0);
}

.p-card2:hover .p-card__content {
  transform: translateY(-10px);
}

/* 4. ボタンを出現させる（色は変えず枠線のまま） */
.p-card2:hover .p-card-btn {
  opacity: 1;
  transform: translateY(0);
}

/* --- Mobile Responsive --- */
@media (max-width: 900px) {
  .project-wrapper {
    display: flex;
    flex-direction: column;
  }

  /* ヘッダーも縦並びにするか、横並びのまま小さくするか */
  /* ここでは「見出し」として機能させるため縦並びに変更 */

  /* もしヘッダーを表示するなら */
  .project-headers-row {
    flex-direction: column;
  }
  .p-header {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  /* 画像エリア */
  .project-images-row {
    flex-wrap: wrap; /* 折り返し許可 */
    height: auto;
  }

  .p-card {
    width: 50%; /* スマホ・タブレットは2列 */
    height: 250px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  }

  .p-card2 {
    width: 100%; /* スマホ・タブレットは2列 */
    height: 250px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  }
}

@media (max-width: 768px) {
  .p-card {
    width: 100%; /* 小さいスマホは1列 */
  }
}
/* ==========================================================================
   Card Button Responsive (.p-card-btn)
   ========================================================================== */

/* --- タブレット・中画面 (900px以下) --- */
@media (max-width: 900px) {
  .p-card-btn {
    /* スマホ・タブレットではホバーを待たずに最初から表示させる */
    opacity: 1 !important;
    transform: translateY(0) !important;

    width: 180px; /* 少しコンパクトに */
    margin-top: 15px;
  }
}

/* --- スマホ (768px以下) --- */
@media (max-width: 768px) {
  .p-card-btn {
    width: 100% !important;
    max-width: 220px;
    padding: 8px 10px 8px 18px;
    font-size: 0.85rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
  }

  .p-card-btn .btn-icon {
    width: 28px;
    height: 28px;
  }

  .p-header__inner {
    padding: 20px 15px;
  }

  .p-header__jp {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  .p-header__desc {
    font-size: 0.875rem;
  }
}

/* ==========================================================================
   Logic Diagram (積み上げ型ロジック図)
   ========================================================================== */

.logic-diagram {
  max-width: 900px;
  margin: 60px auto;
  font-family: var(--font-jp);
  text-align: center;
}

/* --- 共通パーツ --- */
.logic-level {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

/* 矢印（縦の一本線） */
.logic-arrow-up {
  width: 2px;
  height: 30px;
  background: #ccc;
  margin: 0 auto 10px;
  position: relative;
}
.logic-arrow-up::after {
  content: "▲";
  color: #ccc;
  font-size: 10px;
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
}

/* --- LEVEL 4: GOAL (ゴール) --- */
.box-goal {
  background: #fff;
  border: 4px solid var(--color-labor);
  padding: 20px 40px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(22, 88, 160, 0.1);
  position: relative;
  z-index: 2;
}

.goal-title {
  color: var(--color-labor);
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0 0 5px;
}

.goal-sub {
  font-size: 1.1rem;
  font-weight: 700;
  color: #555;
  margin: 0;
}

/* --- LEVEL 3: CORE (核心) --- */
.box-core {
  background: var(--color-labor);
  color: #fff;
  padding: 25px;
  border-radius: 50%; /* 円形にする */
  width: 280px;
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  position: relative;
}

/* 円の周りの「ぼんやりした光」で重要感を出す */
.box-core::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border: 2px dashed rgba(22, 88, 160, 0.3);
  border-radius: 50%;
  animation: spin 20s linear infinite;
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.core-label {
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.core-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 15px;
  line-height: 1.2;
}

.core-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tag-action {
  background: #fff;
  color: var(--color-labor);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 4px;
}

.core-desc {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* --- Connector (活動から核への矢印) --- */
.logic-connector-group {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 40px;
  margin-bottom: -10px; /* 下の要素に被せる */
  position: relative;
  z-index: 1;
}

/* 左右から中央へ集まる線 */
.connector-line {
  flex: 1;
  border-top: 2px solid #ccc;
  height: 100%;
  margin: 0 20px;
  position: relative;
}
/* 線の端っこに縦線を入れる */
.connector-line::before {
  content: "";
  position: absolute;
  top: 0;
  width: 2px;
  height: 20px;
  background: #ccc;
}
/* 左側の線の左端 */
.logic-connector-group .connector-line:first-child::before {
  left: 0;
}
/* 右側の線の右端 */
.logic-connector-group .connector-line:last-child::before {
  right: 0;
}

.connector-center i {
  color: #ccc;
  font-size: 1.2rem;
  background: #fff;
  padding: 0 10px;
  position: relative;
  top: -10px;
}

/* --- LEVEL 2: ACTIONS (活動) --- */
.level-actions {
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 20px;
}

.action-group {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  position: relative;
}

/* グループごとの色分け線 */
.group-purple {
  border-top: 4px solid #6a1b9a;
}
.group-blue {
  border-top: 4px solid var(--color-labor);
}

.action-box {
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  color: #555;
  /* 幅を揃える */
  flex: 1 1 40%;
}

/* --- LEVEL 1: BASE (土台) --- */
.level-base {
  gap: 10px;
}

.base-box {
  background: #666; /* どっしりした色 */
  color: #fff;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 0.95rem;
  min-width: 200px;
}

/* --- スマホ対応 --- */
@media screen and (max-width: 768px) {
  /* 縦積みに変更 */
  .logic-diagram {
    display: flex;
    flex-direction: column-reverse; /* 土台(Lv1)を一番下に、ゴール(Lv4)を一番上に */
    gap: 20px;
  }

  /* 各レベルの並び順もリセット */
  .logic-level {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0;
  }

  /* 矢印関連のリセット */
  .logic-arrow-up,
  .logic-connector-group {
    display: none; /* 複雑な矢印は消して、単純な隙間で表現 */
  }

  /* 簡易的な下向き矢印（スマホ用）を追加 */
  .logic-level::before {
    content: "▼"; /* 上の要素から下の要素への流れ */
    color: #ddd;
    font-size: 0.8rem;
    margin: 10px 0;
  }
  /* 一番上のゴールの上には矢印いらない */
  .level-goal::before {
    display: none;
  }
  /* 一番下の土台の下には矢印いらない */
  .level-base::before {
    display: none;
  }

  /* 要素のサイズ調整 */
  .box-core {
    width: 220px;
    height: 220px;
    padding: 15px;
  }
  .core-title {
    font-size: 1.3rem;
  }

  .level-actions {
    gap: 20px;
  }
  .action-group {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ==========================================================================
   Archive Bookshelf (出版物リスト)
   ========================================================================== */

.archive-shelf {
  display: flex;
  flex-wrap: wrap;
  gap: 40px; /* 本と本の間隔 */
  margin-top: 30px;
}

.archive-book {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  width: 180px; /* 本の幅 */
  transition: transform 0.3s;
}

.archive-book:hover {
  transform: translateY(-10px); /* ホバーで少し浮く */
}

/* 本の表紙エリア */
.book-cover {
  width: 100%;
  /* A4比率に近い縦横比を確保（画像がなくても崩れないように） */
  aspect-ratio: 210 / 297;
  background: #f0f0f0;
  margin-bottom: 15px;
  position: relative;
  border-radius: 2px 4px 4px 2px; /* 本っぽい角丸 */
  box-shadow:
    5px 5px 15px rgba(0, 0, 0, 0.15),
    /* 全体の影 */ inset 3px 0 10px rgba(0, 0, 0, 0.05); /* 背表紙側の陰影 */
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* PDFバッジ（右上に小さく） */
.pdf-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #d32f2f; /* PDFカラー */
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-bottom-left-radius: 4px;
}

/* タイトルテキスト */
.book-title {
  color: #333;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.archive-book:hover .book-title {
  color: var(--jilaf); /* ブランドカラー */
  border-bottom-color: var(--jilaf);
}

/* スマホ対応 */
@media (max-width: 600px) {
  .archive-shelf {
    justify-content: space-between; /* 左右に配置 */
    gap: 20px;
  }
  .archive-book {
    width: 48%; /* 2列表示 */
  }
}
