.nlc-category-hierarchy,
.nlc-category-hierarchy * {
	box-sizing: border-box;
}

.nlc-category-hierarchy {
	--nlc-bg: #f4f6f8;
	--nlc-card: #ffffff;
	--nlc-text: #101820;
	--nlc-muted: #637080;
	--nlc-border: #dfe5ea;
	--nlc-shadow: 0 16px 42px rgba(16, 24, 32, 0.09);
	width: min(100%, 1320px);
	margin-inline: auto;
}

.nlc-category-hierarchy__group {
	display: grid;
	grid-template-columns: minmax(290px, 0.92fr) minmax(0, 2.08fr);
	gap: clamp(18px, 2.2vw, 32px);
	margin: 0 0 clamp(44px, 6vw, 82px);
}

.nlc-category-hierarchy__group:last-child {
	margin-bottom: 0;
}

.nlc-category-hierarchy__parent,
.nlc-category-hierarchy__child {
	color: inherit;
	text-decoration: none !important;
}

.nlc-category-hierarchy__parent {
	position: relative;
	display: block;
	min-height: 100%;
	overflow: hidden;
	background: #16202b;
	border-radius: 20px;
	isolation: isolate;
	box-shadow: var(--nlc-shadow);
}

.nlc-category-hierarchy__parent-media,
.nlc-category-hierarchy__parent-overlay {
	position: absolute;
	inset: 0;
}

.nlc-category-hierarchy__parent-image,
.nlc-category-hierarchy__child-image,
.nlc-category-hierarchy__image--placeholder {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	object-fit: cover;
}

.nlc-category-hierarchy__parent-image {
	transition: transform 520ms ease;
}

.nlc-category-hierarchy__image--placeholder {
	background: linear-gradient(145deg, #dce2e8, #aeb9c4);
}

.nlc-category-hierarchy__parent-overlay {
	z-index: 1;
	background:
		linear-gradient(180deg, rgba(8, 13, 18, 0.04) 18%, rgba(8, 13, 18, 0.9) 100%),
		linear-gradient(90deg, rgba(8, 13, 18, 0.28), transparent 62%);
}

.nlc-category-hierarchy__parent-content {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: clamp(24px, 3vw, 42px);
	color: #ffffff;
}

.nlc-category-hierarchy__eyebrow {
	display: block;
	margin-bottom: 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	opacity: 0.78;
}

.nlc-category-hierarchy__parent-title {
	display: block;
	max-width: 18ch;
	margin: 0;
	color: #ffffff !important;
	font-size: clamp(27px, 2.6vw, 42px);
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -0.035em;
}

.nlc-category-hierarchy__description {
	display: block;
	max-width: 42ch;
	margin-top: 14px;
	font-size: 15px;
	line-height: 1.55;
	opacity: 0.82;
}

.nlc-category-hierarchy__parent-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin-top: clamp(22px, 3vw, 38px);
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.26);
	font-size: 13px;
	line-height: 1.35;
}

.nlc-category-hierarchy__cta {
	font-weight: 600;
	white-space: nowrap;
}

.nlc-category-hierarchy__children {
	display: grid;
	gap: clamp(14px, 1.8vw, 24px);
}

.nlc-category-hierarchy__children--1 {
	grid-template-columns: minmax(0, 1fr);
}

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

.nlc-category-hierarchy__children--3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.nlc-category-hierarchy__child {
	display: flex;
	min-width: 0;
	flex-direction: column;
	overflow: hidden;
	background: var(--nlc-card);
	border: 1px solid var(--nlc-border);
	border-radius: 16px;
	box-shadow: 0 7px 24px rgba(16, 24, 32, 0.055);
	transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.nlc-category-hierarchy__child-media {
	display: block;
	width: 100%;
	aspect-ratio: 825 / 1050;
	overflow: hidden;
	background: var(--nlc-bg);
}

.nlc-category-hierarchy__child-image {
	transition: transform 420ms ease;
}

.nlc-category-hierarchy__child-content {
	display: flex;
	min-height: 92px;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 17px 18px 18px;
}

.nlc-category-hierarchy__child-copy {
	display: block;
	min-width: 0;
}

.nlc-category-hierarchy__child-title {
	display: block;
	margin: 0;
	color: var(--nlc-text);
	font-size: clamp(15px, 1.3vw, 18px);
	font-weight: 600;
	line-height: 1.3;
}

.nlc-category-hierarchy__count {
	display: block;
	margin-top: 6px;
	color: var(--nlc-muted);
	font-size: 13px;
	line-height: 1.3;
}

.nlc-category-hierarchy__arrow {
	display: grid;
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	place-items: center;
	color: var(--nlc-text);
	background: var(--nlc-bg);
	border-radius: 50%;
	font-size: 18px;
	transition: transform 220ms ease, color 220ms ease, background-color 220ms ease;
}

.nlc-category-hierarchy__standalone {
	margin: 0;
}

.nlc-category-hierarchy__standalone-title {
	margin: 0 0 clamp(20px, 2.5vw, 32px);
	color: var(--nlc-text);
	font-size: clamp(25px, 2.4vw, 36px);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.025em;
}

.nlc-category-hierarchy__standalone-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(14px, 1.8vw, 24px);
}

.nlc-category-hierarchy__notice {
	width: min(100%, 1320px);
	margin: 0 auto;
	padding: 18px 20px;
	color: #5f4600;
	background: #fff7d6;
	border: 1px solid #e8d58d;
	border-radius: 10px;
}

@media (hover: hover) and (pointer: fine) {
	.nlc-category-hierarchy__parent:hover .nlc-category-hierarchy__parent-image,
	.nlc-category-hierarchy__parent:focus-visible .nlc-category-hierarchy__parent-image {
		transform: scale(1.025);
	}

	.nlc-category-hierarchy__child:hover,
	.nlc-category-hierarchy__child:focus-visible {
		transform: translateY(-4px);
		border-color: #cbd4dc;
		box-shadow: 0 18px 42px rgba(16, 24, 32, 0.12);
	}

	.nlc-category-hierarchy__child:hover .nlc-category-hierarchy__child-image,
	.nlc-category-hierarchy__child:focus-visible .nlc-category-hierarchy__child-image {
		transform: scale(1.035);
	}

	.nlc-category-hierarchy__child:hover .nlc-category-hierarchy__arrow,
	.nlc-category-hierarchy__child:focus-visible .nlc-category-hierarchy__arrow {
		transform: translateX(3px);
		color: #ffffff;
		background: var(--nlc-text);
	}
}

.nlc-category-hierarchy__parent:focus-visible,
.nlc-category-hierarchy__child:focus-visible {
	outline: 3px solid #2f6fed;
	outline-offset: 4px;
}

/*
 * Desktop: the parent content participates in the grid height calculation.
 * This prevents long titles or descriptions from being clipped and lets the
 * subcategory images grow naturally to match the resulting section height.
 */
@media (min-width: 861px) {
	.nlc-category-hierarchy__group {
		align-items: stretch;
	}

	.nlc-category-hierarchy__parent {
		display: flex;
		min-height: 0;
	}

	.nlc-category-hierarchy__parent-content {
		position: relative;
		inset: auto;
		width: 100%;
		min-width: 0;
		flex: 1 1 auto;
	}

	.nlc-category-hierarchy__children {
		align-self: stretch;
		grid-auto-rows: minmax(0, 1fr);
	}

	.nlc-category-hierarchy__child {
		height: 100%;
	}

	.nlc-category-hierarchy__child-media {
		flex: 1 1 auto;
	}
}

@media (max-width: 1100px) {
	.nlc-category-hierarchy__group {
		grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.7fr);
	}

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

@media (max-width: 860px) {
	.nlc-category-hierarchy__group {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.nlc-category-hierarchy__parent {
		min-height: clamp(390px, 70vw, 620px);
	}

	.nlc-category-hierarchy__children,
	.nlc-category-hierarchy__children--2,
	.nlc-category-hierarchy__children--3,
	.nlc-category-hierarchy__children--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

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

@media (max-width: 560px) {
	.nlc-category-hierarchy__group {
		margin-bottom: 52px;
	}

	.nlc-category-hierarchy__parent {
		min-height: 500px;
		border-radius: 16px;
	}

	.nlc-category-hierarchy__parent-content {
		padding: 24px;
	}

	.nlc-category-hierarchy__parent-title {
		font-size: 30px;
	}

	.nlc-category-hierarchy__parent-footer {
		align-items: flex-start;
		flex-direction: column;
		gap: 9px;
	}

	.nlc-category-hierarchy__children,
	.nlc-category-hierarchy__children--2,
	.nlc-category-hierarchy__children--3,
	.nlc-category-hierarchy__children--4 {
		grid-template-columns: 1fr;
	}

	.nlc-category-hierarchy__standalone-grid {
		grid-template-columns: 1fr;
	}

	.nlc-category-hierarchy__child-media {
		aspect-ratio: 825 / 1050;
	}

	.nlc-category-hierarchy__child-content {
		min-height: 84px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nlc-category-hierarchy__parent-image,
	.nlc-category-hierarchy__child,
	.nlc-category-hierarchy__child-image,
	.nlc-category-hierarchy__arrow {
		transition: none;
	}
}
