/* スタイルガイドのアートボード
   値はすべて --lp- の変数から読む。変数は .sg の要素に直接入る */

.sg {
	container-type: inline-size;
	background: var(--lp-bg-sub);
	color: var(--lp-text);
	font-family: var(--lp-font);
	font-size: var(--lp-fs-body);
	font-weight: var(--lp-fw-regular);
	line-height: var(--lp-lh-body);
	padding: var(--lp-space-5) var(--lp-space-4);
}
.sg *, .sg *::before, .sg *::after { box-sizing: border-box; }
.sg p, .sg dl, .sg dd, .sg ul, .sg h1, .sg h2, .sg h3 { margin: 0; padding: 0; }
.sg ul { list-style: none; }

.sg-inner { max-width: var(--lp-content-w); margin: 0 auto; }

.sg-label { font-size: var(--lp-fs-small); line-height: var(--lp-lh-small); font-weight: var(--lp-fw-bold); }
.sg-code { font-family: var(--lp-font-en); font-size: var(--lp-fs-small); line-height: var(--lp-lh-small); }
.sg-note { margin-top: var(--lp-space-2) !important; font-size: var(--lp-fs-small); line-height: var(--lp-lh-small); }

/* ---- 表紙 ---- */
.sg-head {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: var(--lp-space-2) var(--lp-space-4);
	align-items: end;
	padding-bottom: var(--lp-space-3);
	margin-bottom: var(--lp-space-4);
	border-bottom: var(--lp-line-bold) solid var(--lp-text);
}
.sg-title {
	font-family: var(--lp-font-head);
	font-size: var(--lp-fs-h1);
	font-weight: var(--lp-fw-bold);
	line-height: var(--lp-lh-h1);
	letter-spacing: var(--lp-ls-head);
}
.sg-info { display: flex; flex-wrap: wrap; gap: var(--lp-space-1) var(--lp-space-3); }
.sg-info div { display: flex; gap: var(--lp-space-1); }
.sg-info dt { font-weight: var(--lp-fw-bold); }
.sg-rule { grid-column: 1 / -1; font-weight: var(--lp-fw-bold); }

/* ---- ブロック ---- */
.sg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--lp-space-3); }
.sg-block {
	background: var(--lp-bg);
	border: var(--lp-line) solid var(--lp-border);
	border-radius: var(--lp-radius-lg);
	padding: var(--lp-space-4);
	scroll-margin: var(--lp-space-3);
}
.sg-block--wide { grid-column: 1 / -1; }
.sg-h2 {
	margin-bottom: var(--lp-space-3) !important;
	padding-bottom: var(--lp-space-2) !important;
	border-bottom: var(--lp-line) solid var(--lp-border);
	font-family: var(--lp-font-head);
	font-size: var(--lp-fs-h3);
	font-weight: var(--lp-fw-bold);
	line-height: var(--lp-lh-h3);
	letter-spacing: var(--lp-ls-head);
}

.sg-specs div {
	display: grid;
	grid-template-columns: 136px 1fr;
	gap: var(--lp-space-2);
	padding: var(--lp-space-1) 0;
	border-bottom: var(--lp-line) solid var(--lp-border);
}
.sg-specs dt { font-weight: var(--lp-fw-bold); }

/* ---- 色 ---- */
.sg-ratio {
	display: flex;
	height: var(--lp-space-5);
	margin-bottom: var(--lp-space-3);
	border: var(--lp-line) solid var(--lp-border);
	border-radius: var(--lp-radius);
	overflow: hidden;
	font-size: var(--lp-fs-small);
	font-weight: var(--lp-fw-bold);
	line-height: var(--lp-lh-small);
}
.sg-ratio span { display: flex; align-items: center; padding: 0 var(--lp-space-2); white-space: nowrap; overflow: hidden; }
.sg-ratio__base { flex: 60; background: var(--lp-bg); }
.sg-ratio__main { flex: 30; background: var(--lp-main); color: var(--lp-bg); }
.sg-ratio__accent { flex: 10; background: var(--lp-accent); color: var(--lp-bg); justify-content: center; padding: 0 !important; }
.sg-colors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--lp-space-3); }
.sg-chip { display: block; aspect-ratio: 4 / 3; margin-bottom: var(--lp-space-1); border-radius: var(--lp-radius); border: var(--lp-line) solid var(--lp-border); }
.sg-color-name { font-weight: var(--lp-fw-bold); }

/* ---- 書体 ---- */
.sg-font {
	display: grid;
	grid-template-columns: 184px 1fr;
	gap: var(--lp-space-3);
	align-items: center;
	padding: var(--lp-space-2) 0;
	border-bottom: var(--lp-line) solid var(--lp-border);
}
.sg-font__sample { font-size: var(--lp-fs-h1); font-weight: var(--lp-fw-bold); line-height: var(--lp-lh-h1); white-space: nowrap; }
.sg-font__sample--en { font-family: var(--lp-font-en); }

/* ---- 文字 ---- */
.sg-type-row {
	display: grid;
	grid-template-columns: var(--lp-space-6) minmax(0, 1fr) 208px;
	gap: var(--lp-space-3);
	align-items: baseline;
	padding: var(--lp-space-2) 0;
	border-bottom: var(--lp-line) solid var(--lp-border);
}
.sg-type-spec { font-family: var(--lp-font-en); font-size: var(--lp-fs-small); line-height: var(--lp-lh-small); text-align: right; }
.sg-h { font-family: var(--lp-font-head); font-weight: var(--lp-fw-bold); letter-spacing: var(--lp-ls-head); }
.sg-h1 { font-size: var(--lp-fs-h1); line-height: var(--lp-lh-h1); }
.sg-h2x { font-size: var(--lp-fs-h2); line-height: var(--lp-lh-h2); }
.sg-h3 { font-size: var(--lp-fs-h3); line-height: var(--lp-lh-h3); }
.sg-h4 { font-size: var(--lp-fs-h4); line-height: var(--lp-lh-h4); }
.sg-body { font-size: var(--lp-fs-body); line-height: var(--lp-lh-body); }
.sg-small { font-size: var(--lp-fs-small); line-height: var(--lp-lh-small); }

/* ---- 余白 ---- */
.sg-spaces li {
	display: grid;
	grid-template-columns: var(--lp-space-3) var(--lp-space-8) 1fr;
	gap: var(--lp-space-2);
	align-items: center;
	padding: 4px 0;
	font-family: var(--lp-font-en);
	font-size: var(--lp-fs-small);
	line-height: var(--lp-lh-small);
}
.sg-spaces i { display: block; height: var(--lp-space-2); background: var(--lp-main); }
.sg-spaces + .sg-specs { margin-top: var(--lp-space-3); }

/* ---- 形 ---- */
.sg-shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--lp-space-2); margin-bottom: var(--lp-space-3); align-items: end; }
.sg-shape-box { display: block; height: var(--lp-space-8); margin-bottom: var(--lp-space-1); background: var(--lp-bg-sub); border: var(--lp-line) solid var(--lp-border); }
.sg-shape-box--btn { height: var(--lp-space-5); background: var(--lp-main); border-color: var(--lp-main); }
.sg-line { display: inline-block; width: var(--lp-space-6); border-top: var(--lp-line) solid var(--lp-text); vertical-align: middle; margin-right: var(--lp-space-2); }
.sg-line--bold { border-top-width: var(--lp-line-bold); }
.sg-shadow { display: inline-block; width: var(--lp-space-6); height: var(--lp-space-3); background: var(--lp-bg); border-radius: var(--lp-radius); box-shadow: var(--lp-shadow); border: var(--lp-line) solid var(--lp-border); vertical-align: middle; margin-right: var(--lp-space-2); }

/* ---- 部品 ---- */
.sg-parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--lp-space-3); }
.sg-part > .sg-label { margin-bottom: var(--lp-space-2) !important; }
.sg-buttons { display: grid; gap: var(--lp-space-2); justify-items: start; }

.sg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--lp-space-1);
	min-width: 176px;
	padding: var(--lp-space-2) var(--lp-space-4);
	border: var(--lp-line-bold) solid var(--lp-accent);
	border-radius: var(--lp-radius-pill);
	background: var(--lp-accent);
	color: var(--lp-bg);
	font-family: var(--lp-font);
	font-size: var(--lp-fs-body);
	font-weight: var(--lp-fw-bold);
	line-height: var(--lp-lh-small);
	text-decoration: none;
	white-space: nowrap;
}
.sg-btn--arrow::after {
	content: "";
	width: var(--lp-space-1);
	height: var(--lp-space-1);
	margin-left: var(--lp-space-1);
	border-top: var(--lp-line-bold) solid currentColor;
	border-right: var(--lp-line-bold) solid currentColor;
	transform: rotate(45deg);
}
.sg-btn--lift { box-shadow: 0 4px 0 var(--sg-accent-dark, rgba(0, 0, 0, .3)); }
.sg-btn--sub { background: var(--lp-bg); border-color: var(--lp-main); color: var(--lp-main); box-shadow: none; }

.sg-heading {
	font-family: var(--lp-font-head);
	font-size: var(--lp-fs-h2);
	font-weight: var(--lp-fw-bold);
	line-height: var(--lp-lh-h2);
	letter-spacing: var(--lp-ls-head);
	position: relative;
}
.sg .sg-heading--underline { padding-bottom: var(--lp-space-2); }
.sg-heading--underline::after { content: ""; position: absolute; left: 0; bottom: 0; width: var(--lp-space-5); border-top: var(--lp-line-bold) solid var(--lp-main); }
.sg .sg-heading--leftbar { padding-left: var(--lp-space-2); border-left: var(--lp-space-1) solid var(--lp-main); }
.sg .sg-heading--center { text-align: center; padding-top: var(--lp-space-3); }
.sg-heading--center::before { content: ""; position: absolute; left: 50%; top: 0; height: var(--lp-space-2); border-left: var(--lp-line-bold) solid var(--lp-main); }

.sg-card { padding: var(--lp-card-pad); border-radius: var(--lp-radius); background: var(--lp-bg); }
.sg-card--line { border: var(--lp-line) solid var(--lp-border); }
.sg-card--shadow { box-shadow: var(--lp-shadow); border: var(--lp-line) solid transparent; }
.sg-card--fill { background: var(--lp-bg-sub); }
.sg-card__title { margin-bottom: var(--lp-space-1) !important; font-family: var(--lp-font-head); font-size: var(--lp-fs-h4); font-weight: var(--lp-fw-bold); line-height: var(--lp-lh-h4); }

.sg-cta { display: grid; gap: var(--lp-space-2); justify-items: start; padding: var(--lp-card-pad); border-radius: var(--lp-radius); }
.sg-cta__title { font-family: var(--lp-font-head); font-size: var(--lp-fs-h4); font-weight: var(--lp-fw-bold); line-height: var(--lp-lh-h4); }
.sg-cta--main { background: var(--lp-main); }
.sg-cta--main .sg-cta__title { color: var(--lp-bg); }
.sg-cta--sub { background: var(--lp-bg-sub); }
.sg-cta--line { background: var(--lp-bg); border: var(--lp-line-bold) solid var(--lp-main); }

.sg-table { width: 100%; margin-top: var(--lp-space-4); border-collapse: collapse; font-size: var(--lp-fs-small); line-height: var(--lp-lh-small); }
.sg-table th, .sg-table td { padding: var(--lp-space-1) var(--lp-space-2); border: var(--lp-line) solid var(--lp-border); text-align: left; vertical-align: top; }
.sg-table th { background: var(--lp-bg-sub); font-weight: var(--lp-fw-bold); }
.sg-empty { font-family: var(--lp-font); }

/* ---- 写真とアイコン ---- */
.sg-photos { display: grid; grid-template-columns: minmax(0, 320px); gap: var(--lp-space-2); margin-top: var(--lp-space-3); }
.sg-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--lp-radius-lg); background: #bcd4e6; }
.sg-photo i { position: absolute; display: block; }
.sg-photo .sky { inset: 0; background: linear-gradient(#a9cbe8, #e6eef2); }
.sg-photo .sun { width: 18%; aspect-ratio: 1; border-radius: 50%; background: #fff4cc; right: 16%; top: 14%; }
.sg-photo .hill { left: -10%; right: -10%; bottom: -30%; height: 70%; border-radius: 50%; background: #8fb07a; }
.sg-photo .house { left: 20%; bottom: 22%; width: 26%; height: 26%; background: #f3ede2; }
.sg-photo .roof { left: 17%; bottom: 47%; width: 32%; height: 16%; background: #b5553c; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sg-photo .person { right: 22%; bottom: 14%; width: 12%; height: 40%; }
.sg-photo .person::before { content: ""; position: absolute; left: 50%; top: 0; width: 60%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: #e9c6a5; }
.sg-photo .person::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 68%; border-radius: 40% 40% 0 0; background: #3f5f7a; }
.sg-photo figcaption { position: absolute; left: var(--lp-space-1); bottom: var(--lp-space-1); padding: 0 var(--lp-space-1); background: rgba(255, 255, 255, .9); color: #111; font-size: var(--lp-fs-small); line-height: var(--lp-lh-small); border-radius: 4px; }

.sg-icons { display: flex; flex-wrap: wrap; gap: var(--lp-space-3); margin-top: var(--lp-space-3); padding: var(--lp-space-3); border: var(--lp-line) solid var(--lp-border); border-radius: var(--lp-radius); color: var(--lp-main); }
.sg-icons svg { width: var(--lp-space-5); height: var(--lp-space-5); }

/* ---- 小さい見本（選択肢の中で使う） ---- */
.sg--mini { padding: var(--lp-space-2); background: var(--lp-bg); }
.sg--mini .sg-heading { font-size: var(--lp-fs-h4); }
.sg--mini .sg-btn { min-width: 0; padding: var(--lp-space-1) var(--lp-space-3); font-size: var(--lp-fs-small); }

/* ---- 幅が狭いとき ---- */
@container (max-width: 880px) {
	.sg-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.sg-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 640px) {
	.sg-inner { padding: 0; }
	.sg-head { grid-template-columns: 1fr; }
	.sg-grid { grid-template-columns: 1fr; }
	.sg-block { padding: var(--lp-space-3); }
	.sg-colors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sg-parts { grid-template-columns: 1fr; }
	.sg-type-row { grid-template-columns: var(--lp-space-5) minmax(0, 1fr); }
	.sg-type-spec { grid-column: 2; text-align: left; }
	.sg-font { grid-template-columns: 1fr; gap: 0; }
	.sg-table th:nth-child(3), .sg-table td:nth-child(3) { display: none; }
}

/* ---- 参考画像 ---- */
.sg-ref {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 208px 1fr;
	gap: var(--lp-space-3);
	align-items: start;
	padding: var(--lp-space-2);
	background: var(--lp-bg);
	border: var(--lp-line) solid var(--lp-border);
	border-radius: var(--lp-radius);
}
.sg-ref--text { grid-template-columns: 1fr; }
.sg-ref img { display: block; width: 100%; border-radius: var(--lp-radius); }
@container (max-width: 640px) {
	.sg-ref { grid-template-columns: 1fr; }
}
