/*
 * SEO ランディングページ（/ai-game-maker など）の差分スタイル。
 *
 * 前提: このファイルは article.css の**後**に読み込まれる（public/lp.html）。
 * 変数（--red / --gray-* / --measure / --safe-*）・ヘッダー・フッター・
 * 言語切替・翻訳未完了バナー・本文タイポグラフィは article.css をそのまま使う。
 *
 * WHY article.css に足さないのか:
 *   article.css は /news・/help・/blog の3面が共有していて、そこに LP 専用の
 *   グリッドや CTA を足すと、記事側の見た目を LP の都合で揺らすリスクを常に抱える
 *   （しかも記事は本文が6言語 × 数十本あり、崩れに気づくのが遅い）。
 *   差分を別ファイルに置けば、LP を消すときもこのファイルを消すだけで済む。
 */

/* h1: 記事の .article-title と違い、日付行が続かないので下の余白を自分で持つ。
   LP の h1 は「検索から着地した人が最初に読む一文」なので長くなる前提で、
   行間をやや広めに取る（詰めると3行の見出しが塊に見える）。 */
.lp-title {
  max-width: var(--measure);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.6px;
  margin-bottom: 24px;
}

/* :::lead の導入文。article.css の .lead をそのまま使うが、LP では h1 直下に来るので
   上の余白だけ詰める。 */
.lp-body > .lead:first-child { margin-top: 0; }

/* ── 実 UGC のグリッド（<!-- games --> の差し込み先）──────────────────
   本文の測度（--measure ≒ 68ch）を意図的に**超える**。ここは読み物ではなく
   「実際に人が作って遊ばれている証拠」の陳列で、幅を本文に合わせると
   1行2枚の窮屈な棚になる。 */
.lp-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin: 28px 0 40px;
}

.lp-game-card {
  display: block;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: border-color .15s, transform .15s;
}
.lp-game-card:hover { border-color: var(--red); transform: translateY(-2px); }

/* サムネイルは 390x844（ゲームの縦画面）が原寸。棚では 3:4 に切り詰める
   —— 原寸の縦横比だとカード1枚が画面の大半を占め、8本並べた意味が消える。 */
.lp-game-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--gray-100);
}
.lp-game-thumb--empty { aspect-ratio: 3 / 4; }

.lp-game-body { padding: 10px 12px 12px; }
.lp-game-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 4px;
  /* タイトルはユーザーが書くので長さが読めない。2行で打ち切る（カードの高さを揃える） */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lp-game-creator { font-size: 12px; color: var(--gray-600); margin: 0 0 2px; }
.lp-game-plays { font-size: 12px; color: var(--gray-400); margin: 0; }

.lp-empty { color: var(--gray-400); margin: 24px 0 40px; }

/* ── 相互リンク（<!-- more-ways-in --> の差し込み先）────────────────── */
.lp-more-ways {
  max-width: var(--measure);
  margin: 48px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--gray-200);
}
.lp-more-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.lp-more-ways ul { list-style: none; margin: 0; padding: 0; }
.lp-more-ways li { padding: 10px 0; border-bottom: 1px solid var(--gray-200); }
.lp-more-ways a { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.lp-more-ways a:hover { color: var(--red); }
.lp-more-desc { display: block; font-size: 13px; color: var(--gray-600); margin-top: 2px; }

/* ── 末尾の CTA ─────────────────────────────────────────────────────
   検索から来た人の出口はここ1つに絞る（/ へ）。LP に出口を複数置くと、
   いちばん取りたい行動（つくってみる）が薄まる。 */
.lp-cta {
  max-width: var(--measure);
  margin: 48px 0 0;
  padding: 28px 24px;
  border-radius: 16px;
  background: var(--gray-50);
  text-align: center;
}
.lp-cta-lead { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.lp-cta-button {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.lp-cta-button:hover { opacity: .9; }

@media (max-width: 600px) {
  .lp-title { font-size: 26px; }
  .lp-game-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
}

/* Curated, original interaction example: only rendered on the selected JA/EN LP. */
.lp-creation-example { margin: 2rem 0; padding: 1.25rem; border: 1px solid #cbd5e1; border-radius: 16px; }
.lp-example-player { display: block; width: 100%; height: 460px; border: 0; border-radius: 12px; background: #10243a; }
.lp-creation-example textarea { display: block; box-sizing: border-box; width: 100%; margin: .5rem 0; padding: .75rem; font: inherit; line-height: 1.5; resize: vertical; }
.lp-creation-example button { padding: .65rem 1rem; font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid #64748b; }
.lp-example-copy-status { min-height: 1.5em; }
.lp-example-create { display: inline-block; padding: .75rem 1rem; background: #264ab7; color: #fff !important; border-radius: 8px; }

/* ── 印刷用の区画（:::print）と学校の窓口（<!-- school-contact -->）・2026-10-21 c5teach ──
   先生向け LP の授業案・生徒の手順を「そのまま印刷して配れる」ようにする。
   画面では枠で囲んだ 1 枚の紙に見せ、印刷では紙の幅いっぱいに出す。 */
.print-sheet {
  max-width: var(--measure);
  margin: 28px 0;
  padding: 20px 22px;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  background: #fff;
}
.print-sheet > * + * { margin-top: .8em; }
.print-sheet table { font-size: 14px; }
/* 授業の流れの表の 1 列目（分: 「12–22」）は折り返すと読みにくく、行が縦に伸びて紙が 1 枚増える */
.print-sheet td:first-child { white-space: nowrap; }
.print-sheet-button {
  float: right;
  margin: 0 0 12px 12px;
  padding: 8px 16px;
  border: 1px solid var(--gray-400);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.print-sheet-button:hover { border-color: var(--red); color: var(--red); }
@media (max-width: 600px) {
  .print-sheet { padding: 16px 14px; }
  /* 375px では右寄せのボタンが見出しを細く押しつぶすので、1 行を占有させる */
  .print-sheet-button { float: none; display: block; margin: 0 0 12px; }
  /* 授業の流れの表（4 列）は article.css の .table-wrap が区画の中だけ横スクロールにする（ページは横に流れない） */
  /* ただし 375px に 4 列を押し込むと 1 列が 3〜4 文字幅になって読めない（2026-10-21 のスクリーンショット）。
     最小幅を持たせ、横スクロールで読む形にする */
  .print-sheet table { min-width: 560px; }
}

.lp-school-contact { max-width: var(--measure); margin: 16px 0 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.lp-school-contact-button {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--red);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
}
.lp-school-contact-address { font-weight: 600; user-select: all; overflow-wrap: anywhere; }
.lp-school-contact--pending { color: var(--gray-600); }

/* 印刷（ボタンが無い「ブラウザの印刷」でも効く）:
   画面用の部品（ナビ・棚・作例の iframe・CTA・言語切替・フッター）を隠し、本文だけを出す。
   :::print 区画は新しいページから始め、途中で表の行が割れないようにする。 */
@media print {
  .site-header, .site-footer, .lp-cta, .lang-switcher, .translation-notice,
  .lp-game-grid, .lp-empty, .lp-more-ways, .lp-creation-example,
  .print-sheet-button, .lp-school-contact-button { display: none !important; }
  .print-sheet { border: 0; padding: 0; margin: 0; max-width: none; break-before: page; font-size: 12.5px; line-height: 1.45; }
  /* 紙では文字と余白を詰める（先生の plan が A4 2 枚・生徒のシートが 1 枚に収まる大きさ・2026-10-21 の PDF で確認） */
  .print-sheet h3 { font-size: 17px; }
  .print-sheet h4 { font-size: 14px; margin-top: 1em; }
  .print-sheet table { font-size: 11.5px; }
  .print-sheet th, .print-sheet td { padding: 4px 8px; }
  .print-sheet tr, .print-sheet li { break-inside: avoid; }
  /* 区画の後ろの本文は次の紙から（配る紙に「ゲームのアイデア」などが混ざらない）。
     表は 1 枚に収まるなら割らない（評価の表が 2 枚にまたがっていた・2026-10-21 の PDF） */
  .print-sheet { break-after: page; }
  .print-sheet .table-wrap { break-inside: avoid; }
  .print-sheet .table-wrap { overflow: visible; }
  .print-sheet table { min-width: 0; }
  /* 「このシートを印刷する」で押した区画だけを紙に出す（lp-print.js が付ける印） */
  html.lp-print-one .lp-title,
  html.lp-print-one .lp-body > :not(.print-sheet),
  html.lp-print-one .lp-body > .print-sheet:not([data-printing]) { display: none !important; }
  html.lp-print-one .print-sheet[data-printing] { break-before: auto; }
}
