/* ═══════════════════════════════════════════════════════════════════════════
   Categories landing page — premium collection cards (owner 2026-07-19)
   ═══════════════════════════════════════════════════════════════════════════
   Rendered by the [laymoun_categories] shortcode. Full-bleed category image
   with a gradient scrim + name / product-count / CTA (the premium "shop by
   collection" pattern — Baymard category-page guidance). Grid centres a 3-then-2
   layout on desktop, 2-up tablet, 1-up phone. RTL mirrors on its own (logical
   props + flex). Brand: green #186034, lemon-yellow #f8d92e, card radius 20px. */

.lm-catpage {
	margin: 48px 0 40px; /* breathing room below the header bar */
}

/* ── Section heading ── */
.lm-catpage__head {
	text-align: center;
	max-width: 640px;
	margin: 0 auto 34px;
	padding: 0 16px;
}
.lm-catpage__title {
	margin: 0;
	font-size: 32px;
	line-height: 1.2;
	font-weight: 700;
	color: #182119;
}
.lm-catpage__sub {
	margin: 10px 0 0;
	font-size: 15px;
	line-height: 1.5;
	color: #6f7d72;
}

/* ── Grid: 3 per row, the trailing row centred (3 + 2) ── */
.lm-catpage__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 24px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 16px;
}
.lm-catpage__card {
	position: relative;
	display: block;
	flex: 0 0 calc((100% - 48px) / 3);
	max-width: calc((100% - 48px) / 3);
	aspect-ratio: 4 / 3;
	border-radius: 20px;
	overflow: hidden;
	background: #eef1ea;
	box-shadow: 0 1px 2px rgba(31, 42, 34, 0.06), 0 12px 28px rgba(31, 42, 34, 0.08);
	text-decoration: none;
	transition: transform 0.28s ease, box-shadow 0.28s ease;
}

/* ── Media ── */
.lm-catpage__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}
/* Gradient scrim so the text is legible over any photo (accessibility). */
.lm-catpage__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient( to top, rgba(9, 24, 14, 0.82) 0%, rgba(9, 24, 14, 0.38) 34%, rgba(9, 24, 14, 0) 62% );
}

/* ── Text block (bottom-anchored, reading start) ── */
.lm-catpage__content {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	padding: 20px 22px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: start;
	color: #fff;
}
.lm-catpage__name {
	font-size: 23px;
	line-height: 1.15;
	font-weight: 700;
	text-transform: none; /* category names as stored, not the store-wide capitalize (QA DEF-121, app repo plan 144) */
	color: #fff;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}
.lm-catpage__count {
	margin-top: 4px;
	font-size: 13px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.86);
}
/* CTA pill — always visible affordance (touch has no hover); fills on hover. */
.lm-catpage__cta {
	margin-top: 14px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 16px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	border: 1px solid rgba(255, 255, 255, 0.5);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.lm-catpage__cta svg {
	width: 14px;
	height: 14px;
	display: block;
}
/* Arrow points to the reading end; flip in RTL. */
[dir="rtl"] .lm-catpage__cta svg {
	transform: scaleX(-1);
}

/* ── Hover (desktop only — no size-jump on touch) ── */
@media (hover: hover) and (pointer: fine) {
	.lm-catpage__card:hover {
		transform: translateY(-4px);
		box-shadow: 0 6px 12px rgba(31, 42, 34, 0.10), 0 20px 40px rgba(31, 42, 34, 0.14);
	}
	.lm-catpage__card:hover .lm-catpage__img {
		transform: scale(1.06);
	}
	.lm-catpage__card:hover .lm-catpage__cta {
		background: #fff;
		color: var(--secondary, #186034);
		border-color: #fff;
	}
}
/* Keyboard focus affordance for the whole-card link. */
.lm-catpage__card:focus-visible {
	outline: 3px solid var(--primary, #f8d92e);
	outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
	.lm-catpage__card,
	.lm-catpage__img,
	.lm-catpage__cta {
		transition: none;
	}
	.lm-catpage__card:hover {
		transform: none;
	}
	.lm-catpage__card:hover .lm-catpage__img {
		transform: none;
	}
}

/* ── Responsive: 2-up tablet, 1-up phone ── */
@media (max-width: 991px) {
	.lm-catpage__card {
		flex-basis: calc((100% - 24px) / 2);
		max-width: calc((100% - 24px) / 2);
	}
	.lm-catpage__title {
		font-size: 27px;
	}
}
@media (max-width: 575px) {
	.lm-catpage {
		margin-top: 30px; /* a touch tighter on phones */
	}
	.lm-catpage__grid {
		gap: 18px;
	}
	.lm-catpage__card {
		flex-basis: 100%;
		max-width: 460px;
		aspect-ratio: 3 / 2;
	}
	.lm-catpage__name {
		font-size: 21px;
	}
}
