/**
 * Reusable product discovery card.
 */

.myc-album-grid {
	grid-template-columns: repeat(var(--myc-grid-columns, 4), minmax(0, 1fr));
	gap: var(--ps-grid-gap);
}

.myc-album-card {
	display: flex;
	min-width: 0;
	flex-direction: column;
	border-color: var(--ps-color-border);
	border-radius: var(--ps-radius-lg);
	box-shadow: none;
	transition: transform var(--ps-transition-base), box-shadow var(--ps-transition-base);
}

/*
 * The lift and the zoom below are the pointer's alone; focus does not raise the
 * card.
 *
 * Both used to run on `:focus-within` too, which a right-click triggered — it
 * hands the focus to the image link — and then held after the pointer had left,
 * because focus only moves on when something else takes it. The card stayed
 * raised until the next click landed elsewhere. `:has(:focus-visible)` is not
 * the fix either: dismissing the context menu with Escape counts as a keyboard
 * interaction, so Chrome starts matching `:focus-visible` on the link that
 * already holds the focus, and the card sticks again.
 *
 * Keyboard focus is served by the global outline in base.css, which is the
 * theme's single focus treatment. A local box-shadow on top of it would be the
 * second one this codebase deliberately does not have.
 */
.myc-album-card:hover {
	box-shadow: 0 20px 44px rgb(20 22 31 / 9%);
	transform: translateY(-4px);
}

.myc-album-image {
	aspect-ratio: var(--ps-card-image-ratio);
	background: var(--ps-color-surface-muted);
	-webkit-tap-highlight-color: transparent;
}

.myc-album-image img {
	transition: transform var(--ps-transition-base);
}

.myc-album-card:hover .myc-album-image img {
	transform: scale(1.035);
}

.myc-product-version {
	position: absolute;
	right: var(--ps-space-3);
	bottom: var(--ps-space-3);
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	min-height: 26px;
	padding: 0 3px;
	border-radius: 5px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .04em;
}

.myc-product-version.is-pro {
	border: 0;
	background: var(--ps-color-ink-strong);
	color: var(--ps-color-gold);
}

@media (max-width: 1080px) {
	.myc-product-version {
		right: var(--ps-space-2);
		bottom: var(--ps-space-2);
		min-width: 38px;
		min-height: 24px;
		padding: 4px 5px;
		font-size: 11px;
	}
}

.myc-album-content {
	display: flex;
	min-height: 0;
	flex: 1;
	flex-direction: column;
	padding: var(--ps-space-4);
}

.myc-category-label {
	margin-bottom: var(--ps-space-2);
	color: var(--ps-color-brand-700);
}

/* Keep the product grid aligned without allowing long names to stretch cards. */
.myc-album-content h3 {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	min-height: 44px;
	margin-bottom: var(--ps-space-3);
}

.myc-album-content h3 a:hover,
.myc-album-content h3 a:focus-visible {
	color: var(--ps-color-brand-700);
}

/*
 * The truncation ellipsis that -webkit-line-clamp generates on a two-line
 * title takes its colour from the clamped h3 box itself, not from the
 * hovered <a> nested inside it — so hovering the title turned the visible
 * text maroon but left the "…" whatever colour the h3 inherited. :has()
 * scopes this to the title itself, the same trigger as the rule above,
 * rather than the whole card.
 */
.myc-album-content h3:has(a:hover),
.myc-album-content h3:has(a:focus-visible) {
	color: var(--ps-color-brand-700);
}

.myc-album-meta {
	margin-top: auto;
	padding-top: var(--ps-space-2);
	border-top: 1px solid var(--ps-color-border);
}

.myc-album-meta strong {
	color: var(--ps-color-brand-700);
	font-size: 17px;
}

.myc-card-actions {
	grid-template-columns: minmax(0, 1fr);
	margin-top: var(--ps-space-3);
}

.myc-card-link,
.myc-card-buy {
	min-height: 42px;
	border-radius: var(--ps-radius-sm);
}

@media (max-width: 1080px) {
	.myc-album-grid {
		grid-template-columns: repeat(var(--myc-grid-tablet-columns, 4), minmax(0, 1fr));
		gap: var(--ps-space-4);
	}

	/* Preserve the two-line maximum while allowing short tablet titles to fit. */
	.myc-album-content h3 {
		min-height: 0;
	}

	.myc-album-meta > span {
		display: none;
	}
}

@media (max-width: 760px) {
	.myc-album-grid {
		grid-template-columns: repeat(var(--myc-grid-mobile-columns, 2), minmax(0, 1fr));
		gap: var(--ps-space-3);
	}
}

@media (max-width: 760px) {
	.myc-album-content {
		padding: var(--ps-space-3);
	}

	.myc-album-content h3 {
		min-height: 38px;
		margin-bottom: var(--ps-space-2);
		font-size: 14px;
	}

	.myc-album-meta {
		gap: var(--ps-space-2);
		font-size: 11px;
	}

	.myc-album-meta strong {
		font-size: 15px;
	}
}

@media (min-width: 600px) and (max-width: 760px) {
	.myc-album-grid {
		grid-template-columns: repeat(var(--myc-grid-tablet-columns, 4), minmax(0, 1fr));
		gap: var(--ps-space-4);
	}
}
