/*
Theme Name: gColors
Description: A block theme inspired by traditional Japanese colors.
Version: 1.0.5
Author: Your Name
License: GPL v2 or later
Text Domain: wagashi-traditional
*/

/* =====================================================
   1. 変数・ベース設定 (Variables & Base)
   ===================================================== */
:root {
	--z-base: 1;
	--z-header: 50;
	--z-floating-ui: 100;
	--z-modal: 1000;
}

html {
	scroll-behavior: smooth;
	overflow-x: hidden;
	width: 100%;
}

body {
	background-color: var(--wp--preset--color--kinari-iro);
	color: var(--wp--preset--color--sumi-iro);
	line-height: 1.8;
	letter-spacing: 0.02em;
	font-weight: 400;
	overflow-x: hidden;
	width: 100%;
}

/* スクロールバーによる横揺れ（全幅の計算ずれ）対策 */
@media screen and (min-width: 768px) {
	html { margin-right: calc(100vw - 100%); }
}

/* =====================================================
   2. タイポグラフィ・共通パーツ
   ===================================================== */
h1, h2, h3, h4, h5, h6 {
	font-weight: 600;
	line-height: 1.4;
	color: var(--wp--preset--color--text-main);
}

.wp-block-site-title {
	font-size: var(--wp--preset--font-size--normal) !important;
}

.my-element {
	color: var(--wp--preset--color--enji-iro);
	background-color: var(--wp--preset--color--kinari-iro);
}

/* =====================================================
   3. レイアウト・セクション制御
   ===================================================== */
/* メイン領域の初期化 */
main.wp-block-group {
	font-size: 18px;
	padding: 0;
	/*margin: 0;*/
}

/* コンテンツ幅制限と全幅補正 */
.wp-block-post-content > *:not(.alignfull):not(.alignwide) {
	max-width: 42em;
	margin-inline: auto;
	padding-inline: 1.2rem;
}

.alignfull {
	width: 100vw;
	max-width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-block-start: 0;
	margin-right: -50vw;
	margin-block-end: 0;
	margin-left: -50vw;
}

/* セクション構造と余白 */
main section.wp-block-group {
	padding: 6rem var(--wp--preset--spacing--s);
	margin-block-start: 0;
}

main section.wp-block-group:nth-of-type(even) {
	background: rgba(251, 247, 240, 0.5); /* kinari-iro */
}

@media (max-width: 768px) {
	main section.wp-block-group {
		padding-top: 3rem;
		padding-bottom: 3rem;
	}
}

/* 特殊テキストボックス */
section.is-layout-constrained .top-block-main-text {
	padding: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--m);
}

/* =====================================================
   4. ナビゲーション・UI
   ===================================================== */
.wp-block-navigation__responsive-container.has-modal-open.is-menu-open {
	padding: 2rem 1.5rem;
}

.is-menu-open .wp-block-navigation__responsive-dialog button {
	padding-top: 0.4rem;
}

/* Page Top Button */
.page-top-nav {
	position: fixed;
	right: 0.5rem;
	bottom: 6rem;
	z-index: var(--z-floating-ui);
}

.page-top-nav a.wp-block-button__link.wp-element-button {
	width: 3rem !important;
	height: 3rem !important;
	padding: 0 !important;
	border-radius: 50%;
	display: grid;
	place-items: center;
	aspect-ratio: 1 / 1;
}

/* =====================================================
   5. フォーム (Contact Form 7)
   ===================================================== */
.wpcf7-form input:not([type="submit"]),
.wpcf7-form textarea {
	width: 100%;
	padding: 12px 15px;
	margin-bottom: 20px;
	border: 1px solid #ddd;
	border-radius: 6px;
	box-sizing: border-box;
}

.wpcf7-submit {
	width: 100%;
	max-width: 250px;
	display: block;
	margin: 20px auto;
	background-color: #1e293b;
	color: #fff;
	padding: 16px 32px;
	border-radius: 30px;
	font-weight: bold;
	cursor: pointer;
	transition: 0.3s;
	border: none;
}

.wpcf7-submit:hover {
	background-color: #555;
	opacity: 0.8;
}

span.required { color: #9F1D35; }

/* =====================================================
   6. アクセシビリティ・調整
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-main);
	outline-offset: 3px;
}

iframe { width: 100%; }

/* add */
header {
	border-bottom: 1px var(--wp--preset--color--rikyu-cha-iro) solid;
}

main {
	margin-block-start: 0;
}

.home main > div,
.home main > section,
.home main > article {
	border-bottom: 1px var(--wp--preset--color--rikyu-cha-iro) solid;
	padding-top: 6rem;
	padding-bottom: 6rem;
	margin-block-start: 0;
}


footer {
	margin-block-start: 0;
}

.br-sp {
	display: none;
}

@media (max-width: 768px) {
	.br-sp {
		display: block;
	}
}