.mekom-catalog-block {
	margin: 40px 0;
}

.mekom-catalog-block.has-background {
	position: relative;
	background-size: cover;
	background-position: center;
	padding: 32px 0;
}

.mekom-catalog-block.has-background::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background: rgba( 255, 255, 255, 0.88 );
}

.mekom-catalog-block.has-background > * {
	position: relative;
	z-index: 1;
}

.mekom-catalog-block__title {
	position: relative;
	margin: 0 0 28px;
	padding-bottom: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.mekom-catalog-block__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 56px;
	height: 3px;
	background: #d81f1f;
}

.mekom-catalog-grid {
	display: grid;
	grid-template-columns: repeat( 2, 1fr );
	gap: 12px;
}

@media ( min-width: 480px ) {
	.mekom-catalog-grid {
		gap: 16px;
	}
}

@media ( min-width: 640px ) {
	.mekom-catalog-grid {
		grid-template-columns: repeat( 3, 1fr );
	}
}

@media ( min-width: 1024px ) {
	.mekom-catalog-grid {
		grid-template-columns: repeat( var( --mekom-catalog-columns, 4 ), 1fr );
		gap: 20px;
	}
}

.mekom-catalog-tile {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	padding: 10px;
	border: 1px solid #e8e2d8;
	background: #fff;
	color: #1a1a1a;
	text-align: center;
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

@media ( min-width: 480px ) {
	.mekom-catalog-tile {
		padding: 14px;
	}
}

.mekom-catalog-tile:hover,
.mekom-catalog-tile:focus-visible {
	border-color: #d81f1f;
	box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.06 );
	transform: translateY( -2px );
}

.mekom-catalog-tile.is-highlighted {
	background: #f2ece1;
}

.mekom-catalog-tile__label {
	position: relative;
	z-index: 2;
	font-size: 13px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	transition: color 0.25s ease;
}

@media ( min-width: 480px ) {
	.mekom-catalog-tile__label {
		font-size: 14px;
		letter-spacing: 0.02em;
	}
}

/*
 * The darkening gradient (and white label text) only apply when a tile has
 * BOTH a photo and a label - it exists purely to keep the label readable
 * over the photo. A photo-only tile (no label) shows the photo plain, with
 * no overlay.
 */
.mekom-catalog-tile.has-image-with-label .mekom-catalog-tile__label {
	color: #fff;
	text-shadow: 0 1px 6px rgba( 0, 0, 0, 0.45 );
}

.mekom-catalog-tile.has-image-with-label::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient( 180deg, rgba( 0, 0, 0, 0 ) 40%, rgba( 0, 0, 0, 0.35 ) 100% );
}

.mekom-catalog-tile__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease, filter 0.3s ease;
}

/* Darkening only applies when a label sits on top of the photo (see comment above). */
.mekom-catalog-tile.has-image-with-label .mekom-catalog-tile__bg {
	filter: brightness( 0.65 );
}

.mekom-catalog-tile.has-image-with-label:hover .mekom-catalog-tile__bg,
.mekom-catalog-tile.has-image-with-label:focus-visible .mekom-catalog-tile__bg {
	filter: brightness( 0.55 );
	transform: scale( 1.06 );
}

.mekom-catalog-tile.has-image:not( .has-image-with-label ):hover .mekom-catalog-tile__bg,
.mekom-catalog-tile.has-image:not( .has-image-with-label ):focus-visible .mekom-catalog-tile__bg {
	transform: scale( 1.06 );
}

@media ( prefers-reduced-motion: reduce ) {
	.mekom-catalog-tile,
	.mekom-catalog-tile__bg {
		transition: none;
	}
}
