/* まとめ記事（/c/〈記事〉/）の見た目。まとめ記事のページだけが読む（templates/article.html）。
   本文 16px・表とチップ 14px 以上（13px 未満を作らない）・見出し（h2）は深緑の帯に白い字・作品は白いカード。
   画像は切り抜かない（拡大・縮小だけ。contain）。拡大表示の画像を押した時の動きと PR の一文は、画像を出す段階の部品（static_images）が持つ */

/* ---- 本文と右の列（PC は 1100px 以上で本文＋右の列 300px。目次だけが付いてくる） */
.mx-wrap { max-width: 1160px; margin: 0 auto; padding: 0; }
.mx [hidden], .mx-wrap [hidden], .mx-salebar[hidden], .mx-gone, .mx-sheet:not([open]) { display: none !important; }
.mx { min-width: 0; padding: 0 0 40px; line-height: 1.8; font-size: 16px; }
.mx p { font-size: 16px; }
.mx-side { display: none; }
@media (min-width: 1100px) {
  .mx-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
  .mx-side { display: block; position: static; align-self: stretch; padding-top: 12px; }
  .mx-side-in { position: sticky; top: 12px; }
  .mx-toc-btn, .mx-sheet { display: none !important; }
}
.mx-side-in { max-height: calc(100vh - 24px); overflow-y: auto; border: 2px solid var(--brand); border-radius: 10px; background: #fff; padding: 0 16px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.mx-side-h { font-weight: bold; color: #fff; background: var(--brand); margin: 0 -16px 8px; padding: 8px 16px; font-size: 15px; }
.mx-side-toc { list-style: none; margin: 0 0 6px; padding: 0; font-size: 14px; line-height: 1.6; }
.mx-side-toc li.g { font-weight: bold; color: var(--brand-dark); margin: 10px 0 4px; }
.mx-side-toc a { display: flex; gap: 8px; padding: 8px 2px; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line); }
.mx-side-toc a:hover { color: var(--brand-dark); }
.mx-side-toc a span { flex: none; width: 1.6em; text-align: right; color: var(--brand); font-weight: bold; }
.mx-side-toc li.s a { font-weight: bold; color: var(--brand-dark); }
/* 広告の枠（300×250 のバナーが入る幅）。枠はスクロールで流れ、目次だけが付いてくる */
.mx-ad { margin: 0 0 16px; text-align: center; }
.mx-ad-box { width: 300px; height: 250px; margin: 0 auto; display: flex; align-items: center; justify-content: center;
  border: 1px dashed #b9c4bf; background: var(--panel); color: var(--muted); font-size: 14px; }
.mx-ad .pr-label { margin: 4px 0 0; }
.mx-ad .banner-img { max-width: 300px; height: auto; }

/* ---- 見出し・題名・書き手の行・説明の一文 */
.mx h2 { font-size: 20px; line-height: 1.5; margin: 40px 0 14px; padding: 10px 14px; background: var(--brand); color: #fff; border-radius: 4px; }
.mx-title { font-size: 26px; line-height: 1.45; margin: 12px 0 6px; }
.mx-byline { color: var(--muted); font-size: 14px !important; margin: 0 0 12px; }
.mx-leadline { font-weight: bold; background: var(--brand-soft); border-left: 4px solid var(--brand); padding: 10px 14px; border-radius: 4px; }
.mx-group { margin-top: 48px !important; }
/* 読み込む前・隠した画像は場所を取らない（年齢確認の前・画像を隠す・急いで止める） */
.mx img:not([src]) { display: none; }
.mx-img, .mx-rel-img { display: block; line-height: 0; }

/* ---- 迷ったらこれ（1作品を大きく。理由は書かない） */
.mx-pick { display: flex; gap: 24px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: #fff;
  color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.mx-pick:hover { border-color: var(--brand); }
.mx-pick-img { flex: none; line-height: 0; }
.mx-pick img { width: 240px; height: auto; border-radius: 4px; }
.mx-pick-b { flex: 1; min-width: 0; }
.mx-pick-t { display: block; font-size: 22px; font-weight: bold; line-height: 1.45; color: var(--fg); text-decoration: none; }
.mx-pick-t:hover { text-decoration: underline; }
.mx-pick-a { display: block; font-size: 15px; color: var(--muted); margin-top: 4px; }
.mx-pick .mx-chips { margin: 10px 0 0; }
.mx-pick .mx-buy { margin: 14px 0 0; text-align: left; max-width: 520px; }

/* ---- いまセール中の帯（迷ったらこれのすぐ下。押すとその作品のカードへ） */
.mx-salebar { margin: 14px 0 0; padding: 10px 14px; border: 1px solid #f3b4b4; border-radius: 8px; background: #fdecec; }
.mx-salebar-h { margin: 0 0 6px; font-weight: bold; color: var(--accent); font-size: 16px !important; }
.mx-salebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mx-salebar li { font-size: 15px; line-height: 1.6; }
.mx-salebar a { color: var(--fg); font-weight: bold; }

/* ---- 早見表（白い地と枠・1行おきの色。見出しを押して並べ替え） */
.mx-toc { margin: 20px 0; }
.mx-cmp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid #c9d6d0; border-radius: 10px; }
.mx-toc table { border-collapse: collapse; font-size: 14px; width: 100%; min-width: 760px; }
.mx-toc th { background: var(--brand-soft); color: var(--brand-dark); text-align: left; padding: 8px; white-space: nowrap; }
.mx-toc td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; background: #fff; }
.mx-toc tbody tr:nth-child(even) td { background: #f7faf8; }
.mx-toc tbody tr:last-child td { border-bottom: 0; }
.mx-toc td:first-child, .mx-toc th:first-child { text-align: center; width: 2.6em; white-space: nowrap; }
.mx-toc td:nth-child(2) { min-width: 15em; }
.mx-toc td:nth-child(3) { width: 7.5em; font-size: 13px; line-height: 1.5; }
.mx-toc td:nth-child(n+4) { white-space: nowrap; }
.mx-t-sale { color: var(--accent); font-size: 13px; font-weight: bold; }
.mx-sort th button { all: unset; box-sizing: border-box; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; user-select: none; font: inherit; font-weight: bold; color: inherit; white-space: nowrap; min-height: 28px; }
.mx-sort th button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.mx-sort th button span { color: var(--muted); font-weight: normal; }
.mx-sort th[aria-sort="ascending"] button span, .mx-sort th[aria-sort="descending"] button span { color: var(--brand); }
.mx-note { font-size: 13px !important; color: var(--muted); }

/* ---- 作品のカード（縦1列：表紙 → サンプル → 一言・チップ・採点 → どんな話・読みどころ → ボタン） */
.mx-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 22px 0; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.mx-h { display: flex; gap: 12px; align-items: flex-start; font-size: 19px; line-height: 1.5; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 2px solid var(--brand-soft); }
.mx-no { flex: none; width: 36px; height: 36px; line-height: 36px; text-align: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 17px; font-weight: bold; }
.mx-ht a { color: var(--fg); text-decoration: none; font-weight: bold; }
.mx-ht a:hover { text-decoration: underline; }
.mx-author { display: block; font-size: 14px; font-weight: normal; color: var(--muted); margin-top: 2px; }
.mx-top { display: block; }
.mx-media { min-width: 0; text-align: center; margin: 0 0 16px; align-self: start; }
.mx-cover { padding: 0; border: 0; background: none; cursor: zoom-in; }
.mx-cover.shot-btn { display: inline-block; width: auto; max-width: 100%; height: auto; line-height: 0; }
.mx-cover img { display: block; width: auto; max-width: 100%; height: auto; max-height: 520px; margin: 0 auto; border-radius: 4px; }
/* サンプル：切らずに正方形の枠に収める（余った所は地の色） */
.mx-samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; margin-top: 10px; }
.mx-shot { display: block; padding: 0; border: 0; background: var(--panel); cursor: zoom-in; border-radius: 3px; overflow: hidden; aspect-ratio: 1 / 1; }
.mx-shot.shot-btn { height: auto; width: 100%; }
.mx-shot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mx-shot:focus-visible { outline: 3px solid var(--brand); }
.mx-sum { font-weight: bold; margin: 0 0 12px; background: var(--brand-soft); border-left: 4px solid var(--brand); padding: 10px 12px; border-radius: 4px; line-height: 1.7; }
/* チップ */
.mx-chips { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.mx-chips li { font-size: 14px; line-height: 1.4; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.mx-chips li.money { font-weight: bold; border-color: var(--brand); color: var(--brand-dark); }
.mx-chips li.mx-asof { border: 0; padding-left: 0; padding-right: 0; color: var(--muted); font-size: 13px; }
.mx-check { font-size: 14px !important; color: var(--muted); margin: 0 0 8px; }
.mx-gl { font-size: 14px !important; color: var(--muted); margin: 10px 0 4px; }
.mx-genres li { background: var(--panel); border-color: transparent; }
/* セールの帯（カードの上で目立たせる） */
.mx-sale { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 10px; padding: 8px 12px; border-radius: 6px;
  background: #fdecec; border: 1px solid #f3b4b4; color: var(--accent); font-size: 15px !important; }
.mx-sale b { background: var(--accent); color: #fff; border-radius: 4px; padding: 2px 8px; font-size: 14px; }
.mx-sale s { color: var(--muted); }
.mx-sale strong { font-size: 18px; }
.mx-sale-end { font-size: 13px; }
/* ★の採点（付いていない分は白抜きの ☆。★との区別は形） */
.mx-score { margin: 4px 0 14px; padding: 12px 16px; border: 2px solid #e6dcc0; border-radius: 8px; background: #fffdf6; }
.mx-score-h { font-weight: bold; font-size: 16px !important; margin: 0 0 8px; color: var(--brand-dark); }
.mx-score-h span, .mx-hitokoto-h span { font-weight: normal; color: var(--muted); font-size: 13px; margin-left: 8px; }
.mx-score dl { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.mx-score dl div { display: flex; gap: 6px; align-items: center; }
.mx-score dt { font-size: 16px; color: var(--fg); font-weight: bold; }
.mx-score dd { margin: 0; font-size: 22px; letter-spacing: 2px; }
.mx-score .on { color: #e8a317; }
.mx-score .off { color: #b9a97a; }
/* 書き手のひとこと */
.mx-hitokoto { margin: 0 0 14px; padding: 12px 16px; border-left: 4px solid #e8a317; background: #fffaf0; border-radius: 4px; }
.mx-hitokoto-h { font-weight: bold; font-size: 15px !important; margin: 0 0 4px; color: #8a5a00; }
.mx-hitokoto-t { margin: 0; }
.mx-concern { margin: 0 0 14px; padding: 10px 16px; border-left: 4px solid #b9b9b9; background: #f7f7f7; border-radius: 4px; }
.mx-concern-h { font-weight: bold; font-size: 15px !important; margin: 0 0 4px; color: #555; }
.mx-concern-t { margin: 0; }
/* どんな話・読みどころ */
.mx-text { margin-top: 16px; }
.mx-text p { margin: 0 0 12px; }
.mx-label { font-size: 16px; margin: 14px 0 6px; padding-left: 10px; border-left: 4px solid var(--brand); color: var(--brand-dark); line-height: 1.4; }
.mx-extra { font-size: 14px !important; color: var(--muted); margin: 0 0 10px; }
/* 向く人／合わないかも */
.mx-fit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.mx-fit-box { border-radius: 8px; padding: 10px 14px; background: var(--panel); }
.mx-fit-box.ok { background: var(--brand-soft); }
.mx-fit-h { font-weight: bold; margin: 0 0 4px; font-size: 15px !important; }
.mx-fit-box.ok .mx-fit-h { color: var(--brand-dark); }
.mx-fit-box ul { margin: 0; padding-left: 1.2em; font-size: 15px; line-height: 1.7; }
.mx-other { font-size: 14px !important; margin: 10px 0 0; }
/* ボタン：試し読みと購入を同じ大きさで横に。PR はボタンのすぐ下（本文と同じ大きさ・色） */
.mx-buy { margin: 18px auto 0; max-width: 640px; text-align: center; }
.mx-btns { display: grid; gap: 10px; }
.mx-btns.n2 { grid-template-columns: 1fr 1fr; }
.mx-btns.n1 { max-width: 320px; margin: 0 auto; }
.mx-buy .mx-cta { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 60px; text-align: center; font-size: 17px; font-weight: bold;
  padding: 10px 12px; border-radius: 8px; box-shadow: 0 3px 0 rgba(0,0,0,.18); width: 100%; box-sizing: border-box; }
.mx-buy .mx-cta.sub { background: #fff; color: #c2185b; border: 2px solid #d63f77; box-shadow: 0 3px 0 rgba(0,0,0,.10); }
.mx-price { display: block; font-size: 13px; font-weight: normal; margin-top: 2px; }
.mx-price s { opacity: .8; }
.mx-buy .pr-label { margin: 6px 0 0; }
.mx-more { display: inline-block; margin-top: 10px; font-size: 15px; }
.mx-ended { font-weight: bold; color: var(--muted); margin: 0; }

/* ---- 好みで選ぶ・惜しくも外れた作品・よくある質問・書き手の箱・関連する記事 */
/* 好みで選ぶ：広い画面では箱を2つずつ横に並べる（1つの箱は1〜3作なので、1列だと右が空く。2026-10-25）。箱の数が奇数の時は最後の箱を横いっぱいに */
.mx-choose { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.mx-choose > h2 { grid-column: 1 / -1; }
.mx-choose > .mx-cb:last-child:nth-child(even) { grid-column: 1 / -1; }
.mx-cb { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; margin: 0; }
.mx-cb-h { font-weight: bold; font-size: 17px; color: var(--brand-dark); margin: 0 0 2px; padding-left: 10px; border-left: 4px solid var(--brand); }
.mx-cb-why { font-size: 14px !important; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
.mx-cb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.mx-cbc { display: flex; flex-direction: column; gap: 6px; color: var(--fg); text-decoration: none; }
.mx-cbc img { width: 100%; max-width: 200px; height: auto; border-radius: 4px; }
.mx-cbc:hover .mx-cbc-t { text-decoration: underline; }
.mx-cbc-t { font-size: 15px; font-weight: bold; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mx-out { display: grid; grid-template-columns: 160px 1fr; gap: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; margin: 0 0 14px; }
.mx-out-cover img { width: 160px; height: auto; border-radius: 4px; display: block; }
.mx-out-t { font-weight: bold; font-size: 17px; color: var(--fg); text-decoration: none; }
.mx-out-t:hover { text-decoration: underline; }
.mx-out-sum { font-weight: bold; margin: 8px 0 4px; }
.mx-out-meta { font-size: 14px !important; color: var(--muted); margin: 0 0 6px; }
.mx-out-why { font-size: 15px !important; margin: 0; }
.mx-faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.mx-faq summary { cursor: pointer; font-weight: bold; }
.mx-author-box { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 28px 0 10px; background: var(--brand-soft); }
.mx-ab-name { font-weight: bold; margin: 0 0 4px; }
.mx-imgnote { font-size: 13px !important; color: var(--muted); }
.mx-history ul { font-size: 14px; }
.mx-rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mx-rel { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
  color: var(--fg); text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.mx-rel:hover { border-color: var(--brand); }
.mx-rel-img { aspect-ratio: 16 / 10; background: var(--panel); overflow: hidden; }
.mx-rel-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mx-rel-t { display: block; padding: 10px 12px; font-weight: bold; font-size: 15px; line-height: 1.5; }

/* ---- 「目次」ボタン（1099px 以下）と、下から開く目次のシート。購入のボタンと重なる間は隠す（article.js が is-away を付ける） */
.mx-toc-btn { display: none; }
@media (max-width: 1099px) {
  .mx-toc-btn { display: block; position: fixed; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 50; min-width: 56px; min-height: 44px;
    padding: 0 14px; border: 0; border-radius: 22px; background: var(--brand); color: #fff; font: inherit; font-size: 14px; font-weight: bold; line-height: 44px;
    cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: opacity .15s; }
  .mx-toc-btn.is-away { opacity: 0; visibility: hidden; pointer-events: none; }
}
.mx-sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 640px; max-height: 80vh; max-height: 80dvh; padding: 0; border: 0;
  border-radius: 16px 16px 0 0; background: #fff; color: var(--fg); overflow: hidden; overscroll-behavior: contain; box-shadow: 0 -4px 16px rgba(0,0,0,.25); }
.mx-sheet[open] { display: block; animation: mx-sheet-up .2s ease-out; }
.mx-sheet::backdrop { background: rgba(0,0,0,.5); }
.mx-sheet-in { display: flex; flex-direction: column; max-height: 80vh; max-height: 80dvh; }
.mx-sheet-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 4px 16px; background: var(--brand); color: #fff; }
.mx-sheet-h { margin: 0; font-weight: bold; font-size: 16px !important; }
.mx-sheet-close { min-height: 44px; min-width: 64px; padding: 0 12px; border: 0; background: none; color: #fff; font: inherit; font-size: 15px; font-weight: bold; cursor: pointer; }
.mx-sheet .mx-side-toc a:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.mx-sheet-close:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.mx-sheet .mx-side-toc { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 4px 16px calc(12px + env(safe-area-inset-bottom, 0px)); font-size: 15px; }
.mx-sheet .mx-side-toc a { padding: 11px 2px; }
@keyframes mx-sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mx-sheet[open] { animation: none; } .mx-toc-btn { transition: none; } }

/* ---- 狭い画面 */
@media (max-width: 860px) {
  .mx-card { padding: 14px; }
  .mx-cover img { max-height: 440px; }
  .mx-pick { flex-direction: column; text-align: center; padding: 16px; gap: 12px; }
  .mx-pick img { width: 100%; max-width: 300px; }
  .mx-pick-t { font-size: 19px; }
  .mx-pick .mx-buy { text-align: center; max-width: none; }
  .mx-pick .mx-chips { justify-content: center; }
  .mx-choose { display: block; }
  .mx-cb { margin: 0 0 14px; }
  .mx-cb-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mx-out { grid-template-columns: 110px 1fr; gap: 12px; }
  .mx-out-cover img { width: 110px; }
  .mx-btns { gap: 8px; }
  .mx-buy .mx-cta { font-size: 15px; line-height: 1.35; padding: 8px 6px; min-height: 56px; }
  .mx-samples { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .mx-score dd { font-size: 19px; }
  .mx-fit { grid-template-columns: 1fr; }
}
/* スマホ（600px 以下）：カードは左右いっぱい（サイトの .page の左右 16px の所まで）。サンプルは3枚（1行）だけ出し、残りは拡大表示の「次へ」で送る。
   早見表は題名の列を左に固定 */
@media (max-width: 600px) {
  .mx-card { margin-left: -16px; margin-right: -16px; padding: 16px; border-left: 0; border-right: 0; border-radius: 0; }
  .mx-samples .mx-shot:nth-child(n+4) { display: none !important; }
  .mx-toc th:nth-child(2), .mx-toc td:nth-child(2) { position: sticky; left: 0; z-index: 1; min-width: 9.5em; max-width: 11em; box-shadow: 1px 0 0 var(--line), 3px 0 4px -2px rgba(0,0,0,.18); }
  .mx-toc th:nth-child(2) { background: var(--brand-soft); z-index: 2; }
  .mx-toc table { min-width: 800px; }
}
