/*
 * 使い方動画の案内ページ（badone.jp/guides/videos/ と videos-<回>/）の見た目。
 * guide-pages.mjs が各ページの assets/guide.css にコピーする（直すのはこのファイルだけ）。
 * 色は動画シリーズ（design.md・templates/stage.html）と同じ。配信の CSP で Web フォントは使えないので、
 * 丸ゴシック系のシステムフォントを並べる。小さい文字の色は読みやすさ（コントラスト）を優先して、
 * 色つきの地には白ではなく ink の文字をのせる。
 */
:root {
  --cream: #FFF7E8; --ink: #1E2A44; --gold: #E2A93B; --mint: #2BC4A0;
  --coral: #FF6F61; --sky: #4AA3FF; --lilac: #9B8CFF; --white: #FFFFFF;
  --muted: #5B6680; --line: #E6DCC8; --link: #1C63B8;
  --shadow: 0 4px 0 rgba(30, 42, 68, .08), 0 10px 26px rgba(30, 42, 68, .10);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "BIZ UDPGothic", "Meiryo", sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.8; overflow-wrap: anywhere; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
body.index main { max-width: 1080px; }
img { max-width: 100%; height: auto; }
a { color: var(--link); }
/* フォーカス枠は背景（cream・白）と 3:1 以上の差が出る濃い青（--link は cream に対して約 5.6:1） */
a:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.4; }
h1 { font-size: 1.6rem; margin: .3em 0 .2em; }
h2 { font-size: 1.3rem; margin: 2em 0 .6em; }
h3 { font-size: 1.15rem; margin: 0 0 .4em; }
p { margin: .6em 0; }
strong { color: #C8392C; }
/* 画面には出さず、読み上げにだけ渡す文字（外部リンクの「（新しいタブで開く）」など） */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- 上部 ---------- */
/* バドONEハブ（アプリ）へ戻る帯。アプリから別タブで開くと「戻る」が効かないので、いちばん上に置く */
.appbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; padding: 0 0 10px; border-bottom: 2px dashed var(--line); }
.appbar-brand { font-weight: 800; letter-spacing: .02em; }
.appbar-actions { display: flex; flex: none; gap: 8px; }
.appbar-home, .appbar-share { flex: none; padding: 4px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); color: var(--ink); font: inherit; font-size: .85rem; font-weight: 700; line-height: 1.5; text-decoration: none; cursor: pointer; }
.appbar-home:hover, .appbar-share:hover { background: #FFF0CF; }
.appbar-share[hidden] { display: none; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: #B8AE9A; }
.hero { margin: 16px 0 8px; }
.lead { font-weight: 700; font-size: 1.05rem; color: #3A4664; margin-top: 0; }
.intro { margin: 1em 0; }
.hint { font-size: .95rem; }

/* タグ（サムネイルと同じ色分け。色つきの地に ink の文字） */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; line-height: 1.5; }
.tag { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--ink); background: var(--line); white-space: nowrap; }
.tag-gold { background: var(--gold); }
.tag-mint { background: var(--mint); }
.tag-coral { background: var(--coral); }
.tag-sky { background: var(--sky); }
.tag-lilac { background: var(--lilac); }
.tag-ink { background: var(--ink); color: var(--white); }
.tag-time { background: var(--white); border: 2px solid var(--ink); padding: 0 10px; }
.tag-time::before { content: "▶ "; font-size: .7em; vertical-align: .1em; }
/* 動画ではないガイドのページのカード（目次の「大会の申込のしかた」など）。時間の札と同じ形で、▶ は付けない */
.tag-steps { background: var(--white); border: 2px solid var(--ink); padding: 0 10px; }

/* ---------- 動画（YouTube へのリンク。再生ボタンは擬似要素で描く） ---------- */
.video { display: block; margin: 20px 0 8px; color: var(--ink); text-decoration: none; }
.video-frame { position: relative; display: block; overflow: hidden; border: 3px solid var(--ink); border-radius: 18px; background: var(--white); box-shadow: 0 6px 0 rgba(30, 42, 68, .12), 0 14px 32px rgba(30, 42, 68, .14); }
.video-frame img { display: block; width: 100%; }
/* 再生ボタンはサムネイル左の題名に掛からないよう、右側の画面の写真の上（横 72%・縦 55%）に置く。
   大きさは枠の幅に合わせて変える（スマホの狭い幅でも題名まで広がらない） */
.video-frame::before { content: ""; position: absolute; left: 72%; top: 55%; width: clamp(40px, 8%, 60px); aspect-ratio: 1; border-radius: 50%; background: var(--coral); border: 3px solid var(--white); box-shadow: 0 5px 16px rgba(30, 42, 68, .35); transform: translate(-50%, -50%); transition: transform .15s ease; }
.video-frame::after { content: ""; position: absolute; left: 72%; top: 55%; width: clamp(13px, 2.6%, 20px); aspect-ratio: 5 / 6; background: var(--white); clip-path: polygon(0 0, 100% 50%, 0 100%); transform: translate(-38%, -50%); }
.video:hover .video-frame::before, .video:focus-visible .video-frame::before { transform: translate(-50%, -50%) scale(1.1); }
.video-label { display: block; width: fit-content; margin: 14px auto 0; padding: 8px 26px; border-radius: 999px; background: var(--ink); color: var(--white); font-weight: 700; box-shadow: 0 4px 0 rgba(30, 42, 68, .18); }
.video:hover .video-label { background: #2C3B5E; }

/* ---------- この動画でわかること ---------- */
.learn { margin-top: 28px; padding: 4px 18px 10px; border: 3px solid var(--mint); border-radius: 18px; background: var(--white); }
.learn h2 { margin: .7em 0 .3em; font-size: 1.1rem; }
.learn ol { margin: 0; padding-left: 1.6em; }
.learn li { margin: .3em 0; }
.learn li strong { color: var(--ink); }
.learn-desc { color: var(--muted); font-size: .92rem; }

/* ---------- 手順 ---------- */
.step { margin: 28px 0; padding-top: 20px; border-top: 2px dashed var(--line); }
.howto > h2 + .step { border-top: 0; padding-top: 0; }
.step-no { color: #1B9C7E; font-size: 1.25em; }
.jump { margin: 0 0 10px; font-size: .9rem; }
.jump a { display: inline-block; padding: 2px 14px; border: 2px solid var(--sky); border-radius: 999px; background: var(--white); text-decoration: none; font-weight: 700; }
.jump a:hover { background: #EAF4FF; }
/* 節の途中の画面（2 本目以降）へ飛ぶリンク。節の頭より控えめに */
.jump-sub { margin: 18px 0 0; font-size: .8rem; }
.jump-sub a { padding: 0 10px; border-width: 1px; font-weight: 700; }
.shot { margin: 14px 0 10px; }
.shot img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: var(--shadow); }
/* スマホの画面は幅を絞って真ん中に */
.shot.phone img { width: auto; max-width: min(300px, 100%); margin: 0 auto; border: 6px solid var(--ink); border-radius: 26px; }

/* 注意・ポイント（動画のカードと同じ） */
.box { margin: 28px 0; padding: 14px 18px 12px; border: 3px solid var(--coral); border-radius: 18px; background: var(--white); box-shadow: 0 5px 0 rgba(255, 111, 97, .22); }
.box-tag { display: inline-block; margin: 0 0 4px; padding: 1px 14px; border-radius: 999px; background: var(--coral); color: var(--ink); font-weight: 800; font-size: .9rem; }
.box-body { font-weight: 800; font-size: 1.1rem; line-height: 1.6; }
.box-note { color: var(--muted); font-size: .92rem; }
.box.point { border-color: var(--mint); box-shadow: 0 5px 0 rgba(43, 196, 160, .22); }
.box.point .box-tag { background: var(--mint); }

/* ---------- つぎに見る・前後 ---------- */
.next-up h2 { font-size: 1.1rem; }
.next-card { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--white); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.next-card:hover { border-color: var(--gold); }
.next-card img { display: block; width: 100%; border-radius: 10px; }
.next-body { display: grid; gap: 2px; line-height: 1.5; }
.next-body strong { color: var(--ink); }
.next-body span { color: var(--muted); font-size: .85rem; }
.pager { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; margin: 28px 0 0; }
.pager a { display: block; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 14px; background: var(--white); color: var(--ink); text-decoration: none; font-weight: 700; line-height: 1.4; }
.pager a:hover { background: #FFF0CF; }
.pager small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: .75rem; }
.pager .toc { align-self: center; border-radius: 999px; }
.pager .next { text-align: right; }
/* ページの下の「ホームへ」。金色の地に ink の文字（約 7:1） */
.back-home { margin: 24px 0 0; }
.back-home a { display: block; max-width: 480px; margin: 0 auto; padding: 12px 16px; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 800; text-align: center; text-decoration: none; box-shadow: 0 4px 0 rgba(30, 42, 68, .16); }
.back-home a:hover { background: #EDBE5E; }
.footnote { margin-top: 32px; padding-top: 12px; border-top: 2px dashed var(--line); color: var(--muted); font-size: .8rem; }

/* ---------- 目次 ---------- */
.channel { display: inline-block; padding: 8px 22px; border-radius: 999px; background: var(--coral); color: var(--ink); font-weight: 800; text-decoration: none; box-shadow: 0 4px 0 rgba(30, 42, 68, .16); }
.channel:hover { background: #FF8A7E; }
.group h2 { display: flex; align-items: center; gap: 10px; }
.count { padding: 0 10px; border-radius: 999px; background: var(--white); border: 2px solid var(--line); color: var(--muted); font-size: .8rem; font-weight: 700; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.card { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 2px solid var(--line); border-radius: 18px; background: var(--white); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--gold); }
.card img { display: block; width: 100%; }
.card-body { display: grid; gap: 6px; padding: 12px 14px 14px; line-height: 1.5; }
.card-title { color: var(--ink); font-size: 1.05rem; }
.card-lead { color: var(--muted); font-size: .88rem; }
/* 先頭の紹介動画（guide-pages.json の intro。YouTube へのリンク）。グループのカードより一段目立たせて金の枠に。
   スマホは縦に積み、600px 以上は左にサムネイル・右に字。字の側が高いときは、サムネイルを紺の帯の真ん中に置く */
.intro-video { margin: 24px 0 0; }
.intro-card { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; border: 3px solid var(--gold); border-radius: 18px; background: var(--white); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease; }
.intro-card:hover { transform: translateY(-2px); }
.intro-thumb { display: flex; align-items: center; background: var(--ink); }
.intro-thumb img { display: block; width: 100%; }
.intro-body { display: grid; justify-items: start; align-content: center; gap: 8px; padding: 14px 16px 18px; line-height: 1.5; }
.intro-title { color: var(--ink); font-size: 1.3rem; }
/* 題名と一言は、幅が足りる限り設定で分けたところで折る（「52秒でわかる」と「バドONEハブ」のあいだ）。
   狭い幅で文字を大きくして 1 つ分も入らないときは、はみ出さないよう語の途中でも折れる */
.intro-title span, .intro-lead span { display: inline-block; }
.intro-lead { color: #3A4664; font-weight: 700; }
.intro-body .video-label { margin: 4px 0 0; }
.intro-card:hover .video-label { background: #2C3B5E; }

@media (min-width: 600px) {
  main { padding: 24px 24px 64px; }
  h1 { font-size: 2rem; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .next-card { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
  .intro-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .intro-body { padding: 18px 24px; }
}
@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intro-body { padding: 24px 36px; }
  .intro-title { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .intro-card, .video-frame::before { transition: none; }
}
