/* Model listing pages. Figma section 1689:13396. All selectors are scoped with .pm-. */
.pm-page {
	--pm-ink: #32373c;
	--pm-text: #111827;
	--pm-muted: #6b7280;
	--pm-line: #e5e7eb;
	--pm-soft: #f9fafb;
	--pm-sold: #f14747;
	--pm-gothic: "Yu Gothic", YuGothic, "Noto Sans JP", sans-serif;
	--pm-gutter: clamp(64px, calc((100vw - 1320px) * .16 + 64px), 160px);
	color: var(--pm-text);
	font-family: "Noto Sans JP", sans-serif;
}

.pm-page h1,
.pm-page h2,
.pm-page h3,
.pm-page p {
	margin: 0;
}

/* Hero */
.pm-hero {
	position: relative;
	aspect-ratio: 1920 / 550;
	overflow: hidden;
}

.pm-hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pm-hero h1 {
	position: absolute;
	inset: 50% 16px auto;
	transform: translateY(-50%);
	color: #fff;
	font: 400 36px / 1.15 "Playfair Display SC", serif;
	letter-spacing: .4em;
	text-align: center;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

/* Shared section */
.pm-section {
	padding: 64px var(--pm-gutter);
}

.pm-heading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-bottom: 40px;
	text-align: center;
}

.pm-heading__title {
	font: 800 32px / 1.5 "M PLUS 1p", sans-serif;
	color: var(--pm-text);
}

.pm-heading__title::after {
	content: "";
	display: block;
	width: 56px;
	height: 4px;
	margin: 12px auto 0;
	border-radius: 999px;
	background: var(--pm-ink);
}

.pm-heading__text {
	font: 700 16px / 1.5 var(--pm-gothic);
}

.pm-heading__text a {
	text-decoration: underline;
}

.pm-heading__intro {
	max-width: 800px;
	color: var(--pm-muted);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.6;
}

/* Features */
.pm-features {
	background: var(--pm-soft);
}

.pm-features .pm-heading {
	margin-bottom: 32px;
}

.pm-features .pm-heading__title {
	font-size: 28px;
}

.pm-features .pm-heading__title::after {
	width: 48px;
}

.pm-feature-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.pm-feature {
	/* The cross-fade copy of the photo (assets/js/image-swap.js) is placed against this box. */
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 16px;
	border: 1px solid var(--pm-line);
	border-radius: 24px;
	background: #fff;
}

.pm-feature__image {
	height: 240px;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .05);
	object-fit: cover;
}

.pm-thumbs {
	display: flex;
	gap: 8px;
	margin-top: -12px;
}

.pm-thumb {
	width: 72px;
	height: 56px;
	padding: 0;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: 8px;
	background: none;
	cursor: pointer;
}

.pm-thumb[aria-pressed="true"] {
	border-color: var(--pm-ink);
}

.pm-thumb:focus-visible {
	outline: 2px solid var(--pm-ink);
	outline-offset: 2px;
}

.pm-thumb img {
	height: 100%;
	object-fit: cover;
}

.pm-feature__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pm-feature h3 {
	padding-bottom: 12px;
	border-bottom: 2px solid var(--pm-line);
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
}

/*
 * Cards in a row share four rows (photo, thumbnails, title, text) through subgrid, so
 * the titles' borders and the text line up even when only some cards have thumbnails
 * or a title wraps; a shorter title starts at the top of the taller title row. The
 * spacing moves from gaps to margins, so an empty thumbnail row takes no space: the
 * grid's row gap would otherwise fall between the rows inside each card too.
 * The editor keeps the flex layout (blocks-editor.css).
 */
.pm-feature-grid:has(> .pm-feature) {
	row-gap: 0;
	margin-bottom: -16px;
}

.pm-feature-grid > .pm-feature {
	display: grid;
	grid-row: span 4;
	grid-template-rows: subgrid;
	row-gap: 0;
	margin-bottom: 16px;
}

.pm-feature-grid > .pm-feature > .pm-feature__image {
	grid-row: 1;
}

.pm-feature-grid > .pm-feature > .pm-thumbs {
	grid-row: 2;
	margin-top: 12px;
}

.pm-feature-grid > .pm-feature > .pm-feature__body {
	display: grid;
	grid-row: 3 / span 2;
	grid-template-rows: subgrid;
	row-gap: 0;
	margin-top: 24px;
}

/* The title text starts at the top of its row; a column keeps a typed line break as two lines. */
.pm-feature-grid > .pm-feature > .pm-feature__body > h3 {
	display: flex;
	flex-direction: column;
	justify-content: start;
}

.pm-feature-grid > .pm-feature > .pm-feature__body > .pm-feature__content {
	margin-top: 12px;
}

.pm-feature__content {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pm-feature__lead {
	color: var(--pm-ink);
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
}

.pm-feature__text {
	color: var(--pm-muted);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.6;
}

/* Color lineup */
.pm-lineup {
	padding-block: clamp(64px, calc((100vw - 1320px) * .06 + 64px), 100px);
	background: #fff;
}

.pm-lineup .pm-heading {
	margin-bottom: 56px;
}

.pm-product-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
}

.pm-product {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--pm-line);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 0 16px rgba(0, 0, 0, .05);
}

.pm-product__image {
	--pm-image-pad: 24px;
	padding: var(--pm-image-pad) var(--pm-image-pad) 0;
	/* Keeps the zoomed photo inside its rounded frame. */
	clip-path: inset(var(--pm-image-pad) var(--pm-image-pad) 0 round 8px);
}

.pm-product__image img {
	aspect-ratio: 1;
	border-radius: 8px;
	object-fit: cover;
	transition: scale .4s ease, rotate .4s ease;
}

/* Cards with a product page: the whole card is the link, and hovering it zooms the photo. */
.pm-product a.pm-button::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: 24px;
}

.pm-product:has(a.pm-button):hover .pm-product__image img {
	scale: 1.1;
	rotate: 2.5deg;
}

.pm-product__info {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: space-between;
	gap: 16px;
	padding: 24px;
}

.pm-product__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--pm-line);
}

.pm-product__label {
	margin-bottom: 8px !important;
	color: var(--pm-muted);
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
}

.pm-product h3,
.pm-product__price {
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
}

.pm-product__price {
	flex: none;
	margin-left: auto !important;
	white-space: nowrap;
}

.pm-product__price span {
	color: var(--pm-muted);
	font-size: 12px;
	font-weight: 500;
}

.pm-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 37px;
	padding: 8px 24px;
	border: 1px solid var(--pm-ink);
	border-radius: 8px;
	background: var(--pm-ink);
	box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
	color: #fff;
	font: 700 14px / 1.5 var(--pm-gothic);
	transition: background-color .25s ease, color .25s ease;
}

.pm-button img {
	flex: none;
	width: 15px;
	height: 15px;
	transition: filter .25s ease;
}

/* Hover (the whole card is the link): an outlined button with the arrow darkened to the ink colour. */
.pm-product:has(a.pm-button):hover a.pm-button {
	background: transparent;
	color: var(--pm-ink);
}

.pm-product:has(a.pm-button):hover a.pm-button img {
	filter: brightness(.2);
}

.pm-button--disabled {
	border-color: var(--pm-line);
	background: var(--pm-line);
	box-shadow: none;
	color: var(--pm-muted);
}

.pm-badge {
	position: absolute;
	top: -1px;
	left: -1px;
	z-index: 1;
	padding: 16px 24px;
	border-radius: 24px 0;
	background: var(--pm-sold);
	color: #fff;
	font: 700 16px / 1.2 Roboto, sans-serif;
}

.pm-badge--coming {
	background: var(--pm-ink);
}

/* Categories */
.pm-categories {
	padding-block: 80px;
	background: var(--pm-soft);
}

.pm-category-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

@media (max-width: 1320px) {
	.pm-hero h1 {
		line-height: 1.2;
		letter-spacing: 0;
	}

	.pm-section,
	.pm-categories {
		padding-block: 40px;
	}

	.pm-lineup {
		padding-block: 64px;
	}

	.pm-features .pm-heading,
	.pm-lineup .pm-heading {
		margin-bottom: 40px;
	}

	.pm-features .pm-heading__title {
		font-size: 32px;
	}

	.pm-features .pm-heading__title::after {
		width: 56px;
	}

	.pm-product h3 {
		line-height: 1.4;
	}

	.pm-product h3,
	.pm-product__price {
		font-size: 18px;
	}

	.pm-category-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 1024px) {
	.pm-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.pm-page {
		--pm-gutter: 16px;
	}

	.pm-section,
	.pm-lineup,
	.pm-categories {
		padding-block: 40px;
	}

	.pm-hero h1 {
		font-size: 22px;
	}

	.pm-heading,
	.pm-features .pm-heading,
	.pm-lineup .pm-heading {
		gap: 8px;
		margin-bottom: 24px;
	}

	.pm-heading__title,
	.pm-features .pm-heading__title {
		font-size: 24px;
	}

	.pm-heading__title::after {
		margin-top: 8px;
	}

	.pm-heading__text {
		font-size: 15px;
		line-height: 1.6;
	}

	.pm-heading__intro {
		font-size: 14px;
	}

	.pm-feature-grid,
	.pm-product-grid,
	.pm-category-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.pm-product-grid {
		gap: 24px;
	}

	.pm-product__image {
		--pm-image-pad: 16px;
	}

	.pm-product__info {
		padding: 16px;
	}

	.pm-category-grid {
		gap: 16px;
	}

	.pm-feature h3 {
		font-size: 20px;
	}

	.pm-feature__text {
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pm-product__image img {
		transition: none;
	}
}
