/**
 * Phase 6.X.1 — Practice Question Banks product cards (ground-up).
 * Scoped to #nds-practice / .nds-pq-card only.
 */

#nds-practice.nds-shelf--mosaic {
	--pq-ink: #0a1218;
	--pq-mute: #5c656e;
	--pq-soft: #8a929a;
	--pq-accent: #0b5f69;
	--pq-line: rgba(10, 18, 24, 0.08);
	--pq-ease: cubic-bezier(0.22, 1, 0.36, 1);
	padding: 3rem 0 3.2rem !important;
	margin: 0;
	background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 52%, #ffffff 100%);
	border: 0;
	color: var(--pq-ink);
}

#nds-practice.nds-shelf--mosaic .nds-shelf__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.25rem 2rem;
	margin-bottom: 1.85rem;
	padding-bottom: 0;
	border: 0;
}

#nds-practice.nds-shelf--mosaic .nds-shelf__intro {
	max-width: 40rem;
}

#nds-practice.nds-shelf--mosaic .nds-shelf__eyebrow {
	margin: 0 0 0.4rem;
	font-size: 0.68rem;
	font-weight: 750;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--pq-accent);
	opacity: 1;
}

#nds-practice.nds-shelf--mosaic .nds-shelf__title {
	margin: 0 0 0.4rem;
	font-family: var(--nds-font-display);
	font-size: clamp(1.65rem, 2.6vw, 2.2rem);
	font-weight: 650;
	letter-spacing: -0.035em;
	line-height: 1.12;
	color: var(--pq-ink);
}

#nds-practice.nds-shelf--mosaic .nds-shelf__desc {
	margin: 0;
	max-width: 46ch;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--pq-mute);
	opacity: 1;
}

#nds-practice.nds-shelf--mosaic .nds-shelf__stat {
	margin: 0.45rem 0 0;
	font-size: 0.86rem;
	font-weight: 550;
	line-height: 1.35;
	color: var(--pq-soft);
}

#nds-practice.nds-shelf--mosaic .nds-shelf__all {
	flex-shrink: 0;
	align-self: flex-end;
	font-size: 0.95rem;
	font-weight: 650;
	color: var(--pq-accent);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	padding-bottom: 0.1rem;
	transition: color 0.25s ease, border-color 0.25s ease;
}

#nds-practice.nds-shelf--mosaic .nds-shelf__all:hover,
#nds-practice.nds-shelf--mosaic .nds-shelf__all:focus-visible {
	color: var(--pq-ink);
	border-bottom-color: currentColor;
}

#nds-practice.nds-shelf--mosaic .nds-shelf__all:focus-visible {
	outline: 2px solid var(--pq-accent);
	outline-offset: 3px;
}

#nds-practice.nds-shelf--mosaic .nds-shelf__rail {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.65rem 1.55rem;
	overflow: visible;
	padding-bottom: 0.5rem;
	scroll-snap-type: none;
}

#nds-practice.nds-shelf--mosaic .nds-shelf__item {
	width: auto;
	min-width: 0;
}

/* —— Marketplace card —— */
#nds-practice .nds-pq-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	padding: 1rem 1rem 1.1rem;
	border-radius: 24px;
	background: #ffffff;
	border: 1px solid var(--pq-line);
	box-shadow:
		0 1px 2px rgba(10, 18, 24, 0.03),
		0 14px 32px rgba(10, 18, 24, 0.05);
	transition:
		transform 0.25s var(--pq-ease),
		box-shadow 0.25s ease,
		border-color 0.25s ease;
}

#nds-practice .nds-pq-card__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 100%;
	min-height: 11.5rem;
	aspect-ratio: 1 / 0.92;
	margin: 0 0 0.95rem;
	padding: 0.85rem 1rem;
	overflow: hidden;
	border-radius: 18px;
	background:
		radial-gradient(80% 70% at 50% 20%, rgba(11, 95, 105, 0.08), transparent 60%),
		linear-gradient(165deg, #f4f7f8 0%, #e7eef1 100%);
	border: 1px solid rgba(10, 18, 24, 0.05);
}

#nds-practice .nds-pq-card__media img {
	display: block;
	width: auto;
	max-width: 72%;
	height: auto;
	max-height: 100%;
	object-fit: contain;
	border-radius: 6px;
	filter: drop-shadow(0 14px 24px rgba(10, 18, 24, 0.22));
	transition: transform 0.25s var(--pq-ease), filter 0.25s ease;
}

#nds-practice .nds-pq-card__ph {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 10rem;
	font-size: 0.8rem;
	color: var(--pq-soft);
}

#nds-practice .nds-pq-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 0.55rem;
	min-width: 0;
}

#nds-practice .nds-pq-card__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
}

#nds-practice .nds-pq-card__chip {
	display: inline-flex;
	align-items: center;
	height: 22px;
	padding: 0 0.55rem;
	border-radius: 999px;
	font-size: 0.64rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1;
	color: var(--pq-mute);
	background: #eef1f3;
}

#nds-practice .nds-pq-card__chip--subject {
	color: var(--pq-accent);
	background: color-mix(in srgb, var(--pq-accent) 10%, #fff);
}

#nds-practice .nds-pq-card__title {
	margin: 0;
	font-family: var(--nds-font-display);
	font-size: 1.08rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

#nds-practice .nds-pq-card__title a {
	color: var(--pq-ink);
	text-decoration: none;
	transition: color 0.25s ease;
}

#nds-practice .nds-pq-card__info {
	margin: 0;
	font-size: 0.8rem;
	font-weight: 500;
	line-height: 1.35;
	color: var(--pq-soft);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#nds-practice .nds-pq-card__price-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.65rem;
	margin-top: 0.1rem;
}

#nds-practice .nds-pq-card__price {
	font-size: 1.35rem;
	font-weight: 750;
	letter-spacing: -0.035em;
	line-height: 1.1;
	color: var(--pq-ink);
}

#nds-practice .nds-pq-card__price .woocommerce-Price-amount,
#nds-practice .nds-pq-card__price .amount {
	font-weight: 750;
	color: inherit;
}

#nds-practice .nds-pq-card__instant {
	display: inline-flex;
	align-items: center;
	gap: 0.28rem;
	font-size: 0.72rem;
	font-weight: 650;
	letter-spacing: 0.01em;
	color: var(--pq-accent);
	white-space: nowrap;
}

#nds-practice .nds-pq-card__bolt {
	width: 0.9rem;
	height: 0.9rem;
	flex: 0 0 auto;
}

#nds-practice .nds-pq-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem 0.95rem;
	margin-top: auto;
	padding-top: 0.55rem;
}

#nds-practice .nds-pq-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	padding: 0 1rem;
	border-radius: 11px;
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	color: #fff !important;
	background: var(--pq-accent);
	border: 1px solid transparent;
	box-shadow: 0 1px 2px color-mix(in srgb, var(--pq-accent) 22%, transparent);
	transition:
		background-color 0.25s ease,
		box-shadow 0.25s ease,
		transform 0.25s var(--pq-ease);
}

#nds-practice .nds-pq-card__cta:hover,
#nds-practice .nds-pq-card__cta:focus-visible {
	background: color-mix(in srgb, var(--pq-accent) 86%, #000);
	color: #fff !important;
	box-shadow: 0 8px 18px color-mix(in srgb, var(--pq-accent) 26%, transparent);
	transform: translateY(-1px);
}

#nds-practice .nds-pq-card__preview {
	display: inline-flex;
	align-items: center;
	gap: 0.28rem;
	font-size: 0.88rem;
	font-weight: 650;
	color: var(--pq-accent);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.25s ease, border-color 0.25s ease;
}

#nds-practice .nds-pq-card__preview span {
	display: inline-block;
	transition: transform 0.25s var(--pq-ease);
}

#nds-practice .nds-pq-card__preview:hover,
#nds-practice .nds-pq-card__preview:focus-visible {
	color: var(--pq-ink);
	border-bottom-color: currentColor;
}

#nds-practice .nds-pq-card__preview:hover span,
#nds-practice .nds-pq-card__preview:focus-visible span {
	transform: translateX(3px);
}

#nds-practice .nds-pq-card__cta:focus-visible,
#nds-practice .nds-pq-card__preview:focus-visible,
#nds-practice .nds-pq-card__title a:focus-visible {
	outline: 2px solid var(--pq-accent);
	outline-offset: 3px;
}

#nds-practice .nds-pq-card:focus-within {
	outline: 2px solid var(--pq-accent);
	outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
	#nds-practice .nds-pq-card:hover,
	#nds-practice .nds-pq-card:focus-within {
		transform: translateY(-8px);
		border-color: color-mix(in srgb, var(--pq-accent) 16%, var(--pq-line));
		box-shadow:
			0 1px 2px rgba(10, 18, 24, 0.04),
			0 24px 48px rgba(10, 18, 24, 0.11);
	}

	#nds-practice .nds-pq-card:hover .nds-pq-card__media img,
	#nds-practice .nds-pq-card:focus-within .nds-pq-card__media img {
		transform: scale(1.035) translateY(-2px);
		filter: drop-shadow(0 18px 28px rgba(10, 18, 24, 0.26));
	}

	#nds-practice .nds-pq-card:hover .nds-pq-card__title a,
	#nds-practice .nds-pq-card:focus-within .nds-pq-card__title a {
		color: var(--pq-accent);
	}
}

@media (max-width: 1100px) {
	#nds-practice.nds-shelf--mosaic .nds-shelf__rail {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.35rem;
	}
}

@media (max-width: 640px) {
	#nds-practice.nds-shelf--mosaic {
		padding: 2.4rem 0 2.6rem !important;
	}

	#nds-practice.nds-shelf--mosaic .nds-shelf__head {
		flex-direction: column;
		align-items: flex-start;
		margin-bottom: 1.35rem;
	}

	#nds-practice.nds-shelf--mosaic .nds-shelf__rail {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.15rem;
	}

	#nds-practice .nds-pq-card {
		padding: 0.95rem;
	}

	#nds-practice .nds-pq-card__media {
		aspect-ratio: 16 / 13;
		min-height: 10.5rem;
	}

	#nds-practice .nds-pq-card__actions {
		flex-direction: column;
		align-items: stretch;
	}

	#nds-practice .nds-pq-card__cta {
		width: 100%;
	}

	#nds-practice .nds-pq-card__preview {
		justify-content: center;
	}

	#nds-practice .nds-pq-card__price-row {
		flex-wrap: wrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	#nds-practice .nds-pq-card,
	#nds-practice .nds-pq-card__media img,
	#nds-practice .nds-pq-card__cta,
	#nds-practice .nds-pq-card__preview span,
	#nds-practice .nds-pq-card__title a {
		transition: none;
	}

	#nds-practice .nds-pq-card:hover,
	#nds-practice .nds-pq-card:focus-within,
	#nds-practice .nds-pq-card__cta:hover,
	#nds-practice .nds-pq-card__cta:focus-visible {
		transform: none;
	}

	#nds-practice .nds-pq-card:hover .nds-pq-card__media img,
	#nds-practice .nds-pq-card:focus-within .nds-pq-card__media img {
		transform: none;
	}
}
