/* デザイン指示: design-spec.md（Codex）。値の根拠はそちらを参照 */
:root {
  /* 紺と黄色のロゴに合わせた配色（design-spec-logo-v2.md） */
  --color-bg: #F7F5EF;
  --color-surface: #FFFFFF;
  --color-soft: #EAF0F6;
  --color-text: #23364A;
  --color-muted: #526477;
  --color-brand: #0B3A6E;
  --color-accent: #F7C531;
  --color-accent-light: #FBD978;
  --color-alert: #805619;
  --color-alert-bg: #F4EAD5;
  --color-rule: #CDD7E2;
  --color-control: #738396;
  --color-line: #06C755;
  /* #06C755 に白文字は 2.26:1 で AA 未達のため濃緑文字にする */
  --color-line-text: #103B29;
  --color-line-hover: #05B64D;
  --color-focus: #0B3A6E;

  --font-body: "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-heading: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --font-number: "Inter", "Noto Sans JP", sans-serif;

  --gutter: 20px;
  --sticky-space: 0px;
}

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

html {
  font-size: 100%;
  scroll-padding-top: 16px;
  scroll-padding-bottom: var(--sticky-space);
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.85;
  letter-spacing: 0.02em;
  -webkit-text-size-adjust: 100%;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--color-brand); text-underline-offset: 0.2em; }
a:hover { color: var(--color-text); }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

h1, h2, h3 { margin: 0; letter-spacing: 0.03em; }
h1, h2 { font-family: var(--font-heading); font-weight: 600; }
h1 { font-size: 2rem; line-height: 1.45; }
h2 { font-size: 1.625rem; line-height: 1.5; margin-bottom: 24px; }
h3 { font-size: 1.25rem; line-height: 1.6; font-weight: 700; }
p { margin: 0 0 20px; }
p:last-child { margin-bottom: 0; }

.container {
  width: min(calc(100% - var(--gutter) * 2), 1120px);
  margin-inline: auto;
}
.prose { max-inline-size: 40rem; }
.section { padding-block: 3rem; }
.section--soft { background: var(--color-soft); }
.note { font-size: 1rem; line-height: 1.75; color: var(--color-muted); }
.eyebrow { font-size: 1rem; font-weight: 700; line-height: 1.6; color: var(--color-brand); margin-bottom: 16px; }
.underline {
  text-decoration: underline;
  text-decoration-color: var(--color-brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

/* CTA */
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  padding: 16px 24px;
  border: 1px solid var(--color-line-text);
  border-radius: 10px;
  background: var(--color-line);
  color: var(--color-line-text);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  margin-block: 24px 16px;
}
.cta:hover { background: var(--color-line-hover); color: var(--color-line-text); }
.cta:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; box-shadow: 0 0 0 3px #fff; }
.cta--small { min-height: 44px; padding: 8px 14px; font-size: 1rem; margin: 0; width: auto; }

a, .cta { transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease; }

/* ヘッダー */
.site-header { border-bottom: 1px solid var(--color-rule); }
.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "logo cta" "nav nav";
  align-items: center;
  gap: 8px 16px;
  padding-block: 12px;
}
.site-header .service-logo { grid-area: logo; justify-self: start; }
/* 320px幅でもロゴと横並びに収めるため、スマホでは2行にする */
.site-header__cta { grid-area: cta; flex-direction: column; width: 6.5rem; padding: 6px 10px; line-height: 1.35; }
.site-header__cta > span { white-space: nowrap; }

/* サービスロゴ。<img> のSVGはページのWebフォントを使えないので、文字はHTMLで組む */
.service-logo {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; max-width: 100%;
  color: var(--color-brand); text-decoration: none;
}
.service-logo:hover { color: var(--color-brand); }
.service-logo .service-logo__mark { display: block; flex: 0 0 auto; width: 32px; height: 32px; margin: 0; }
.service-logo__text {
  display: flex; flex-direction: column; align-items: flex-start;
  font-family: var(--font-heading); font-size: 1rem; font-weight: 600;
  line-height: 1.4; letter-spacing: 0; white-space: nowrap;
}
.service-logo__free { padding-inline: 4px; border-radius: 2px; background: var(--color-accent); color: var(--color-brand); }
.site-nav { grid-area: nav; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px;
}
.site-nav a {
  display: flex; align-items: center; min-height: 44px;
  font-size: 1rem; color: var(--color-text);
}

/* ファーストビュー */
.hero__grid { display: grid; gap: 32px; }
.hero h1 { margin-bottom: 24px; }
.hero__note { margin: 0; }
.hero__art { display: none; }
.hero__art svg { max-width: 240px; margin-inline: auto; }
.hero__art .doc { fill: var(--color-surface); stroke: var(--color-brand); stroke-width: 2; }
.hero__art .doc-rule { stroke: var(--color-rule); stroke-width: 2; }
.hero__body > .cta { max-width: 420px; }

/* 2. 首相の投稿と事実 */
.split { display: grid; gap: 32px; margin-top: 32px; }
.split > * { min-width: 0; }
.post-source { margin: 0; width: 100%; max-width: 550px; min-width: 0; }
.post-source__embed .twitter-tweet:not(.twitter-tweet-rendered) {
  margin: 0;
  padding: 24px;
  background: var(--color-surface);
  border-left: 3px solid var(--color-brand);
  border-radius: 0 8px 8px 0;
}
.post-source__embed .twitter-tweet a { color: var(--color-text); }
.post-source figcaption { font-size: 1rem; margin-top: 12px; }
.post-source figcaption a { display: inline-flex; min-height: 44px; align-items: center; }

.facts__score {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px;
  padding: 20px 24px;
  background: var(--color-alert-bg);
  color: var(--color-alert);
  border-radius: 8px;
  margin-bottom: 8px;
}
.facts__label { flex-basis: 100%; font-size: 1rem; font-weight: 700; }
.facts__num {
  font-family: var(--font-number); font-weight: 600;
  font-size: 2.5rem; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.facts__scale, .facts__meta { font-size: 1.125rem; font-weight: 700; }
.facts__list { list-style: none; margin: 0 0 16px; padding: 0; }
.facts__list li { padding-block: 14px; border-bottom: 1px solid var(--color-rule); }

/* 3. リスク */
.risks { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; }
.risks li { border-top: 2px solid var(--color-brand); padding-top: 20px; min-width: 0; }
.risks .icon { width: 32px; height: 32px; color: var(--color-brand); margin-bottom: 12px; }
.risks h3 { margin-bottom: 8px; }
.risks__note { margin-top: 32px; max-inline-size: 40rem; }

/* 4. 対象とセルフチェック */
.plain-list { margin: 0 0 32px; padding-left: 1.25em; }
.plain-list li + li { margin-top: 8px; }
.checklist {
  margin: 0; padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: 8px;
  max-inline-size: 48rem;
}
.checklist legend {
  float: left; width: 100%;
  font-weight: 700; line-height: 1.6;
  margin-bottom: 8px; padding: 0;
}
.checklist label {
  clear: both;
  display: flex; align-items: center; gap: 16px;
  min-height: 64px; padding-block: 12px;
  border-top: 1px solid var(--color-rule);
  cursor: pointer;
}
.checklist input {
  appearance: none; flex: none;
  width: 24px; height: 24px; margin: 0;
  border: 2px solid var(--color-control); border-radius: 4px;
  background: var(--color-surface);
  display: grid; place-content: center;
  cursor: pointer;
}
.checklist input::after {
  content: ""; width: 12px; height: 7px;
  border: solid #fff; border-width: 0 0 3px 3px;
  transform: translateY(-2px) rotate(-45deg);
  opacity: 0;
}
.checklist input:checked { background: var(--color-brand); border-color: var(--color-brand); }
.checklist input:checked::after { opacity: 1; }

/* 5. ポイント */
.points { margin: 32px 0 0; max-inline-size: 48rem; }
.points > div { padding-block: 20px; border-top: 1px solid var(--color-rule); }
.points > div:last-child { border-bottom: 1px solid var(--color-rule); }
.points dt { font-family: var(--font-body); font-weight: 700; font-size: 1.25rem; margin-bottom: 4px; }
.points dd { margin: 0; }
.callout {
  margin-top: 24px; padding-left: 16px;
  border-left: 3px solid var(--color-brand);
  font-weight: 700; max-inline-size: 40rem;
}

/* 6. 診断票 */
.sheet {
  list-style: none; margin: 0; padding: 8px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: 8px;
  max-inline-size: 48rem;
}
.sheet li {
  display: grid; grid-template-columns: 3rem 1fr; gap: 16px;
  padding-block: 20px;
}
.sheet li + li { border-top: 1px solid var(--color-rule); }
.sheet li > div { min-width: 0; }
.sheet__num {
  font-family: var(--font-number); font-weight: 600;
  font-size: 1.75rem; line-height: 1.2;
  color: var(--color-brand); font-variant-numeric: tabular-nums;
}
.sheet__title { font-weight: 700; margin-bottom: 4px; }
.sheet__after { margin-top: 24px; }

/* 7. ステップ */
.steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 0; }
.steps li {
  position: relative; min-width: 0;
  padding: 0 0 32px 64px;
}
.steps li:not(:last-child)::before {
  content: ""; position: absolute;
  left: 21px; top: 44px; bottom: 0;
  border-left: 2px solid var(--color-brand);
}
.steps__num {
  position: absolute; left: 0; top: 0;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--color-brand); color: #fff;
  display: grid; place-content: center;
  font-family: var(--font-number); font-weight: 700;
}
.steps h3 { margin-bottom: 4px; padding-top: 6px; }
.steps__example {
  display: inline-block; max-width: 100%;
  padding: 12px 16px; margin-top: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-rule); border-radius: 8px;
  font-size: 1rem; line-height: 1.75;
  overflow-wrap: anywhere;
}
#flow .cta { max-width: 420px; }

/* 8. 選択肢 */
.options { list-style: none; margin: 32px 0 0; padding: 0; max-inline-size: 48rem; }
.options li { padding-block: 20px; border-top: 1px solid var(--color-rule); }
.options li:last-child { border-bottom: 1px solid var(--color-rule); }
.options h3 { margin-bottom: 4px; }

/* 9. 会社 */
.about { display: grid; gap: 24px; }
.about__logo img { width: 160px; height: auto; }
.about__area { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--color-control); }
.about__area-label { font-weight: 700; margin-bottom: 4px; }
.about__company-link { margin-top: 20px; }
.about__company-link a { display: inline-flex; align-items: center; min-height: 44px; }

/* 10. FAQ */
.faq { border-top: 1px solid var(--color-rule); }
.faq details { border-bottom: 1px solid var(--color-rule); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding-block: 20px;
  font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none;
  font-family: var(--font-number); font-size: 1.5rem; font-weight: 400;
  color: var(--color-brand); line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 20px; }

/* 11. 最後に */
.final { border-top: 2px solid var(--color-brand); }
.final__inner { max-width: 720px; }
.final .cta { max-width: 420px; }

/* プライバシーポリシー */
.policy h1 { margin-bottom: 32px; }
.policy h2 { font-size: 1.375rem; margin: 40px 0 16px; }
.policy ul, .policy ol { margin: 0 0 20px; padding-left: 1.25em; }
.policy li + li { margin-top: 8px; }

/* フッター */
.site-footer { padding-block: 48px; border-top: 1px solid var(--color-rule); font-size: 1rem; }
.site-footer__brand { margin-bottom: 20px; }
.site-footer__links { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-footer__links a { display: inline-flex; min-height: 44px; align-items: center; }
.site-footer .note { margin-bottom: 4px; }

/* スマホの追従CTA。横向きなど高さが足りない時は本文が隠れるので出さない */
.sticky-cta { display: none; }
@media (max-width: 47.99rem) and (min-height: 501px) {
  /* 追従CTAを置くページだけ余白を取る。privacy.html などに空白が残らないように */
  :root.has-sticky-cta { --sticky-space: calc(7rem + env(safe-area-inset-bottom)); }
  .has-sticky-cta body { padding-bottom: var(--sticky-space); }
  .sticky-cta {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-top: 1px solid var(--color-rule);
  }
  .sticky-cta .cta { margin: 0; min-height: 56px; padding-block: 12px; }
}

@media (max-width: 22.49rem) {
  :root { --gutter: 16px; }
}

@media (min-width: 48rem) {
  :root { --gutter: 32px; }
  .section { padding-block: 3.5rem; }
  h2 { margin-bottom: 28px; }
  .risks { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .steps li { padding: 64px 0 0; }
  .steps li:not(:last-child)::before {
    left: 52px; right: -24px; top: 21px; bottom: auto;
    border-left: 0; border-top: 2px solid var(--color-brand);
  }
  .points > div, .options li { display: grid; grid-template-columns: 14rem 1fr; gap: 24px; align-items: baseline; }
  .points dt, .options h3 { margin-bottom: 0; }
  .checklist, .sheet { padding-inline: 28px; }
}

@media (min-width: 64rem) {
  :root { --gutter: 40px; }
  .section { padding-block: 4.5rem; }
  h1 { font-size: 3rem; }
  h2 { font-size: 2.125rem; margin-bottom: 32px; }
  h3 { font-size: 1.375rem; }
  .cta { font-size: 1.125rem; }
  .cta--small { font-size: 1rem; }

  .site-header__inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo nav cta";
    gap: 24px;
  }
  .service-logo .service-logo__mark { width: 36px; height: 36px; }
  .service-logo__text { font-size: 1.125rem; }
  .site-header__cta { flex-direction: row; width: auto; padding: 8px 14px; line-height: 1.5; }
  .site-nav ul { display: flex; justify-content: center; gap: 24px; }

  .hero__grid { grid-template-columns: repeat(12, 1fr); gap: 32px; align-items: center; }
  .hero__body { grid-column: 1 / span 8; }
  .hero__art { display: block; grid-column: 9 / span 4; }

  .split { grid-template-columns: minmax(0, 550px) minmax(0, 1fr); gap: 48px; align-items: start; }
  .facts__num { font-size: 3.25rem; }

  .about { grid-template-columns: repeat(12, 1fr); gap: 32px; }
  .about__logo { grid-column: 1 / span 4; display: flex; justify-content: center; align-items: flex-start; }
  .about__logo img { width: 200px; }
  .about__body { grid-column: 5 / span 8; }

  .final__inner { text-align: left; }
  .checklist, .sheet { padding-inline: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
