/* =========================================================
   記事（/column/スラッグ/）
   Studio の記事ページ（/TF19Tlsy/12v_battery-shaken）の実測値（PC 1440px・スマホ 393px）と
   Studio のリッチテキストの決まり（見出し・段落・表・目次など）で再現
   画面幅の切り替えは Studio と同じ 1140 / 840 / 540px
   ========================================================= */

/* ---------- 上の帯：写真に白いベール（高さ260px）・日付・題名 ---------- */
.single-hero { position: relative; display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 260px; overflow: hidden; }
.single-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center bottom; }
.single-hero__veil { position: relative; flex: 1; display: flex; justify-content: center; align-items: center; width: 100%; padding: 80px 0 0; background: rgba(255, 255, 255, .9); }
.single-hero__inner { display: flex; justify-content: space-between; align-items: center; width: 1080px; max-width: 100%; margin: 20px 0; padding: 0 48px; }
.single-hero__ttl { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.single-hero__date { color: #000; font-weight: var(--w-l); font-size: 20px; line-height: 1.4; letter-spacing: .05em; }
.single-hero__title { color: #000; font-weight: var(--w-m); font-size: 40px; line-height: 1.4; letter-spacing: .25em; word-break: break-word; }

/* ---------- 本文の白い箱（幅1080px・うすい影） ---------- */
.single-box { width: 1080px; max-width: 100%; margin: 40px auto 0; padding: 16px 48px; background: #fff; box-shadow: 3px 3px 7px rgba(217, 217, 217, .2); }

/* ---------- 記事一覧へ（黒い角丸） ---------- */
.single-back { display: flex; justify-content: center; padding: 16px 4px 48px; }
.single-back__btn { display: flex; justify-content: center; align-items: center; width: 282px; max-width: calc(100% - 8px); height: 40px; padding: 0 0 2px; border: 1px solid #000; border-radius: 20px; background: #000; color: #fff; font-weight: var(--w-m); font-size: 16px; line-height: 1; letter-spacing: .1em; text-align: center; transition: background .3s cubic-bezier(.4, .4, 0, 1), color .3s cubic-bezier(.4, .4, 0, 1), border-color .3s cubic-bezier(.4, .4, 0, 1); }
@media (hover: hover) { .single-back__btn:hover { border-color: rgb(40, 56, 89); background: #fff; color: rgb(40, 56, 89); } }

/* =========================================================
   本文（Studio のリッチテキストと同じ決まり）
   ここの決まりは :where() で弱くしてある（埋め込み .mm-embed の中には効かせない。下の「埋め込み」を参照）
   ========================================================= */
.single-body { display: flow-root; padding-bottom: 49px; border-bottom: 1px solid #7b7b7b; color: #333; font-family: var(--gin); font-weight: var(--w-l); font-size: 16px; line-height: 1.4; text-align: left; word-break: break-word; overflow-wrap: anywhere; }

/* 段落：上20px・下8px（続く段落の間は20px）。空の段落も1行分の高さ */
:where(.single-body) > p { min-height: 1em; margin: 20px 0 8px; letter-spacing: .05em; }

/* 見出し */
:where(body:not(.mm-kit) .single-body) > h1, :where(body:not(.mm-kit) .single-body) > p.mm-h1 { margin: 20px 0; font-weight: var(--w-b); font-size: 3em; line-height: 1.4; letter-spacing: normal; }
/* 本文の h1（題名と違う文＝リード文）は表示のときに p.mm-h1 にしている（inc/content.php）。新しいデザインでは本文より少し大きいリード文 */
:where(body.mm-kit .single-body) > p.mm-h1 { margin: 24px 0 8px; font-weight: var(--w-m); font-size: 1.25em; line-height: 1.7; letter-spacing: .04em; }
:where(body:not(.mm-kit) .single-body) > h2 { margin: 40px 0; padding: 8px; background: #000; color: #fff; font-weight: var(--w-m); font-size: 28px; line-height: 1.4; letter-spacing: .15em; }
:where(body:not(.mm-kit) .single-body) > h3 { margin: 60px 0 20px; padding: 0 0 0 10px; border-bottom: 3px solid #a4161a; font-weight: var(--w-b); font-size: 28px; line-height: 1.4; letter-spacing: .15em; }
:where(.single-body) > h4 { margin: 10px 0; font-weight: var(--w-b); font-size: 32px; line-height: 1.4; }
:where(.single-body) > :is(h5, h6) { margin: 10px 0; font-weight: var(--w-b); font-size: 1em; line-height: 1.4; }

/* 文字の飾り */
:where(.single-body) :where(strong, b) { color: inherit; font-weight: var(--w-b); }
:where(.single-body) em { margin: 0; color: #4dabbb; font-weight: var(--w-m); font-size: 24px; font-style: normal; letter-spacing: .15em; }
:where(.single-body) u { text-decoration: underline; }
:where(.single-body) s { text-decoration: line-through; }
:where(.single-body) a { color: #007cff; text-decoration: underline; }
@media (hover: hover) { :where(.single-body) a:hover { opacity: .7; } }

/* 画像（左寄せ・幅いっぱいまで） */
:where(.single-body) > figure { margin: 0; }
:where(.single-body) > figure img { display: inline; max-width: 100%; height: auto; vertical-align: bottom; }
:where(.single-body) > figure figcaption:empty { display: none; }
:where(.single-body) > figure figcaption { margin-top: 8px; color: #7b7b7b; font-size: 14px; }

/* リスト */
:where(.single-body) > :is(ul, ol) { margin: 0 0 0 20px; padding: 0; }
:where(.single-body) > ul { font-family: var(--gin); }
:where(.single-body) > ul li { margin: 10px 0; list-style: disc outside; }
:where(.single-body) > ol li { margin: 10px 0; list-style: decimal outside; }
:where(.single-body) > :is(ul, ol) li p { margin: 0; }
:where(.single-body) > :is(ul, ol) :is(ul, ol) { margin: 0 0 0 20px; }

/* 線・引用・コード */
:where(.single-body) > hr { height: 0; margin: 10px 0; border: 0; border-top: 1px solid #ccc; }
:where(.single-body) > blockquote { margin: 10px 0; padding: 10px 15px; border-left: 3px solid rgba(0, 0, 0, .15); font-style: italic; }
:where(.single-body) > blockquote p { margin: 0; }
:where(.single-body) > p > code { display: inline; margin: 2px; padding: 0 5px; border: 1px solid rgba(0, 0, 0, .1); border-radius: 6px; background: #eee; }
:where(.single-body) > pre { margin: 20px 0; padding: 25px 35px; border-radius: 6px; background: #eee; font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre-wrap; }

/* 表（はみ出すときは横にスクロール） */
:where(.single-body) > [data-type="table"] { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
:where(.single-body) > [data-type="table"] > table,
:where(.single-body) > table { margin: 10px 0; border: 1px solid #f2f2f2; border-collapse: collapse; border-spacing: 0; table-layout: auto; color: #1a1a1a; font-size: 14px; line-height: 1.4; }
:where(.single-body) > [data-type="table"] > table :is(td, th),
:where(.single-body) > table :is(td, th) { min-width: 100px; max-width: 240px; padding: 12px; border: 1px solid #f2f2f2; text-align: left; vertical-align: top; }
:where(.single-body) > [data-type="table"] > table th,
:where(.single-body) > table th { background: rgba(245, 245, 245, .5); font-weight: var(--w-b); }
:where(.single-body) > [data-type="table"] > table :is(td, th) p,
:where(.single-body) > table :is(td, th) p { margin: 0; white-space: pre-line; word-break: break-all; }

/* ---------- 目次（灰色の箱・下線つきのリンク。新しいデザインでは Article Kit が番号つきの目次に入れ替える） ---------- */
:where(body:not(.mm-kit) .single-body) > .toc { margin: 0; padding: 24px 8px 8px; border-radius: 2px; background: #e3e3e3; color: #000; font-family: sans-serif; font-weight: 500; font-size: 16px; line-height: 1; }
:where(.single-body) > .toc .toc_list { margin: 0; padding: 0; }
:where(.single-body) > .toc .toc_item { margin: 0 0 16px; color: currentColor; font-weight: inherit; list-style: none; }
:where(.single-body) > .toc .toc_item--2 { padding-left: 2rem; }
:where(.single-body) > .toc .toc_item--3 { padding-left: 4rem; }
:where(.single-body) > .toc .toc_item > a { color: currentColor; font-weight: inherit; text-decoration: underline; }

/* ---------- 相談の案内ボックス（[mitsumaru_cta]。Studio の埋め込みと同じ見た目。小窓の外の大きな空白は出さない） ---------- */
.mm-cta { box-sizing: content-box; max-width: 600px; margin: 20px auto; padding: 20px; border: 1px solid #ddd; border-radius: 10px; background: #fff; color: #333; font-size: 16px; line-height: 1.8; letter-spacing: normal; text-align: center; }
.mm-cta__title { margin: .83em 0 15px; color: #222; font-weight: var(--w-b); font-size: 1.5em; }
.mm-cta__check { margin-bottom: 15px; font-size: 16px; text-align: left; }
.mm-cta__hl { margin-top: 10px; font-weight: var(--w-b); font-size: 18px; }
.mm-cta__btn,
.mm-cta__tel { display: inline-block; width: 100%; max-width: 360px; padding: 12px 20px; border-radius: 5px; color: #fff !important; font-weight: var(--w-b); font-size: 16px; text-decoration: none !important; transition: background .3s; }
.mm-cta__btn { margin: 15px auto; background: #a94442; }
.mm-cta__tel { margin: 10px auto; background: #6c757d; }
@media (hover: hover) {
	.mm-cta__btn:hover { background: #922b2b; opacity: 1 !important; }
	.mm-cta__tel:hover { background: #5a6268; opacity: 1 !important; }
}
@media (max-width: 768px) {
	.mm-cta__btn,
	.mm-cta__tel { max-width: 340px; padding: 10px; font-size: 14px; }
}

/* ---------- 埋め込み（.mm-embed）：記事ごとの HTML（style 属性つき）
   Studio では小窓（iframe）の中だったので、本文の決まりは効いていなかった。
   ここでは中の要素をブラウザの標準の見た目に戻し（all: revert）、style 属性の指定だけで表示する。
   文字の種類だけはサイトと同じゴシック（Studio の小窓は明朝になっていた） ---------- */
.mm-embed, .mm-embed * { all: revert; }
.single-body .mm-embed { display: flow-root; margin: 20px 0; max-width: 100%; color: #000; font-family: var(--gin); font-size: 16px; line-height: normal; letter-spacing: normal; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.single-body .mm-embed img { max-width: 100%; height: auto; }
.single-body .mm-embed table { max-width: 100%; }
.single-body .mm-embed script { display: none; }

/* =========================================================
   840px 以下
   ========================================================= */
@media (max-width: 840px) {
	.single-hero { min-height: 280px; }
	.single-hero__veil { flex-direction: column; }
	.single-hero__inner { flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 0 32px; }
	.single-hero__date { font-size: 18px; }
	.single-hero__title { font-size: 32px; }
	.single-box { width: 100%; padding: 16px 32px; }
	:where(.single-body) > p { font-size: 14px; }
	:where(body:not(.mm-kit) .single-body) > h2 { font-size: 24px; }
	:where(.single-body) > .toc { margin: 0; }
	/* 埋め込みの中の「幅90%＋内側の余白」の箱が細い画面で右にはみ出す（Studio では小窓の外に切れていた）→ 余白込みの幅で数える */
	.single-body .mm-embed :where(div, p, ul, ol, section, figure, blockquote) { box-sizing: border-box; max-width: 100%; }
	@media (hover: hover) { .single-back__btn:hover { background: rgba(77, 171, 187, .6); } }
}

/* =========================================================
   540px 以下：スマホ
   ========================================================= */
@media (max-width: 540px) {
	.single-hero__inner { padding: 0 16px; }
	.single-hero__date { font-size: 16px; }
	.single-hero__title { font-size: 28px; }
	:where(body:not(.mm-kit) .single-body) > h2 { font-size: 20px; }
}

/* =========================================================
   新しいデザイン（TROBZ Article Kit・body.mm-kit。設定 TROBZ/ops/insourcing/plugin/sites/002.json）
   見出し・目次・CTA・運営サイト情報はプラグインが出す。ここはテーマ側の調整だけ
   色：黒 #0B0C0E・字 #171A20・灰 #5C5E62・面 #F4F4F5・線 #E2E3E5（10-22 2回目：赤はやめた。写真・動きは kit-theme.css）
   ========================================================= */
/* 本文のリンク（Studio の青 #007cff）は黒い字に灰の下線 */
body.mm-kit :where(.single-body) a:not([class]):not([style]) { color: #171A20; text-decoration-color: #8E8E8E; text-underline-offset: 3px; }
/* 本文は Studio より少しゆったり（新しいデザインの本文の行間） */
body.mm-kit .single-body { line-height: 1.9; }
body.mm-kit :where(.single-body) > p { margin: 0 0 1.4em; }
/* 外注の部品（「この記事でわかること」など）は Studio の小窓と同じく中身の幅まで縮んでいた → 本文の幅いっぱいに */
body.mm-kit .single-body .mm-embed > div { margin-left: 0; margin-right: 0; }
/* 外注の部品の楕円の札（角丸 50px）を四角に */
body.mm-kit .single-body .mm-embed [style*="border-radius: 50px"] { border-radius: 0; }
/* スマホの画面下はプラグインの帯（CTA の6か所目）を出すので、右下の相談ボタンは記事ページでは重ねない */
@media (max-width: 768px) {
	body.mm-kit .mm-consult { display: none; }
}

/* =========================================================
   関連記事（運営サイト情報の下。inc/related.php）
   ========================================================= */
.single-rel { width: 100%; margin: 48px 0 24px; font-family: var(--gin); }
.single-rel__head { display: flex; flex-direction: column; gap: 6px; margin: 0 0 24px; padding: 0 0 16px; border-bottom: 1px solid #E2E3E5; }
.single-rel__en { display: flex; align-items: center; gap: 14px; color: #5C5E62; font-family: var(--mont); font-size: 13px; font-weight: 500; letter-spacing: .26em; line-height: 1.6; }
.single-rel__en::before { content: ""; display: block; width: 36px; height: 1px; background: #5C5E62; }
.single-rel__title { margin: 0; padding: 0; border: 0; background: none; color: #1A1A1A; font-family: var(--gin); font-size: 24px; font-weight: var(--w-m); letter-spacing: .1em; line-height: 1.4; }
.single-rel__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; margin: 0; padding: 0; list-style: none; }
.single-rel__item { margin: 0; list-style: none; }
.single-rel__link { display: flex; flex-direction: column; gap: 12px; height: 100%; color: #333; text-decoration: none; }
.single-rel__img { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 4px; background: #F4F4F5; }
.single-rel__img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.single-rel__txt { display: flex; flex-direction: column; gap: 6px; }
.single-rel__date { color: #6A6A72; font-family: var(--mont); font-size: 12px; letter-spacing: .08em; line-height: 1.4; }
.single-rel__name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 15px; font-weight: var(--w-m); letter-spacing: .04em; line-height: 1.6; transition: color .3s; }
@media (hover: hover) {
	.single-rel__link:hover .single-rel__img img { transform: scale(1.04); }
	.single-rel__link:hover .single-rel__name { color: #5C5E62; }
}
@media (max-width: 990px) {
	.single-rel__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* スマホ：写真を左、文字を右にした横並びの行（縦に長くしない） */
@media (max-width: 690px) {
	.single-rel { margin: 32px 0 8px; }
	.single-rel__head { margin-bottom: 4px; }
	.single-rel__title { font-size: 20px; }
	.single-rel__list { grid-template-columns: 1fr; gap: 0; }
	.single-rel__item + .single-rel__item { border-top: 1px solid #E2E3E5; }
	.single-rel__link { flex-direction: row; align-items: flex-start; gap: 14px; padding: 14px 0; }
	.single-rel__img { flex: none; width: 120px; border-radius: 4px; }
	.single-rel__name { font-size: 14px; }
}
