/* =========================================================================
   EightDoor Phase 2 — shared.css
   Phase 1 (design-review-2026-09-22/phase1-responsive-top/style.css) の
   共通部品だけを抽出したもの。値は変更していない。
   ページ固有の指定は pages.css に置く。
   ========================================================================= */

:root {
  --font-ja: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-latin: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --ink: #101516;
  --ink-muted: #344245;
  --line: rgba(16, 21, 22, 0.14);
  /* 面・図形・大きな要素に使うブランドコーラル。値は変更しない */
  --coral: #c9473f;
  --accent: var(--coral);
  --accent-hover: #bd4038;
  /* 小さな文字用。明るい背景でWCAG AA 4.5:1を満たす */
  --coral-text: #bf433c;
  /* 小さな文字用。near-black背景でWCAG AA 4.5:1を満たす */
  --coral-text-dark: #e15047;
  /* 図内のtechnical label用。Loop帯で5.21:1 */
  --label-muted: #5f6b6d;
  /* 装飾の連番。大きな文字としてWCAG AA 3:1を満たす */
  --ink-index: rgba(16, 21, 22, 0.48);
  --focus: #125b74;
  --paper: #ffffff;
  --hero-base: #eaf7f7;
  /* ---------- Type scale ----------
     役割ごとにトークンを使う。コンポーネント側で font-size を個別に決めない。
     日本語本文（--fs-body）を基準に設計し、英字ラベルは補助として一段小さく保つ。
     vw に連動させない（拡大時の可読性を壊さないため）。 */
  --fs-hero:    4rem;     /* 64px  Hero H1 */
  --fs-display: 3.5rem;   /* 56px  セクションの主見出し（editorial statement） */
  --fs-h1:      2.75rem;  /* 44px  下層ページの H1 */
  --fs-h2:      2rem;     /* 32px  セクション内の中見出し */
  --fs-h3:      1.375rem; /* 22px  小見出し */
  --fs-lead:   1.0625rem; /* 17px  リード文・セクション説明 */
  --fs-body:   1rem;      /* 16px  本文 */
  --fs-small:  0.875rem;  /* 14px  補足・キャプション */
  --fs-kicker: 0.75rem;   /* 12px  英字キッカー */
  --fs-label:  0.6875rem; /* 11px  図内のtechnical label */
  --fs-num:    2.25rem;   /* 36px  連番 */
  --fs-cta:    0.9375rem; /* 15px  ボタン */
  --fs-nav:    0.9375rem; /* 15px  ナビゲーション */

  /* 行間。日本語本文は広めに取る */
  --lh-tight:  1.24;      /* 大見出し */
  --lh-head:   1.45;      /* 小見出し */
  --lh-lead:   1.85;
  --lh-body:   1.95;

  /* 太さ。見出しは強く、小見出しは一段軽く、リードは本文寄りにする */
  --fw-display: 900;   /* Hero H1 / セクション主見出し */
  --fw-head:    700;   /* 小見出し（H3） */
  --fw-lead:    600;   /* リード文 */
  --fw-body:    500;   /* 本文 */

  /* 字間。英字ラベルだけ広げる */
  --ls-ja:     0.005em;
  --ls-label:  0.08em;

  --content-max: 1320px;
  --page-gutter: 48px;
  --header-h: 76px;
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ja);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--paper);
}

a {
  color: inherit;
}

/* 画像がコンテナを超えないようにする（旧テーマから引き継ぐ既定） */
img {
  max-width: 100%;
  height: auto;
}

/* 複数行の見出しは行の長さをそろえ、1〜2文字だけの行を作らない（2026-09-24。非対応ブラウザでは通常の折り返し） */
h1,
h2,
h3 {
  text-wrap: balance;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.site-shell {
  min-height: 100vh;
  overflow-x: clip;
  background: var(--paper);
}

.site-header {
  position: relative;
  z-index: 10;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid rgba(16, 21, 22, 0.08);
}

.header-inner {
  width: min(calc(100% - (var(--page-gutter) * 2)), var(--content-max));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 52px;
}

.brand {
  width: max-content;
  /* 文字の高さだけだとタップ領域が22pxしかない。
     ヘッダーは高さ固定で中央揃えのため、上下に余白を持たせても文字の位置は動かない */
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 0.42em;
  font-family: var(--font-latin);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
}

/* ロゴマーク（扉）。2026-09-24 ユーザー支給のロゴ案を線で描き直した SVG。
   高さは文字の大きさに比例（大文字の高さの約2.2倍）。色は文字と同じ currentColor なので、
   濃い背景のフッターでは自動で白になる */
.brand-mark {
  flex: none;
  width: auto;
  height: 1.58em;
  fill: none;
  stroke: currentColor;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 扉のドアノブ（2026-09-24 ロゴ差し替え）。線ではなく塗りの丸 */
.brand-mark .brand-mark-knob {
  fill: currentColor;
  stroke: none;
}

.main-navigation {
  display: flex;
  align-items: center;
  gap: 38px;
}

/* Phase 1 では .loop-return と同じ組で指定されていた分の補完。
   PCではmobile用のナビ部品を隠す。 */
.nav-sublist,
.nav-toggle {
  display: none;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 38px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list > li > a {
  position: relative;
  display: inline-block;
  padding: 27px 0 25px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
  text-decoration: none;
}

.nav-list > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 18px;
  height: 1px;
  background: currentColor;
  transition: right 180ms ease;
}

.nav-list > li > a:hover::after,
.nav-list > li > a:focus-visible::after {
  right: 0;
}

.header-cta,
.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 3px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.header-cta {
  min-width: 142px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.875rem;
}

.header-cta:hover,
.primary-cta:hover {
  background: var(--accent-hover);
}

.header-cta:active,
.primary-cta:active {
  transform: translateY(1px);
}

.arrow {
  display: inline-block;
  font-family: var(--font-latin);
  font-weight: 600;
  line-height: 1;
}

.primary-cta {
  min-width: 250px;
  min-height: 58px;
  padding: 0 20px 0 22px;
  font-size: 0.9375rem;
}

.secondary-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 7px;
  border-bottom: 1px solid rgba(16, 21, 22, 0.54);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.secondary-link:hover {
  border-bottom-color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.section-inner {
  width: min(calc(100% - (var(--page-gutter) * 2)), var(--content-max));
  margin: 0 auto;
}

.section-kicker,
.service-type,
.case-meta {
  margin: 0;
  font-family: var(--font-latin);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-kicker {
  margin-bottom: 20px;
  font-size: var(--fs-kicker);
  letter-spacing: var(--ls-label);
  color: var(--coral-text);
}

.section-title {
  max-width: 720px;
  margin: 0;
  font-size: var(--fs-display);
  font-weight: var(--fw-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-ja);
  /* 日本語見出しを語の途中で割らない。句読点と著者が置いた <br> を優先し、
     1行に収まらない場合だけ任意位置へ折り返す */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.section-description {
  margin: 0;
  font-size: var(--fs-lead);
  font-weight: 500;
  line-height: 1.9;
  color: var(--ink-muted);
}

.service-type {
  margin-bottom: 16px;
  font-size: 0.8125rem;
  color: var(--coral-text);
}

.section-link,
.case-link,
.consulting-link,
.all-services-link {
  width: max-content;
  max-width: 100%;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.section-link,
.case-link,
.consulting-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(16, 21, 22, 0.5);
}

.section-link > span:first-child,
.case-link > span:first-child,
.consulting-link > span:first-child {
  min-width: 0;
}

.section-link:hover,
.case-link:hover,
.consulting-link:hover,
.all-services-link:hover {
  border-color: var(--ink);
}

.consulting-link {
  justify-self: start;
  font-size: 0.9375rem;
}

.all-services-link {
  border-bottom: 1px solid rgba(16, 21, 22, 0.5);
  font-size: 0.8125rem;
}

.case-meta {
  margin-bottom: 15px;
  font-size: 0.75rem;
  color: var(--coral-text);
}

.case-link {
  font-size: 0.875rem;
}

.site-footer {
  padding: 76px 0 42px;
  background: var(--ink);
  color: #ffffff;
}

.footer-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(520px, 1.15fr);
  /* 列の間隔だけ。行にも100px入ると、リンクと著作権表示の間が空きすぎる */
  column-gap: 100px;
  row-gap: 0;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  font-family: var(--font-latin);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.footer-branding p {
  max-width: 430px;
  margin: 26px 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.66);
}

/* 6本を3列2段に置く。2列3段より縦が短く、横幅も使い切れる */
.footer-navigation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
  align-content: start;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.footer-navigation a {
  padding: 15px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-navigation a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.72);
}

.footer-copyright {
  grid-column: 1 / -1;
  margin: 56px 0 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--font-latin);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 1279px) {
  :root {
      --page-gutter: 40px;
    }

  .header-inner {
      gap: 36px;
    }

  .main-navigation,
    .nav-list {
      gap: 30px;
    }


  .footer-layout {
      grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
      column-gap: 64px;
    }
}

@media (max-width: 1023px) {
  :root {
      --page-gutter: 32px;
      --loop-indent: 24px;
      --loop-gutter: 22px;
    }

  .header-inner {
      grid-template-columns: minmax(0, 1fr) auto auto;
      gap: 16px;
    }

  .header-cta {
      order: 2;
    }

  .nav-toggle {
      order: 3;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      /* タップ領域を44×44以上にする（従来は30×44だった） */
      min-width: 44px;
      min-height: 44px;
      padding: 0 10px;
      border: 0;
      background: transparent;
      color: var(--ink);
      font-family: inherit;
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0;
      cursor: pointer;
    }

  .nav-toggle-bars {
      display: grid;
      gap: 5px;
      width: 22px;
    }

  .nav-toggle-bars span {
      display: block;
      height: 2px;
      background: currentColor;
    }

  .nav-scrim:not([hidden]) {
      position: fixed;
      z-index: 8;
      inset: var(--header-h) 0 0;
      background: rgba(16, 21, 22, 0.42);
    }

  .main-navigation {
      display: none;
    }

  /* Phase 1 の body.nav-open 系ルールの補完（抽出条件から漏れていた分） */
  body.nav-open .nav-toggle-bars span:nth-child(2) {
      opacity: 0;
    }

  body.nav-open .main-navigation {
      position: fixed;
      z-index: 9;
      top: var(--header-h);
      right: 0;
      bottom: 0;
      left: auto;
      display: block;
      width: min(100%, 26rem);
      padding: 12px var(--page-gutter) 40px;
      overflow-y: auto;
      overscroll-behavior: contain;
      background: var(--paper);
      border-left: 1px solid var(--line);
    }

  .nav-list {
      display: block;
      margin: 0;
      padding: 0;
    }

  .nav-list > li {
      border-bottom: 1px solid var(--line);
    }

  .nav-list > li > a {
      display: block;
      padding: 17px 0 16px;
      font-size: 1rem;
    }

  .nav-list > li > a::after {
      display: none;
    }

  .nav-sublist {
      display: block;
      margin: 0 0 14px;
      padding: 0 0 0 16px;
      border-left: 1px solid var(--line);
      list-style: none;
    }

  .nav-sublist a {
      display: block;
      min-height: 44px;
      padding: 12px 0 11px;
      font-size: 0.875rem;
      font-weight: 500;
      line-height: 1.5;
      color: var(--ink-muted);
      text-decoration: none;
    }

  .section-title {
      max-width: none;
    }

  .section-link,
    .case-link,
    .consulting-link,
    .secondary-link {
      padding: 16px 0 8px;
    }

  .all-services-link {
      display: inline-block;
      padding: 14px 0 8px;
    }

  .site-footer {
      padding: 64px 0 36px;
    }

  .footer-layout {
      display: block;
    }

  .footer-branding p {
      max-width: none;
      margin-top: 18px;
    }

  .footer-navigation {
      grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
      gap: 0 36px;
      margin-top: 40px;
    }

  .footer-navigation a {
      min-height: 44px;
      padding: 14px 0 13px;
    }

  .footer-copyright {
      margin-top: 40px;
    }
}

@media (max-width: 767px) {
  :root {
      --page-gutter: 20px;
      --header-h: 64px;
      --loop-indent: 20px;
      --loop-gutter: 20px;
    }

  .brand {
      font-size: 1.375rem;
    }

  .header-cta {
      min-width: 0;
      padding: 0 14px;
      font-size: 0.8125rem;
      gap: 12px;
    }

  .nav-toggle-label {
      display: none;
    }

  .primary-cta {
      min-width: 0;
      min-height: 54px;
      padding: 0 18px;
    }

  .secondary-link {
      justify-self: start;
    }

  /* 著者が意味の切れ目に置いた <br> は、モバイルでも活かす */
  .section-title br {
      display: inline;
    }

  .section-title {
      line-height: 1.34;
    }

  .section-kicker {
      margin-bottom: 14px;
      font-size: 0.75rem;
    }

  .site-footer {
      padding: 52px 0 32px;
    }

  .footer-brand {
      font-size: 1.5rem;
    }

  .footer-branding p {
      font-size: 0.875rem;
    }

  /* 6本を縦一列にすると帯が長くなりすぎる。2列に折る */
  .footer-navigation {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0 20px;
      margin-top: 34px;
    }

  .footer-copyright {
      margin-top: 32px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .footer-navigation {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 0 24px;
    }
}

@media (max-width: 374px) {
  /* 320px では2列だと「プライバシーポリシー」が折り返すため縦一列へ戻す */
  .footer-navigation {
      grid-template-columns: minmax(0, 1fr);
    }

  /* ロゴマークの分だけ横幅が増えたため、320px でも「無料相談」と重ならない大きさにする（2026-09-24） */
  .brand {
      font-size: 1.0625rem;
    }

  .header-cta {
      padding: 0 12px;
      gap: 8px;
      font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Type scale: tablet / mobile ----------
   1つの場所で段階を切り替える。各コンポーネントで個別に縮めない。 */
@media (max-width: 1279px) {
  :root {
    --fs-hero: 3.5rem;      /* 56px */
  }
}

@media (max-width: 1119px) {
  :root {
    --fs-hero:    3.25rem;  /* 52px */
    --fs-display: 2.75rem;  /* 44px  1024pxで全角9字が1行に収まる */
    --fs-h1:      2.375rem; /* 38px */
    --fs-h2:      1.75rem;  /* 28px */
    --fs-h3:   1.25rem;   /* 20px */
    --fs-num:  2rem;      /* 32px */
  }
}

@media (max-width: 1023px) {
  :root {
    --fs-hero: 3rem;        /* 48px */
  }
}

@media (max-width: 767px) {
  :root {
    --fs-hero:    2.25rem;  /* 36px  390px幅で全角9字が1行に収まる上限 */
    --fs-display: 1.875rem; /* 30px  全角13字が390px幅に収まる */
    --fs-h1:      2rem;     /* 32px */
    --fs-h2:      1.5rem;   /* 24px */
    --fs-h3:   1.1875rem; /* 19px */
    --fs-lead: 1rem;      /* 16px */
    --fs-num:  1.75rem;   /* 28px */
  }
}

@media (max-width: 374px) {
  :root {
    --fs-hero:    1.875rem; /* 30px */
    --fs-display: 1.625rem; /* 26px */
    --fs-h1:      1.75rem;  /* 28px */
    --fs-h2:      1.375rem; /* 22px */
  }
}

/* ---------- 語の途中で改行させたくない見出し ----------
   「品質は、やり切れば上がる。」は 390px で「やり / 切れば」と割れる。
   このコピーだけ一段小さくし、指定した位置で改行させる。 */
@media (max-width: 767px) {
  .about-heading .section-title,
  .company-philosophy .section-title {
    font-size: var(--fs-h1);
  }

  .about-heading .section-title br,
  .company-philosophy .section-title br {
    display: inline;
  }
}
