/* Material page (template-parts/product-material.php): name on top, image on the left, text, facts, thicknesses as
   squares to scale and the inquiry button on the right. Mobile-first. The inquiry modal reuses product-page.css. */

.iw-pmat {
	--iw-mm: 2.4px; /* one millimetre of thickness in the squares */
	background: var(--iw-color-bg);
}

.iw-pmat__inner {
	max-width: var(--iw-container);
	margin: 0 auto;
	padding: var(--iw-space-6) var(--iw-gutter) var(--iw-space-16);
}

/* Breadcrumb */
.iw-pmat__crumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: var(--iw-space-1) var(--iw-space-2);
	margin: 0;
	padding: 0;
	color: var(--iw-color-ink-muted);
	font-size: var(--iw-text-sm);
	list-style: none;
}

.iw-pmat__crumbs li + li::before {
	content: "/";
	margin-right: var(--iw-space-2);
	color: var(--iw-color-taupe);
}

.iw-pmat__crumbs a {
	color: inherit;
	text-decoration: none;
}

.iw-pmat__crumbs a:hover {
	color: var(--iw-color-primary-dark);
}

.iw-pmat__title {
	margin: var(--iw-space-6) 0 var(--iw-space-8);
	font-size: var(--iw-text-h2);
	letter-spacing: -0.015em;
}

.iw-pmat__layout {
	display: grid;
	gap: var(--iw-space-8);
}

/* Image */
.iw-pmat__photo {
	overflow: hidden;
	aspect-ratio: 1;
	background: var(--iw-color-surface);
}

.iw-pmat__photo.is-empty {
	background:
		repeating-linear-gradient(135deg, rgb(68 54 43 / 6%) 0 2px, transparent 2px 14px),
		var(--iw-color-surface);
}

.iw-pmat__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Right column */
.iw-pmat__info {
	display: grid;
	gap: var(--iw-space-6);
	align-content: start;
}

.iw-pmat__text {
	max-width: 38rem;
	margin: 0;
	color: var(--iw-color-ink-soft);
	font-size: var(--iw-text-lg);
}

.iw-pmat__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10rem, max-content));
	gap: 0 var(--iw-space-12);
	margin: 0;
}

.iw-pmat__fact {
	padding: var(--iw-space-3) 0;
	border-top: 1px solid var(--iw-color-line);
}

.iw-pmat__fact dt,
.iw-pmat__label {
	margin: 0 0 var(--iw-space-1);
	color: var(--iw-color-ink-muted);
	font-family: var(--iw-font-body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.iw-pmat__fact dd {
	margin: 0;
	color: var(--iw-color-brown);
	font-size: var(--iw-text-lg);
	font-weight: 600;
	font-variant-numeric: lining-nums;
}

.iw-pmat__label span {
	margin-left: var(--iw-space-3);
	color: var(--iw-color-brown);
	letter-spacing: 0.08em;
	font-variant-numeric: lining-nums;
}

/* Thicknesses: squares stand on one line, the label sits under it. Sets (one per sheet format) sit side by side when there is room. */
.iw-pmat__sets {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--iw-space-16);
}

.iw-pmat__set {
	flex: 0 1 auto;
	padding-top: var(--iw-space-3);
	border-top: 1px solid var(--iw-color-line);
}

.iw-pmat__set .iw-pmat__label {
	margin-bottom: var(--iw-space-4);
}

.iw-pmat__squares {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--iw-space-12) var(--iw-space-3);
	margin: 0;
	padding: 0 0 var(--iw-space-6);
	list-style: none;
}

.iw-pmat__square {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 2.25rem;
}

.iw-pmat__block {
	display: block;
	width: calc(var(--t) * var(--iw-mm));
	height: calc(var(--t) * var(--iw-mm));
	background: var(--iw-color-brown);
	transform-origin: center bottom;
	transition: background-color 0.2s ease;
}

.iw-pmat__square:hover .iw-pmat__block {
	background: var(--iw-color-primary);
}

/* Base line under every square (joins into one line), label under it */
.iw-pmat__square::before {
	content: "";
	position: absolute;
	right: calc(var(--iw-space-2) * -1);
	bottom: 0;
	left: calc(var(--iw-space-2) * -1);
	height: 1px;
	background: var(--iw-color-brown);
}

.iw-pmat__t {
	position: absolute;
	top: 100%;
	left: 50%;
	margin-top: var(--iw-space-2);
	color: var(--iw-color-brown);
	font-size: var(--iw-text-sm);
	font-weight: 600;
	font-variant-numeric: lining-nums;
	white-space: nowrap;
	transform: translateX(-50%);
}

.iw-pmat__t small {
	color: var(--iw-color-ink-muted);
	font-size: 0.75rem;
	font-weight: 500;
}

.iw-pmat__scale {
	margin: calc(var(--iw-space-3) * -1) 0 0;
	color: var(--iw-color-ink-muted);
	font-size: var(--iw-text-sm);
}

/* Inquiry */
.iw-pmat__actions {
	display: grid;
	gap: var(--iw-space-3);
	justify-items: start;
	padding-top: var(--iw-space-3);
}

.iw-pmat .iw-pmat__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 var(--iw-space-8);
	border-radius: var(--iw-radius);
	background: var(--iw-color-primary);
	color: var(--iw-color-on-primary);
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.iw-pmat .iw-pmat__cta:hover {
	background: var(--iw-color-primary-dark);
	color: var(--iw-color-on-primary);
}

.iw-pmat__note,
.iw-pmat__highlight {
	max-width: 32rem;
	margin: 0;
	color: var(--iw-color-ink-soft);
	font-size: var(--iw-text-sm);
}

.iw-pmat__highlight {
	color: var(--iw-color-brown);
	font-weight: 600;
}

/* Squares grow up from the line one by one when they come into view (reduced motion: simply shown) */
@media (prefers-reduced-motion: no-preference) {
	.iw-pmat.is-armed .iw-pmat__block {
		transform: scaleY(0);
		transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--i) * 90ms), background-color 0.2s ease;
	}

	.iw-pmat.is-armed .iw-pmat__t {
		opacity: 0;
		transition: opacity 0.5s ease calc(0.3s + var(--i) * 90ms);
	}

	.iw-pmat.is-armed .iw-pmat__squares.is-in .iw-pmat__block {
		transform: none;
	}

	.iw-pmat.is-armed .iw-pmat__squares.is-in .iw-pmat__t {
		opacity: 1;
	}
}

@media (min-width: 768px) {
	.iw-pmat {
		--iw-mm: 2.8px;
	}
}

@media (min-width: 1024px) {
	.iw-pmat {
		--iw-mm: 3px;
	}

	.iw-pmat__layout {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		gap: var(--iw-space-16);
		align-items: stretch;
	}

	/* The image fills the whole height of the right column */
	.iw-pmat__media {
		position: relative;
		min-height: 480px;
	}

	.iw-pmat__photo {
		position: absolute;
		inset: 0;
		aspect-ratio: auto;
	}
}

/* Category intro: the product list below it (anchor target) */
.iw-pmat__list {
	scroll-margin-top: calc(var(--iw-header-height, 80px) + var(--iw-space-4));
}

.iw-pmat--category .iw-pmat__inner {
	padding-bottom: var(--iw-space-12);
}

/* Second photo under the main one (e.g. stair treads built in). */
.iw-pmat__photo--second {
	margin-top: var(--iw-space-4);
	aspect-ratio: 4 / 3;
}

/* Stair tread profile with the nosing (čelo), to scale. */
.iw-pmat__profile {
	margin: 0;
	padding-top: var(--iw-space-3);
	border-top: 1px solid var(--iw-color-line);
}

.iw-pmat__profile svg {
	display: block;
	width: 100%;
	max-width: 30rem;
	height: auto;
	margin-top: var(--iw-space-3);
	overflow: visible;
}

.iw-pmat__profile-board {
	fill: #d9bf98;
	stroke: var(--iw-color-brown);
	stroke-width: 1;
}

.iw-pmat__profile-dim path {
	fill: none;
	stroke: var(--iw-color-taupe);
	stroke-width: 1;
}

.iw-pmat__profile-text {
	fill: var(--iw-color-ink-soft);
	font-family: var(--iw-font-body);
	font-size: 12px;
	font-variant-numeric: lining-nums;
}

/* Two photos on desktop: they share the height of the right column instead of the main one filling it. */
@media (min-width: 1024px) {
	.iw-pmat__media:has(.iw-pmat__photo--second) {
		display: flex;
		flex-direction: column;
		gap: var(--iw-space-4);
	}

	.iw-pmat__media:has(.iw-pmat__photo--second) .iw-pmat__photo {
		position: relative;
		flex: 1 1 0;
		min-height: 240px;
		margin: 0;
	}

	.iw-pmat__media:has(.iw-pmat__photo--second) .iw-pmat__photo img {
		position: absolute;
		inset: 0;
	}
}

/* Photos in use (e.g. treads built into a staircase): whole photos, never cropped, two side by side. The main
   photo (a product on white) is then shown whole too and on desktop takes the height left above them. */
.iw-pmat__media.has-gallery .iw-pmat__photo {
	background: var(--iw-color-bg);
}

.iw-pmat__media.has-gallery .iw-pmat__photo img {
	object-fit: contain;
}

.iw-pmat__gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--iw-space-4);
	align-items: start;
	margin: var(--iw-space-4) 0 0;
	padding: 0;
	list-style: none;
}

.iw-pmat__gallery-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--iw-radius);
}

@media (min-width: 1024px) {
	.iw-pmat__media.has-gallery {
		display: flex;
		flex-direction: column;
	}

	.iw-pmat__media.has-gallery .iw-pmat__photo {
		position: relative;
		flex: 1 1 auto;
		min-height: 260px;
	}

	.iw-pmat__media.has-gallery .iw-pmat__photo img {
		position: absolute;
		inset: 0;
	}

	.iw-pmat__media.has-gallery .iw-pmat__gallery {
		flex: none;
	}
}

/* Class thumbnails that switch the main photo (e.g. stair treads rustik / select). */
.iw-pmat__classes {
	padding-top: var(--iw-space-3);
	border-top: 1px solid var(--iw-color-line);
}

.iw-pmat__class-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--iw-space-3);
	margin: var(--iw-space-2) 0 0;
	padding: 0;
	list-style: none;
}

.iw-pmat__class {
	display: flex;
	align-items: center;
	gap: var(--iw-space-3);
	min-height: 44px;
	padding: var(--iw-space-1) var(--iw-space-4) var(--iw-space-1) var(--iw-space-1);
	border: 1px solid var(--iw-color-line);
	border-radius: var(--iw-radius);
	background: var(--iw-color-bg);
	color: var(--iw-color-brown);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.iw-pmat__class:hover {
	border-color: var(--iw-color-taupe);
}

.iw-pmat__class[aria-pressed="true"] {
	border-color: var(--iw-color-brown);
	box-shadow: 0 0 0 1px var(--iw-color-brown);
}

.iw-pmat__class:focus-visible {
	outline: 2px solid var(--iw-color-primary);
	outline-offset: 2px;
}

.iw-pmat__class-img {
	display: block;
	width: 64px;
	height: 48px;
	border-radius: calc(var(--iw-radius) - 2px);
	background: var(--iw-color-bg);
	object-fit: contain;
}

/* A photo in use is a button that opens it enlarged. */
.iw-pmat__gallery-open {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--iw-radius);
	background: none;
	cursor: zoom-in;
}

.iw-pmat__gallery-open:focus-visible {
	outline: 2px solid var(--iw-color-primary);
	outline-offset: 3px;
}

.iw-pmat__gallery-open .iw-pmat__gallery-img {
	transition: opacity 0.2s ease;
}

.iw-pmat__gallery-open:hover .iw-pmat__gallery-img {
	opacity: 0.88;
}

/* Two photos (e.g. table legs): the first one big and whole on the left, the second whole under the inquiry button. */
.iw-pmat__media.has-second {
	min-height: 0;
}

.iw-pmat__media.has-second .iw-pmat__photo {
	position: relative;
	inset: auto;
	aspect-ratio: 4 / 5;
	background: #fff;
}

.iw-pmat__media.has-second .iw-pmat__photo img,
.iw-pmat__info > .iw-pmat__photo--second img {
	object-fit: contain;
}

.iw-pmat__info > .iw-pmat__photo--second {
	position: relative;
	inset: auto;
	width: min(100%, 22rem);
	margin-top: var(--iw-space-4);
	aspect-ratio: 3 / 4;
	background: #fff;
}

@media (min-width: 1024px) {
	/* The big photo takes the whole height of the column next to it, so both columns end together. */
	.iw-pmat__media.has-second {
		display: grid;
		grid-template-rows: 1fr;
	}

	.iw-pmat__media.has-second .iw-pmat__photo {
		aspect-ratio: auto;
		min-height: 520px;
	}

	.iw-pmat__info > .iw-pmat__photo--second {
		width: min(100%, 18rem);
	}
}

/* Table legs: the second photo and the base circles (to scale) side by side. */
.iw-pmat__pair {
	display: flex;
	gap: var(--iw-space-5);
	align-items: stretch;
	margin-top: var(--iw-space-4);
}

.iw-pmat__pair > .iw-pmat__photo--second {
	flex: 0 0 18rem;
	width: auto;
	margin-top: 0;
}

.iw-pmat__bases {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	padding: var(--iw-space-3);
	border-top: 1px solid var(--iw-color-line);
	display: grid;
	align-content: center;
	gap: var(--iw-space-2);
}

.iw-pmat__bases svg {
	display: block;
	width: 100%;
	max-width: 20rem;
	height: auto;
	margin: 0 auto;
}

.iw-pmat__base {
	fill: none;
	stroke: var(--iw-color-brown);
	stroke-width: 1;
}

.iw-pmat__base-text {
	fill: var(--iw-color-ink-soft);
	font-family: var(--iw-font-body);
	font-size: 13px; font-weight: 600;
	font-variant-numeric: lining-nums;
}

.iw-pmat__bases figcaption {
	color: var(--iw-color-ink-muted);
	font-size: var(--iw-text-sm, 0.875rem);
	text-align: center;
}

@media (max-width: 639px) {
	.iw-pmat__pair {
		flex-direction: column;
	}

	.iw-pmat__pair > .iw-pmat__photo--second {
		flex: none;
		width: min(100%, 22rem);
	}
}

.iw-pmat__pair > .iw-pmat__photo--second {
	position: relative;
	inset: auto;
	aspect-ratio: 3 / 4;
	background: #fff;
}

.iw-pmat__pair > .iw-pmat__photo--second img {
	object-fit: contain;
}

/* Edge profiles of solid boards, to scale. */
.iw-pmat__edges {
	padding-top: var(--iw-space-3);
	border-top: 1px solid var(--iw-color-line);
}

.iw-pmat__edge-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--iw-space-4);
	margin: var(--iw-space-3) 0 0;
	padding: 0;
	list-style: none;
}

.iw-pmat__edge {
	display: grid;
	gap: var(--iw-space-2);
	justify-items: start;
}

.iw-pmat__edge svg {
	max-width: 100%;
	display: block;
	width: 100%;
	max-width: 250px;
	height: auto;
	overflow: visible;
}

.iw-pmat__edge-shape {
	fill: none;
	stroke: var(--iw-color-brown);
	stroke-width: 2;
	stroke-linejoin: round;
}

.iw-pmat__edge-text {
	fill: var(--iw-color-ink-soft);
	font-family: var(--iw-font-body);
	font-size: 11px;
	font-variant-numeric: lining-nums;
}

.iw-pmat__edge-name {
	/* Starts where the drawn edge starts (50 of the 190 units of the drawing), not at the label space on its left. */
	padding-left: min(26.3%, 65.8px);
	color: var(--iw-color-brown);
	font-size: var(--iw-text-sm, 0.875rem);
	font-weight: 600;
}

/* Board shapes (solid oak boards): cut-out photos in a grid, name underneath. */
.iw-pmat__shapes {
	margin-top: var(--iw-space-12);
	padding-top: var(--iw-space-6);
	border-top: 1px solid var(--iw-color-line);
}

.iw-pmat__shape-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--iw-space-6) var(--iw-space-4);
	margin: var(--iw-space-6) 0 0;
	padding: 0;
	list-style: none;
}

.iw-pmat__shape {
	display: grid;
	gap: var(--iw-space-3);
	justify-items: center;
	align-content: start;
}

.iw-pmat__shape-frame {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 3 / 2;
}

.iw-pmat__shape-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	filter: drop-shadow(0 10px 14px rgb(68 54 43 / 18%));
}

.iw-pmat__shape-name {
	color: var(--iw-color-brown);
	font-weight: 600;
	text-align: center;
}

@media (min-width: 1024px) {
	.iw-pmat__shape-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--iw-space-8) var(--iw-space-6);
	}
}

/* Class switcher of the shapes: changes all shapes at once. */
.iw-pmat__shapes-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--iw-space-3) var(--iw-space-6);
}

.iw-pmat__shape-classes {
	display: flex;
	flex-wrap: wrap;
	gap: var(--iw-space-2);
}

.iw-pmat__shape-class {
	min-height: 40px;
	padding: 0 var(--iw-space-4);
	border: 1px solid var(--iw-color-line);
	border-radius: var(--iw-radius);
	background: var(--iw-color-bg);
	color: var(--iw-color-brown);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.iw-pmat__shape-class:hover {
	border-color: var(--iw-color-taupe);
}

.iw-pmat__shape-class[aria-pressed="true"] {
	border-color: var(--iw-color-brown);
	box-shadow: 0 0 0 1px var(--iw-color-brown);
}

.iw-pmat__shape-class:focus-visible {
	outline: 2px solid var(--iw-color-primary);
	outline-offset: 2px;
}

/* A shape without a photo in the chosen class yet: the natur photo, faded. */
.iw-pmat__shape.is-unavailable .iw-pmat__shape-frame,
.iw-pmat__shape.is-unavailable .iw-pmat__shape-name {
	opacity: 0.3;
}

.iw-pmat__shape-frame,
.iw-pmat__shape-name {
	transition: opacity 0.25s ease;
}

.iw-pmat__photo picture {
	display: contents;
}

/* A board shape is a button that opens the enlarged photo. */
button.iw-pmat__shape-frame {
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}

button.iw-pmat__shape-frame:focus-visible {
	outline: 2px solid var(--iw-color-primary);
	outline-offset: 4px;
}

button.iw-pmat__shape-frame .iw-pmat__shape-img {
	transition: transform 0.25s ease;
}

button.iw-pmat__shape-frame:hover .iw-pmat__shape-img {
	transform: scale(1.03);
}

/* Groups (hardware): one row per group, title and text on the left, photos whole in a grid on the right. */
.iw-pmat__groups {
	margin-top: var(--iw-space-16);
}

.iw-pmat__group {
	display: grid;
	gap: var(--iw-space-6);
	padding: var(--iw-space-8) 0;
	border-top: 1px solid var(--iw-color-line);
}

.iw-pmat__group-title {
	margin: 0 0 var(--iw-space-4);
	color: var(--iw-color-brown);
	font-size: var(--iw-text-h3);
	line-height: var(--iw-leading-tight);
}

.iw-pmat__group-text p {
	max-width: 38rem;
	margin: 0 0 var(--iw-space-3);
	color: var(--iw-color-ink-soft);
}

.iw-pmat__group-text p:last-child {
	margin-bottom: 0;
}

.iw-pmat__group-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--iw-space-4);
	align-content: start;
	margin: 0;
	padding: 0;
	list-style: none;
}

.iw-pmat__group-item {
	display: grid;
	gap: var(--iw-space-2);
	align-content: start;
}

/* Photos fill the whole frame (user, 26. 11. 2026: no white bands); the frame has the shape most photos have. */
.iw-pmat__group-open {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: var(--ar, 1);
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--iw-color-line);
	background: #fff;
	cursor: zoom-in;
}

.iw-pmat__group-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.iw-pmat__group-open:hover .iw-pmat__group-img {
	transform: scale(1.03);
}

.iw-pmat__group-open:focus-visible {
	outline: 2px solid var(--iw-color-primary);
	outline-offset: 3px;
}

.iw-pmat__group-caption {
	color: var(--iw-color-ink-muted);
	font-size: var(--iw-text-sm);
}

/* One photo, or a wide one (2:1 and wider): its own proportions, across the whole row. */
.iw-pmat__group.is-single .iw-pmat__group-list {
	grid-template-columns: minmax(0, 1fr);
}

.iw-pmat__group-item.is-wide {
	grid-column: 1 / -1;
}

.iw-pmat__group.is-single .iw-pmat__group-open,
.iw-pmat__group-item.is-wide .iw-pmat__group-open {
	aspect-ratio: auto;
	border: 0;
	background: none;
}

.iw-pmat__group.is-single .iw-pmat__group-img,
.iw-pmat__group-item.is-wide .iw-pmat__group-img {
	height: auto;
}

@media (min-width: 640px) {
	.iw-pmat__group-list {
		grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.iw-pmat__group {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		gap: var(--iw-space-16);
		padding: var(--iw-space-12) 0;
	}

	/* The photos are exactly as tall as the text next to them (user, 26. 11. 2026: no empty space under the text).
	   contain: size takes the grid out of the row height, so the text sets it; the grid then fills that height and
	   the photos fill their cells. product-material.js picks the number of columns that crops the photos least. */
	.iw-pmat__group-list.is-fit {
		contain: size;
		align-self: stretch;
		min-height: 260px;
		grid-template-columns: repeat(var(--fit-cols, 2), minmax(0, 1fr));
		grid-auto-rows: minmax(0, 1fr);
	}

	.is-fit .iw-pmat__group-item {
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	.is-fit .iw-pmat__group-item.is-wide {
		grid-column: auto;
	}

	.is-fit .iw-pmat__group-open,
	.is-fit .iw-pmat__group-item.is-wide .iw-pmat__group-open,
	.iw-pmat__group.is-single .is-fit .iw-pmat__group-open {
		flex: 1 1 0;
		min-height: 0;
		aspect-ratio: auto;
		border: 0;
	}

	.is-fit .iw-pmat__group-img,
	.is-fit .iw-pmat__group-item.is-wide .iw-pmat__group-img,
	.iw-pmat__group.is-single .is-fit .iw-pmat__group-img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

/* The main photo opens enlarged in the dialog (same as the other photos on the page). */
.iw-pmat__photo[data-iw-pmat-photo] {
	cursor: zoom-in;
}

.iw-pmat__photo[data-iw-pmat-photo]:focus-visible {
	outline: 2px solid var(--iw-color-primary);
	outline-offset: 2px;
}

/* Oil colours for the board photos (same swatches as on the floors page). */
.iw-pmat__oils {
	display: flex;
	flex-direction: column;
	gap: var(--iw-space-3);
	margin: 0 0 var(--iw-space-6);
}

.iw-pmat__oil-label {
	margin: 0;
	color: var(--iw-color-ink-muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.iw-pmat__oil-label strong {
	margin-left: var(--iw-space-2);
	color: var(--iw-color-brown);
	letter-spacing: 0.08em;
}

.iw-pmat__swatches {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 2.5rem));
	gap: var(--iw-space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.iw-pmat__swatch {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	padding: 0;
	border: 2px solid var(--iw-color-bg);
	border-radius: 50%;
	background: var(--iw-swatch);
	box-shadow: 0 0 0 1px var(--iw-color-line);
	cursor: pointer;
	transition: box-shadow 0.2s ease;
}

.iw-pmat__swatch:hover {
	box-shadow: 0 0 0 1px var(--iw-color-taupe);
}

.iw-pmat__swatch[aria-pressed="true"] {
	box-shadow: 0 0 0 2px var(--iw-color-brown);
}

.iw-pmat__swatch:focus-visible {
	outline: 2px solid var(--iw-color-primary);
	outline-offset: 3px;
}

@media (min-width: 640px) {
	.iw-pmat__swatches {
		grid-template-columns: repeat(12, minmax(0, 2.5rem));
	}
}

/* An uneven number of board shapes: the one left alone in the last row stays the same size as the others, centred. */
@media (max-width: 1023px) {
	.iw-pmat__shape:last-child:nth-child(2n + 1) {
		grid-column: 1 / -1;
		justify-self: center;
		width: calc((100% - var(--iw-space-4)) / 2);
	}
}

@media (min-width: 1024px) {
	.iw-pmat__shape:last-child:nth-child(3n + 1) {
		grid-column: 2;
	}
}
