/**
 * Course card grid — shared by digitalacademy/course-grid (published courses,
 * cards link to the first lesson) and digitalacademy/coming-soon-grid (coming
 * soon courses, cards are buttons that open a register-interest modal).
 *
 * Registered once as the `digitalacademy-course-grid` style handle (see
 * lib/blocks.php) and referenced from both blocks' block.json "style", so the
 * two grids look identical with zero duplicated CSS. Uses theme.json presets so
 * it tracks the palette / type scale.
 *
 * @package digitalacademy
 */

.da-course-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
	gap: var(--wp--preset--spacing--medium);
}

/* The whole card is the trigger — a lesson link (course-grid) or a modal button
   (coming-soon-grid). Hard 1px border + offset-shadow hover to match the theme's
   card / button language. `button.da-course-card` resets the native control so
   both element types render identically. */
.da-course-card {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: var(--wp--preset--spacing--medium);
	background-color: var(--wp--preset--color--light-intense);
	color: var(--wp--preset--color--dark);
	border: 1px solid var(--wp--preset--color--dark);
	border-radius: 0.3rem;
	text-decoration: none;
	transition:
		transform 0.12s ease,
		box-shadow 0.12s ease;
	.da-eyebrow {
		opacity: 0.5;
	}
}

/* Between the lesson count and the estimated time. Only rendered when a course
   sets a time, so there's never a dangling dot. */
.da-course-card__meta-sep {
	margin-inline: 0.15em;
	opacity: 0.6;
}

button.da-course-card {
	inline-size: 100%;
	font: inherit;
	text-align: start;
	cursor: pointer;
	appearance: none;
}

.da-course-card:hover,
.da-course-card:focus-visible {
	transform: translate(-2px, -2px);
	box-shadow: 3px 3px 0 0 var(--wp--preset--color--dark);
}

/* A coming-soon course with no form ID: shown for completeness but not
   interactive (no modal), so drop the clickable affordances. */
.da-course-card--static {
	cursor: default;
}

.da-course-card--static:hover,
.da-course-card--static:focus-visible {
	transform: none;
	box-shadow: none;
}

/* "n Lessons" — mono label in the primary accent. */
.da-course-card__count {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--primary);
}

.da-course-card__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 700;
	line-height: 1.15;
}

.da-course-card__desc {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--dark-muted);
}
