/* 研究支援実績ページ共通スタイル（styles.css の後に読み込む） */
:root {
  --ink-soft: #486176;
  --tint: #eaf3f6;
  --tint-line: #c6dce5;
  --panel: #e9eff2;
  --navy: #0e2237;
}

body { background: var(--surface); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.skip-link { position: absolute; top: -80px; left: 16px; padding: 12px; background: white; z-index: 100; }
.skip-link:focus { top: 12px; }

/* ヘッダー */
.research-nav { display: flex; gap: 24px; font-size: 13px; font-weight: 700; }
.research-nav a:hover, .back-link:hover { color: var(--brand-deep); text-decoration: underline; }

/* ヒーロー */
.case-hero { padding: 48px 0 72px; background: linear-gradient(120deg, #e8f0f3, #f6f9fa 70%); border-bottom: 1px solid #cddde3; }
.breadcrumb { margin: 0 0 40px; font-size: 12px; color: var(--muted); }
.case-hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 64px; align-items: start; }
.case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; }
.case-no { font: 500 13px/1 var(--label-font); color: var(--brand-deep); letter-spacing: .12em; }
.case-field { padding: 5px 12px; border: 1px solid #abc4d0; border-radius: 3px; font-size: 12px; color: #3d6276; }
.case-hero h1 { margin: 22px 0 24px; font-size: clamp(28px, 3.3vw, 46px); line-height: 1.45; letter-spacing: -.02em; }
.case-hero .lead { margin: 0; max-width: 680px; color: var(--ink-soft); line-height: 2; }
.case-card { margin: 0; padding: 28px; background: #ffffffd0; border: 1px solid var(--tint-line); border-radius: 6px; box-shadow: 0 16px 48px #0e22370a; }
.case-card div + div { margin-top: 18px; padding-top: 18px; border-top: 1px solid #dce5e9; }
.case-card dt { font: 500 11px/1 var(--label-font); color: var(--brand-deep); letter-spacing: .1em; }
.case-card dd { margin: 8px 0 0; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li { font-size: 11px; padding: 4px 9px; background: #eff5f7; color: #3d6276; border-radius: 2px; }

/* セクション共通 */
.case-section { padding: 88px 0; scroll-margin-top: 90px; }
.case-section.is-tinted { background: var(--panel); }
.case-section h2 { font-size: clamp(26px, 3vw, 38px); }
.section-intro { max-width: 760px; margin: 20px 0 40px; color: var(--ink-soft); line-height: 1.95; }

/* 背景と課題 */
.challenge-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.challenge-layout .section-intro { margin-bottom: 0; }
.challenge-list { margin: 0; padding: 0; list-style: none; counter-reset: challenge; }
.challenge-list li { position: relative; padding: 22px 0 22px 56px; border-top: 1px solid #d3e0e6; counter-increment: challenge; }
.challenge-list li:last-child { border-bottom: 1px solid #d3e0e6; }
.challenge-list li::before { content: counter(challenge, decimal-leading-zero); position: absolute; left: 0; top: 24px; font: 500 14px/1 var(--label-font); color: var(--accent); }
.challenge-list strong { display: block; font-size: 17px; }
.challenge-list span { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-soft); }

/* 処理構成（入力→処理→出力） */
.pipeline { display: grid; grid-template-columns: 1fr auto 1.5fr auto 1fr; align-items: stretch; margin: 0; }
.stage { padding: 24px; background: white; border: 1px solid var(--tint-line); border-radius: 4px; }
.stage.is-core { border: 2px solid var(--brand); }
.stage h3 { margin: 0 0 16px; font: 500 12px/1 var(--label-font); color: var(--brand-deep); letter-spacing: .12em; }
.stage ul, .stage ol { margin: 0; padding: 0; list-style: none; }
.stage li { padding: 10px 0; font-size: 14px; font-weight: 700; line-height: 1.5; }
.stage li + li { border-top: 1px dashed #d3e0e6; }
.stage li small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--muted); }
.stage ol { counter-reset: step; }
.stage ol li { position: relative; padding-left: 34px; counter-increment: step; }
.stage ol li::before { content: counter(step); position: absolute; left: 0; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: white; font: 500 12px/22px var(--label-font); text-align: center; }
.pipe-arrow { display: flex; align-items: center; justify-content: center; width: 40px; color: var(--brand); font-size: 20px; }
.pipeline-note { margin: 18px 0 0; font-size: 12px; color: var(--muted); }

/* 開発のポイント */
.point-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.point { padding: 32px; background: white; border: 1px solid #d3e0e6; border-radius: 4px; }
.point-no { margin: 0 0 14px; font: 500 12px/1 var(--label-font); color: var(--brand-deep); letter-spacing: .1em; }
.point h3 { margin: 0 0 14px; font-size: 20px; line-height: 1.5; }
.point p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.9; }
.point .tags { margin-top: 20px; }

/* 技術構成 */
.stack { width: 100%; border-collapse: collapse; background: white; border: 1px solid #d3e0e6; }
.stack th, .stack td { padding: 16px 20px; border-bottom: 1px solid #dce5e9; text-align: left; vertical-align: top; font-size: 14px; }
.stack thead th { background: var(--tint); font: 500 12px/1.4 var(--label-font); color: var(--brand-deep); letter-spacing: .08em; }
.stack tbody th { width: 22%; font-weight: 700; }
.stack td:first-of-type { width: 30%; font-weight: 700; color: var(--navy); }
.stack td:last-child { color: var(--ink-soft); }

/* 成果 */
.outcome-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 40px 0 0; padding: 0; list-style: none; }
.outcome-list li { padding-top: 22px; border-top: 3px solid var(--brand); }
.outcome-list strong { display: block; font-size: 18px; line-height: 1.5; }
.outcome-list span { display: block; margin-top: 10px; font-size: 14px; color: var(--ink-soft); line-height: 1.9; }

/* 関連事例 */
.related { margin-top: 48px; padding: 28px 32px; display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; background: var(--tint); border-left: 4px solid var(--brand); }
.related p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.related p strong { display: block; margin-bottom: 4px; color: var(--navy); font-size: 16px; }
.text-link { color: var(--brand-deep); font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--brand-deep); padding-bottom: 3px; }
.text-link:hover { color: #005e7a; }

/* 他の事例 */
.case-nav { padding: 56px 0; border-top: 1px solid #d3e0e6; }
.case-nav h2 { margin-bottom: 24px; font-size: 20px; color: var(--navy); }
.case-nav-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.case-nav-list a { display: block; height: 100%; padding: 20px 22px; background: white; border: 1px solid #d3e0e6; border-radius: 4px; transition: border-color .2s, transform .2s; }
.case-nav-list a:hover { border-color: var(--brand); transform: translateY(-2px); }
.case-nav-list small { display: block; font: 500 11px/1 var(--label-font); color: var(--brand-deep); letter-spacing: .08em; }
.case-nav-list span { display: block; margin-top: 10px; font-size: 15px; font-weight: 700; line-height: 1.5; }

/* お問い合わせ・フッター */
.primary-link { display: inline-flex; justify-content: center; align-items: center; padding: 14px 22px; background: var(--brand-deep); color: white; border-radius: 3px; font-weight: 700; font-size: 14px; }
.primary-link:hover { background: #005e7a; }
.research-contact { padding: 64px 0; background: var(--navy); color: white; }
.research-contact h2 { color: white; font-size: clamp(26px, 3vw, 38px); }
.research-contact p { color: #c9dae4; max-width: 760px; margin: 24px 0; }
.research-contact .section-label { color: #c9dae4; border-color: #829eaf; }
.research-footer { padding: 28px 0; background: #e8eef1; }
.research-footer .container { display: flex; justify-content: space-between; gap: 18px; align-items: center; font-size: 12px; color: var(--muted); }

@media (max-width: 960px) {
  .case-hero-grid, .challenge-layout { grid-template-columns: 1fr; gap: 36px; }
  .pipeline { grid-template-columns: 1fr; }
  .pipe-arrow { width: auto; height: 36px; transform: rotate(90deg); }
  .outcome-list { grid-template-columns: 1fr; gap: 20px; }
  .case-nav-list { grid-template-columns: 1fr; }
  .brand-text span { display: none; }
}

@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .research-nav { gap: 20px; font-size: 12px; }
  .case-hero { padding: 28px 0 44px; }
  .breadcrumb { margin-bottom: 28px; }
  .case-card { padding: 22px; }
  .case-section { padding: 56px 0; scroll-margin-top: 140px; }
  .challenge-list li { padding-left: 44px; }
  .point-list { grid-template-columns: 1fr; gap: 16px; }
  .point { padding: 24px; }
  .stack thead { display: none; }
  .stack, .stack tbody, .stack tr, .stack th, .stack td { display: block; width: 100% !important; }
  .stack tr { padding: 14px 18px; border-bottom: 1px solid #dce5e9; }
  .stack th, .stack td { padding: 2px 0; border: 0; }
  .stack tbody th { font: 500 11px/1.6 var(--label-font); color: var(--brand-deep); }
  .related { padding: 22px; }
  .research-contact { padding: 48px 0; }
  .research-footer .container { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .case-nav-list a { transition: none; }
}
