/* FitLevel BLOG（gallapp.jp/blog）— FitLevel アプリの見た目に寄せる（2026-10-15 オーナー「Fitlevelのアプリの配色やロゴによせて」）。
   正本はアプリの src/constants/theme.ts: 紺のヒーロー・青の主色・差し色ライム・炎のオレンジ・薄い青灰の地・角丸の白カード（紺の薄い影）。
   ロゴは Outfit 800 で「Fit」白＋「Level」ライム。文言・構造・SEO要素は src/blog.mjs と記事側が持つ */
:root {
  color-scheme: light;
  --text: #151C3B;
  --text-2: #3A4466;
  --muted: #737C99;
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --line: #E7EAF3;
  --navy: #121B45;
  --navy-deep: #0E1535;
  --on-navy: #8EA0D6;
  --accent: #3D6BFF;
  --accent-edge: #2A4FD1;
  --accent-soft: #E4ECFF;
  --lime: #B6FF3B;
  --flame: #FF8A1F;
  --success: #2EBD6B;
  --shadow: 0 8px 24px rgba(18, 27, 69, .07), 0 1px 3px rgba(18, 27, 69, .05);
  --shadow-up: 0 16px 36px rgba(18, 27, 69, .13), 0 2px 6px rgba(18, 27, 69, .06);
  --num: "Outfit", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  /* カテゴリの色（アプリのランク・状態の色から） */
  --cat-training-basics: #3D6BFF;
  --cat-exercise: #FF8A1F;
  --cat-nutrition: #2EBD6B;
  --cat-recovery: #B26CF0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 16px/1.85 -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent-edge); }
a:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; top: -80px; left: 16px; padding: 8px 14px; background: #fff; z-index: 10; border-radius: 10px; }
.skip:focus { top: 8px; }
h1, h2, h3, p { margin-top: 0; }

/* ---- ヘッダー（紺） ---- */
.site-head { background: var(--navy); color: #fff; }
.head-inner { max-width: 1160px; margin: auto; min-height: 66px; padding: 12px 28px; display: flex; gap: 28px; align-items: center; justify-content: space-between; }
.wordmark { display: inline-flex; align-items: center; white-space: nowrap; color: #fff; text-decoration: none; font: 800 27px/1 var(--num); letter-spacing: -.03em; }
.wordmark img { width: 34px; height: 34px; margin-right: 10px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .14); }
.wordmark span { color: var(--lime); }
.wordmark small { margin-left: 10px; padding: 4px 8px 3px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #DCE3F7; font: 700 11px/1 var(--num); letter-spacing: .16em; }
.wordmark:hover { color: #fff; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.site-head nav a { padding: 7px 14px; border-radius: 999px; color: #DCE3F7; text-decoration: none; font-size: 14px; font-weight: 700; }
.site-head nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.container { max-width: 1160px; padding: 0 28px; margin: auto; }

/* ---- 一覧・カテゴリの見出し（紺のヒーロー） ---- */
.lead {
  position: relative; padding: clamp(56px, 7vw, 96px) 0 clamp(52px, 6vw, 80px);
  background: var(--navy); color: #fff;
  box-shadow: 0 0 0 100vmax var(--navy); clip-path: inset(0 -100vmax);
}
.lead.compact { margin-top: 16px; padding: 40px 0 44px; background: #1B2A6B; box-shadow: 0 0 0 100vmax #1B2A6B; }
.lead.compact::after { /* 右に光の輪（アプリの Glow） */
  content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 420px;
  background: radial-gradient(closest-side, rgba(76, 125, 255, .55) 0%, rgba(76, 125, 255, 0) 100%);
  pointer-events: none;
}
.lead > * { position: relative; z-index: 1; }
.eyebrow { display: inline-block; margin: 0 0 14px; padding: 5px 12px 4px; border-radius: 999px; background: var(--lime); color: var(--navy); font: 800 12px/1.2 var(--num); letter-spacing: .14em; }
.lead.compact .eyebrow { background: rgba(255, 255, 255, .14); color: #fff; }
.lead h1 { max-width: 900px; margin: 0 0 20px; font-size: clamp(34px, 5vw, 60px); line-height: 1.28; font-weight: 800; letter-spacing: -.03em; }
.lead p:last-child { max-width: 680px; margin: 0; color: #C9D3F2; font-size: 17px; font-weight: 600; }

/* 一覧のヒーロー: 全幅のジム写真をモノクロに落とし、紺のマスクをかける（スポーツブランド調＋アプリの紺） */
.lead:not(.compact) { padding: clamp(80px, 9vw, 140px) 0; min-height: clamp(440px, 44vw, 600px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.lead:not(.compact) > * { max-width: min(600px, 56%); }
.lead:not(.compact)::before { /* 写真（色を抜いて硬めのコントラスト） */
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); z-index: 0;
  background: url("/img/blog/hero.jpg") 72% 35% / cover no-repeat;
  filter: grayscale(1) contrast(1.15) brightness(.95);
}
.lead:not(.compact)::after { /* 紺のマスク。左から濃く、上下も締め、右寄りにライムの細い斜め線を1本 */
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); z-index: 0;
  background:
    linear-gradient(90deg, rgba(14, 21, 53, .97) 0%, rgba(18, 27, 69, .9) 32%, rgba(27, 42, 107, .5) 60%, rgba(51, 80, 201, .25) 100%),
    linear-gradient(0deg, rgba(14, 21, 53, .85) 0%, rgba(14, 21, 53, 0) 38%),
    linear-gradient(180deg, rgba(14, 21, 53, .55) 0%, rgba(14, 21, 53, 0) 22%),
    linear-gradient(115deg, transparent 78%, rgba(182, 255, 59, .35) 78% 78.6%, transparent 78.6%);
  pointer-events: none;
}
.lead:not(.compact) h1 { font-size: clamp(30px, 3.8vw, 52px); text-shadow: 0 2px 24px rgba(0, 0, 0, .3); }

/* ---- 見出し（セクション） ---- */
.category-section { padding: 40px 0 8px; }
.category-section h2, .section-head h2, .related h2 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.category-section h2::before, .section-head h2::before, .related h2::before { content: ""; width: 8px; height: 24px; border-radius: 4px; background: linear-gradient(180deg, #4C7DFF, #2F5BE6); }

/* ---- カテゴリ（丸いチップ） ---- */
.category-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; color: var(--muted); }
.category-links a {
  display: inline-flex; min-height: 42px; align-items: center; gap: 8px; padding: 6px 18px 6px 14px;
  border-radius: 999px; background: var(--card); box-shadow: var(--shadow); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 700;
}
.category-links a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cat, var(--accent)); }
.category-links a:hover { box-shadow: var(--shadow-up); color: var(--text); }

/* ---- 記事一覧（角丸の白カード） ---- */
.latest { padding: 32px 0 96px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 4px; }
.section-head span { color: var(--muted); font: 700 13px/1 var(--num); }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 22px 0 0; margin: 0; }
.article-card { min-width: 0; }
.article-card > a { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: box-shadow .2s, transform .2s; }
.article-card > a:hover { box-shadow: var(--shadow-up); transform: translateY(-3px); }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(180deg, #3350C9 0%, #1B2A6B 55%, #121B45 100%); }
.thumb::before { /* カテゴリ色の光 */
  content: ""; position: absolute; left: -20%; top: -40%; width: 90%; height: 160%;
  background: radial-gradient(circle, var(--cat, var(--accent)) 0%, transparent 62%); opacity: .55;
}
.thumb-num { position: absolute; left: 16px; bottom: 8px; color: var(--lime); font: 800 64px/1 var(--num); letter-spacing: -.04em; }
.thumb-label { position: absolute; left: 14px; top: 14px; padding: 5px 11px 4px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--text); font-size: 12px; font-weight: 800; }
.thumb-mascot { position: absolute; right: 10px; bottom: -6px; width: 42%; height: auto; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .3)); transition: transform .25s; }
.article-card > a:hover .thumb-mascot { transform: translateY(-4px) rotate(-3deg); }
.article-card .eyebrow { align-self: flex-start; margin: 16px 20px 6px; padding: 0; border-radius: 0; background: none; color: var(--cat, var(--accent)); font: 800 12px/1.2 -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif; letter-spacing: .04em; }
.article-card h2 { margin: 0 20px 10px; font-size: 18px; line-height: 1.55; font-weight: 800; }
.article-card p { margin: 0 20px 14px; color: var(--muted); font-size: 14px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { margin: auto 20px 20px; align-self: flex-start; padding: 7px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; }

/* ---- パンくず ---- */
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 20px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.crumb a { color: var(--muted); }

/* ---- 記事ページ ---- */
.article-page { padding-bottom: 96px; }
.article-head { max-width: 880px; padding: 28px 0 32px; }
.category-pill { display: inline-flex; margin-bottom: 16px; padding: 6px 14px 5px; border-radius: 999px; background: var(--cat, var(--accent)); color: #fff; text-decoration: none; font-size: 13px; font-weight: 800; }
.category-pill:hover { color: #fff; filter: brightness(.93); }
.article-head h1 { margin: 0 0 18px; font-size: clamp(29px, 4vw, 44px); line-height: 1.4; font-weight: 800; letter-spacing: -.02em; }
.byline { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.byline span::before { content: ""; display: inline-block; width: 26px; height: 26px; margin-right: 8px; vertical-align: -8px; border-radius: 8px; background: url("/img/blog/fitlevel-icon.png") center / cover; }
.deck { margin: 20px 0 0; padding: 18px 20px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border-left: 6px solid var(--accent); font-size: 16px; color: var(--text-2); font-weight: 600; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: clamp(28px, 4vw, 56px); align-items: start; }
.article-layout .toc { order: 2; }
.article-layout .article-body { order: 1; }

/* 目次: 紺の見出しの角丸カード */
.toc { position: sticky; top: 20px; overflow: hidden; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; }
.toc p { margin: 0; padding: 12px 18px; background: var(--navy); color: #fff; font-weight: 800; letter-spacing: .04em; }
.toc ol { list-style: none; margin: 0; padding: 12px 18px 16px; counter-reset: toc; }
.toc li { margin: 8px 0; line-height: 1.55; }
.toc li.level-2 { counter-increment: toc; display: flex; gap: 10px; font-weight: 700; }
.toc li.level-2::before { content: counter(toc, decimal-leading-zero); color: var(--accent); font: 800 13px/1.55 var(--num); }
.toc li.level-3 { margin-left: 28px; font-weight: 500; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* 本文: 白い角丸の面に載せる。h2 は紺の帯＋ライムの縦線、h3 は青の下線 */
.article-body { min-width: 0; max-width: 780px; padding: clamp(22px, 3.5vw, 44px); border-radius: 24px; background: var(--card); box-shadow: var(--shadow); overflow-wrap: anywhere; font-size: 17px; line-height: 2; color: var(--text); }
.article-body p { margin: 0 0 24px; }
.article-body strong { background: linear-gradient(transparent 62%, rgba(182, 255, 59, .55) 62%); }
.article-body h2 {
  scroll-margin-top: 20px; margin: 52px 0 22px; padding: 14px 18px 13px 22px; border-radius: 14px;
  background: var(--navy); color: #fff; box-shadow: inset 6px 0 0 var(--lime);
  font-size: 22px; line-height: 1.5; font-weight: 800;
}
.article-body > h2:first-child { margin-top: 0; }
.article-body h3 { position: relative; scroll-margin-top: 20px; margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 3px solid var(--accent-soft); font-size: 19px; line-height: 1.5; font-weight: 800; }
.article-body h3::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 64px; height: 3px; background: var(--accent); }
.article-body a { color: var(--accent); text-decoration-thickness: 1px; }
.article-body ul, .article-body ol { margin: 0 0 28px; padding: 18px 22px 18px 2.6em; border-radius: 16px; background: var(--bg); }
.article-body li { margin: 6px 0; }
.article-body ul li::marker { color: var(--accent); }
.article-body ol li::marker { color: var(--accent); font-weight: 800; }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; margin: 8px 0 30px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); }
.table-scroll:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.article-body table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.7; }
.article-body th, .article-body td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-body th { background: var(--navy); color: #fff; font-weight: 800; }
.article-body tbody tr:nth-child(even) td { background: #FAFBFE; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body tbody td:first-child { font-weight: 800; color: var(--text); }
/* 出典の節は小さく控えめに（本文の最後の見出し以降） */
.article-body h2:last-of-type ~ ul, .article-body h2:last-of-type ~ ol, .article-body h3:last-of-type ~ ul, .article-body h3:last-of-type ~ ol { background: none; padding: 0 0 0 1.4em; font-size: 14px; line-height: 1.8; }
.article-body .editor-note { margin: 44px 0 0; padding: 16px 18px; border-radius: 16px; background: var(--accent-soft); color: var(--text-2); font-size: 13px; line-height: 1.75; font-weight: 600; }

.related { margin-top: 64px; }
.related .article-grid { padding-top: 22px; }

/* ---- フッター（紺） ---- */
.site-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 30px max(28px, calc((100vw - 1104px) / 2)); background: var(--navy); color: #fff; font-size: 13px; }
.site-foot div { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.site-foot a { color: #fff; font-weight: 700; text-decoration-color: var(--lime); }
.site-foot a:hover { color: var(--lime); }
.site-foot span { color: var(--on-navy); }

/* ---- カテゴリの色（cat-<slug> を付けた要素とその中が --cat を持つ。上の既定より後に置く） ---- */
.cat-training-basics { --cat: var(--cat-training-basics); }
.cat-exercise { --cat: var(--cat-exercise); }
.cat-nutrition { --cat: var(--cat-nutrition); }
.cat-recovery { --cat: var(--cat-recovery); }

/* ---- 幅ごと ---- */
@media (max-width: 980px) {
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 1fr; gap: 22px; }
  .article-layout .toc { order: 0; position: static; }
}
@media (max-width: 760px) {
  .head-inner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 20px; }
  .site-head nav { gap: 2px; margin-left: -14px; }
  .article-grid { grid-template-columns: 1fr; }
  .site-foot { flex-direction: column; align-items: flex-start; }
  /* スマホ: 写真は全幅のまま、首の途中から下だけ見せ（10-15 オーナー「首から上はうつしちゃいけない」）、下半分を紺で落として見出しを載せる */
  .lead:not(.compact) { padding: 220px 0 48px; min-height: 0; justify-content: flex-end; }
  .lead:not(.compact) > * { max-width: none; }
  .lead:not(.compact)::before { background-size: auto 114%; background-position: 58% 100%; }
  .lead:not(.compact)::after {
    background: linear-gradient(0deg, rgba(14, 21, 53, .97) 0%, rgba(18, 27, 69, .9) 45%, rgba(27, 42, 107, .35) 75%, rgba(14, 21, 53, .55) 100%);
  }
  .lead:not(.compact) h1 { font-size: min(33px, 7.4vw); }
}
@media (max-width: 540px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .head-inner { padding: 12px 16px; }
  .wordmark { font-size: 24px; }
  .wordmark img { width: 30px; height: 30px; }
  .lead p:last-child { font-size: 15px; }
  .article-card h2 { font-size: 17px; }
  .thumb-num { font-size: 54px; }
  .article-head { padding: 20px 0 24px; }
  .article-head h1 { font-size: 26px; }
  .deck { font-size: 15px; padding: 14px 16px; }
  .article-body { padding: 20px 16px; border-radius: 20px; font-size: 16px; line-height: 1.95; }
  .article-body h2 { font-size: 19px; padding: 12px 14px 11px 20px; margin-top: 44px; }
  .article-body h3 { font-size: 17px; }
  .article-body ul, .article-body ol { padding: 14px 14px 14px 2.2em; }
  .site-foot { padding: 28px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .article-card > a, .thumb-mascot { transition: none; }
  .article-card > a:hover, .article-card > a:hover .thumb-mascot { transform: none; }
}
