/* ============================================================
 * Sound Collective — Terms of Service & Policies ページ 専用CSS
 * GitHub #56 (/terms-of-service/) / Epic #55「Figmaデザイン無しページ作成ルール」準拠。
 * デザイントークンは sc-design-tokens.css の :root を利用。
 * クラスは sc-tos-* で衝突回避(他ファイルに存在しないユニーク接頭辞)。
 * ============================================================ */

.sc-tos {
	--sc-margin: 80px;
	background: var(--sc-bg);
	color: var(--sc-fg);
	font-family: var(--sc-font);
	font-weight: var(--sc-fw-medium);
	line-height: 1.4;
}
.sc-tos *, .sc-tos *::before, .sc-tos *::after { box-sizing: border-box; }
.sc-tos h1, .sc-tos h2, .sc-tos h3, .sc-tos p, .sc-tos ul, .sc-tos dl { margin: 0; }

.sc-tos__inner {
	max-width: calc(1280px + var(--sc-margin) * 2);
	margin-inline: auto;
	padding: 80px var(--sc-margin);
}

/* ============================== Head ============================== */
.sc-tos__head { margin-bottom: 32px; }
.sc-tos__title {
	font-size: 40px; font-weight: var(--sc-fw-bold); line-height: 1.2;
	color: var(--sc-fg);
}
/* ★ セレクタに `.sc-tos` を前置きして (0,2,0) にする。理由: 上の :17
 *   `.sc-tos h1, .sc-tos h2, .sc-tos h3, .sc-tos p, .sc-tos ul, .sc-tos dl { margin: 0 }` が
 *   (0,1,1) で、単体クラス (0,1,0) の margin を全部食う(= #192 と同型の罠)。
 *   ブラウザ実測でも marginTop は 0px だった。--inline 修飾子も同じ理由で効いていないので
 *   セットで前置きする(両方 (0,2,0) にすれば「後勝ち」の base/modifier 関係が保たれる)。 */
.sc-tos .sc-tos__updated {
	margin-top: 8px;
	font-size: 14px; color: var(--sc-fg-secondary);
}
.sc-tos .sc-tos__updated--inline { margin: 0 0 16px; }

/* ============================== TOC ============================== */
.sc-tos-toc {
	background: var(--sc-bg-bright);
	border-radius: var(--sc-radius-card);
	padding: 24px 32px;
	margin-bottom: 48px;
}
/* ★ `.sc-tos` 前置きで (0,2,0)。:17 の `.sc-tos h2`(0,1,1) が margin-bottom を食っていた
 *   (#192 と同型。ブラウザ実測 0px = 見出しが目次リストに密着)。 */
.sc-tos .sc-tos-toc__title {
	font-size: 18px; font-weight: var(--sc-fw-bold); line-height: 1.2;
	color: var(--sc-fg); margin-bottom: 16px;
}
.sc-tos-toc__list {
	list-style: none; padding: 0;
	display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 32px;
}
.sc-tos-toc__link {
	color: var(--sc-primary);
	text-decoration: none;
	font-weight: var(--sc-fw-medium);
	font-size: 16px;
}
.sc-tos-toc__link:hover { color: var(--theme-link-hover-color); text-decoration: underline; }

/* ============================== Sections ============================== */
.sc-tos-section {
	background: var(--sc-bg-bright);
	border-radius: var(--sc-radius-card);
	padding: 32px;
	margin-bottom: 24px;
	scroll-margin-top: 96px; /* アンカージャンプ時にヘッダー分オフセット */
}
.sc-tos-h2 {
	font-size: 32px; font-weight: var(--sc-fw-bold); line-height: 1.2;
	color: var(--sc-fg);
}
.sc-tos-h3 {
	font-size: 24px; font-weight: var(--sc-fw-bold); line-height: 1.2;
	color: var(--sc-fg);
}
/* ★ margin-bottom だけを `.sc-tos` 前置きの別ルール (0,2,0) に出す。#192 と同型で :17 の
 *   `.sc-tos h2 / .sc-tos h3`(0,1,1) に食われていた(ブラウザ実測 0px = 見出しが本文に密着。
 *   `.sc-tos-h4` だけ正常に見えていたのは h4 が :17 のリストに無いから)。
 *   ここで「ルール全体」を前置きしないのは、SP の :163-164 `.sc-tos-h2/h3 { font-size }`(0,1,0)
 *   が base に負けて SP の縮小が壊れるため。値の二重管理を避けるため宣言は上のブロックから
 *   移動させている(コピーではない)。 */
.sc-tos .sc-tos-h2 { margin-bottom: 16px; }
.sc-tos .sc-tos-h3 { margin-bottom: 12px; }
.sc-tos-h4 {
	font-size: 18px; font-weight: var(--sc-fw-bold); line-height: 1.2;
	color: var(--sc-fg); margin: 20px 0 8px;
}
.sc-tos-p {
	font-size: 16px; line-height: 1.4; color: var(--sc-fg);
	max-width: 72ch;
}
.sc-tos-p + .sc-tos-p { margin-top: 12px; }

/* Lists */
.sc-tos-list {
	list-style: disc; padding-left: 24px; max-width: 72ch;
}
.sc-tos-list li {
	font-size: 16px; line-height: 1.4; color: var(--sc-fg);
	margin-bottom: 8px;
}
.sc-tos-list li strong { font-weight: var(--sc-fw-bold); }

/* Links */
.sc-tos-link {
	color: #f04b50;
	text-decoration: underline;
}
.sc-tos-link:hover { color: var(--theme-link-hover-color); }

/* Offerings grid */
.sc-tos-offerings {
	display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.sc-tos-offering {
	background: var(--sc-bg);
	border: 1px solid var(--sc-border-dim);
	border-radius: var(--sc-radius-card);
	padding: 24px;
}
.sc-tos-offering--note { grid-column: 1 / -1; }
/* ★ `.sc-tos` 前置きで (0,2,0)。:17 の `.sc-tos h3`(0,1,1) に margin-bottom を食われていた(#192 同型)。 */
.sc-tos .sc-tos-offering__title {
	font-size: 20px; font-weight: var(--sc-fw-bold); line-height: 1.2;
	color: var(--sc-fg); margin-bottom: 12px;
}
.sc-tos-offering .sc-tos-list { margin: 0; }

/* Policy subsections */
.sc-tos-policy { margin-top: 24px; scroll-margin-top: 96px; }
.sc-tos-policy:first-of-type { margin-top: 0; }

/* Contact definition list */
.sc-tos-contact { display: flex; flex-direction: column; gap: 12px; }
.sc-tos-contact__row { display: flex; gap: 16px; flex-wrap: wrap; }
.sc-tos-contact__row dt {
	flex: 0 0 120px; font-weight: var(--sc-fw-bold); color: var(--sc-fg);
	font-size: 16px;
}
.sc-tos-contact__row dd {
	margin: 0; flex: 1 1 auto; min-width: 0;
	font-size: 16px; color: var(--sc-fg);
}

/* Privacy: spacing after each H3 block */
#privacy .sc-tos-h3 { margin-top: 24px; }
#privacy .sc-tos-h3:first-of-type { margin-top: 24px; }

/* ============================================================
 * SP — max-width:1024px
 * ============================================================ */
@media (max-width: 1024px) {
	.sc-tos { --sc-margin: 16px; overflow-x: clip; }
	.sc-tos__inner { padding: 48px var(--sc-margin); }
	.sc-tos__title { font-size: 32px; }
	.sc-tos-h2 { font-size: 24px; }
	.sc-tos-h3 { font-size: 18px; }
	.sc-tos-toc { padding: 20px; }
	.sc-tos-toc__list { grid-template-columns: 1fr; }
	.sc-tos-section { padding: 24px 20px; }
	.sc-tos-offerings { grid-template-columns: 1fr; }
	.sc-tos-contact__row dt { flex: 0 0 100px; }
}

/* ============================================================
 * GitHub #63: /terms-of-service-policies/(旧・本番インポートの Gutenberg ページ)
 *   このページは [sc_terms_of_service] を使わず素の wp-block-* で描画され、sc-tos-* が
 *   効かない。Blocksy 既定の見出し色(--theme-headings-color = #111518)・本文色(#000000)が
 *   #40 のダーク地(#121212)にほぼ埋もれるため、body.sc-tos-policies(#63 で PHP が当ページのみに付与)
 *   スコープで entry-content の文字色だけをデザイントークンへ統一する。
 *   ページ固有クラスを祖先に持つため他ページの .entry-content には一切及ばない。
 *   詳細度: .sc-tos-policies .entry-content …(0,2,1)が Blocksy の .entry-content h*(0,1,1)に勝つ。
 * ============================================================ */
.sc-tos-policies .entry-content { color: var(--sc-fg); }
.sc-tos-policies .entry-content h1,
.sc-tos-policies .entry-content h2,
.sc-tos-policies .entry-content h3,
.sc-tos-policies .entry-content h4,
.sc-tos-policies .entry-content h5,
.sc-tos-policies .entry-content h6,
.sc-tos-policies .entry-content .wp-block-heading { color: var(--sc-fg); }
.sc-tos-policies .entry-content a { color: #f04b50; }
.sc-tos-policies .entry-content a:hover { color: var(--theme-link-hover-color); }
