/* ==========================================================================
   段階3（記事のページ）の見た目。build.py が、モックの assets/css/style.css のうち
   レビュー記事（review.php）の部品の規則だけを写して作る（直接は直さない。直すときはモック側を直して build.py を実行する）
   どの規則も、新しい記事の中身（.mdk-single）の中だけに効く形にしてある。色は、モックの基本の色（ダーク）
   並び：Cocoon が0にした余白を戻す → 本文の部分の地の色 → マウスを乗せたときの色 → モックの規則（コメントもモックのまま）
   ========================================================================== */

/* Cocoon は「* { margin: 0; padding: 0 }」ですべての余白を消している。モックの CSS はブラウザの初期の余白を
   前提にしているので、戻す。:where() で優先度を最も低くしてあり、この後に読むモックの CSS が必ず勝つ。
   Cocoon のウィジェットや本文に影響しないよう、子テーマが作る部分（.mdk-scope の中）だけに効かせる */
:where(.mdk-single) :where(p, ul, ol, dl, blockquote, pre) { margin-block: 1em; }
:where(.mdk-single) :where(ul, ol) { padding-left: 40px; }
:where(.mdk-single) :where(ul ul, ol ol, ul ol, ol ul) { margin-block: 0; }
:where(.mdk-single) :where(h1) { margin-block: .67em; }
:where(.mdk-single) :where(h2) { margin-block: .83em; }
:where(.mdk-single) :where(h3) { margin-block: 1em; }
:where(.mdk-single) :where(h4) { margin-block: 1.33em; }
:where(.mdk-single) :where(figure) { margin: 1em 40px; }
:where(.mdk-single) :where(dd) { margin-left: 40px; }
:where(.mdk-single) :where(button) { padding: 1px 6px; }
:where(.mdk-single) :where(input, textarea) { padding: 1px 2px; }
:where(.mdk-single) :where(th, td) { padding: 1px; }

/* 本文の部分の地の色（モックの --paper と同じ）。Cocoon の本文の枠（#content）だけに付け、枠の外にある Cocoon の部品
   （通知エリア・カルーセル・コンテンツ上部と下部のウィジェットなど）は、Cocoon の明るい地のままにする */
body.mdk-single-page #content {
  background-color: #15130f;
}

/* マウスを乗せたときに、Cocoon の「a:hover」の赤色にしない（下のモックの規則の色を、:hover にも付けた写し） */
.mdk-single:hover { color: var(--ink); }
.mdk-single a:hover { color: var(--accent-ink); }
.mdk-single .chip:hover { color: var(--ink); }
.mdk-single .chip[aria-current="page"]:hover { color: var(--on-ink); }
.mdk-single .chip--small:hover { color: var(--accent-ink); }
.mdk-single .stars:hover { color: var(--star-empty); }
.mdk-single .stars-fill:hover { color: var(--star); }
.mdk-single .rating-num:hover { color: var(--ink); }
.mdk-single .pr-badge:hover { color: var(--ink); }
.mdk-single .pr-badge--on-accent:hover { color: #fff; }
.mdk-single .mdk-breadcrumb:hover { color: var(--ink-3); }
.mdk-single .mdk-breadcrumb a:hover { color: var(--ink-2); }
.mdk-single .mdk-card-meta:hover { color: var(--ink-3); }
.mdk-single .card-link:hover { color: var(--ink); }
.mdk-single .card-excerpt:hover { color: var(--ink-2); }
.mdk-single .pr-notice:hover { color: var(--ink-2); }
.mdk-single .review-meta:hover { color: var(--ink-3); }
.mdk-single .review-score-label:hover { color: var(--ink-2); }
.mdk-single .quick-verdict-label:hover { color: var(--on-ink); }
.mdk-single .key-facts > li:hover { color: var(--ink-2); }
.mdk-single .gallery-count:hover, .mdk-single .gallery-zoom-hint:hover { color: #fff; }
.mdk-single .gallery-arrow:hover { color: #fff; }
.mdk-single .mdk-gallery-caption:hover { color: var(--ink-3); }
.mdk-single .trailer:hover { color: #e9e2d8; }
.mdk-single .trailer-text small:hover { color: #c9c0b3; }
.mdk-single .verdict-kicker:hover { color: var(--on-ink); }
.mdk-single .fit-col--good .fit-title:hover { color: var(--good-ink); }
.mdk-single .fit-col--bad .fit-title:hover { color: var(--bad-ink); }
.mdk-single .verdict-note:hover { color: var(--ink-3); }
.mdk-single .cta-head:hover { color: var(--ink-2); }
.mdk-single .cta-plan:hover { color: var(--ink-2); }
.mdk-single .mdk-cta-button:hover { color: #fff; }
.mdk-single .cta-note:hover { color: var(--ink-3); }
.mdk-single .cta-button--sub:hover { color: var(--accent-ink); }
.mdk-single .cta-bar-date:hover { color: var(--ink-3); }
.mdk-single .cta-bar-button:hover { color: #fff; }
.mdk-single .mdk-toc-title:hover { color: var(--ink-2); }
.mdk-single .mdk-toc a:hover { color: var(--ink); }
.mdk-single .section-note:hover { color: var(--ink-3); }
.mdk-single .spec-table th:hover { color: var(--ink-2); }
.mdk-single .lightbox:hover { color: #fff; }
.mdk-single .lightbox-count:hover { color: #d8d0c4; }
.mdk-single .lightbox-btn:hover { color: #fff; }

/* ---------- 色・文字・余白の基準 ----------
   色はダーク（暗い色）を基本にする（2026-12-05）。ライトの色は、下の :root[data-theme="light"] で置き換える */
.mdk-single {
  color-scheme: dark;      /* ブラウザが描く部品（入力欄・スクロールバー）もダークの色にする */
  --paper: #15130f;        /* ページの背景 */
  --surface: #1e1b17;      /* カード・枠の背景 */
  --ink: #efe8df;          /* 本文の文字 */
  --ink-2: #cfc5b9;        /* 補足の文字 */
  --ink-3: #a5998b;        /* 日付などの控えめな文字（背景とのコントラスト比は4.5以上） */
  --line: #38322b;         /* 区切り線 */
  --line-strong: #857b6f;  /* 入力欄などの枠（背景とのコントラスト比は3以上） */
  --accent: #b5541c;       /* ボタンなど強調の色（白い文字とのコントラスト比は4.5以上。ライトでも同じ色） */
  --accent-ink: #f29a62;   /* リンクの文字の色 */
  --accent-soft: #2a1e16;  /* 強調の色の薄い背景 */
  --fact-soft: #1a2129;    /* 表の見出しの列 */
  --good-bg: #17251a;      /* 向いている視聴者 */
  --good-ink: #93d4a1;
  --bad-bg: #2d1b16;       /* 向いていない視聴者 */
  --bad-ink: #f3a891;
  --caution-bg: #2a2111;   /* 注意点の枠 */
  --caution-line: #6e5621;
  --caution-ink: #f0c763;
  --star: #f0b13a;         /* 星の色 */
  --focus: #74aaff;        /* キーボードで操作しているときの枠 */
  --on-ink: #15130f;       /* --ink を背景にした所の文字（--ink の色のボタン・選択中のジャンル・ラベル） */
  --on-ink-2: #4f463d;     /* 選択中のジャンルの件数 */
  --field-bg: #1a1713;     /* 入力欄・選択欄の背景 */
  --header-bg: rgba(24, 21, 18, .96);  /* 固定ヘッダーの背景（少し透かす） */
  --bar-bg: rgba(30, 27, 23, .97);     /* スマホの画面下のバーの背景 */
  --bar-shadow: 0 -1px 0 var(--line), 0 -6px 20px rgba(0, 0, 0, .45);
  --accent-line: #4e3727;  /* ひとこと結論の枠の線 */
  --accent-line-2: #5a4232; /* 基本情報のラベルの線 */
  --star-empty: #4f463d;   /* 星の、点の無い部分 */
  --media-bg: #2b2621;     /* 画像を読み込むまでの背景 */
  --caution-mark: #f0c763; /* 注意点の「!」の丸 */
  --caution-mark-ink: #15130f;
  --footer-bg: #0f0d0b;    /* フッター（ライトでもダークでも暗い帯にする） */
  --trailer-line: rgba(255, 255, 255, .1);  /* 予告編の枠の縁（ライトでは線を出さない） */
  --toast-line: rgba(255, 255, 255, .18);   /* 案内（トースト）の縁（ライトでは線を出さない） */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .35);
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  --container: 1120px;     /* 中身の最大の幅 */
  --gutter: 20px;          /* 画面の左右の余白 */
  --section-gap: clamp(56px, 8vw, 96px); /* セクションとセクションの間 */
  --sticky-top: 84px;      /* 固定ヘッダーの高さ＋少し。目次のジャンプ先が隠れないようにする */
}

@media (min-width: 640px) {
  .mdk-single { --gutter: 28px; }
}

@media (min-width: 960px) {
  .mdk-single { --gutter: 32px; }
}

/* ---------- 基本 ---------- */
.mdk-single *,
.mdk-single *::before,
.mdk-single *::after {
  box-sizing: border-box;
}

.mdk-single {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.mdk-single img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.mdk-single a {
  color: var(--accent-ink);
  text-underline-offset: .2em;
}

.mdk-single :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* 中身の幅をそろえる入れ物。左右の余白だけを持たせる（上下の余白は各セクションで持つ） */
.mdk-single .mdk-container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* iPhoneを横にしたとき、画面の切り欠き（ノッチ）の下に文字が入らないようにする（header.php の viewport-fit=cover と組み合わせる） */
@supports (padding: max(0px)) {
  .mdk-single .mdk-container {
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
}

/* 見出しは文節の切れ目で折り返し、行の長さもそろえる（「レビ／ュー」のような、単語の途中での改行を防ぐ）。
   word-break: auto-phrase に対応しているのは今のところ Chrome・Edge だけ。
   対応していないブラウザでは、これまでどおり文字の単位で折り返す（崩れはしない） */
.mdk-single .section-title,
.mdk-single .mdk-card-title,
.mdk-single .verdict-title,
.mdk-single .section-heading {
  word-break: auto-phrase;
  text-wrap: balance;
}

/* 画面には出さず、読み上げだけで伝える文字 */
.mdk-single .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 共通の部品 ---------- */

/* セクションの上の余白（どのセクションも同じ間隔にそろえる） */
.mdk-single .section {
  padding-top: var(--section-gap);
}

.mdk-single .section-title {
  margin: 0 0 20px;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800;
  line-height: 1.4;
}

/* ジャンルなどの丸いラベル */
.mdk-single .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}

.mdk-single .chip:hover {
  border-color: var(--ink);
}

.mdk-single .chip[aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.mdk-single .chip--small {
  padding: 1px 9px;
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
}

/* 星の評価：灰色の星5つの上に、評価の割合だけ黄色の星を重ねる */
.mdk-single .rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mdk-single .stars {
  position: relative;
  display: inline-block;
  color: var(--star-empty);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 1px;
  white-space: nowrap;
}

.mdk-single .stars::before {
  content: "★★★★★";
}

.mdk-single .stars-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  color: var(--star);
  white-space: nowrap;
}

.mdk-single .stars-fill::before {
  content: "★★★★★";
}

.mdk-single .rating-num {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.mdk-single .rating--large .stars {
  font-size: 20px;
}

.mdk-single .rating--large .rating-num {
  font-size: 20px;
}

/* 「PR」の表示。広告であることがひと目で分かるよう、文字の大きさ・枠線を控えめにしすぎない */
.mdk-single .pr-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--ink-2);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
}

/* 色の付いたボタンの中に置く「PR」（白い枠と文字にして、ボタンの色の上でも読めるようにする） */
.mdk-single .pr-badge--on-accent {
  min-width: 30px;
  height: 20px;
  border-color: rgba(255, 255, 255, .9);
  background: transparent;
  color: #fff;
  font-size: 11px;
}

/* パンくずリスト */
.mdk-single .mdk-breadcrumb {
  margin: 16px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

.mdk-single .mdk-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mdk-single .mdk-breadcrumb ol > li + li::before {
  content: "›";
  margin-right: 4px;
}

.mdk-single .mdk-breadcrumb a {
  color: var(--ink-2);
}

/* ---------- カード（トップ・一覧・関連レビュー） ---------- */
.mdk-single .card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .mdk-single .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .mdk-single .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.mdk-single .card {
  position: relative;
  isolation: isolate;      /* 中の z-index（作品名のリンクを広げた面）を、このカードの中だけで効かせる。ヘッダーや画面下のバーより上に出ないように */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow .2s, transform .2s;
}

.mdk-single .card:hover {
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: no-preference) {
  .mdk-single .card:hover { transform: translateY(-2px); }
}

/* 画像を枠に収める（functions.php の fit_image_html() が出力するHTML）。
   16:9の画像は枠いっぱいに表示する。縦長などの画像は切らずに収め、空いた部分を同じ画像をぼかしたもので埋める */
.mdk-single .fit-image {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate; /* ぼかしの背景（z-index: -1）を、この枠の中だけで画像の後ろに重ねる */
}

.mdk-single .fit-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mdk-single .fit-image--contain img {
  object-fit: contain;
}

.mdk-single .fit-image-bg {
  position: absolute;
  inset: -16px; /* ぼかすと縁が薄くなるので、枠より少し大きくし、はみ出た分は枠で隠す */
  z-index: -1;
  background-position: center;
  background-size: cover;
  filter: blur(14px) brightness(.62);
}

/* カードの画像の枠（画像の表示のしかたは、上の .fit-image で指定している） */
.mdk-single .card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--media-bg);
}

.mdk-single .card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 18px;
}

.mdk-single .mdk-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
}

.mdk-single .mdk-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
}

.mdk-single .card-link {
  color: var(--ink);
  text-decoration: none;
}

/* 作品名のリンクの押せる範囲を、カード全体に広げる。
   z-index: 1 で、カードの中の position を持つ部品（画像の枠・星・箇条書き）より上に置く。
   置かないと、HTMLでリンクより後ろにあるそれらの部品の上を押しても、記事に移らない
   （注目のレビューは画像がリンクより後ろに並ぶので、画像も押せなくなる。2026-12-05にPCの幅で見つけた） */
.mdk-single .card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

/* キーボードで選んだときは、カード全体を枠で囲む */
.mdk-single .card-link:focus-visible {
  outline: none;
}

.mdk-single .card-link:focus-visible::after {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

/* カードの抜粋は、結論の1文目（ひとこと結論）だけ。長い1文に備えて、3行を超えたら「…」で切る。
   ひとこと結論と同じく、文節の切れ目で折り返す（「ホ／テル」のような改行を防ぐ） */
.mdk-single .card-excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.75;
  word-break: auto-phrase;
  text-wrap: pretty;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ---------- レビュー記事ページ ---------- */

/* 記事冒頭のPR表記 */
.mdk-single .pr-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}

.mdk-single .review-header {
  margin: 16px 0;
}

.mdk-single .review-genre {
  margin: 0 0 6px;
}

/* 記事の題名。
   - 文字の大きさ：スマホ（〜390px）は22px、PC（1280px〜）は32px。その間は画面の幅に合わせて大きくする。
     デジタル庁デザインシステムの見出しの段階（Std-22・Std-32）と、Material Design 3 の Headline Large（32）に合わせた。
     本文（16px）・本文の見出し（スマホ20px・PC24px）より、どの幅でも大きい
     （以前はスマホで26px〔50字を超える題名が6行〕、のちに21px〔本文の見出しと1pxしか違わない〕、PCで38px〔本文の2.4倍で大きすぎ〕だった）
   - 行の高さ：1.5（同じデザインシステムの、20〜32pxの見出しの行の高さ）
   - 折り返し：文節の切れ目で折り返し（word-break: auto-phrase）、行はできるだけ右端まで埋める（text-wrap: pretty。最後の行が1〜2字だけになるのは防ぐ）。
     ほかの見出しと同じ balance（行の長さをそろえる）にすると、2行の題名で両方の行が短くなり、PCで右に大きな空きができるため、題名だけ変えている
   - text-spacing-trim: trim-start：行頭の「【」「（」などの左の空きを詰めて、ほかの行と左端をそろえる（対応していないブラウザでは、これまでどおり） */
.mdk-single .review-title {
  margin: 0;
  font-size: clamp(22px, 1.12vw + 17.6px, 32px);
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .01em;
  word-break: auto-phrase;
  text-wrap: pretty;
  text-spacing-trim: trim-start;
}

.mdk-single .review-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  margin-top: 10px;
  color: var(--ink-3);
  /* 題名の下の「総合評価」と公開日・更新日は14px（デジタル庁デザインシステムで、14px未満は原則として使わない大きさのため。
     以前は13px・日付だけ12px。14pxでも、公開日と更新日は幅320pxのスマホで1行に収まる） */
  font-size: 14px;
}

.mdk-single .review-dates {
  font-size: 14px;
}

/* 題名の上のジャンルのラベル：ほかの小さいラベル（12px）より大きく、題名の下の文字と同じ14pxにする */
.mdk-single .review-genre .chip {
  padding: 2px 10px;
  font-size: 14px;
}

.mdk-single .review-dates > span[aria-hidden] {
  margin-inline: 6px;
}

.mdk-single .review-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mdk-single .review-score-label {
  color: var(--ink-2);
  font-weight: 700;
}

/* 画像エリアと結論：スマホは縦に（画像 → ひとこと結論 → 結論ボックス）、PCは横に並べる */
.mdk-single .review-hero {
  display: grid;
  align-items: start;
  gap: 16px;
}

.mdk-single .review-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 960px) {
  .mdk-single .review-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 32px;
  }

  /* 作品の画像が無いレビュー（作品データを入れる前の、前からある記事など）は、画像の列を作らず1列にする */
  .mdk-single .review-hero--no-media {
    grid-template-columns: minmax(0, 1fr);
  }

  /* PCでは、右側の結論を読み進める間も、画像が見えたままになるように固定する */
  .mdk-single .mdk-gallery {
    position: sticky;
    top: var(--sticky-top);
  }
}

/* --- ひとこと結論（要約の1文目・基本情報・ボタン） --- */
.mdk-single .quick-verdict {
  padding: 14px 16px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-soft);
}

/* ひとこと結論は、文節の切れ目で折り返し（「ドラ／マ」のような単語の途中での改行を防ぐ）、
   最後の行が1〜2字だけにならないようにする（text-wrap: pretty。対応していないブラウザでは、これまでどおり折り返すだけ） */
.mdk-single .quick-verdict-text {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
  word-break: auto-phrase;
  text-wrap: pretty;
}

.mdk-single .quick-verdict-label {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  vertical-align: 1px;
}

/* 基本情報のラベル（収録時間・画質・料金の形） */
.mdk-single .key-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.mdk-single .key-facts > li {
  padding: 2px 10px;
  border: 1px solid var(--accent-line-2);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.6;
}

/* --- 画像エリア --- */
.mdk-single .mdk-gallery {
  min-width: 0;
}

/* メイン画像の枠（16:9）。中に全部の画像を横に並べ、指でスワイプすると1枚ずつ止まるようにする（scroll-snap） */
.mdk-single .gallery-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #1d1b18;
}

.mdk-single .gallery-track {
  display: flex;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  overscroll-behavior-x: contain; /* 端までスワイプしても、ブラウザの「戻る」の操作にならないようにする */
  scroll-snap-type: x mandatory;
  scrollbar-width: none;          /* スクロールバーは出さない（スワイプ・サムネイル・矢印で切り替える） */
}

.mdk-single .gallery-track::-webkit-scrollbar {
  display: none;
}

.mdk-single .gallery-slide {
  flex: 0 0 100%;
  aspect-ratio: 16 / 9;
  scroll-snap-align: start;
  scroll-snap-stop: always;       /* 勢いよくスワイプしても、1枚ずつ止まる */
}

.mdk-single .gallery-zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

/* 画像エリアでは、16:9の画像も含めて、切らずに全体を見せる */
.mdk-single .gallery-zoom .fit-image img {
  object-fit: contain;
}

/* 何枚目か（左下）と「拡大」（右下）の表示 */
.mdk-single .gallery-count,
.mdk-single .gallery-zoom-hint {
  position: absolute;
  bottom: 10px;
  margin: 0;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  pointer-events: none;
}

.mdk-single .gallery-count {
  left: 10px;
  font-variant-numeric: tabular-nums;
}

.mdk-single .gallery-zoom-hint {
  right: 10px;
}

/* 左右の矢印：マウスで操作する画面だけに出す（タッチの画面では、スワイプとサムネイルで切り替える） */
.mdk-single .gallery-arrow {
  position: absolute;
  top: 50%;
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
  transform: translateY(-50%);
  transition: opacity .15s, background .15s;
}

.mdk-single .gallery-arrow--prev { left: 10px; }

.mdk-single .gallery-arrow--next { right: 10px; }

.mdk-single .gallery-arrow:hover,
.mdk-single .gallery-arrow:focus-visible {
  background: rgba(0, 0, 0, .75);
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .mdk-single .gallery-arrow { display: grid; }
}

.mdk-single .mdk-gallery-caption {
  margin: 6px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

/* サムネイル：スマホは横にスクロール（4枚見える）、少し広い画面では5枚見える */
.mdk-single .gallery-thumbs {
  display: grid;
  grid-auto-columns: calc((100% - 24px) / 4);
  grid-auto-flow: column;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0 0 6px;
  overflow-x: auto;
  list-style: none;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
}

@media (min-width: 640px) {
  .mdk-single .gallery-thumbs { grid-auto-columns: calc((100% - 32px) / 5); }
}

.mdk-single .gallery-thumbs > li {
  scroll-snap-align: start;
}

.mdk-single .gallery-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #000;
  cursor: pointer;
}

.mdk-single .gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .7;
  transition: opacity .15s;
}

.mdk-single .gallery-thumb:hover img,
.mdk-single .gallery-thumb[aria-current="true"] img {
  opacity: 1;
}

.mdk-single .gallery-thumb[aria-current="true"] {
  border-color: var(--accent);
}

/* 予告編の位置（本文の先頭。スマホで結論まで早くたどり着けるよう、画像エリアから移した） */
.mdk-single .trailer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 40px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #24211e;
  box-shadow: 0 0 0 1px var(--trailer-line);
  color: #e9e2d8;
}

.mdk-single .trailer-play {
  position: relative;
  flex: none;
  width: 52px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
}

/* 再生の三角形 */
.mdk-single .trailer-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-width: 7px 0 7px 12px;
  border-style: solid;
  border-color: transparent transparent transparent #fff;
  transform: translate(-40%, -50%);
}

.mdk-single .trailer-text {
  display: grid;
  font-size: 14px;
  line-height: 1.5;
}

.mdk-single .trailer-text small {
  color: #c9c0b3;
  font-size: 12px;
}

/* --- 結論ボックス --- */
.mdk-single .verdict {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: var(--sticky-top);
}

@media (min-width: 960px) {
  .mdk-single .verdict { padding: 24px; }
}

.mdk-single .verdict-kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
}

.mdk-single .verdict-title {
  margin: 0;
  font-size: clamp(19px, 2vw, 22px);
  font-weight: 800;
  line-height: 1.5;
}

.mdk-single .verdict-summary p {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.85;
}

.mdk-single .fit {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

/* タブレットくらいの幅では「向いている／向いていない」を横に並べて見比べやすくする */
@media (min-width: 640px) and (max-width: 959px) {
  .mdk-single .fit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.mdk-single .fit-col {
  padding: 14px 16px;
  border-radius: 10px;
}

.mdk-single .fit-col--good {
  background: var(--good-bg);
}

.mdk-single .fit-col--bad {
  background: var(--bad-bg);
}

.mdk-single .fit-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
}

.mdk-single .fit-col--good .fit-title { color: var(--good-ink); }

.mdk-single .fit-col--bad .fit-title { color: var(--bad-ink); }

.mdk-single .fit-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mdk-single .fit-list > li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.7;
}

.mdk-single .fit-list > li::before {
  position: absolute;
  top: 0;
  left: 0;
  font-weight: 800;
}

.mdk-single .fit-col--good .fit-list > li::before {
  content: "✓";
  color: var(--good-ink);
}

.mdk-single .fit-col--bad .fit-list > li::before {
  content: "×";
  color: var(--bad-ink);
}

/* 結論ボックスの最後の注意書き（評価と感想は、レビュアーが観て感じたことであること） */
.mdk-single .verdict-note {
  margin: 14px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

.mdk-single .verdict-note a {
  margin-left: 6px;
}

/* --- アフィリエイト枠 --- */
/* scroll-margin-top：画面下のバーや右の枠の「広告のリンクへ」で #cta-summary へ移ったとき、
   枠の上（PR表記）が固定ヘッダーの下に隠れないようにする */
.mdk-single .cta {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  scroll-margin-top: var(--sticky-top);
}

.mdk-single .cta-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.mdk-single .cta-service {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin: 0 0 12px;
}

.mdk-single .cta-service-name {
  font-size: 16px;
  font-weight: 800;
}

.mdk-single .cta-plan {
  color: var(--ink-2);
  font-size: 13px;
}

.mdk-single .mdk-cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 2px 0 #7f3a12;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  /* ボタンの文字が長くて2行になるときは、単語の途中ではなく文節の切れ目で改行する */
  word-break: auto-phrase;
  transition: background .15s;
}

.mdk-single .mdk-cta-button:hover {
  background: var(--accent-ink);
}

/* 幅が375pxより狭いスマホ（Androidに多い360pxなど）では、ボタンの左右の余白を詰め、
   ボタンの文字（12字まで。inc/site.php の CTA_DEFAULT_LABEL を参照）を1行に収める */
@media (max-width: 374px) {
  .mdk-single .mdk-cta-button { padding-inline: 12px; }
}

.mdk-single .cta-note {
  margin: 10px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.6;
}

.mdk-single .cta--compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
}

.mdk-single .cta-text-link {
  font-weight: 700;
}

/* 広告コードの入れ物。配置を整えるのはこの外側の枠だけで、中の要素には書式を当てない（改変にあたるため） */
.mdk-single .asp-code {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

/* ひとこと結論の下のボタン（枠の線や背景は付けず、ボタンと日付だけにする） */
.mdk-single .cta--quick {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
}

.mdk-single .cta--quick .cta-note {
  margin-top: 6px;
  text-align: center;
}

/* 広告コードの作品では、ひとこと結論の下に大きい枠（広告コードそのもの）を出す */
.mdk-single .quick-verdict .cta--full {
  margin-top: 12px;
  background: var(--surface);
}

/* 広告コードの作品で使う「広告のリンクへ移動」ボタン（ページ内の移動なので、色を控えめにする） */
.mdk-single .cta-button--sub {
  border: 1px solid var(--accent);
  background: var(--surface);
  box-shadow: none;
  color: var(--accent-ink);
}

.mdk-single .cta-button--sub:hover {
  background: var(--accent-soft);
}

/* PCで目次の下に固定する枠（スマホでは画面下のバーを使うので出さない） */
.mdk-single .cta--side {
  display: none;
  margin-top: 0;
  background: var(--surface);
}

.mdk-single .cta--side .mdk-cta-button {
  min-height: 48px;
  font-size: 15px;
}

/* スマホ：最初の画面（390×844）に、ひとこと結論のボタンの下の端まで収めるため、記事の冒頭の余白を詰める。
   どれも見た目の印象が変わらない程度（2〜8px）にとどめ、PR表記の枠・文字の大きさは変えない。
   上書きする元の指定（.quick-verdict・.gallery-thumbs・.cta--quick など）より後ろに置く（同じ強さの指定は、後ろのものが勝つため） */
@media (max-width: 639px) {
  .mdk-single .mdk-breadcrumb { margin-top: 10px; }

  .mdk-single .pr-notice { margin-top: 10px; padding-block: 6px; }

  .mdk-single .review-header { margin: 12px 0; }

  .mdk-single .review-meta { margin-top: 6px; row-gap: 2px; }

  .mdk-single .review-hero { gap: 12px; }

  .mdk-single .mdk-gallery-caption { margin-top: 4px; line-height: 1.5; }

  .mdk-single .gallery-thumbs { margin-top: 8px; padding-bottom: 2px; }

  .mdk-single .quick-verdict { padding-top: 12px; }

  .mdk-single .key-facts { margin-top: 8px; }

  .mdk-single .cta--quick { margin-top: 10px; }
}

/* --- スマホで画面の下に固定するバー（PCでは出さない）。出す・隠すは main.js が .is-visible で切り替える --- */
.mdk-single .cta-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); /* iPhoneのホームバーに重ならないようにする */
  border-top: 1px solid var(--line);
  background: var(--bar-bg);
  box-shadow: var(--bar-shadow);
  transform: translateY(110%);
  visibility: hidden; /* 隠れている間は、Tabキーでも選ばれないようにする */
}

.mdk-single .cta-bar.is-visible {
  transform: none;
  visibility: visible;
}

@media (prefers-reduced-motion: no-preference) {
  .mdk-single .cta-bar { transition: transform .25s ease, visibility .25s; }
}

.mdk-single .cta-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mdk-single .cta-bar-text {
  display: grid;
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
}

.mdk-single .cta-bar-service {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mdk-single .cta-bar-date {
  color: var(--ink-3);
  font-size: 11px;
}

.mdk-single .cta-bar-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

@media (min-width: 1024px) {
  .mdk-single .cta-bar { display: none; }
}

/* --- 目次と本文 --- */
.mdk-single .review-layout {
  display: grid;
  gap: 32px;
  margin-top: 40px;
}

.mdk-single .mdk-toc {
  align-self: start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.mdk-single .mdk-toc-title {
  margin: 0 0 6px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}

.mdk-single .mdk-toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 1.4em;
  font-size: 13.5px;
}

/* 目次の項目も、文節の切れ目で折り返す（「レビュ／ー」のような改行を防ぐ） */
.mdk-single .mdk-toc a {
  color: var(--ink);
  text-decoration: none;
  word-break: auto-phrase;
}

.mdk-single .mdk-toc a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.mdk-single .review-body {
  min-width: 0;
  max-width: 800px;
}

/* PCでは目次を右側に置き、スクロールしても見えるように固定する
   （幅は、いちばん長い項目「同ジャンル作品との比較・立ち位置」が1行に収まる280px） */
@media (min-width: 1024px) {
  .mdk-single .review-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 48px;
  }

  .mdk-single .review-body {
    grid-row: 1;
    grid-column: 1;
  }

  /* 目次とアフィリエイト枠をまとめて、右側に固定する */
  .mdk-single .review-aside {
    position: sticky;
    top: var(--sticky-top);
    display: grid;
    gap: 16px;
    grid-row: 1;
    grid-column: 2;
    align-self: start;
  }

  .mdk-single .cta--side {
    display: block;
  }
}

.mdk-single .article-section {
  padding-top: 48px;
  scroll-margin-top: var(--sticky-top);
}

/* 本文の最初のセクション（先頭に予告編があるときも、セクションの中で最初のもの）は上の余白をなくす */
.mdk-single .article-section:first-of-type {
  padding-top: 0;
}

.mdk-single .section-heading {
  margin: 0 0 16px;
  padding-left: 14px;
  border-left: 5px solid var(--accent);
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 800;
  line-height: 1.45;
}

/* 基本スペックの見出しの下の「〇年〇月〇日に配信ページで確かめた情報です。」（見出しとの間を少し詰める） */
.mdk-single .section-note {
  margin: -8px 0 12px;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.6;
}

.mdk-single .section-content > p {
  margin: 0 0 1em;
}

/* 番号付きの箇条書き（ol）も、箇条書き（ul）と同じ余白にする（本文はHTMLなので、ol も書ける） */
.mdk-single .section-content > ul,
.mdk-single .section-content > ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

.mdk-single .section-content > ul > li,
.mdk-single .section-content > ol > li {
  margin: .35em 0;
}

/* 本文に画像を入れたとき、スマホの画面の幅からはみ出さないようにする */
.mdk-single .section-content img {
  max-width: 100%;
  height: auto;
}

.mdk-single .section-content > h3 {
  margin: 1.5em 0 .5em;
  font-size: 17px;
}

/* 気になった点・注意点の枠 */
.mdk-single .caution-box {
  padding: 16px 18px 2px;
  border: 1px solid var(--caution-line);
  border-radius: var(--radius);
  background: var(--caution-bg);
}

.mdk-single .caution-box > ul {
  padding-left: 0;
  list-style: none;
}

.mdk-single .caution-box > ul > li {
  position: relative;
  padding-left: 30px;
}

.mdk-single .caution-box > ul > li::before {
  content: "!";
  position: absolute;
  top: .3em;
  left: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--caution-mark);
  color: var(--caution-mark-ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

/* スペック表 */
.mdk-single .table-wrap {
  margin: 0 0 1em;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.mdk-single .spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.mdk-single .spec-table th,
.mdk-single .spec-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.mdk-single .spec-table tr:last-child > th,
.mdk-single .spec-table tr:last-child > td {
  border-bottom: 0;
}

.mdk-single .spec-table th {
  width: 34%;
  background: var(--fact-soft);
  color: var(--ink-2);
  font-weight: 700;
  word-break: auto-phrase; /* 狭い画面で「チャプター／構成」のように、語の切れ目で折り返す */
}

/* まとめは枠で囲んで、記事の締めくくりだと分かるようにする */
.mdk-single .article-section--summary .section-content {
  padding: 20px 20px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.mdk-single .article-section--summary .cta {
  margin: 4px 0 16px;
}

/* ---------- 拡大表示（<dialog>） ---------- */
.mdk-single .lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh; /* スマホでアドレスバーが出入りしても、高さがずれないようにする */
  max-height: none;
  margin: 0;
  padding: 64px 16px;
  border: 0;
  background: rgba(14, 12, 10, .94);
  color: #fff;
  overscroll-behavior: contain;
}

.mdk-single .lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mdk-single .lightbox::backdrop {
  background: rgba(14, 12, 10, .6);
}

.mdk-single .lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: min(1200px, 100%);
}

.mdk-single .lightbox-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  border-radius: 6px;
  object-fit: contain;
  transition: transform .2s ease, opacity .2s ease;
}

/* スワイプ中は、画像が指にそのままついてくるようにする（離したら元の位置へ戻す） */
.mdk-single .lightbox.is-dragging .lightbox-img {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .mdk-single .lightbox-img { transition: none; }
}

.mdk-single .lightbox-count {
  margin: 0;
  color: #d8d0c4;
  font-size: 13px;
}

.mdk-single .lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.mdk-single .lightbox-btn:hover {
  background: rgba(255, 255, 255, .28);
}

/* iPhoneを横にしたときの切り欠き（ノッチ）にボタンが隠れないよう、env(safe-area-inset-*) の分だけ内側に置く */
.mdk-single .lightbox-prev {
  top: 50%;
  left: max(12px, env(safe-area-inset-left));
  transform: translateY(-50%);
}

.mdk-single .lightbox-next {
  top: 50%;
  right: max(12px, env(safe-area-inset-right));
  transform: translateY(-50%);
}

.mdk-single .lightbox-close {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  font-size: 26px;
}

/* ---------- 指で押しやすくする（タッチで操作する端末と、狭い画面） ----------
   押せる範囲を縦44px以上にする（Appleの目安。WCAG 2.2 の最低限は24px）。
   見た目はなるべく変えず、余白（padding）で押せる範囲を広げ、その分を負のマージンで打ち消す。
   マウスで操作するPCでは、目次などの行の間隔を詰めたままにする */
@media (pointer: coarse), (max-width: 639px) {
  /* 横は左右に6pxずつ広げる（「トップ」「アニメ」のような3文字のリンクでも、幅が44px以上になるように。
     リンクの間には区切りの「›」と余白が約15pxあるので、隣のリンクの押せる範囲とは重ならない） */
  .mdk-single .mdk-breadcrumb a {
    display: inline-block;
    margin: -14px -6px;
    padding: 14px 6px;
  }

  /* 記事の上のジャンルのラベル：見た目はそのままで、押せる範囲だけ上下に広げる */
  .mdk-single .review-genre .chip {
    position: relative;
  }

  .mdk-single .review-genre .chip::after {
    content: "";
    position: absolute;
    inset: -11px -4px;
  }

  .mdk-single .verdict-note a,
  .mdk-single .cta-text-link {
    display: inline-block;
    margin-block: -10px;
    padding-block: 10px;
  }

  /* 「レビューの方針」は文字が小さい（12px）ので、上下の余白を2px多くして44pxに届かせる */
  .mdk-single .verdict-note a {
    margin-block: -12px;
    padding-block: 12px;
  }

  /* 目次とフッターのリンクは、1行ずつの高さを44px以上にする */
  .mdk-single .mdk-toc ol {
    gap: 0;
  }

  .mdk-single .mdk-toc a {
    display: block;
    padding-block: 10px;
  }
}
