/* ==========================================================
   MisoWorks 公式サイトの見た目
   ・端末の設定(ダーク / ライト)に合わせて、自動で色が変わる
   ・色は下の 2 つのかたまり(ダーク・ライト)にまとめてある。色を変えるときはここだけ直す
   ========================================================== */

/* ダークモード(基本の色) */
:root {
  color-scheme: dark;
  --bg: #121417;        /* 背景(チャコールグレー。真っ黒は使わない) */
  --surface: #1E2126;   /* 少しだけ明るい面(画像の下地・コードなど) */
  --line: #2C3037;      /* 区切りの線 */
  --text: #F2F2F2;      /* 文字(柔らかい白) */
  --body: #E2E4E7;      /* 長い文章の文字 */
  --muted: #9CA3AC;     /* 補助の文字(グレー) */
  --link: #7FE7C4;      /* リンク(ミントグリーン) */
  --accent: #7FE7C4;    /* Google Play のボタン */
  --accent-ink: #0F2A21;/* ボタンの上の文字 */
}

/* ライトモード(端末がライトの設定のとき) */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #FAFAF8;
    --surface: #EFF0F1;
    --line: #E2E4E7;
    --text: #1D2024;
    --body: #2A2E33;
    --muted: #5E656E;
    --link: #0B7A5C;    /* 白い地ではミントが読みにくいので、同じ系統の濃い緑にする */
    --accent: #7FE7C4;
    --accent-ink: #0F2A21;
  }
}

:root {
  --width: 700px;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.45; }
/* 見出しを、日本語の言葉の切れ目で折り返す(1 文字だけ次の行に落ちるのを防ぐ。対応していないブラウザではふつうに折り返す) */
h1, h2, h3, .post-item__title { word-break: auto-phrase; text-wrap: pretty; }

.container { max-width: var(--width); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 10; background: var(--bg); padding: 8px 12px; }
.muted { color: var(--muted); }

/* ---------- ヘッダー ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo { color: var(--text); text-decoration: none; font-size: 20px; font-weight: 400; white-space: nowrap; }
.logo b { font-weight: 800; }
.nav { display: flex; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 15px;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
}
.nav a:last-child { padding-right: 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

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

/* ---------- 見出し・まとまり ---------- */
.page-title { font-size: 24px; margin: 0 0 8px; }
.section { margin-top: 48px; }
.section:first-child { margin-top: 0; }
.section-title {
  font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em;
  margin: 0 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.more { margin: 16px 0 0; font-size: 15px; }

/* トップの紹介文 */
.intro { margin: 0 0 8px; }
.intro p { margin: 0; font-size: 17px; color: var(--body); }

/* ---------- ボタン ---------- */
.btn-play {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 16px; text-decoration: none;
}
.btn-play:hover { filter: brightness(1.05); }
.btn-play__icon { width: 16px; height: 16px; fill: currentColor; flex: none; }
.btn-play--large { min-height: 56px; font-size: 17px; width: 100%; }
.btn-play--disabled { background: var(--surface); color: var(--muted); }

/* ---------- アプリ ---------- */
.app-entry + .app-entry { margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--line); }
.app-entry__head { display: flex; align-items: center; gap: 14px; }
.app-icon { width: 60px; height: 60px; border-radius: 14px; flex: none; background: var(--surface); object-fit: cover; }
.app-icon--large { width: 88px; height: 88px; border-radius: 20px; }
.app-entry__name { margin: 0; font-size: 19px; }
.app-entry__name a { color: var(--text); text-decoration: none; }
.app-entry__name a:hover { text-decoration: underline; }
.app-entry__tagline { margin: 2px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.app-entry__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 18px; }
.app-entry__actions a:not(.btn-play) { font-size: 15px; padding: 10px 0; }

/* アプリの段階の印(テスト中・まもなくリリース。言葉は _data/app_status.yml) */
.status-badge {
  display: inline-block; vertical-align: middle; margin-left: 10px;
  font-size: 12px; font-weight: 700; line-height: 1; letter-spacing: 0.02em; white-space: nowrap;
  padding: 5px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted);
}
.status-badge--coming_soon { border-color: var(--link); color: var(--link); }
.status-note { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* スクリーンショット(縦長 9:16 を想定) */
.shots img { aspect-ratio: 9 / 16; object-fit: cover; width: 100%; border-radius: 8px; background: var(--surface); }
.shots--row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.shots--gallery {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 28px -20px 0; padding: 0 20px 8px;
  scrollbar-color: var(--line) transparent;
}
.shots--gallery img { flex: 0 0 64%; max-width: 260px; scroll-snap-align: start; }

/* アプリのページ */
.app-head { display: flex; align-items: center; gap: 18px; margin: 0 0 24px; }
.app-head__name { font-size: 26px; margin: 0; }
.app-head__tagline { margin: 4px 0 0; color: var(--muted); line-height: 1.6; }
.feature-list { margin: 0; padding-left: 1.3em; color: var(--body); }
.feature-list li { margin: 0.5em 0; }
.feature-list li::marker { color: var(--muted); }
.cta { margin-top: 40px; }
.cta p { margin: 12px 0 0; font-size: 14px; }

/* ---------- ブログ ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.post-item:first-child { padding-top: 0; }
.post-item__title { display: inline-block; color: var(--text); font-size: 17px; font-weight: 700; line-height: 1.55; text-decoration: none; }
.post-item__title:hover { text-decoration: underline; }
.post-item__summary { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.post-meta { margin: 0 0 2px; color: var(--muted); font-size: 13px; letter-spacing: 0.02em; }
.post-meta .sep { margin: 0 0.4em; }

.cat-nav { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 4px 0 24px; font-size: 15px; }
.cat-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.cat-nav a:hover { color: var(--text); }
.cat-nav a[aria-current="page"] { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 6px; }
.empty { color: var(--muted); }

/* 記事のページ */
.post-header { margin-bottom: 28px; }
.post-title { font-size: 25px; margin: 6px 0 0; }
.breadcrumb { margin: 0 0 20px; font-size: 14px; }
.breadcrumb a { display: inline-block; padding: 6px 0; }
.post-nav { display: grid; gap: 4px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; }
.post-nav a { display: block; padding: 8px 0; }
.post-nav span { display: block; color: var(--muted); font-size: 13px; }
.post-nav__next { text-align: right; }
.post-back { margin-top: 40px; }
.post-nav + .post-back { margin-top: 16px; }

/* 長い文章(記事・説明・プライバシーポリシー) */
.prose { color: var(--body); font-size: 17px; line-height: 1.95; letter-spacing: 0.02em; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1.5em; }
.prose h2 { color: var(--text); font-size: 20px; margin: 2.2em 0 0.7em; }
.prose h3 { color: var(--text); font-size: 18px; margin: 1.8em 0 0.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0.3em 0; }
.prose strong { color: var(--text); }
.prose img { border-radius: 6px; margin: 1.5em auto; }
.prose blockquote { padding: 2px 0 2px 16px; border-left: 3px solid var(--line); color: var(--muted); margin-left: 0; }
.prose code { background: var(--surface); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.prose pre { background: var(--surface); padding: 16px; border-radius: 6px; overflow-x: auto; line-height: 1.6; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; }

/* まだ書いていない部分(TODO)の目印。本文を書いたら消える */
.todo {
  border: 1px dashed var(--muted); border-radius: 6px; padding: 10px 14px;
  color: var(--muted); font-size: 15px; line-height: 1.7;
}
.notice { border-left: 3px solid var(--line); padding-left: 14px; color: var(--muted); font-size: 15px; }
.updated { color: var(--muted); font-size: 13px; margin: 0 0 28px; }

/* ---------- リンク ---------- */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.link-list li:first-child { padding-top: 0; }
.link-list a { font-weight: 700; display: inline-block; padding: 4px 0; }
.link-list .muted { display: block; font-size: 14px; line-height: 1.6; }

/* ---------- フッター ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 18px; margin-bottom: 10px !important; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- 書く画面(/write/。運営者用) ---------- */
.write-form { margin-top: 24px; }
.field { margin-bottom: 18px; flex: 1; min-width: 0; }
.field label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.field label .muted { font-weight: 400; font-size: 13px; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { min-width: 140px; }
.field-inline { display: flex; gap: 10px; }
.field-inline input { flex: 1; min-width: 0; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; line-height: 1.7;
}
.field textarea { resize: vertical; min-height: 280px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--link); outline-offset: 0; border-color: transparent; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.hint summary { cursor: pointer; padding: 6px 0; }
.hint ul { margin: 4px 0 0; padding-left: 1.3em; }
.write-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
button.btn-sub { background: none; cursor: pointer; font: inherit; color: var(--text); }
button.btn-play { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.btn-sub {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 18px; border-radius: 6px; border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 15px;
}
.row-actions { display: flex; gap: 20px; margin-top: 2px; }
.row-actions a { display: inline-flex; align-items: center; min-height: 40px; font-weight: 400; }
.write-preview { border: 1px dashed var(--line); border-radius: 6px; padding: 20px; }
.steps { padding-left: 1.4em; color: var(--body); }
.steps li { margin: 0.4em 0; }

/* ---------- 404 ---------- */
.notfound .page-title { margin-top: 8px; }

/* ---------- 大きい画面 ---------- */
@media (min-width: 720px) {
  .site-main { padding-top: 56px; }
  .page-title { font-size: 28px; }
  .post-title { font-size: 30px; }
  .app-head__name { font-size: 30px; }
  .btn-play--large { width: auto; min-width: 280px; }
  .shots--gallery { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .shots--gallery img { flex-basis: 220px; }
  .post-nav { grid-template-columns: 1fr 1fr; }
}
