/**
 * 漫画でわかる みんなシステムズ（/manga/ の一覧、/manga/{slug}/ の1話のページ、/history/ の最後のリンク）
 * 一覧は templates/index.php、1話のページは templates/episode.php
 * コマ内の文字サイズは cqw（ページ幅に対する%）で指定し、ページの大きさが変わっても崩れないようにしている
 */
.mb { --ink:#111; padding:72px 16px 80px; background:#efede8; }
.mb__inner { max-width:1080px; margin:0 auto; }
.mb__head { text-align:center; margin-bottom:28px; }
.mb__en { margin:0; font-size:12px; letter-spacing:.24em; color:#888; font-weight:700; }
.mb__title { margin:8px 0 0; font-size:26px; font-weight:700; color:#111; }
.mb__lead { margin:12px 0 0; font-size:14px; color:#555; line-height:1.8; }

/* 一覧ページ（/manga/） */
main:has(.mb--index) { margin-bottom:0; }
.mb--index { padding-top:52px; }
.mb__foot { display:flex; flex-wrap:wrap; justify-content:center; gap:12px; margin-top:12px; }
.mb__foot a { display:inline-block; padding:14px 28px; border-radius:999px; text-decoration:none; font-weight:700; font-size:15px; border:2px solid #111; background:#fff; color:#111; }
.mb__foot a.is-primary { background:#fed93f; border-color:#fed93f; }

/* /history/（みんシス物語）の最後の「ほかの漫画も読む」 */
.mb-more { background:#f4f1ea; padding:0 12px 88px; }
.mb-more__link { display:grid; gap:4px; max-width:760px; margin:0 auto; padding:22px 24px; background:#fff; border:2px solid #231815; box-shadow:0 4px 0 #231815; color:#231815; text-decoration:none; text-align:center; transition:transform .15s, box-shadow .15s; }
.mb-more__link:hover { transform:translateY(2px); box-shadow:0 2px 0 #231815; color:#231815; }
.mb-more__en { font-size:12px; font-weight:700; letter-spacing:.2em; color:#b8860b; }
.mb-more__text { font-size:15px; font-weight:700; }
.mb-more__go { font-size:17px; font-weight:900; }

/* 一覧（カテゴリごとに、1話ずつのページへのリンク） */
.mb__cat { margin:0 0 36px; }
.mb__cat-title { margin:0 0 14px; padding:0 0 0 12px; border:0; border-left:6px solid #f7d13b; background:none; font-size:18px; font-weight:800; color:#111; line-height:1.4; }
.mb__cat-title::before, .mb__cat-title::after { display:none; }
.mb__cards { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:16px; }
.mb__cards li { margin:0; padding:0; }
.mb__cards li::before { display:none; }
.mb__card { display:flex; flex-direction:column; height:100%; background:#fff; color:#111; text-decoration:none; border:2px solid #111; box-shadow:0 4px 0 #111; transition:transform .15s, box-shadow .15s; }
.mb__card:hover { transform:translateY(2px); box-shadow:0 2px 0 #111; color:#111; }
.mb__card-img { display:block; aspect-ratio:16 / 10; overflow:hidden; border-bottom:2px solid #111; background:#ddd; }
.mb__card-img img { width:100%; height:100%; object-fit:cover; display:block; max-width:none; }
.mb__card-body { display:flex; flex-direction:column; gap:4px; padding:12px 14px 14px; flex:1; }
.mb__card-no { font-size:12px; font-weight:800; color:#888; letter-spacing:.06em; }
.mb__card-title { font-size:15px; font-weight:800; line-height:1.5; }
.mb__card-meta { margin-top:auto; padding-top:6px; font-size:12px; font-weight:700; color:#b8860b; }
.mb__soon { margin:0; padding:20px; text-align:center; background:#fff; border:2px dashed #bbb; color:#666; font-size:14px; line-height:1.8; }

/* ページ（表紙・裏表紙の cqw はページ幅が基準） */
.mb .page { container-type:inline-size; }
.mb .sheet { position:relative; width:100%; height:100%; background:#fff; padding:5.5% 5% 7%; box-sizing:border-box; container-type:inline-size; overflow:hidden; }
.mb .grid { position:relative; width:100%; height:100%; }
.mb .panel { position:absolute; margin:0; overflow:hidden; border:.45cqw solid var(--ink); background:#ddd; box-sizing:border-box; }
.mb .panel img { width:100%; height:100%; object-fit:cover; display:block; max-width:none; }
.mb .nombre { position:absolute; bottom:2.4%; left:0; right:0; text-align:center; font-size:2cqw; color:#555; }

/* 吹き出し・ナレーションなど */
.mb .bubble, .mb .narr, .mb .tag, .mb .shout { writing-mode:vertical-rl; white-space:pre; margin:0; }
.mb .bubble { position:absolute; background:#fff; color:var(--ink); border:.35cqw solid var(--ink); border-radius:50%; padding:3cqw 2.4cqw;
              font-weight:700; font-size:2.45cqw; line-height:1.5; letter-spacing:.04em; }
.mb .shout-wrap { position:absolute; filter:drop-shadow(.3cqw 0 0 #111) drop-shadow(-.3cqw 0 0 #111) drop-shadow(0 .3cqw 0 #111) drop-shadow(0 -.3cqw 0 #111); }
.mb .shout { color:var(--ink); background:#fff; font-weight:900; font-size:5cqw; line-height:1.2; padding:5cqw 4.4cqw;
             clip-path:polygon(50% 0,58% 12%,72% 3%,73% 18%,92% 14%,84% 30%,100% 38%,86% 50%,100% 62%,84% 70%,92% 86%,73% 82%,72% 97%,58% 88%,50% 100%,42% 88%,28% 97%,27% 82%,8% 86%,16% 70%,0 62%,14% 50%,0 38%,16% 30%,8% 14%,27% 18%,28% 3%,42% 12%); }
.mb .narr { position:absolute; background:#fff; color:var(--ink); border:.3cqw solid var(--ink); padding:1.8cqw 1.4cqw;
            font-family:"Hiragino Mincho ProN","Yu Mincho","Noto Serif JP",serif; font-weight:600; font-size:2.35cqw; line-height:1.55; }
.mb .tag { position:absolute; background:var(--ink); color:#fff; font-weight:800; font-size:2.9cqw; padding:1.8cqw 1.2cqw; letter-spacing:.08em; white-space:nowrap; }
.mb .label { position:absolute; margin:0; background:var(--ink); color:#fff; font-size:1.9cqw; font-weight:700; padding:.8cqw 1.6cqw; line-height:1.4; white-space:pre; }
.mb .label small { display:block; font-size:1.5cqw; font-weight:500; opacity:.85; }

/* まとめのコマ */
.mb .summary { position:absolute; margin:0; border:.45cqw solid var(--ink); box-sizing:border-box; background:#fff; padding:3cqw 3.4cqw; }
.mb .summary h3 { margin:0 0 2.2cqw; padding:0; border:0; background:none; font-size:3.4cqw; text-align:center; letter-spacing:.06em; color:#111; }
.mb .summary h3::before, .mb .summary h3::after { display:none; }
.mb .summary ol { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:1fr 1fr; gap:1.6cqw 2.4cqw; }
.mb .summary li { display:flex; align-items:center; gap:1.4cqw; font-size:2.5cqw; font-weight:700; border-bottom:.2cqw solid #ccc; padding:0 0 1.2cqw; margin:0; line-height:1.4; }
.mb .summary li::before { display:none; }
.mb .summary li b { flex:none; width:4.6cqw; height:4.6cqw; border-radius:50%; background:var(--ink); color:#fff; display:grid; place-items:center; font-size:2.3cqw; }
.mb .summary li span { font-weight:500; font-size:1.9cqw; color:#555; display:block; }

/* 説明用の文字だけのコマ（式・計算・チェックリスト） */
.mb .board { position:absolute; margin:0; border:.45cqw solid var(--ink); box-sizing:border-box; background:#fff;
             display:flex; flex-direction:column; justify-content:center; align-items:center; gap:2cqw; padding:3cqw 4cqw; text-align:center; color:#111; }
.mb .board__label { font-size:2.4cqw; font-weight:700; color:#666; letter-spacing:.08em; }
.mb .board__eq { font-size:5.2cqw; font-weight:900; line-height:1.3; letter-spacing:.02em; }
.mb .board__eq em { font-style:normal; background:linear-gradient(transparent 60%, #f7d13b 60%); padding:0 .4cqw; }
.mb .board__row { font-size:3.2cqw; font-weight:800; line-height:1.4; }
.mb .board__row small { display:block; font-size:2.2cqw; font-weight:600; color:#555; }
.mb .board__note { font-size:2.4cqw; font-weight:700; color:#333; line-height:1.5; white-space:pre-line; }
.mb .board__list { list-style:none; margin:0; padding:0; text-align:left; display:grid; gap:1.4cqw; width:100%; }
.mb .board__list li { margin:0; padding:0 0 1.2cqw 5.6cqw; position:relative; font-size:2.7cqw; font-weight:700; line-height:1.45; border-bottom:.2cqw solid #ddd; }
.mb .board__list li::before { content:""; position:absolute; left:0; top:.4cqw; width:3.2cqw; height:3.2cqw; border:.4cqw solid #111; border-radius:.6cqw; background:#fff; }
.mb .board__list li::after { content:""; position:absolute; left:.9cqw; top:.5cqw; width:1.2cqw; height:2.2cqw; border:solid #e07b39; border-width:0 .6cqw .6cqw 0; transform:rotate(45deg); }

/* 表紙・裏表紙 */
.mb .cover { position:relative; width:100%; height:100%; background:#111; color:#fff; overflow:hidden; container-type:inline-size; }
.mb .cover img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.92; max-width:none; }
.mb .cover__band { position:absolute; left:0; right:0; bottom:9%; text-align:center; padding:8cqw 0 4cqw; background:linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.75) 35%); }
.mb .cover__series { display:inline-block; background:#fff; color:#111; font-weight:800; font-size:3.4cqw; padding:1.2cqw 3cqw; letter-spacing:.12em; }
.mb .cover__title { margin:4cqw 0 0; padding:0; border:0; background:none; color:#fff; font-size:9cqw; font-weight:900; line-height:1.15; text-shadow:0 0 1.2cqw #000, 0 0 2.4cqw #000; }
.mb .cover__ep { display:block; font-size:4cqw; font-weight:800; margin-bottom:1.5cqw; }
.mb .cover__foot { position:absolute; left:0; right:0; bottom:0; padding:3cqw 5cqw; background:#fff; color:#111; display:flex; justify-content:space-between; align-items:center; font-weight:800; font-size:3cqw; }
/* 裏表紙：HPのメインカラー（common.css の --color-primary） */
.mb .back { width:100%; height:100%; background:#f7d13b; color:#111; display:flex; flex-direction:column; align-items:center; justify-content:center;
             gap:6cqw; padding:10cqw 8cqw; box-sizing:border-box; text-align:center; container-type:inline-size; }
.mb .back__illust { width:44%; height:auto; max-width:none; filter:drop-shadow(0 1.2cqw 0 rgba(0,0,0,.12)); }
.mb .back__logo { width:34%; height:auto; max-width:none; }
.mb .back p { margin:0; font-size:5.4cqw; line-height:1.7; font-weight:800; color:#111; }
.mb .back small { display:block; margin-top:3cqw; font-size:3.4cqw; font-weight:700; color:#333; }

/* ---------- 1話のページ（/manga/{slug}/）：創業の話と同じく縦に並べて読む ---------- */
main:has(.mv) { margin-bottom:0; }
.mv { --mv-w:min(760px, calc(100% - 24px)); background:#f4f1ea; color:#2b3540; padding:0 0 88px; overflow:clip; }
.mv__head { width:var(--mv-w); margin:0 auto; padding:52px 0 36px; text-align:center; }
.mv__series { margin:0; font-size:13px; font-weight:700; letter-spacing:.16em; color:#b8860b; }
.mv__title { margin:10px 0 0; padding:0; border:0; background:none; font-size:clamp(24px, 4.4vw, 38px); font-weight:900; line-height:1.35; color:#231815; }
.mv__title::before, .mv__title::after { display:none; }
.mv__title span { display:block; font-size:.5em; color:#888; margin-bottom:4px; letter-spacing:.06em; }
.mv__lead { margin:14px 0 0; font-size:15px; line-height:1.9; }

.mb.mv__book { padding:0; background:none; display:grid; gap:40px; }
.mv__book > .page { width:var(--mv-w); margin:0 auto; aspect-ratio:1 / 1.414; background:#fff; box-shadow:0 2px 0 rgba(0,0,0,.04), 0 12px 32px rgba(35,24,21,.10); }
/* 見開きをそろえる白ページと裏表紙は、縦読みでは出さない */
.mv__book > .page:has(> .sheet[aria-hidden]), .mv__book > .page:has(> .back) { display:none; }

.mv__end { width:var(--mv-w); margin:56px auto 0; text-align:center; }
.mv__end-text { margin:0; font-size:clamp(18px, 3vw, 24px); font-weight:800; line-height:1.7; color:#231815; }
.mv__buttons { display:flex; flex-wrap:wrap; justify-content:center; gap:12px; margin-top:20px; }
.mv__buttons a { display:inline-block; padding:14px 28px; border-radius:999px; text-decoration:none; font-weight:700; font-size:15px; border:2px solid #231815; background:#fff; color:#231815; }
.mv__buttons a.is-primary { background:#fed93f; border-color:#fed93f; }
.mv__pager { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:44px; text-align:left; }
.mv__pager a { display:block; padding:14px 16px; background:#fff; border:2px solid #231815; color:#231815; text-decoration:none; font-weight:700; font-size:14px; line-height:1.5; }
.mv__pager small { display:block; font-size:12px; color:#888; margin-bottom:2px; }
.mv__pager-next { grid-column:2; text-align:right; }
.mv__all { margin:20px 0 0; font-size:14px; }
.mv__all a { color:#231815; font-weight:700; }

@media (max-width:599px) {
  .mb.mv__book { gap:24px; }
  .mv { padding-bottom:64px; }
  .mv__pager { grid-template-columns:1fr; }
  .mv__pager-next { grid-column:1; }
}
