/* ==========================================================================
   css/components.css
   再利用コンポーネント（全ページ共通）
   MIRAIE PROJECT | 株式会社IKIpuro コーポレートサイト
   ガイドライン v1.2 準拠 / 設定シート 4.1章 対応
   ========================================================================== */


/* ──────────────────────────────────────────────────────────────────────────
   1. .btn — ボタン
   用途: 全ページの CTA ボタン
   バリアント: .btn--primary（緑背景・白文字）
   ────────────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: 12px 36px; /* 要調整 */
  border-radius: 999px; /* 要調整（XD がパス描き） */
  font-family: var(--font-base);
  font-size: var(--fs-sm); /* 16px */
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.8;
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn--primary::after {
  content: '→';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--color-white);
  color: var(--color-primary);
  font-size: 14px;
  margin-left: var(--sp-xs);
  flex-shrink: 0;
}


/* ──────────────────────────────────────────────────────────────────────────
   2. .section-title — セクション大見出し
   用途: 各セクションの h2/h3 タイトル（緑・中央揃え）
   セット: 直後に .section-title-line を置く
   ────────────────────────────────────────────────────────────────────────── */

.section-title {
  color: var(--color-primary);
  font-size: var(--fs-xl); /* 30px */
  font-weight: 700;
  line-height: var(--lh-loose); /* 44px */
  text-align: center;
  letter-spacing: 0.05em;
}


/* ──────────────────────────────────────────────────────────────────────────
   3. .section-title-line — 見出し装飾線
   用途: .section-title 直下の黄緑波線（画像）
   画像: images/common/section-title-line.png
   ────────────────────────────────────────────────────────────────────────── */

.section-title-line {
  display: block;
  width: 180px;  /* 要調整 */
  height: 14px;  /* 要調整（画像の高さに合わせる） */
  margin-inline: auto;
  margin-top: var(--sp-xs);
  margin-bottom: var(--sp-lg);
}


/* ──────────────────────────────────────────────────────────────────────────
   4. .badge — カテゴリバッジ
   用途: お知らせリスト行のカテゴリ表示
   構造: <span class="badge">お知らせ</span>
   ────────────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px; /* 要調整 */
  border-radius: 999px; /* 要調整 */
  font-size: 14px;
  font-weight: 500;
  line-height: var(--lh-tight); /* 24px */
  white-space: nowrap;
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none; 
}


/* ──────────────────────────────────────────────────────────────────────────
   5. .news-item — お知らせリスト行
   用途: TOP お知らせセクション・お知らせ一覧ページ
   構造:
     <li class="news-item">
       <div class="news-item-meta">
         <time class="news-item-date">yyyy/mm/dd</time>
         <span class="news-item-badges">
           <span class="badge">お知らせ</span>
           <span class="badge">カテゴリ</span>
         </span>
       </div>
       <a href="..." class="news-item-title">タイトルテキスト</a>
     </li>
   ────────────────────────────────────────────────────────────────────────── */

.news-item {
  padding-block: var(--sp-md); /* 24px */
  border-bottom: 1px dashed var(--color-primary);
}

.news-item:first-child {
  border-top: 1px dashed var(--color-primary);
}

.news-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-xs) var(--sp-sm);
  margin-bottom: var(--sp-xs);
}

.news-item-date {
  color: var(--color-primary);
  font-size: var(--fs-sm); /* 16px */
  font-weight: 700;
  line-height: var(--lh-tight); /* 24px */
  white-space: nowrap;
}

.news-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
}

.news-item-title {
  display: block;
  color: var(--color-primary);
  font-size: var(--fs-sm); /* 16px */
  line-height: var(--lh-base); /* 29px */
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-item-title:hover {
  opacity: 0.7;
}


.site-header--subpage::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 120px;
  background-color: var(--color-white);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* ──────────────────────────────────────────────────────────────────────────
   6. .page-hero — 下層ページ共通ヒーロー帯
   用途: vision / project / partner ページのヒーロー写真＋タイトル
   構造:
     <section class="page-hero">
       <div class="page-hero-bg">
         <img src="..." alt="">
         <div class="page-hero-overlay"></div>
       </div>
       <h1 class="page-hero-title">ページタイトル</h1>
     </section>
   確定値: オーバーレイ linear-gradient(to bottom, #FBF9EB00, #FBF9EB)
   要調整: clip-path の数値
   ────────────────────────────────────────────────────────────────────────── */

.page-hero {
  position: relative;
}

/* 写真＋下端カーブ */
.page-hero-bg {
  position: relative;
  overflow: hidden;
}

.page-hero-bg img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

/* 写真下部グラデーションオーバーレイ */
.page-hero-overlay {
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 70%, var(--color-bg-sub) 100%);
}

.page-hero-curve {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background-color: var(--color-white);
  clip-path: ellipse(55% 100% at 50% 0%);
  z-index: 1;
}

/* ページタイトル（写真上に中央揃えで重ねる） */
.page-hero-title {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-white);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: var(--lh-loose);
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}


/* ──────────────────────────────────────────────────────────────────────────
   7. .nav-overlay — ハンバーガーメニュー（右ドロワー）
   用途: 全ページ共通のSPドロワーナビ
   JS: .js-menu-toggle クリック → body に .is-menu-open を付与
       aria-hidden="true" ↔ "false" を切り替える
   構造:
     <nav id="nav-overlay" class="nav-overlay" aria-hidden="true">
       <div class="nav-overlay-inner"> ... </div>
     </nav>
   ────────────────────────────────────────────────────────────────────────── */

/* 全画面バックドロップ（body.is-menu-open 時に表示） */
body.is-menu-open::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  background-color: rgba(0, 0, 0, 0.4);
}

.nav-overlay {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
  width: min(340px, 90vw); /* 要調整 */
  height: 100%;
  background-color: #f5f5f5;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  /* 非表示時はフォーカストラップ外に */
  visibility: hidden;
}

.nav-overlay[aria-hidden="false"] {
  transform: translateX(0);
  visibility: visible;
}

.nav-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-md) var(--sp-md) var(--sp-xl);
  gap: var(--sp-md);
}

/* ドロワー内ロゴ */
.nav-overlay-logo {
  width: 100px; /* 要調整 */
}

/* 閉じるボタン（×）右上配置 */
.nav-overlay-close {
  position: absolute;
  top: var(--sp-md);
  right: var(--sp-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  font-size: 24px;
  line-height: 1;
}

/* ナビリスト */
.nav-overlay-list {
  width: 100%;
}

.nav-overlay-item {
  border-bottom: none;
}

.nav-overlay-item > a {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-text);
}

/* 親項目の緑丸矢印 */
.nav-overlay-item--parent > a::before {
  content: '→';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: 12px;
  flex-shrink: 0;
}

.nav-overlay-item--parent > a::after {
  display: none;
}

/* サブメニュー */
.nav-overlay-sub {
  padding-left: var(--sp-md);
  padding-bottom: var(--sp-xs);
}

.nav-overlay-sub li a {
  display: block;
  padding: 6px 0;
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.nav-overlay-sub li a::before {
  content: 'ー';
  margin-right: 4px;
  color: var(--color-text);
}

/* CTA ボタン */
.nav-overlay-cta {
  margin-top: var(--sp-sm);
  width: 100%;
  max-width: 240px; /* 要調整 */
}


/* ──────────────────────────────────────────────────────────────────────────
   8. .btn-top — ページトップへ戻るボタン
   用途: 全ページ右下固定
   JS: スクロール量に応じて .is-visible を付与
   構造:
     <a href="#" class="btn-top js-btn-top" aria-label="ページトップへ戻る">
       <span class="btn-top-icon" aria-hidden="true">▲</span>
       <span class="btn-top-label">TOP</span>
     </a>
   ────────────────────────────────────────────────────────────────────────── */

.btn-top {
  position: fixed;
  right: var(--sp-sm);
  bottom: var(--sp-md);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: #6b6b6b;
  color: var(--color-white);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.btn-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.btn-top:hover {
  opacity: 0.8;
}

.btn-top-icon {
  font-size: 14px;
  line-height: 1;
}

.btn-top-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
}


/* ──────────────────────────────────────────────────────────────────────────
   9. .footer-photo — フッター直前の田園風景写真
   ────────────────────────────────────────────────────────────────────────── */

.footer-photo {
  position: relative;
  line-height: 0;
}

.footer-photo-curve {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background-color: var(--color-bg-sub);
  clip-path: ellipse(55% 100% at 50% 0%);
  z-index: 1;
}

.footer-photo img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}


/* ──────────────────────────────────────────────────────────────────────────
   10. .site-footer — フッター
   用途: 全ページ共通フッター（コピーライトのみ）
   ────────────────────────────────────────────────────────────────────────── */

.site-footer {
  padding-block: var(--sp-md);
  text-align: center;
  background-color: #6b6b6b;
}

.site-footer-copy {
  font-size: 14px;
  font-weight: 400;
  line-height: var(--lh-tight);
  color: var(--color-white);
}


/* ──────────────────────────────────────────────────────────────────────────
   10. .vision-card — ビジョンリンクカード
   用途: TOPヒーローセクションのカードボタン（2枚横並び）
   構造:
     <a href="..." class="vision-card">
       <div class="vision-card-img">
         <img src="..." alt="">
       </div>
       <div class="vision-card-body">
         <span class="vision-card-label">テキスト</span>
         <span class="vision-card-arrow" aria-hidden="true">→</span>
       </div>
     </a>
   ────────────────────────────────────────────────────────────────────────── */

.vision-card {
  display: flex;
  align-items: stretch;
  flex: 1 1 100%;         /* 2枚均等分割 */
  height: 80px;         /* 要調整 */
  background-color: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: opacity 0.2s;
  width: 100%;
}

.vision-card:hover {
  opacity: 0.8;
}

/* 写真エリア（カード高さいっぱい） */
.vision-card-img {
  position: relative;
  width: 35%; /* 要調整: カード幅の約1/3〜1/2 */
  flex-shrink: 0;
  overflow: hidden;
}

.vision-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* 写真右端フェード（写真色 → 白） */
.vision-card-img::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 48px; /* 要調整 */
  height: 100%;
  background: linear-gradient(to right, transparent, #FFFFFF);
  pointer-events: none;
}

/* テキスト＋矢印エリア */
.vision-card-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-xs);
  padding: 0 var(--sp-sm);
}

/* ラベルテキスト */
.vision-card-label {
  font-size: var(--fs-sm); /* 16px */
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--color-primary);
  text-align: left;
  white-space: nowrap;
}

/* 丸囲み矢印アイコン */
.vision-card-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #FFFFFF;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  color: var(--color-primary);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}


/* ──────────────────────────────────────────────────────────────────────────
   11. .content-card — 白カード（共通）
   用途: vision代表メッセージ・projectページ等の白背景カード
   ────────────────────────────────────────────────────────────────────────── */
.content-card {
  background-color: var(--color-white);
  border-radius: 20px;
  padding: var(--sp-xl);
  width: 100%;
  display: block;
  overflow: visible;
}

@media (max-width: 767px) {
  .content-card {
    padding: var(--sp-md);
  }
}


/* ──────────────────────────────────────────────────────────────────────────
   12. .sns-icons — SNSアイコン
   用途: トップページ お知らせセクション / news/index.html
   ────────────────────────────────────────────────────────────────────────── */
.sns-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
  margin-top: var(--sp-lg);
}

.sns-icons a {
  display: block;
  transition: opacity 0.2s;
}

.sns-icons a:hover {
  opacity: 0.7;
}

.sns-icons img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}


/* ──────────────────────────────────────────────────────────────────────────
   13. .news-filter — お知らせカテゴリフィルター
   用途: index.html お知らせセクション / news/index.html
   ────────────────────────────────────────────────────────────────────────── */
.news-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-md);
}

.news-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  background-color: transparent;
  color: var(--color-primary);
  font-family: var(--font-base);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.news-filter-btn:hover,
.news-filter-btn.is-active {
  background-color: var(--color-primary);
  color: var(--color-white);
}

@media (max-width: 767px) {
  .news-filter-btn {
    font-size: 14px;
    padding: 5px 14px;
  }
}
