/* Category tiles (template-parts/home/category-tiles.php), ported from the guardrail
   sections/category-tiles.liquid stylesheet. Per-instance values arrive as inline
   --hg-tiles-* custom properties; the fallbacks are the section defaults. Tiles swipe
   sideways below 990px, then form a grid of --hg-tiles-cols-md and, from 1280px,
   --hg-tiles-cols columns. */

.hg-tiles {
	padding-block: var(--hg-tiles-pad-top-m, 56px) var(--hg-tiles-pad-bottom-m, 32px);
	background: var(--hg-tiles-bg, #0b0b0b);
	color: var(--hg-tiles-text, #f2ede4);
}
.hg-tiles__inner {
	box-sizing: border-box;
	max-width: var(--hg-tiles-width, 1440px);
	margin-inline: auto;
	padding-inline: var(--hg-tiles-side-m, 20px);
}
.hg-tiles__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px 24px;
	margin-bottom: var(--hg-tiles-head-gap, 20px);
}
.hg-tiles .hg-tiles__title {
	margin: 0;
	min-width: 0;
	color: var(--hg-tiles-text, #f2ede4);
	font-size: var(--hg-tiles-h-size-m, 23.4px);
	letter-spacing: -0.025em;
	line-height: 1;
	overflow-wrap: anywhere;
}
.hg-tiles__sub {
	margin: 0;
	min-width: 0;
	font-family: var(--hg-font-body);
	font-size: var(--hg-tiles-sub, 12px);
	font-weight: 600;
	letter-spacing: 0.18em;
	line-height: 1.6;
	text-transform: uppercase;
	opacity: 0.75;
	overflow-wrap: anywhere;
}
.hg-tiles__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: var(--hg-tiles-col-m, 44%);
	gap: var(--hg-tiles-gap-m, 10px);
	padding-bottom: 4px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.hg-tiles__track::-webkit-scrollbar { display: none; }
.hg-tiles__tile {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border-radius: var(--hg-tiles-radius, 0px);
	background: var(--hg-tiles-tile-bg, #161514);
	color: var(--hg-tiles-text, #f2ede4);
	text-decoration: none;
	scroll-snap-align: start;
	transition: none;
}
/* Ecomus recolours a:hover / a:active; tiles keep their text colour. */
.hg-tiles__tile:hover,
.hg-tiles__tile:active,
.hg-tiles__tile:focus {
	color: var(--hg-tiles-text, #f2ede4);
	text-decoration: none;
}
.hg-tiles__tile:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
.hg-tiles__media {
	display: block;
	aspect-ratio: var(--hg-tiles-ratio, 4 / 5);
	overflow: hidden;
	background: var(--hg-tiles-tile-bg, #161514);
}
.hg-tiles__media img,
.hg-tiles__placeholder {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
	transition: transform 0.6s;
}
.hg-tiles__placeholder { background: currentColor; opacity: 0.35; }
@media (hover: hover) {
	a.hg-tiles__tile:hover .hg-tiles__media img { transform: scale(1.04); }
}
.hg-tiles__label {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 44px;
	padding: 14px 14px 16px;
	font-family: var(--hg-font-body);
	font-size: var(--hg-tiles-label, 12px);
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.35;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}
.hg-tiles__arrow { flex: 0 0 auto; }
.hg-tiles__arrow:dir(rtl) { scale: -1 1; }
@media (min-width: 750px) {
	.hg-tiles { padding-block: var(--hg-tiles-pad-top, 56px) var(--hg-tiles-pad-bottom, 32px); }
}
@media (min-width: 768px) {
	.hg-tiles .hg-tiles__title { font-size: var(--hg-tiles-h-size, 34.5px); }
}
@media (min-width: 990px) {
	.hg-tiles__inner { padding-inline: var(--hg-tiles-side, 40px); }
	.hg-tiles__track {
		grid-auto-flow: row;
		grid-template-columns: repeat(var(--hg-tiles-cols-md, 3), minmax(0, 1fr));
		gap: var(--hg-tiles-gap, 10px);
		overflow: visible;
	}
}
@media (min-width: 1200px) {
	.hg-tiles .hg-tiles__title { font-size: var(--hg-tiles-h-size, 39.1px); }
}
@media (min-width: 1280px) {
	.hg-tiles__track { grid-template-columns: repeat(var(--hg-tiles-cols, 6), minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
	.hg-tiles__media img { transition: none; }
	a.hg-tiles__tile:hover .hg-tiles__media img { transform: none; }
}
