/* ============================================================
   日本ランニング協会 サンプルHP 共通スタイル
   正本: DESIGN.md (色・フォント・余白・コンポーネントは全て準拠)
   ============================================================ */

/* ---- Design Tokens (DESIGN.md §2, §6) ---- */
:root {
  --navy-900: #0A1E3F;
  --navy-700: #16305E;
  --orange-700: #C2410C;
  --orange-500: #F76707;
  --ink-900: #1B1F27;
  --ink-600: #4B5563;
  --mist-100: #F1F3F7;
  --border-300: #D6DAE3;
  --white: #FFFFFF;
  --blue-200: #C7D0E0;

  --shadow-1: 0 2px 8px rgba(10, 30, 63, 0.08);
  --shadow-2: 0 8px 24px rgba(10, 30, 63, 0.14);

  --font-jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-en: "Oswald", "Arial Narrow", "Helvetica Neue", sans-serif;

  --container: 1120px;
  --pad-x: 24px;
  --section-y: 96px;
  --gap: 24px;
}

/* ---- Reset / Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

/* インラインリンク (DESIGN.md §3) — :visited も同色 */
.link-inline,
.link-inline:visited {
  color: var(--orange-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-inline:hover { color: var(--navy-900); text-decoration: underline; }

/* focus / transition (DESIGN.md §4 全インタラクティブ要素共通) */
a, button, input, select, textarea, summary {
  transition: all 0.2s ease;
}
:focus-visible {
  outline: 3px solid var(--orange-500);
  outline-offset: 2px;
}

/* スキップリンク (キーボード操作時のみ表示) */
.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 200;
  background: var(--navy-900);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 0 0 6px 6px;
}
.skip-link:focus-visible { top: 0; }

/* ---- Layout ---- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: var(--section-y); }

/* 背景バリエーション (White 60% / Navy 30% / Mist 10%) */
.section--mist { background: var(--mist-100); }
.section--navy {
  background: var(--navy-900);
  color: var(--white);
}

/* ---- Section Label (Oswald 500 16px 字間0.08em 大文字 + 32x3px装飾線) ---- */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-600);
}
.section-label::before {
  content: "";
  width: 32px;
  height: 3px;
  background: var(--orange-500);
}
.section--navy .section-label { color: var(--blue-200); }

.section-head { margin-bottom: 48px; }
.section-head .h2 { margin-top: 12px; }

/* ---- Typography ---- */
.h1 {
  font-weight: 900;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--navy-900);
}
.h2 {
  font-weight: 900;
  font-size: 32px;
  line-height: 1.3;
  color: var(--navy-900);
}
.section--navy .h2 { color: var(--white); }

.h3 {
  font-weight: 700;
  font-size: 20px;
  line-height: 1.4;
  color: var(--navy-900);
}

.lead {
  font-size: 18px;
  line-height: 1.8;
}

.note {
  font-size: 14px;
  color: var(--ink-600);
}
.section--navy .note { color: var(--blue-200); }

/* ---- Buttons (DESIGN.md §4) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 32px;
  border-radius: 6px;
  border: 0;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  cursor: pointer;
}
.btn--primary {
  background: var(--orange-700);
  color: var(--white);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.btn--secondary {
  background: transparent;
  border: 2px solid var(--navy-900);
  color: var(--navy-900);
}
.btn--secondary:hover {
  background: var(--navy-900);
  color: var(--white);
}
.section--navy .btn--secondary {
  border-color: var(--white);
  color: var(--white);
}
.section--navy .btn--secondary:hover {
  background: var(--white);
  color: var(--navy-900);
}
.btn:disabled,
.btn[aria-disabled="true"],
fieldset:disabled .btn {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn:disabled:hover,
.btn[aria-disabled="true"]:hover,
fieldset:disabled .btn:hover {
  transform: none;
  box-shadow: none;
}

/* ---- SAMPLE バナー (DESIGN.md §4: sticky top / h32 / z100) ---- */
.sample-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--orange-700);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-inline: 12px;
  white-space: nowrap;
  overflow: hidden;
}
.sample-banner .en {
  font-family: var(--font-en);
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* ---- Header (position: static — DESIGN.md §4) ---- */
.site-header {
  position: static;
  background: var(--white);
  border-bottom: 1px solid var(--border-300);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding-block: 12px;
}
.brand {
  display: block;
  line-height: 1.3;
}
.brand__org {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-600);
  letter-spacing: 0.06em;
}
.brand__name {
  display: block;
  font-weight: 900;
  font-size: 20px;
  color: var(--navy-900);
  letter-spacing: 0.02em;
}
.global-nav { margin-left: auto; }
.global-nav ul {
  display: flex;
  align-items: center;
  gap: 28px;
}
.global-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy-900);
}
.global-nav a:hover { color: var(--orange-700); }
.global-nav a[aria-current="page"] {
  color: var(--orange-700);
  box-shadow: inset 0 -3px 0 var(--orange-500);
}
.site-header__cta {
  min-height: 48px;
  padding: 10px 24px;
  font-size: 15px;
}

/* ---- Hero (非対称 60/40・テキスト左 — DESIGN.md §5) ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: 96px;
}
.hero__inner {
  display: grid;
  grid-template-columns: 6fr 4fr;
  gap: 48px;
  align-items: center;
}
.hero__slogan {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-600);
}
.hero__slogan::before {
  content: "";
  width: 32px;
  height: 3px;
  background: var(--orange-500);
}
.hero__title { margin-top: 20px; }
.hero__lead {
  margin-top: 28px;
  max-width: 34em;
}
.hero__cta {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.hero__en {
  margin-top: 48px;
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-600);
}

/* 写真: Navy ソリッド板を背面にずらして重ねる */
.hero__media {
  position: relative;
}
.hero__media::before {
  content: "";
  position: absolute;
  inset: 24px -24px -24px 24px;
  background: var(--navy-900);
  z-index: 0;
}
.hero__media img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* トラックレーン装飾 その1 (平行線 -8deg — ページ内最大2箇所) */
.lane-lines {
  position: absolute;
  pointer-events: none;
  background: repeating-linear-gradient(
    82deg,
    var(--orange-500) 0px,
    var(--orange-500) 3px,
    transparent 3px,
    transparent 36px
  );
  opacity: 0.9;
}
.hero .lane-lines {
  width: 420px;
  height: 180px;
  right: -60px;
  bottom: -40px;
  z-index: 2;
  opacity: 0.85;
}

/* ---- 数字帯 (DESIGN.md §4 スタット: 縦積み3段・中央揃え) ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
.stat {
  text-align: center;
  padding: 16px 8px;
}
.stat__value {
  display: block;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 56px;
  line-height: 1.1;
  color: var(--orange-500);
}
.section--navy .stat__value { color: var(--white); }
.stat__unit {
  display: block;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-900);
  margin-top: 4px;
}
.stat__label {
  display: block;
  font-size: 14px;
  color: var(--ink-600);
  margin-top: 4px;
}
.section--navy .stat__unit { color: var(--white); }
.section--navy .stat__label { color: var(--blue-200); }

/* ---- 3カラムカード帯 ---- */
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* ---- Cards (DESIGN.md §4) ---- */
.card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  padding: 32px;
}
.card:hover { box-shadow: var(--shadow-2); }

/* Navy セクション内カード: 背景 Navy-700・shadowなし (DESIGN.md §6) */
.section--navy .card {
  background: var(--navy-700);
  box-shadow: none;
  color: var(--white);
}
.section--navy .card:hover { box-shadow: none; }
.section--navy .card .h3 { color: var(--white); }
.section--navy .card p { color: var(--white); }

/* ---- 資格カード 3+2 の2段組 (DESIGN.md §5) ---- */
.license-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gap);
}
.license-grid .card { grid-column: span 2; }
.license-grid .card:nth-child(4) { grid-column: 2 / span 2; }
.license-grid .card:nth-child(5) { grid-column: 4 / span 2; }

.license-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.license-card__no {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--ink-600);
}
.license-card__target {
  font-size: 14px;
  color: var(--ink-600);
}
.license-card p { flex: 1; }
.license-card .link-inline { font-size: 15px; }

/* ---- ストーリー (引用カード) ---- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.story-grid--2 { grid-template-columns: repeat(2, 1fr); }
.story-card blockquote {
  margin: 0;
  position: relative;
  padding-top: 36px;
  flex: 1;
}
.story-card blockquote::before {
  content: "“";
  position: absolute;
  top: -14px;
  left: -6px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 72px;
  line-height: 1;
  color: var(--orange-500);
}
.story-card {
  display: flex;
  flex-direction: column;
}
.story-card footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-300);
  font-size: 14px;
  color: var(--ink-600);
}
.story-card footer b {
  display: block;
  font-size: 15px;
  color: var(--navy-900);
}

/* ---- スケジュール (リスト形式 — 要件定義 §2) ---- */
.schedule-list {
  display: grid;
  gap: 16px;
}
.schedule-item {
  display: grid;
  grid-template-columns: 120px 1fr auto auto;
  align-items: center;
  gap: 24px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  padding: 24px 32px;
}
.schedule-item:hover { box-shadow: var(--shadow-2); }
.schedule-item__date {
  text-align: center;
  border-right: 1px solid var(--border-300);
  padding-right: 24px;
}
.schedule-item__date .d {
  display: block;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  color: var(--navy-900);
}
.schedule-item__date .m {
  display: block;
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--ink-600);
}
.schedule-item__date .w {
  display: block;
  font-size: 13px;
  color: var(--ink-600);
}
.schedule-item__meta {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-600);
}
.capacity {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 96px;
}
.capacity__seats {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy-900);
}
.capacity__seats.is-few { color: var(--orange-700); }
.capacity__total {
  font-size: 13px;
  color: var(--ink-600);
}
.chip-sample {
  display: inline-block;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--orange-700);
  border: 1px solid var(--orange-700);
  border-radius: 4px;
  padding: 2px 8px;
}

/* ---- 帯写真 (ストーリー等の区切り) ---- */
.photo-band {
  position: relative;
}
.photo-band img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

/* ---- B2B (Navy セクション + 写真) ---- */
.b2b { overflow: hidden; }
.b2b__inner {
  position: relative;
  display: grid;
  grid-template-columns: 5fr 5fr;
  gap: 48px;
  align-items: center;
}
.b2b__cards {
  display: grid;
  gap: var(--gap);
  margin-top: 32px;
}
.b2b__media {
  position: relative;
}
.b2b__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
/* トラックレーン装飾 その2 */
.b2b .lane-lines {
  width: 360px;
  height: 140px;
  left: -80px;
  top: -70px;
  opacity: 0.5;
}

/* ---- お問い合わせ (ダミー form — DESIGN.md §4 入力欄) ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: 48px;
  align-items: start;
}
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--navy-900);
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border-300);
  border-radius: 4px;
  background: var(--white);
  font-family: var(--font-jp);
  font-size: 16px;
  color: var(--ink-900);
  padding: 0 14px;
}
.form-field textarea {
  height: 140px;
  padding: 12px 14px;
  resize: vertical;
}
fieldset.contact-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
fieldset:disabled input,
fieldset:disabled select,
fieldset:disabled textarea {
  background: var(--mist-100);
  cursor: not-allowed;
}

/* ---- Footer (Navy-900 — DESIGN.md §2) ---- */
.site-footer {
  background: var(--navy-900);
  color: var(--white);
  padding-block: 64px 40px;
}
.site-footer .brand__org { color: var(--blue-200); }
.site-footer .brand__name { color: var(--white); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 24px;
}
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-200);
}
.footer-nav a:hover { color: var(--white); }
.footer-sample {
  margin-top: 32px;
  padding: 20px 24px;
  border: 1px solid var(--navy-700);
  border-radius: 6px;
  background: var(--navy-700);
}
.footer-sample .en {
  display: block;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--white);
}
.footer-sample p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--blue-200);
}
.copyright {
  margin-top: 32px;
  font-size: 12px;
  color: var(--blue-200);
}

/* ---- ページヘッダー (下層) ---- */
.page-head {
  background: var(--navy-900);
  color: var(--white);
  padding-block: 72px;
}
.page-head .h1 {
  color: var(--white);
  font-size: clamp(32px, 4.5vw, 48px);
}
.page-head .lead {
  margin-top: 16px;
  color: var(--blue-200);
  max-width: 40em;
}

/* ---- 比較表 (qualifications) ---- */
.table-wrap { overflow-x: auto; }
.compare-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--white);
  box-shadow: var(--shadow-1);
  border-radius: 12px;
  overflow: hidden;
}
.compare-table th,
.compare-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-300);
  font-size: 15px;
  vertical-align: top;
}
.compare-table thead th {
  background: var(--navy-900);
  color: var(--white);
  font-size: 14px;
  white-space: nowrap;
}
.compare-table tbody th {
  font-weight: 700;
  color: var(--navy-900);
  white-space: nowrap;
}
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td { border-bottom: 0; }
.price-placeholder {
  display: inline-block;
  font-size: 13px;
  color: var(--ink-600);
  background: var(--mist-100);
  border: 1px dashed var(--border-300);
  border-radius: 4px;
  padding: 4px 10px;
}

/* ---- 資格体系図 (qualifications) ---- */
.hierarchy {
  display: grid;
  gap: 16px;
  max-width: 720px;
  margin-inline: auto;
}
.hierarchy__tier {
  border-radius: 12px;
  padding: 24px 32px;
  text-align: center;
}
.hierarchy__tier--top {
  background: var(--navy-900);
  color: var(--white);
}
.hierarchy__tier--base {
  background: var(--white);
  box-shadow: var(--shadow-1);
}
.hierarchy__tier .tier-label {
  display: block;
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-200);
}
.hierarchy__tier--base .tier-label { color: var(--ink-600); }
.hierarchy__tier .tier-name {
  display: block;
  font-weight: 700;
  font-size: 20px;
  margin-top: 6px;
}
.hierarchy__tier--top .tier-name { color: var(--white); }
.hierarchy__tier--base .tier-name { color: var(--navy-900); }
.hierarchy__tier p {
  font-size: 14px;
  margin-top: 8px;
  color: var(--ink-600);
}
.hierarchy__tier--top p { color: var(--blue-200); }
.hierarchy__arrow {
  text-align: center;
  font-weight: 700;
  color: var(--orange-700);
  font-size: 14px;
}
.hierarchy__names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.hierarchy__names span {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-900);
  background: var(--mist-100);
  border-radius: 4px;
  padding: 4px 12px;
}

/* ---- 活動事例カード (activities: 3列 — DESIGN.md §5) ---- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.case-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.case-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.case-card__body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.case-card__tag {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-600);
}
.case-card p { flex: 1; }

/* ---- スクロールリビール (CSS + IntersectionObserver のみ) ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  a, button, input, select, textarea, summary { transition: none; }
}

/* ============================================================
   Responsive (ブレークポイント 768px — DESIGN.md §8)
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --pad-x: 20px;
    --section-y: 64px;
  }

  .card { padding: 24px; }

  .stat__value { font-size: 40px; }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 16px;
  }

  /* Header: 1行目=ロゴ+CTA、2行目=ナビ (横スクロール可) */
  .site-header__inner {
    flex-wrap: wrap;
    gap: 0 12px;
    padding-block: 12px 0;
  }
  .site-header__cta {
    margin-left: auto;
    padding: 10px 16px;
    font-size: 14px;
  }
  .global-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .global-nav ul {
    gap: 20px;
    padding-block: 4px 12px;
    white-space: nowrap;
  }

  /* Hero: 縦積み (テキスト → 写真) */
  .hero { padding-block: 56px 72px; }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero__media { margin-right: 20px; }
  .hero .lane-lines {
    width: 240px;
    height: 110px;
    right: -40px;
    bottom: -28px;
  }
  .hero__en { margin-top: 32px; }

  .license-grid,
  .story-grid,
  .case-grid,
  .cards-3 {
    grid-template-columns: 1fr;
  }
  .license-grid .card,
  .license-grid .card:nth-child(4),
  .license-grid .card:nth-child(5) {
    grid-column: auto;
  }

  .schedule-item {
    grid-template-columns: 88px 1fr;
    gap: 12px 20px;
    padding: 20px;
  }
  .schedule-item__date { padding-right: 16px; }
  .schedule-item__date .d { font-size: 26px; }
  .schedule-item__extra {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .capacity { align-items: flex-start; min-width: 0; }

  .b2b__inner,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .b2b .lane-lines {
    width: 220px;
    height: 100px;
    left: -60px;
    top: -50px;
  }

  .photo-band img { height: 200px; }

  .compare-table th,
  .compare-table td { padding: 12px 14px; }

  .hierarchy__tier { padding: 20px; }
}

@media (min-width: 768px) {
  .schedule-item__extra {
    display: contents;
  }
}
