/*
 * relay2ai LP — ガイド記事セクション(/guide/)専用スタイル。
 *
 * LP 本体(src/index.css, Tailwind)には触れない。ガイドは JS なしの純静的ページなので、
 * ここも Tailwind を使わず手書きの CSS 1 本で完結させる(依存を増やさない方針)。
 * トークン(色・フォント)は src/index.css の @theme から値だけ転記している —— 変える
 * ときは両方見ること。
 *
 * accent は LP の --color-accent(#c44a2f)を使う。ガイドの設計メモにある #d75a3c は
 * LP の --color-robot(写真そのままの赤)の値で、白文字を乗せると 3.9:1 しか出ず
 * WCAG AA(4.5:1)を割る。CTA ボタン・ヘッダーボタンは白文字が乗るため、
 * 4.8:1 が確認済みの --color-accent 側の値を使う(README 未記載の判断。報告に明記)。
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-sans-jp-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/noto-sans-jp-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Shippori Mincho B1';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/shippori-mincho-b1-700.woff2') format('woff2');
}

:root {
  --bg: #f4f3f5;
  --paper: #ffffff;
  --ink: #1f1a14;
  --muted: #5c554d;
  --line: #e6e1dc;
  --teal: #1f6a6a;
  /* LP の --color-accent / --color-accent-strong と同じ値(理由は冒頭コメント)。 */
  --accent: #c44a2f;
  --accent-strong: #a83e27;
  --code-bg: #faf9f7;

  --font-sans: 'Inter', 'Noto Sans JP', system-ui, sans-serif;
  --font-display: 'Shippori Mincho B1', serif;

  --content-width: 42rem; /* 672px — 紙・パンくず・関連記事の読みものカラム */
  --chrome-width: 70rem; /* 1120px — ヘッダー・フッターの帯(LP の Footer と同じ幅) */
  --paper-shadow: 0 1px 3px rgba(31, 26, 20, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: rgba(196, 74, 47, 0.25);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* パンくず・関連記事ナビの横幅は、紙(.paper)の本文カラムと揃える。紙自身は
   padding が内側にあるぶん見た目の余白が広く出るので、これは背景の無いラッパー
   として「テキストの位置」だけを紙に合わせる役目。 */
.container {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ヘッダー・フッターは読みものカラムより広い帯(LP の Footer と同じ 1120px)。
   ロゴ+ナビ、ロゴ+運営リンクが 1 行に収まる余地を持たせる。 */
.header-inner,
.footer-inner {
  max-width: var(--chrome-width);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---- ヘッダー ---- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 12px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  height: 28px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-nav > a {
  white-space: nowrap;
}

.header-nav > a:not(.btn-accent) {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.header-nav > a:not(.btn-accent):hover {
  color: var(--ink);
}

/* 1 ページに accent ボタンはヘッダーとここだけ、の一方。 */
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding-inline: 20px;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.btn-accent:hover {
  background: var(--accent-strong);
  color: #fff;
}

/* ---- パンくず ---- */

.breadcrumbs {
  padding-block: 16px 12px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.breadcrumbs .crumb-sep {
  margin-inline: 6px;
  /* 区切りも表示テキスト: WCAG 1.4.3 のため線用トークンではなく muted(白地 4.5:1 以上)を使う */
  color: var(--muted);
}

.breadcrumbs [aria-current='page'] {
  color: var(--ink);
}

/* ---- 紙(記事・一覧の本体) ---- */

.paper {
  max-width: var(--content-width);
  margin: 0 auto 48px;
  background: var(--paper);
  padding: 20px;
  border-radius: 0;
  box-shadow: none;
}

/* ---- 見出し・本文の基本タイポグラフィ ---- */

.paper h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.5;
  margin: 0 0 8px;
}

.paper .meta {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--muted);
}

.paper p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.9;
}

.paper strong {
  font-weight: 600;
}

.paper h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.4;
  margin: 48px 0 12px;
}

.paper h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  margin: 32px 0 8px;
}

/* 直前が見出しなら、見出し側の margin-top を優先して詰める。 */
.paper h1 + h2,
.paper h2 + h3 {
  margin-top: 0;
}

.paper ul,
.paper ol {
  margin: 12px 0;
  padding-inline-start: 1.25em;
}

.paper li {
  margin-bottom: 6px;
  color: var(--ink);
}

.paper li::marker {
  color: var(--muted);
}

/* ---- テーブル ---- */

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.paper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.paper th,
.paper td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.paper thead th {
  background: var(--code-bg);
  font-weight: 600;
  white-space: nowrap;
}

.paper tbody tr:last-child th,
.paper tbody tr:last-child td {
  border-bottom: none;
}

/* ---- コピペ用ブロック(``` フェンス) ---- */

.paper pre.copy {
  margin: 16px 0;
  padding: 16px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- CTA ボックス ---- */

.cta {
  margin-top: 40px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.cta p {
  margin: 0;
}

/* CTA 段落に自然に埋め込まれているリンク(本文最後の「無料相談」等)を、
   このセクションの主ボタンとして立たせる。1 ページに accent ボタンは
   ヘッダーとここだけ。 */
.cta a {
  /* flex(ブロック)にして常に単独行にする。inline-flex だと前後の地の文が
     ボタンの左右に回り込み、48px の高さと噛み合わずに読みにくくなるため。 */
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding-inline: 24px;
  margin: 12px 0 4px;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.cta a:hover {
  background: var(--accent-strong);
  color: #fff;
}

/* ---- 関連記事(前の記事・次の記事) ---- */

.related {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
}

.related-link {
  display: block;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
}

.related-link:hover {
  border-color: var(--teal);
}

.related-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* ---- 一覧ページ(/guide/) ---- */

.paper .lead {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

.entry-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
}

.entry {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.entry:last-child {
  padding-bottom: 0;
}

.entry-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  text-decoration: none;
}

.entry-title:hover {
  color: var(--teal);
}

.entry-desc {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

.entry-date {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- フッター(LP と同じ 1 行流儀) ---- */

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-block: 32px;
  font-size: 13px;
  color: var(--muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand img {
  height: 20px;
  width: auto;
}

.footer-meta a {
  color: var(--teal);
}

.footer-meta .dot {
  margin-inline: 6px;
}

/* ---- 640px 以上 ---- */

@media (max-width: 399px) {
  .brand img {
    width: 110px;
    height: auto;
  }

  .header-nav .btn-accent {
    padding-inline: 12px;
  }
}

@media (min-width: 640px) {
  .container,
  .header-inner,
  .footer-inner {
    padding-inline: 40px;
  }

  .header-nav {
    gap: 16px;
  }

  .header-nav > a:not(.btn-accent) {
    font-size: 14px;
  }

  .paper {
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--paper-shadow);
  }

  .paper h1 {
    font-size: 30px;
  }

  .paper p {
    font-size: 17px;
  }

  .paper h2 {
    font-size: 24px;
  }

  .paper h3 {
    font-size: 18px;
  }

  .paper table,
  .paper .lead {
    font-size: 15px;
  }

  .cta {
    padding: 24px;
  }

  .related {
    flex-direction: row;
  }

  .related-link {
    flex: 1;
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
