@charset "utf-8";

/**
 * トップページ専用スタイル。
 */

/* ページテンプレートと固定ページ本文の余白を調整する */
.home.page:not(.page-template-template-homepage) .site-header {
	margin-bottom: 0;
}

.home .entry-header {
	display: none;
}

.page-template-template-homepage .type-page {
	padding-top: 0;
	padding-bottom: 0;
}

.page-template-template-homepage:not(.has-post-thumbnail) .site-main {
	padding-top: 0;
}

@media (min-width: 768px) {
	.home.page:not(.page-template-template-homepage) .site-header {
		padding-bottom: 0;
	}

	.home .wp-block-group {
		text-align: center;
	}
}

/* メインビジュアル */
.main-visual picture,
.main-visual img {
	display: block;
	width: 100%;
}

@media (max-width: 767px) {
	.main-visual img {
		height: 100dvh;
		object-fit: cover;
	}
}

/* プロフィール画像 */
.profile-photo img {
	width: 100%;
	max-width: 400px;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 50%;
}

@media (max-width: 767px) {
	.profile-photo img {
		max-width: 300px;
	}
}

/* --------------------------------------------------------------------------
 * 最新投稿カルーセル
 * PC・モバイルとも2行を固定し、縦2件ずつ横方向へ送る。
 * ----------------------------------------------------------------------- */

body.home .wp-block-query.post-carousel {
	position: relative;
}

body.home .wp-block-query.post-carousel .wp-block-post-template {
	display: grid;
	grid-template-rows: repeat(2, auto);
	grid-template-columns: none;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 120px) / 4);
	gap: 18px;
	margin: 0;
	padding: 0 0 14px;
	overflow-x: auto;
	overflow-y: hidden;
	list-style: none;
	scrollbar-width: none;
	scroll-snap-type: x mandatory;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

body.home .wp-block-query.post-carousel .wp-block-post-template::-webkit-scrollbar {
	display: none;
}

body.home .wp-block-query.post-carousel .wp-block-post-template > li {
	width: auto;
	min-width: 0;
	list-style: none;
	scroll-snap-align: start;
}

/* ブロックエディター由来のインライン余白をカルーセル用に上書きする */
body.home .wp-block-query.post-carousel .wp-block-post-template > li .wp-block-group {
	padding: 20px !important;
}

body.home .wp-block-query.post-carousel .wp-block-post-featured-image {
	margin: 0 0 0.75em;
}

body.home .wp-block-query.post-carousel .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: 0.75em;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

body.home .wp-block-query.post-carousel .wp-block-post-title {
	margin-top: 6px;
	margin-bottom: 0;
	font-size: 16px;
	line-height: 1.45;
}

body.home .wp-block-query.post-carousel .wp-block-post-title a {
	color: var(--jy-color-text);
	text-decoration: none;
}

body.home .wp-block-query.post-carousel .wp-block-post-date {
	margin-top: 0.3em;
	color: var(--jy-color-muted);
	font-size: 14px;
}

body.home .wp-block-query.post-carousel .post-carousel-nav {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-bottom: 10px;
}

body.home .wp-block-query.post-carousel .post-carousel-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0 0.97em 2px;
	border: 1px solid var(--jy-color-border);
	border-radius: 999px;
	background: var(--jy-color-surface);
	color: var(--jy-color-text);
	cursor: pointer;
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
}

body.home .wp-block-query.post-carousel .post-carousel-btn:disabled,
body.home .wp-block-query.post-carousel .post-carousel-btn[aria-disabled="true"] {
	border-color: #ddd;
	background: var(--jy-color-surface);
	color: #ddd;
	cursor: default;
	opacity: 1;
	-webkit-text-fill-color: #ddd;
}

body.home .wp-block-query.post-carousel .post-carousel-nav[hidden] {
	display: none;
}

@media (max-width: 767px) {
	body.home .wp-block-query.post-carousel .wp-block-post-template {
		grid-auto-columns: calc((100% - 64px) / 2);
		gap: 12px;
		padding-bottom: 12px;
	}

	body.home .wp-block-query.post-carousel .wp-block-post-template > li .wp-block-group {
		padding: 10px !important;
	}
}

/* --------------------------------------------------------------------------
 * 商品カルーセル
 * WooCommerce Blocksのカルーセル表示を投稿カルーセルへ揃える。
 * ----------------------------------------------------------------------- */

/*
 * ブロック側のプリセット文字サイズには!importantが付くため、
 * 商品名を従来の大きさへ戻すこの箇所に限り同じ指定で上書きする。
 */
.home .wc-block-product h2.has-medium-font-size {
	font-size: 1rem !important;
}

.home .wc-block-product h2 a {
	color: var(--jy-color-text);
	text-decoration: none;
}

.home-carousel .wc-block-next-previous-buttons {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-bottom: 10px;
}

/* WooCommerce Blocksの既定ボタンスタイルをトップページ用に統一する */
.home-carousel .wc-block-next-previous-buttons__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	min-width: 56px;
	height: 34px;
	min-height: 34px;
	padding: 0;
	border: 1px solid var(--jy-color-border);
	border-radius: 999px;
	background: var(--jy-color-surface);
	color: var(--jy-color-text);
	box-shadow: none;
	cursor: pointer;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
	text-shadow: none;
	appearance: none;
	-webkit-appearance: none;
}

.home-carousel .wc-block-next-previous-buttons__button svg {
	display: none;
}

.home-carousel .wc-block-next-previous-buttons__button::before {
	display: block;
	color: currentColor;
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
	transform: translateY(-1px);
}

.home-carousel .wc-block-next-previous-buttons__button:first-child::before {
	content: "‹";
}

.home-carousel .wc-block-next-previous-buttons__button:last-child::before {
	content: "›";
}

.home-carousel .wc-block-next-previous-buttons__button[aria-disabled="true"] {
	cursor: default;
	opacity: 0.35;
	pointer-events: none;
}

.home-carousel .wc-block-next-previous-buttons__button[aria-disabled="true"]:focus,
.home-carousel .wc-block-next-previous-buttons__button[aria-disabled="true"]:focus-visible {
	outline: none;
	box-shadow: none;
}

/* WooCommerce Blocksがタッチ端末で非表示にする操作ボタンを表示する */
@media (max-width: 600px) and (hover: none) and (pointer: coarse) {
	.home-carousel .wp-block-woocommerce-product-collection:has(.is-product-collection-layout-carousel)
		.wc-block-next-previous-buttons {
		display: flex;
	}
}

@media (max-width: 767px) {
	.home-carousel ul.is-product-collection-layout-carousel {
		gap: 14px;
		padding: 0 18px 10px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
	}

	.home-carousel ul.is-product-collection-layout-carousel > li.wc-block-product {
		flex: 0 0 78%;
		scroll-snap-align: start;
	}
}
