/* ============================================================
 * blog-parts.css — 記事共通パーツ（tcgpro-blogparts-proposals 採用案）
 *
 * Markdown.php の独自記法が出力するパーツと、/oripa/shop 等の
 * テンプレが共有するコンポーネント層。値は必ず --ds-* 経由。
 *
 * 採用案の出典（デザイン案カタログ）:
 *   結論       = point.html 案04（ダーク帯見出し型）/ 案06（結論⇒理由の2段構成）
 *   ステップ   = steps.html 案05（チェックリスト進行型）
 *   記事埋め込み = blogcard.html 案09（ダーク反転ナイトカード）
 *   採点・評価 = score.html 案01（大数字+星の総合サマリー）
 *   トグル     = accordion.html 案02（淡グレー塗りフラット）
 *   吹き出し   = say.html 案02（左アバター+しっぽ吹き出し）
 *   引用       = quote.html 案02（大型クォートマーク型）
 * ============================================================ */

/* ===== 結論 :::point — ダーク帯見出し型 ===== */
.article-point {
    border-radius: var(--ds-radius-card);
    overflow: hidden;
    margin: 0 0 var(--ds-space-stack-md);
}
.article-point__head {
    display: flex;
    align-items: center;
    gap: var(--ds-space-inline-sm);
    background: var(--ds-color-bg-inverse);
    color: var(--ds-color-text-inverse);
    font-size: var(--ds-text-body-sm-size);
    font-weight: var(--ds-text-h3-weight);
    line-height: var(--ds-text-body-sm-lh);
    padding: var(--ds-space-stack-xs) var(--ds-space-stack-sm);
}
.article-point__head svg { flex: none; }
.article-point__body {
    background: var(--ds-color-bg-subtle);
    padding: var(--ds-space-stack-sm) var(--ds-space-stack-md);
}
.article-point__body p { margin: 0 0 var(--ds-space-stack-xs); }
.article-point__body > :last-child { margin-bottom: 0; }
/* 箇条書き対応（.article__body ul/li の本文既定に詳細度で勝たせる） */
.article__body .article-point__body ul,
.article-point__body ul {
    margin: 0;
    padding-left: var(--ds-space-stack-md);
}
.article__body .article-point__body li,
.article-point__body li { margin-bottom: var(--ds-space-stack-xs); }
.article__body .article-point__body li:last-child,
.article-point__body li:last-child { margin-bottom: 0; }

/* ===== 結論 :::point（理由あり）— 結論⇒理由の2段構成 ===== */
.article-point--prep {
    background: var(--ds-color-bg-subtle);
    border-radius: var(--ds-radius-card);
    overflow: visible;
    padding: var(--ds-space-inline-xs) var(--ds-space-stack-md);
}
.article-point__row {
    display: flex;
    align-items: flex-start;
    gap: var(--ds-space-inline-md);
    padding: var(--ds-space-stack-sm) 0;
}
.article-point__row + .article-point__row {
    border-top: var(--ds-border-width) solid var(--ds-color-border);
}
.article-point__chip {
    flex: none;
    font-size: var(--ds-text-micro-size);
    font-weight: var(--ds-text-h3-weight);
    line-height: var(--ds-text-micro-lh);
    border-radius: var(--ds-radius-chip);
    padding: 5px 12px;
    margin-top: 2px;
}
.article-point__chip--main {
    background: var(--ds-color-bg-inverse);
    color: var(--ds-color-text-inverse);
}
.article-point__chip--why {
    background: var(--ds-color-bg);
    color: var(--ds-color-text-muted);
    border: var(--ds-border-width) solid var(--ds-color-border-strong);
    padding-top: 4px;
    padding-bottom: 4px;
}
.article-point__row p { margin: 0; }
.article-point__row--main p { font-weight: var(--ds-text-h3-weight); }
.article-point__row--why p {
    font-size: var(--ds-text-body-sm-size);
    line-height: var(--ds-text-body-lh);
    color: var(--ds-color-text-muted);
}

/* ===== ステップ :::steps — チェックリスト進行型 ===== */
.article-steps {
    list-style: none;
    margin: 0 0 var(--ds-space-stack-md);
    padding: 0;
}
.article__body .article-steps { padding-left: 0; }
.article-steps__item {
    position: relative;
    display: flex;
    gap: var(--ds-space-inline-md);
    padding-bottom: var(--ds-space-stack-md);
    margin: 0;
}
.article-steps__item:last-child { padding-bottom: 0; }
.article-steps__item::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 30px;
    bottom: 4px;
    width: 0;
    border-left: 2px dotted var(--ds-color-border-strong);
}
.article-steps__item:last-child::before { display: none; }
.article-steps__icon {
    flex: none;
    width: 24px;
    height: 24px;
    color: var(--ds-color-text-subtle);
}
.article-steps__icon svg { display: block; }
.article-steps__item--done .article-steps__icon { color: var(--ds-color-positive); }
.article-steps__item--done .article-steps__icon .ring { fill: var(--ds-color-positive); stroke: none; }
.article-steps__item--done .article-steps__icon .tick { stroke: var(--ds-color-bg); }
.article-steps__body { min-width: 0; }
.article-steps__ttl {
    margin: 0 0 2px;
    font-weight: var(--ds-text-h3-weight);
    line-height: 1.5;
}
.article-steps__desc {
    margin: 0;
    font-size: var(--ds-text-body-sm-size);
    line-height: 1.7;
    color: var(--ds-color-text-muted);
}

/* ===== トグル :::accordion — 淡グレー塗りフラット ===== */
.article-accordion {
    background: var(--ds-color-bg-subtle);
    border-radius: var(--ds-radius-card);
    margin: 0 0 var(--ds-space-stack-xs);
}
.article-accordion__summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--ds-space-inline-md);
    min-height: var(--ds-touch-target-min);
    padding: var(--ds-space-stack-sm) var(--ds-space-stack-sm);
    font-weight: var(--ds-text-h3-weight);
    font-size: var(--ds-text-body-size);
    color: var(--ds-color-text);
}
.article-accordion__summary::-webkit-details-marker { display: none; }
.article-accordion__title { flex: 1; }
.article-accordion__chev {
    flex: none;
    color: var(--ds-color-text-subtle);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.article-accordion[open] .article-accordion__chev { transform: rotate(180deg); }
.article-accordion__body {
    margin: 0 var(--ds-space-stack-sm);
    padding: var(--ds-space-stack-sm) 0;
    border-top: var(--ds-border-width) solid var(--ds-color-border);
    color: var(--ds-color-text-muted);
    font-size: var(--ds-text-body-sm-size);
    line-height: var(--ds-text-body-lh);
}
.article-accordion__body p { margin: 0 0 var(--ds-space-stack-xs); }
.article-accordion__body > :last-child { margin-bottom: 0; }
/* 開閉をぬるっと（FAQ と同じ ::details-content + interpolate-size。
 * 未対応ブラウザは即時開閉でフォールバック） */
@supports (interpolate-size: allow-keywords) {
    .article-accordion { interpolate-size: allow-keywords; }
    .article-accordion::details-content {
        block-size: 0;
        overflow: clip;
        transition: block-size 0.4s cubic-bezier(0.22, 1, 0.36, 1), content-visibility 0.4s;
        transition-behavior: allow-discrete;
    }
    .article-accordion[open]::details-content { block-size: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .article-accordion__chev { transition: none; }
    .article-accordion::details-content { transition: none; }
}

/* ===== 吹き出し :::say — 左アバター+しっぽ吹き出し ===== */
.article-say {
    display: flex;
    align-items: flex-start;
    gap: var(--ds-space-inline-md);
    margin: 28px 0 var(--ds-space-stack-md);
}
.article-say__speaker {
    flex: none;
    width: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.article-say__avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--ds-radius-avatar);
    background: var(--ds-color-bg-subtle);
    color: var(--ds-color-text-disabled);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    object-fit: cover;
}
.article-say__avatar svg { width: 100%; height: 100%; display: block; }
.article-say__name {
    margin-top: var(--ds-space-inline-sm);
    font-size: var(--ds-text-body-sm-size);
    line-height: var(--ds-text-body-sm-lh);
    font-weight: var(--ds-text-h3-weight);
    color: var(--ds-color-text);
}
.article-say__role {
    margin-top: 2px;
    font-size: var(--ds-text-micro-size);
    line-height: var(--ds-text-micro-lh);
    color: var(--ds-color-text-subtle);
}
.article-say__bubble {
    position: relative;
    flex: 1;
    min-width: 0;
    background: var(--ds-color-bg-subtle);
    border-radius: var(--ds-radius-card);
    padding: var(--ds-space-stack-sm) var(--ds-space-stack-md);
}
.article-say__bubble::before {
    content: "";
    position: absolute;
    top: 18px;
    left: -9px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid var(--ds-color-bg-subtle);
}
.article-say__bubble p { margin: 0 0 var(--ds-space-stack-xs); }
.article-say__bubble > :last-child { margin-bottom: 0; }

/* ===== 引用 — 大型クォートマーク型 ===== */
.article-quote { margin: 0 0 var(--ds-space-stack-md); }
.article-quote blockquote {
    position: relative;
    margin: 0;
    padding: var(--ds-space-stack-md) 0 0 56px;
    border: 0;
    background: none;
}
.article-quote blockquote::before {
    content: "\201C";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 84px;
    line-height: 1;
    font-weight: var(--ds-text-h1-weight);
    color: var(--ds-color-border);
}
.article-quote blockquote p {
    margin: 0;
    color: var(--ds-color-text);
    line-height: var(--ds-text-body-lh);
}
.article-quote figcaption {
    margin-top: var(--ds-space-stack-xs);
    text-align: right;
    font-size: var(--ds-text-caption-size);
    line-height: var(--ds-text-caption-lh);
    color: var(--ds-color-text-subtle);
}
.article-quote figcaption a { color: var(--ds-color-link); }
@media (max-width: 639px) {
    .article-quote blockquote { padding-left: 44px; }
    .article-quote blockquote::before { font-size: 64px; }
}

/* ===== 記事埋め込み :::card — ダーク反転ナイトカード ===== */
.article-blogcard-wrap { margin: 0 0 var(--ds-space-stack-md); }
.article-blogcard {
    display: flex;
    align-items: center;
    gap: var(--ds-space-inline-md);
    background: var(--ds-color-bg-inverse);
    border-radius: var(--ds-radius-card);
    padding: var(--ds-space-stack-md);
    color: var(--ds-color-text-inverse);
    text-decoration: none;
}
/* .article__body a の下線を打ち消す */
.article__body a.article-blogcard { text-decoration: none; color: var(--ds-color-text-inverse); }
.article-blogcard__body { flex: 1; min-width: 0; }
.article-blogcard__label {
    display: block;
    font-size: var(--ds-text-micro-size);
    line-height: var(--ds-text-micro-lh);
    font-weight: var(--ds-text-micro-weight);
    letter-spacing: 0.1em;
    color: var(--ds-color-text-disabled);
    margin-bottom: var(--ds-space-stack-xs);
}
.article-blogcard__title {
    display: block;
    font-size: var(--ds-text-body-size);
    line-height: var(--ds-text-body-sm-lh);
    font-weight: var(--ds-text-h3-weight);
    color: var(--ds-color-text-inverse);
    margin-bottom: var(--ds-space-stack-xs);
}
.article-blogcard:hover .article-blogcard__title {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
.article-blogcard__meta {
    display: block;
    font-size: var(--ds-text-caption-size);
    line-height: var(--ds-text-caption-lh);
    color: var(--ds-color-text-disabled);
}
.article-blogcard__arrow {
    flex: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: var(--ds-border-width) solid var(--ds-color-border-inverse);
    border-radius: var(--ds-radius-chip);
    color: var(--ds-color-text-inverse);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.article-blogcard:hover .article-blogcard__arrow {
    background: var(--ds-color-bg);
    border-color: var(--ds-color-bg);
    color: var(--ds-color-text);
}

/* ===== 採点・評価 :::score — 大数字+星の総合サマリー ===== */
.article-score {
    display: flex;
    align-items: stretch;
    gap: var(--ds-space-stack-md);
    background: var(--ds-color-bg-paper);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-space-stack-md);
    margin: 0 0 var(--ds-space-stack-md);
}
.article-score__total {
    flex: none;
    min-width: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-inline-xs);
    padding-right: var(--ds-space-stack-md);
    border-right: var(--ds-border-width) solid var(--ds-color-border);
}
.article-score__label {
    font-size: var(--ds-text-caption-size);
    font-weight: var(--ds-text-h3-weight);
    color: var(--ds-color-text-muted);
    letter-spacing: 0.08em;
}
.article-score__num {
    font-size: var(--ds-text-display-size);
    line-height: var(--ds-text-display-lh);
    font-weight: var(--ds-text-display-weight);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.article-score__num small {
    font-size: var(--ds-text-body-sm-size);
    font-weight: var(--ds-text-body-sm-weight);
    color: var(--ds-color-text-subtle);
    margin-left: 2px;
}
.article-stars { position: relative; display: inline-flex; vertical-align: middle; }
.article-stars__base,
.article-stars__fill { display: flex; color: var(--ds-color-rating-empty); }
.article-stars__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    color: var(--ds-color-rating);
}
.article-stars svg { flex: none; width: 22px; height: 22px; }
.article-stars--sm svg { width: 15px; height: 15px; }
.article-score__items {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--ds-space-stack-xs);
}
.article__body .article-score__items { padding-left: 0; }
.article-score__items li {
    display: flex;
    align-items: center;
    gap: var(--ds-space-inline-sm);
    font-size: var(--ds-text-body-sm-size);
    line-height: var(--ds-text-body-sm-lh);
    margin: 0;
}
.article-score__item-label { flex: 1; }
.article-score__item-num {
    width: 2.4em;
    text-align: right;
    font-weight: var(--ds-text-h3-weight);
    font-variant-numeric: tabular-nums;
}
@media (max-width: 639px) {
    .article-score { flex-direction: column; gap: var(--ds-space-stack-sm); }
    .article-score__total {
        min-width: 0;
        padding-right: 0;
        padding-bottom: var(--ds-space-stack-sm);
        border-right: 0;
        border-bottom: var(--ds-border-width) solid var(--ds-color-border);
    }
}

/* ===== 箇条書き — チェック&丸数字バッジ（list.html 案03） =====
 * 記事本文トップレベルのクラス無し ul/ol のみ対象（:not([class]) で
 * 詳細度を上げ、後読みの media.css 本文既定にも勝たせる）。
 * パーツ内部のネストしたリストには適用しない */
.article__body > ul:not([class]),
.article__body > ol:not([class]) {
    list-style: none;
    margin: 0 0 var(--ds-space-stack-sm);
    padding: 0;
}
.article__body > ul:not([class]) > li,
.article__body > ol:not([class]) > li {
    position: relative;
    padding-left: 32px;
    margin-bottom: var(--ds-space-stack-xs);
}
.article__body > ul:not([class]) > li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 9px;
    width: 12px;
    height: 6px;
    border-left: 2px solid var(--ds-color-text);
    border-bottom: 2px solid var(--ds-color-text);
    transform: rotate(-45deg);
}
.article__body > ol:not([class]) { counter-reset: bp-oln; }
.article__body > ol:not([class]) > li { counter-increment: bp-oln; }
.article__body > ol:not([class]) > li::before {
    content: counter(bp-oln);
    position: absolute;
    left: 0;
    top: 3px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ds-radius-chip);
    background: var(--ds-color-bg-inverse);
    color: var(--ds-color-text-inverse);
    font-size: var(--ds-text-caption-size);
    font-weight: var(--ds-text-h3-weight);
    line-height: 1;
}

/* ===== FAQ アコーディオン :::faq（Q1/A1 ナンバリング。shop 詳細とも共通） ===== */
.article-faq {
    border: var(--ds-border-width) solid var(--ds-color-border);
    border-radius: var(--ds-radius-card);
    margin: 0 0 var(--ds-space-stack-sm);
    background: var(--ds-color-bg-elevated);
}
/* 開閉を滑らかに（::details-content / interpolate-size 対応ブラウザのみ。
 * 未対応ブラウザは従来どおり即時開閉でフォールバックする） */
@supports (interpolate-size: allow-keywords) {
    .article-faq { interpolate-size: allow-keywords; }
    .article-faq::details-content {
        block-size: 0;
        overflow: clip;
        transition: block-size 0.28s ease, content-visibility 0.28s ease;
        transition-behavior: allow-discrete;
    }
    .article-faq[open]::details-content { block-size: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .article-faq::details-content { transition: none; }
}
.article-faq__question {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: var(--ds-space-inline-sm);
    padding: var(--ds-space-stack-sm) var(--ds-space-stack-md);
    font-weight: var(--ds-text-h3-weight);
    color: var(--ds-color-text);
}
.article-faq__question::-webkit-details-marker { display: none; }
.article-faq__q,
.article-faq__a {
    flex: none;
    color: var(--ds-color-text-inverse);
    border-radius: var(--ds-radius-chip);
    width: var(--ds-touch-target-min);
    min-width: var(--ds-touch-target-min);
    text-align: center;
    font-size: var(--ds-text-body-sm-size);
}
.article-faq__q { background: var(--ds-color-faq-q-bg); } /* Q は青 */
.article-faq__a { background: var(--ds-color-faq-a-bg); } /* A は赤 */
.article-faq__answer {
    display: flex;
    align-items: flex-start;
    gap: var(--ds-space-inline-sm);
    padding: 0 var(--ds-space-stack-md) var(--ds-space-stack-sm);
    color: var(--ds-color-text-muted);
}
.article-faq__answer-body > :last-child { margin-bottom: 0; }
.article-faq__answer > :last-child { margin-bottom: 0; }

/* ===== 本文既定の打ち消し =====
 * /media/ では media.css が本ファイルより後に読み込まれ、
 * .article__body p / li / ol（詳細度 0-1-1）がパーツ内部の余白指定に
 * 勝ってしまうため、.article__body を前置した高詳細度で再宣言する */
.article__body .article-steps { margin: 0 0 var(--ds-space-stack-md); }
.article__body .article-steps__item { margin: 0; }
.article__body .article-steps__ttl { margin: 0 0 2px; }
.article__body .article-steps__desc { margin: 0; }
.article__body .article-point__body p { margin: 0 0 var(--ds-space-stack-xs); }
.article__body .article-point__body > :last-child { margin-bottom: 0; }
.article__body .article-point__row p { margin: 0; }
.article__body .article-say__bubble p { margin: 0 0 var(--ds-space-stack-xs); }
.article__body .article-say__bubble > :last-child { margin-bottom: 0; }
.article__body .article-accordion__body p { margin: 0 0 var(--ds-space-stack-xs); }
.article__body .article-accordion__body > :last-child { margin-bottom: 0; }
.article__body .article-score__items { margin: 0; }
.article__body .article-score__items li { margin: 0; }

/* :::tweet フォールバック（widgets.js 読込前・ブロック時）の引用枠。
 * 旧 .article__body blockquote の見た目を tweet 埋め込みに限定して維持 */
.article-embed--tweet blockquote {
    margin: 0 0 var(--ds-space-stack-sm);
    padding: var(--ds-space-stack-sm) var(--ds-space-stack-md);
    border-left: var(--ds-border-width-divider) solid var(--ds-color-border-strong);
    background: var(--ds-color-bg-paper);
    color: var(--ds-color-text-muted);
}

/* ===== 目次の折りたたみ — 下側ブラー＋「もっと見る」ピル ===== */
/* 既存 .article-toc（media.css）に対する追加。閉じている間は
 * リスト末尾に背景色へのフェードを重ね、続きがあることを示す */
.article-toc__more { position: relative; }
.article-toc__more:not([open])::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -72px;
    height: 72px;
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--ds-color-bg-elevated) 0%, transparent),
        var(--ds-color-bg-elevated)
    );
    pointer-events: none;
}
.article-toc__more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-inline-md);
    width: 100%;
    margin: var(--ds-space-stack-sm) auto 0;
    padding: 0;
    border: 0;
    position: relative;
}
.article-toc__more-btn::before,
.article-toc__more-btn::after {
    content: "";
    flex: none;
    width: 28px;
    border-top: 3px dotted var(--ds-color-border-strong);
}
.article-toc__more-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--ds-touch-target-min);
    padding: var(--ds-space-inline-xs) var(--ds-space-stack-lg);
    border: var(--ds-border-width) solid var(--ds-color-text);
    border-radius: var(--ds-radius-chip);
    background: var(--ds-color-bg);
    font-size: var(--ds-text-body-sm-size);
    font-weight: var(--ds-text-h3-weight);
    color: var(--ds-color-text);
}
