/*
 * atelier kadaru テーマ CSS
 * theme.json で表せない分だけを書く（レイアウト・レスポンシブ・ヘッダー等）。
 * 色は必ず theme.json の色（var(--wp--preset--color--*)）を使い、ここに色の値を直接書かない。
 * 値は reference/atelier-kadaru-top.html（ユーザー作成のデザイン案）から取っている。
 */

/* ---------- 全体 ---------- */
html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* サンプルの .frame：中身は 1440px で止める */
.wp-site-blocks {
	max-width: 1440px;
	margin-inline: auto;
}

/* ヘッダー・告知バー・本文・フッターの間はすき間なし */
body .wp-site-blocks > * {
	margin-block: 0;
}

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

/* フォーカス枠 */
body :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--focus);
	outline-offset: 4px;
}

/* 「本文へ」スキップリンク（WordPress標準の色を仕様の色に置きかえる） */
body .skip-link.screen-reader-text:focus {
	top: 10px;
	left: 10px;
	padding: 10px;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.75;
}

/* ボタン：高さ49px以上（サンプルの .btn） */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 49px;
}

/* ---------- ヘッダー ---------- */
.ak-header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 24px;
	min-height: 81px;
	padding: 12px 5%;
}

body .ak-header > * {
	margin: 0;
}

.ak-header__logo {
	white-space: nowrap;
}

.ak-header__logo a {
	text-decoration: none;
}

/* PC用ナビ */
.ak-header__nav .wp-block-navigation__container {
	gap: clamp(14px, 2.5vw, 37px);
}

.ak-header__nav .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

/* メニューボタン（800px以下で表示） */
.ak-header__menu {
	display: none;
}

.ak-header__menu .wp-block-navigation__responsive-container-open,
.ak-header__menu .wp-block-navigation__responsive-container-close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
}

.ak-header__menu .wp-block-navigation__responsive-container-close {
	position: absolute;
	top: 12px;
	right: 4%;
	background-color: var(--wp--preset--color--kinari);
}

.ak-header__menu .wp-block-navigation__responsive-container.is-menu-open {
	padding: 26px 5%;
}

.ak-header__menu .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 56px;
}

.ak-header__menu .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 4px;
}

.ak-header__menu .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: var(--wp--preset--font-size--body);
}

/* 検索・カート */
.ak-header__actions {
	justify-self: end;
	align-items: center;
}

.ak-header__search .wp-block-search__button,
.ak-header__search .wp-block-search__button:hover,
.ak-header__search .wp-block-search__button:focus {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	min-width: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
}

.ak-header__search .wp-block-search__button svg {
	width: 26px;
	height: 26px;
	min-width: 26px;
	fill: currentColor;
}

.ak-header__search .wp-block-search__input {
	border: 1px solid var(--wp--preset--color--link-line);
	border-radius: 0;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--m);
}

.ak-header__cart .wc-block-mini-cart__button {
	display: grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	color: inherit;
}

.ak-header__cart .wc-block-mini-cart__icon {
	width: 26px;
	height: 26px;
}

/* ---------- 告知バー ---------- */
.ak-notice {
	padding: 0 12px;
}

.ak-notice p {
	margin: 0;
}

.ak-notice a {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding-block: 8px;
}

/* ---------- ヒーロー ---------- */
.ak-main {
	margin-block: 0;
}

.ak-hero {
	display: grid;
	grid-template-columns: 42% 58%;
}

body .ak-hero > *,
body .ak-hero__copy > * {
	margin-block: 0;
}

.ak-hero__copy {
	align-self: center;
	padding: clamp(32px, 6vw, 90px) clamp(22px, 5.4vw, 85px);
}

body .ak-hero__copy .ak-hero__lead {
	margin: 19px 0 26px;
}

body .ak-hero .ak-hero__media {
	position: relative;
	min-height: 480px;
	margin: 0;
	overflow: hidden;
}

.ak-hero__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 48%;
}

/* ---------- フッター ---------- */
.ak-footer {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 24px;
	padding: 40px 5%;
}

body .ak-footer > * {
	margin: 0;
}

.ak-footer__logo {
	align-self: start;
}

.ak-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 22px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--m);
}

.ak-footer__links a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.ak-footer__copy {
	grid-column: 1 / -1;
}

/* ---------- 800px以下 ---------- */
@media (max-width: 800px) {
	.ak-header {
		gap: 0;
		min-height: 62px;
		padding-inline: 4%;
	}

	.ak-header__menu {
		display: block;
		grid-column: 1;
		grid-row: 1;
	}

	.ak-header__logo {
		grid-column: 2;
		grid-row: 1;
		justify-self: center;
	}

	.ak-header__nav {
		display: none;
	}

	.ak-header__actions {
		grid-column: 3;
		grid-row: 1;
	}

	.ak-hero {
		grid-template-columns: 1fr 1fr;
	}

	body .ak-hero .ak-hero__media {
		min-height: 340px;
	}

	.ak-hero__copy {
		padding: 30px 20px;
	}

	.ak-hero__lead {
		font-size: var(--wp--preset--font-size--m);
	}
}

/* ---------- 560px以下 ---------- */
@media (max-width: 560px) {
	.ak-notice {
		font-size: var(--wp--preset--font-size--xs);
	}

	.ak-notice .has-s-font-size {
		font-size: inherit !important;
	}

	.ak-hero {
		display: flex;
		flex-direction: column;
	}

	body .ak-hero .ak-hero__media {
		order: -1;
		min-height: 0;
		aspect-ratio: 1.42;
	}

	.ak-hero__copy {
		padding: 23px 5% 27px;
	}

	body .ak-hero .ak-hero__title {
		font-size: 31px;
	}

	body .ak-hero__copy .ak-hero__lead {
		margin: 8px 0 15px;
	}

	.ak-hero__lead br {
		display: none;
	}

	.ak-footer {
		grid-template-columns: 1fr;
	}
}

/* ======================================================
 * 段階2：トップのセクション（Pick Up Items〜Instagram）
 * ====================================================== */

/* ---------- セクション共通 ---------- */
.ak-section {
	padding: clamp(46px, 6.2vw, 95px) 5%;
}

body .ak-section > *,
body .ak-section-head > *,
body .ak-section-head__title > * {
	margin-block: 0;
}

body .ak-section .ak-section-head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 27px;
}

body .ak-section-head__title .ak-sub,
body .ak-story__copy .ak-sub {
	margin-top: 8px;
	font-size: var(--wp--preset--font-size--m);
}

/* テキストリンク（下線つき）。押せる高さ44pxを確保し、下線は文字のすぐ下 */
.ak-text-link {
	font-size: var(--wp--preset--font-size--m);
}

.ak-text-link a {
	display: inline-flex;
	align-items: flex-end;
	min-height: 44px;
	padding-bottom: 4px;
	border-bottom: 1px solid var(--wp--preset--color--link-line);
	line-height: 1.75;
}

/* ---------- 商品カード（Pick Up Items・New Arrivals） ---------- */
body .ak-products .wc-block-product-template {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: clamp(12px, 2vw, 28px);
	margin: 0;
	padding: 0;
	list-style: none;
}

body .ak-products .wc-block-product-template > li {
	width: auto;
	margin: 0;
	text-align: left;
}

body .ak-products .wc-block-product-template > li > * {
	margin-block: 0;
}

body .ak-products .wc-block-components-product-image {
	margin: 0 0 13px;
}

body .ak-products .wc-block-components-product-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 !important;
	object-fit: cover !important;
	background-color: var(--wp--preset--color--photo-bg);
}

.ak-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.ak-badge {
	display: inline-block;
	padding: 2px 8px;
	background-color: var(--wp--preset--color--kinari);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--xs);
	line-height: 1.6;
}

.ak-badge--stock {
	background-color: var(--wp--preset--color--badge-stock-bg);
	color: var(--wp--preset--color--badge-stock-text);
}

body .ak-products .ak-card__form {
	margin-top: 8px;
	font-size: var(--wp--preset--font-size--xs);
}

/* 商品名の太さはサンプルどおり500（2026-11-30 ユーザー指示。見出し400の例外） */
body .ak-products .ak-card__title {
	font-size: var(--wp--preset--font-size--body);
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 0;
}

body .ak-products .ak-card__price,
body .ak-products .ak-card__price .wc-block-components-product-price {
	margin-top: 4px;
	font-size: var(--wp--preset--font-size--m);
	text-align: left;
}

body .ak-products .ak-card__title a:hover {
	text-decoration: underline;
}

/* New Arrivals：2列・最大850px、写真は切らずに見せる */
body .ak-products--new {
	max-width: 850px;
}

body .ak-products--new .wc-block-product-template {
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body .ak-products--new .wc-block-components-product-image img {
	aspect-ratio: 1.35 !important;
	object-fit: contain !important;
	background-color: var(--wp--preset--color--kinari);
}

/* ---------- Category ---------- */
.ak-catgrid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(12px, 2vw, 28px);
}

body .ak-catgrid > *,
body .ak-cat > * {
	margin: 0;
}

.ak-cat__image img {
	width: 100%;
	aspect-ratio: 1.24;
	object-fit: cover;
	background-color: var(--wp--preset--color--photo-bg);
}

body .ak-cat .ak-cat__name {
	margin-top: 9px;
	font-size: var(--wp--preset--font-size--category);
}

.ak-cat:hover .ak-cat__name a {
	text-decoration: underline;
}

/* ---------- About ---------- */
.ak-story {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: stretch;
}

body .ak-story > *,
body .ak-story__copy > * {
	margin-block: 0;
}

body .ak-story .ak-story__media {
	position: relative;
	min-height: 350px;
	margin: 0;
}

.ak-story__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ak-story__copy {
	align-self: center;
	padding: clamp(32px, 6.5vw, 95px);
}

body .ak-story__copy .ak-story__title {
	margin: 15px 0 10px;
	font-size: var(--wp--preset--font-size--story);
}

body .ak-story__copy .ak-story__text {
	margin-bottom: 20px;
}

/* ---------- Journal ---------- */
.ak-entries__list {
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--wp--preset--color--line);
	list-style: none;
}

body .ak-entries__list > li {
	margin: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.ak-entry {
	display: grid;
	grid-template-columns: 8em 1fr;
	align-items: baseline;
	padding: 15px 0;
}

body .ak-entry > * {
	margin: 0;
}

.ak-entry__cat {
	font-size: var(--wp--preset--font-size--s);
}

body .ak-entry .ak-entry__title {
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.75;
	letter-spacing: 0;
}

/* ---------- Instagram ---------- */
.ak-ig {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(12px, 2vw, 28px);
}

body .ak-ig > * {
	margin: 0;
}

.ak-ig__image img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	background-color: var(--wp--preset--color--photo-bg);
}

/* ---------- 段階2：800px以下 ---------- */
@media (max-width: 800px) {
	.ak-story__copy {
		padding: 35px 22px;
	}
}

/* ---------- 段階2：560px以下 ---------- */
@media (max-width: 560px) {
	.ak-section {
		padding-block: 41px;
	}

	body .ak-section .ak-section-head {
		align-items: start;
		margin-bottom: 17px;
	}

	.ak-text-link a {
		white-space: nowrap;
	}

	body .ak-products .wc-block-product-template {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		row-gap: 22px;
	}

	.ak-catgrid {
		gap: 8px;
	}

	.ak-cat__image img {
		aspect-ratio: 1;
	}

	body .ak-cat .ak-cat__name {
		font-size: var(--wp--preset--font-size--xs);
	}

	.ak-story {
		grid-template-columns: 1fr;
	}

	body .ak-story .ak-story__media {
		min-height: 240px;
	}

	.ak-story__copy {
		padding: 30px 5% 38px;
	}

	.ak-entry {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.ak-ig {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
}

/* ======================================================
 * メニュー・会員機能（2026-11-30 現行STORESに合わせる。デザイン仕様書5-3章）
 * ====================================================== */

/* アカウントのアイコン（WooCommerce のマイアカウントへ） */
.ak-header__account a {
	display: grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	color: inherit;
}

.ak-header__account svg {
	width: 26px;
	height: 26px;
}

/* CATEGORY（押すと開く）ボタン：高さ44px、ナビの文字と同じ見た目 */
.ak-header .wp-block-navigation-submenu__toggle {
	min-height: 44px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	cursor: pointer;
}

/* PC：開いたときの箱（WordPress標準の白・薄い黒の枠を仕様の色に置きかえる） */
body .ak-header__nav.wp-block-navigation .wp-block-navigation__submenu-container {
	min-width: 16em;
	padding: 8px 0;
	border: 1px solid var(--wp--preset--color--line);
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
}

body .ak-header__nav.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	white-space: nowrap;
}

/* 「肌着」の子カテゴリは字下げして階層を示す */
body .ak-header .wp-block-navigation__submenu-container .ak-nav-child > .wp-block-navigation-item__content {
	padding-left: calc(20px + 1.2em);
}

/* メニューボタン（800px以下）で開いたとき */
.ak-header__menu .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-submenu__toggle {
	font-size: var(--wp--preset--font-size--body);
}

.ak-header__menu .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	gap: 4px;
	padding-left: 1em;
}

.ak-header__menu .wp-block-navigation__responsive-container.is-menu-open .ak-nav-child > .wp-block-navigation-item__content {
	padding-left: 1.2em;
}

/* 800px以下：右のアイコンが3つになったため、左右2つずつ（メニュー・検索｜ロゴ｜アカウント・カート）にしてロゴを中央に保つ */
@media (max-width: 800px) {
	.ak-header {
		position: relative;
		grid-template-columns: 44px 44px minmax(0, 1fr) 44px 44px;
	}

	.ak-header .ak-header__actions {
		display: contents;
	}

	.ak-header .ak-header__logo {
		grid-column: 3;
	}

	.ak-header .ak-header__search {
		grid-column: 2;
		grid-row: 1;
	}

	.ak-header .ak-header__account {
		grid-column: 4;
		grid-row: 1;
	}

	.ak-header .ak-header__cart {
		grid-column: 5;
		grid-row: 1;
	}

	/* 検索欄を開いたときは、ヘッダーの幅いっぱいに重ねて表示する */
	.ak-header .ak-header__search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper {
		position: absolute;
		top: 50%;
		right: 4%;
		left: 4%;
		z-index: 10;
		display: flex;
		width: auto !important;
		transform: translateY(-50%);
		background-color: var(--wp--preset--color--base);
	}

	.ak-header .ak-header__search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input {
		flex: 1;
		min-height: 44px;
	}
}
