/*
 * GEISHA テーマの土台（R1）
 *
 * 値は公開サイトの表示を測った仕様書（docs/specs/foundation/）から。色・角丸などの設定値は
 * inc/design-tokens.php が :root に --gb-* として出す（外観 → カスタマイズ → GEISHA デザインで変更可）。
 *
 * 画面の幅の区切り：スマホ 〜767px ／ タブレット 768〜1067px ／ PC 1068px〜
 */

/* ------------------------------------------------------------------ 決まった値 */

:root {
	--gb-content-width: 1280px;
	--gb-gutter-sm: 15px;
	--gb-gutter-lg: 50px;
	--gb-duration: 0.25s;
	--gb-ease: cubic-bezier(0.104, 0.204, 0.492, 1);
	--gb-section-space: var(--gb-section-space-sm);
}

@media (min-width: 768px) {
	:root {
		--gb-section-space: var(--gb-section-space-lg);
	}
}

/* ------------------------------------------------------------------ 基本 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--gb-color-bg);
	color: var(--gb-color-text);
	font-family: var(--gb-font-body);
	font-size: calc(17px * var(--gb-body-scale, 1));
	font-weight: 400;
	line-height: calc(1.6 * var(--gb-body-line-scale, 1));
	letter-spacing: var(--gb-body-letter-spacing, 0);
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
	text-decoration: none;
	transition: color var(--gb-duration) var(--gb-ease);
}

/* 段落の下は最後の段落でも 20px（公開サイトと同じ）。文字だけのセクションの本文の最後だけ 0 */
p {
	margin: 0 0 20px;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

:focus-visible {
	outline: 2px solid var(--gb-color-focus);
	outline-offset: 2px;
}

.gb-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------ 幅の枠 */

/* 中身の幅は最大 1280px。左右の余白はスマホ 15px、タブレット以上 50px */
.gb-container {
	width: 100%;
	max-width: calc(var(--gb-content-width) + 2 * var(--gb-gutter-lg));
	margin-inline: auto;
	padding-inline: var(--gb-gutter-sm);
}

@media (min-width: 768px) {
	.gb-container {
		padding-inline: var(--gb-gutter-lg);
	}
}

/* 幅を絞った段（固定ページのタイトル 750px、フォーム 8/12 列） */
.gb-measure-title {
	max-width: 750px;
	margin-inline: auto;
}

@media (min-width: 1068px) {
	.gb-measure-8 {
		max-width: calc((100% + 30px) * 8 / 12 - 30px);
		margin-inline: auto;
	}
}

.gb-section {
	padding-block: var(--gb-section-space);
}

/* ------------------------------------------------------------------ 見出し */

/* 大きさは スマホ / タブレット / PC の3段階。字間 -0.02em、太さ 500 */
.gb-h,
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 20px;
	color: var(--gb-color-heading);
	font-family: var(--gb-font-heading);
	font-weight: 500;
	letter-spacing: var(--gb-heading-letter-spacing);
}

.gb-h--xxl { font-size: 34px; line-height: 42px; }
.gb-h--xl,
h1 { font-size: 34px; line-height: 42px; }
.gb-h--l,
h2 { font-size: 28px; line-height: 36px; }
.gb-h--m,
h3 { font-size: 26px; line-height: 30px; }
.gb-h--s,
h4 { font-size: 20px; line-height: 28px; }
.gb-h--xs,
h5 { font-size: 24px; line-height: 32px; }
.gb-h--xxs,
h6 { font-size: 18px; line-height: 26px; }

@media (min-width: 768px) {
	.gb-h--xxl { font-size: 60px; line-height: 68px; }
	.gb-h--xl,
	h1 { font-size: 38px; line-height: 46px; }
	.gb-h--l,
	h2 { font-size: 36px; line-height: 44px; }
	.gb-h--m,
	h3 { font-size: 30px; line-height: 38px; }
	.gb-h--s,
	h4 { font-size: 24px; line-height: 32px; }
}

@media (min-width: 1068px) {
	.gb-h--xxl { font-size: 72px; line-height: 80px; }
	.gb-h--xl,
	h1 { font-size: 54px; line-height: 62px; }
	.gb-h--l,
	h2 { font-size: 42px; line-height: 50px; }
	.gb-h--m,
	h3 { font-size: 34px; line-height: 42px; }
	.gb-h--s,
	h4 { font-size: 28px; line-height: 36px; }
}

/* 見出しの文字をグラデーションで塗る（セクションの設定。既定は同じ色の2点＝単色に見える） */
.gb-h--gradient {
	color: transparent;
	background: var(--gb-heading-gradient);
	-webkit-background-clip: text;
	background-clip: text;
}

/* 見出しの上の小さな英字 */
.gb-subheading {
	margin: 0 0 20px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* ------------------------------------------------------------------ 本文 */

/* 説明文：スマホ 15px / 24px、タブレット以上 17px / 27.2px */
.gb-text {
	font-size: 15px;
	line-height: 24px;
}

@media (min-width: 768px) {
	.gb-text {
		font-size: 17px;
		line-height: 1.6;
	}
}

.gb-text--sm {
	font-size: 15px;
	line-height: 24px;
}

.gb-text--xs {
	font-size: 12px;
	line-height: 1.6;
}

/* 管理画面で書く本文（固定ページ・商品説明）。リスト・表・引用は公開サイトに例がないため、本文に合わせた控えめな形 */
.gb-rte > * + * {
	margin-top: 0;
}

.gb-rte a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gb-rte a:hover {
	color: var(--gb-color-accent);
}

.gb-rte ul,
.gb-rte ol {
	margin: 0 0 20px;
	padding-left: 1.4em;
}

.gb-rte li + li {
	margin-top: 6px;
}

.gb-rte table {
	width: 100%;
	margin: 0 0 20px;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 24px;
}

.gb-rte th,
.gb-rte td {
	padding: 12px 15px;
	border: 1px solid var(--gb-color-border);
	text-align: left;
	vertical-align: top;
}

.gb-rte th {
	font-weight: 500;
	background: rgba(var(--gb-color-text-rgb), 0.04);
}

.gb-rte blockquote {
	margin: 0 0 20px;
	padding: 4px 0 4px 20px;
	border-left: 2px solid var(--gb-color-border);
}

.gb-rte hr {
	margin: 30px 0;
	border: 0;
	border-top: 1px solid var(--gb-color-border);
}

/* ------------------------------------------------------------------ ボタン */

/* 高さ 50px・角丸 12px・15px / 500。マウスを乗せると背景が 7% 暗くなる（0.25 秒） */
.gb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 7px 30px;
	border: 0;
	border-radius: var(--gb-radius-button);
	background: var(--gb-btn-bg);
	color: var(--gb-btn-text);
	font-family: var(--gb-font-body);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: var(--gb-button-letter-spacing, 0);
	text-align: center;
	text-transform: var(--gb-button-transform, none);
	cursor: pointer;
	transition:
		color var(--gb-duration) var(--gb-ease),
		background-color var(--gb-duration) var(--gb-ease);
}

button.gb-btn {
	line-height: 1;
}

.gb-btn:hover {
	background: var(--gb-btn-bg-hover);
	color: var(--gb-btn-text);
}

.gb-btn--accent {
	--gb-btn-bg: var(--gb-color-accent);
	--gb-btn-bg-hover: var(--gb-color-accent-hover);
}

/* 白いボタン：マウスを乗せても変わらない */
.gb-btn--white {
	--gb-btn-bg: #fff;
	--gb-btn-bg-hover: #fff;
	--gb-btn-text: var(--gb-btn-white-text);
}

.gb-btn--full {
	width: 100%;
}

.gb-btn:disabled,
.gb-btn[aria-disabled='true'] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ------------------------------------------------------------------ 入力欄 */

/* 高さ 50px・角丸 6px・枠 1px。ラベルは欄の中に置く（入力すると上に小さく移る動きは R3） */
.gb-field {
	position: relative;
	margin-bottom: 10px;
}

.gb-input {
	display: block;
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 12px 17px;
	border: 1px solid var(--gb-color-input-border);
	border-radius: var(--gb-radius-input);
	background: transparent;
	font-size: 13px;
	line-height: 1.15;
	transition: all var(--gb-duration) var(--gb-ease);
	-webkit-appearance: none;
	appearance: none;
}

/* コメント欄は文字の行に並ぶ箱（inline-block）なので、下に行の高さの分の隙間ができる（公開サイトと同じ） */
textarea.gb-input {
	display: inline-block;
	height: 200px;
	vertical-align: baseline;
	resize: vertical;
}

/* ラベルを欄の中に出すので、入力前の案内文字（placeholder）は見せない */
.gb-input::placeholder {
	color: transparent;
}

.gb-input:focus {
	outline: none;
	border-color: var(--gb-color-text);
}

.gb-field__label {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	align-items: center;
	height: 50px;
	padding: 12px 17px;
	color: rgba(var(--gb-color-text-rgb), 0.6);
	font-size: 13px;
	line-height: 1;
	letter-spacing: 0.02em;
	pointer-events: none;
	transition: all var(--gb-duration) var(--gb-ease);
}

.gb-form-row {
	display: grid;
	gap: 0;
}

@media (min-width: 768px) {
	.gb-form-row--2 {
		grid-template-columns: 1fr 1fr;
		column-gap: 30px;
	}
}

/* ------------------------------------------------------------------ バッジ・価格 */

.gb-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	padding: 8px 12px;
	border-radius: var(--gb-radius-badge);
	background: var(--gb-color-badge-soldout);
	color: var(--gb-color-badge-text);
	font-size: 11px;
	font-weight: 500;
	line-height: 0;
	text-align: center;
}

.gb-badge--sale {
	background: var(--gb-color-badge-sale);
}

/* 予約商品（geisha-core の preorder.php） */
.gb-badge--preorder {
	background: var(--gb-color-heading, #1a1c1d);
}

.gb-price {
	color: var(--gb-color-price);
	font-size: calc(15px * var(--gb-price-scale, 1));
	line-height: 1;
}

.gb-price--lg {
	font-size: calc(20px * var(--gb-price-scale, 1));
	line-height: 1.6;
}

.gb-price ins {
	text-decoration: none;
}

/* 割引前の価格（公開サイトに割引中の商品がないため、割引の色の設定だけ使う。R4・R5 で確認） */
.gb-price del {
	margin-right: 6px;
	opacity: 0.5;
}

.gb-price--sale ins {
	color: var(--gb-color-price-sale);
}

/* ------------------------------------------------------------------ パンくず */

.gb-breadcrumbs {
	display: inline-flex;
	flex-wrap: nowrap;
	max-width: 100vw;
	padding-block: 15px;
	overflow-x: auto;
	font-size: 12px;
	line-height: 1.6;
	text-align: left;
	white-space: nowrap;
	scrollbar-width: none;
}

.gb-breadcrumbs a {
	display: block;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gb-breadcrumbs a:hover {
	color: var(--gb-color-accent);
}

/* 区切りの「/」は i 要素の既定の斜体のまま（公開サイトと同じ） */
.gb-breadcrumbs__sep {
	display: block;
	margin-inline: 8px;
	opacity: 0.2;
}

/* ------------------------------------------------------------------ ページの見出し */

.gb-page-title {
	margin-bottom: 30px;
	text-align: center;
}

@media (min-width: 768px) {
	.gb-page-title {
		margin-bottom: 55px;
	}
}

.gb-collection-header {
	padding-top: 15px;
	padding-bottom: 30px;
}

.gb-collection-header .gb-h {
	margin-bottom: 10px;
}

/* 説明のない見出し（カートなど）は下に余白を付けない */
.gb-collection-header .gb-h:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ 文字だけのセクション（R8 で他のセクションと合わせて整える） */

.gb-rich-text {
	border-radius: var(--gb-radius-block);
	background: var(--gb-section-bg, var(--gb-color-bg));
	text-align: center;
}

.gb-rich-text__inner {
	max-width: 580px;
	margin-inline: auto;
}

.gb-rich-text__text {
	margin-bottom: 35px;
}

.gb-rich-text__text p:last-child {
	margin-bottom: 0;
}
