/* ============================================================
   works.css
   活動実績ページ専用スタイル
   style.css の変数・共通クラスを継承して使用
============================================================ */

/* ============================================================
   スクリーンリーダー専用クラス（アクセシビリティ）
============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   現在ページのナビリンク（アクティブ表示）
============================================================ */
nav a.nav-current {
  color: var(--c-primary-deep);
  font-weight: 700;
}
nav a.nav-current::after {
  width: 70%; /* 下線を常時表示 */
}

/* ============================================================
   ページヒーロー
============================================================ */
.works-hero {
  padding: 9rem 2rem 5rem;
  background:
    linear-gradient(175deg, var(--c-bg-warm) 0%, var(--c-bg-soft) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 背景の装飾円（やわらかい雰囲気） */
.works-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(212, 160, 23, 0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.works-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.works-hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--c-ink);
  letter-spacing: 0.06em;
  margin-bottom: 1.2rem;
  line-height: 1.3;
}

.works-hero-lead {
  color: var(--c-ink-soft);
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  line-height: 2;
  max-width: 600px;
  margin: 0 auto;
}

/* 波形装飾 */
.works-hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--c-bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

/* ============================================================
   タイムラインセクション
============================================================ */
.works-timeline {
  padding: 1rem 0 6rem;
  background: var(--c-bg);
}

/* タイムラインリスト（縦線を持つレイアウト） */
.timeline-list {
  position: relative;
  list-style: none;
  padding: 0;
  max-width: 760px;
  margin: 0 auto;
}

/* タイムラインの縦線 */
.timeline-list::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  /* マーカー中央に縦線を合わせる（マーカー幅 44px の中心） */
  left: 22px;
  width: 2px;
  background: linear-gradient(to bottom, var(--c-primary-soft), var(--c-line));
  border-radius: 2px;
}

/* 各タイムラインアイテム */
.timeline-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.8rem;
  position: relative;
}

/* 最後のアイテムの余白を調整 */
.timeline-item:last-child {
  margin-bottom: 0;
}

/* ---- タイムラインマーカー（アイコン丸） ---- */
.timeline-marker {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-primary-soft);
  border: 3px solid var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-primary-deep);
  font-size: 1rem;
  position: relative;
  z-index: 1; /* 縦線より前面 */
  box-shadow: 0 4px 12px rgba(212, 160, 23, 0.2);
  /* マーカーを縦線に揃えるためのマージン */
  margin-top: 0.2rem;
}

/* 最新アイテムのマーカーを強調 */
.timeline-item.is-latest .timeline-marker {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(212, 160, 23, 0.4);
}

/* ---- タイムラインカード ---- */
.timeline-card {
  flex: 1;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 1.6rem 1.8rem;
  box-shadow: 0 4px 16px rgba(59, 48, 32, 0.06);
  transition: box-shadow 0.3s, transform 0.3s;
  min-width: 0; /* flex 子要素の折り返し対策 */
}

.timeline-card:hover {
  box-shadow: 0 8px 28px rgba(212, 160, 23, 0.14);
  transform: translateY(-2px);
}

/* ハイライトカード（大分の取り組み） */
.timeline-card.is-highlight {
  background: linear-gradient(135deg, var(--c-bg-warm) 0%, var(--c-paper) 100%);
  border-color: var(--c-primary-soft);
  border-width: 2px;
  box-shadow: 0 6px 24px rgba(212, 160, 23, 0.16);
}

/* カードヘッダー */
.timeline-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  margin-bottom: 1rem;
}

/* 年号タグ */
.timeline-year {
  display: inline-block;
  background: var(--c-primary-pale);
  color: var(--c-primary-deep);
  font-family: var(--f-hand);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.75rem;
  border-radius: 99px;
  white-space: nowrap;
}

/* 活動タイトル */
.timeline-title {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.5;
  flex: 1 1 100%; /* 年号の下に折り返す */
}

/* 新着バッジ */
.timeline-badge {
  display: inline-block;
  background: var(--c-warm);
  color: #fff;
  font-family: var(--f-hand);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.65rem;
  border-radius: 99px;
  vertical-align: middle;
}

/* カード内の画像 */
.timeline-figure {
  margin: 0 0 1.2rem;
  border-radius: var(--r-sm);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--c-bg-warm);
}

.timeline-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.timeline-card:hover .timeline-figure img {
  transform: scale(1.03);
}

/* 画像なしカードは上部の余白を調整 */
.timeline-card.no-image .timeline-card-header {
  margin-bottom: 0.8rem;
}

/* カード本文 */
.timeline-desc {
  color: var(--c-ink-soft);
  font-size: 0.95rem;
  line-height: 2;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 外部リンクエリア */
.timeline-link {
  margin-top: 1.2rem;
}

/* 小サイズのボタン（既存 btn-outline にサイズ上書き） */
.btn-sm {
  padding: 0.5rem 1.2rem !important;
  font-size: 0.82rem !important;
}

/* ============================================================
   アコーディオン
   PC（769px以上）  ：ボタンを非表示にし、本文を常時表示
   スマホ（768px以下）：ボタン表示・タップで開閉
============================================================ */
.accordion {
  margin-top: 1rem;
  border-top: 1px solid var(--c-line);
  padding-top: 0.9rem;
}

/* ---- PC：ボタン非表示・本文を常時表示 ---- */
@media (min-width: 769px) {

  /* ボタンを完全に非表示（スペースも消す） */
  .accordion-toggle {
    display: none;
  }

  /* 本文は hidden 属性に関わらず常時表示 */
  .accordion-body {
    display: block !important; /* hidden を上書き */
  }
}

/* ---- スマホ：開閉ボタン表示 ---- */
@media (max-width: 768px) {

  /* アコーディオン開閉ボタン */
  .accordion-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0;
    color: var(--c-primary-deep);
    font-family: var(--f-japanese);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: opacity 0.2s;
    /* タップしやすい最小サイズ確保 */
    min-height: 44px;
  }

  .accordion-toggle:hover {
    opacity: 0.75;
  }

  /* アコーディオンアイコン（開閉でアニメーション） */
  .accordion-icon {
    font-size: 0.82rem;
    transition: transform 0.3s ease;
  }

  /* 展開時はアイコンを180度回転 */
  .accordion-toggle[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
  }

  /* 本文：初期状態は非表示（hidden属性をJSで制御） */
  .accordion-body[hidden] {
    display: none;
  }

  /* 展開時のアニメーション */
  .accordion-body:not([hidden]) {
    animation: accordionOpen 0.25s ease;
  }
}

/* 本文の共通スタイル（PC・スマホ共通） */
.accordion-body {
  padding: 0.8rem 0 0.4rem;
}

.accordion-body p {
  color: var(--c-ink-soft);
  font-size: 0.95rem;
  line-height: 2;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 外部リンクのマージン（アコーディオン内） */
.accordion-body .timeline-link {
  margin-top: 1.2rem;
}

@keyframes accordionOpen {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   CTAセクション（ページ下部）
============================================================ */
.works-cta {
  padding: 5rem 0 6rem;
  background: var(--c-bg-warm);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 背景装飾 */
.works-cta::before {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(139, 175, 106, 0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.works-cta-inner {
  position: relative;
  z-index: 1;
}

.works-cta-btns {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* LINEボタン（index.phpに合わせたスタイル） */
.btn-line {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 2.4rem;
  background: #06C755;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 99px;
  letter-spacing: 0.1em;
  transition: all 0.3s;
  box-shadow: 0 6px 20px rgba(6, 199, 85, 0.3);
}
.btn-line:hover {
  background: #05b34e;
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(6, 199, 85, 0.4);
}
.btn-line i { font-size: 1.15rem; }

/* ============================================================
   写真ごとの個別調整
   object-position で見せたい部分を指定する。
   書き方例：
     object-position: center top;    （上寄り）
     object-position: center bottom; （下寄り）
     object-position: center 30%;    （上から30%の位置）
     object-position: left center;   （左寄り）
   aspect-ratio を上書きして縦横比を変えることも可能。
============================================================ */

/* ① 料理代行 */
.fig-cooking img {
  object-position: center 60%;
}

/* ② いどばた食堂 カフネ */
.fig-shokudou img {
  object-position: center 30%;
}

/* ③ PULMO 講師登壇 */
.fig-pulmo img {
  object-position: center top;
}

/* ④ 品川区 研修・講師 */
.fig-kousi img {
  object-position: center center;
}

/* ⑤ 品川子育てメッセ 実行委員 */
.fig-iinn img {
  object-position: center center;
}

/* ⑥ 大分での新たな取り組み */
.fig-ooita img {
  object-position: right 20%;
}
@media (max-width: 768px) {

  /* ヒーロー */
  .works-hero {
    padding: 8rem 1.6rem 4rem;
  }

  /* タイムライン縦線位置（マーカー幅に合わせて調整） */
  .timeline-list::before {
    left: 20px;
  }

  .timeline-item {
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .timeline-marker {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .timeline-card {
    padding: 1.2rem 1.2rem;
  }

  /* CTAボタンを縦並びに */
  .works-cta-btns {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 340px;
    margin-inline: auto;
  }
  .works-cta-btns .btn-line,
  .works-cta-btns .btn-cta {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   レスポンシブ（スマホ）
============================================================ */
@media (max-width: 480px) {

  /* タイムラインカードを縦積み（マーカーをカードの上に） */
  .timeline-item {
    flex-direction: column;
    gap: 0.6rem;
  }

  /* スマホでは縦線を非表示にして、カードをフル幅に */
  .timeline-list::before {
    display: none;
  }

  .timeline-marker {
    align-self: flex-start;
  }

  .timeline-card {
    padding: 1rem 1rem;
  }

  .works-hero-title {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .works-hero {
    padding: 8rem 1.25rem 3.5rem;
  }

  .works-cta {
    padding: 4rem 1.25rem 5rem;
  }
}
