/*
 * ModulawAI Academy: the catalog, covers and filters (includes/catalog.php). Uses academy.css's tokens,
 * so light and dark follow the site toggle. Covers are dark in both themes, so what sits on them is
 * always light.
 */

.mpa-catalog [hidden] {
	display: none !important;
}

.mpa-catalog .mpa-catalog__body {
	max-width: 1152px;
	padding-top: clamp(2rem, 4vw, 3rem);
	scroll-margin-top: calc(var(--mpa-header) + var(--mpa-bar));
}

/* The header gives way sooner, so the certifications are on the first screen. */
.mpa-hero--catalog .mpa-hero__inner {
	padding-block: clamp(2.75rem, 5vw, 4.25rem) clamp(2.5rem, 4.5vw, 3.75rem);
}

.mpa-hero--catalog .mpa-hero__title--display {
	max-width: 16ch;
	margin-top: 1.15rem;
	font-size: clamp(2.4rem, 5vw, 4rem);
}

.mpa-hero--catalog .mpa-hero__lead {
	margin-top: 1.1rem;
}

.mpa-hero--catalog .mpa-stats {
	grid-template-columns: repeat(4, auto);
	max-width: none;
	margin-top: 2rem;
}

.mpa-hero--catalog .mpa-stats li {
	align-content: start;
}

.mpa-hero--catalog .mpa-stats strong {
	white-space: nowrap;
}

/* ---------------------------------------------------------------- Covers */

.mpa-cover {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #14161c;
}

.mpa-cover__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 1.1s var(--mpa-ease);
}

/* ---------------------------------------------------------------- Tiles: choose a collection */

.mpa-tiles {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: 1rem;
}

.mpa-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 16px;
	background: var(--mpa-surface);
	box-shadow: 0 0 0 1px var(--ent-rule);
	color: var(--ent-ink);
	transition: box-shadow 0.45s var(--mpa-ease), transform 0.6s var(--mpa-ease);
}

.mpa-tile .mpa-cover {
	aspect-ratio: 2 / 1;
}

.mpa-tile__body {
	display: grid;
	gap: 0.2rem;
	flex: 1;
	align-content: start;
	padding: 1rem 1.1rem 1.1rem;
}

.mpa-tile__kind,
.mpa-tile__n {
	color: var(--ent-muted);
	font-size: 0.75rem;
}

.mpa-tile__title {
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.25;
	text-wrap: balance;
}

.mpa-tile__n {
	margin-top: 0.35rem;
	font-variant-numeric: tabular-nums;
}

.mpa-tile:hover {
	box-shadow: 0 0 0 1px var(--ent-rule-strong), var(--mpa-lift);
}

.mpa-tile:hover .mpa-cover__img,
.mpa-course:hover .mpa-cover__img {
	transform: scale(1.035);
}

.mpa-tile[aria-current] {
	box-shadow: 0 0 0 2px var(--ent-ink), var(--mpa-lift);
}

.mpa-tile[aria-current]::after {
	content: "";
	position: absolute;
	top: 0.7rem;
	right: 0.7rem;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0a0a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.mpa-tile:focus-visible,
.mpa-course:focus-visible,
.mpa-search input:focus-visible,
.mpa-filters summary:focus-visible {
	outline: 2px solid var(--ent-accent);
	outline-offset: 3px;
}

/* ---------------------------------------------------------------- Filters */

.mpa-browse {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: clamp(1.75rem, 4vw, 3rem);
	align-items: start;
	margin-top: clamp(2rem, 4vw, 3rem);
}

.mpa-filters {
	position: sticky;
	top: calc(var(--mpa-header) + var(--mpa-bar) + 1.25rem);
	max-height: calc(100vh - var(--mpa-header) - var(--mpa-bar) - 2.5rem);
	overflow-y: auto;
	margin: 0;
	padding: 3px;
	scrollbar-width: thin;
}

.mpa-search {
	position: relative;
	display: block;
}

.mpa-search svg {
	position: absolute;
	top: 50%;
	left: 0.85rem;
	color: var(--ent-muted);
	transform: translateY(-50%);
	pointer-events: none;
}

.mpa-search input {
	box-sizing: border-box;
	width: 100%;
	height: 2.6rem;
	margin: 0;
	padding: 0 0.85rem 0 2.35rem;
	border: 1px solid var(--ent-rule-strong);
	border-radius: 10px;
	background: var(--mpa-surface);
	color: var(--ent-ink);
	font: inherit;
	font-size: 0.875rem;
}

.mpa-search input::placeholder {
	color: var(--ent-muted);
	opacity: 1;
}

.mpa-filters__more > summary {
	display: none;
}

.mpa-filter {
	min-width: 0;
	margin: 0;
	padding: 1.25rem 0 1.1rem;
	border: 0;
	border-bottom: 1px solid var(--ent-rule);
}

.mpa-filter:last-child {
	border-bottom: 0;
}

.mpa-filter legend {
	float: left;
	width: 100%;
	margin-bottom: 0.55rem;
	padding: 0;
	color: var(--ent-ink);
	font-size: 0.8125rem;
	font-weight: 600;
}

.mpa-filter ul {
	clear: both;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mpa-tick {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.6rem;
	padding: 0.36rem 0;
	color: var(--ent-ink-soft);
	font-size: 0.875rem;
	line-height: 1.3;
	cursor: pointer;
}

.mpa-tick:hover {
	color: var(--ent-ink);
}

.mpa-tick input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.mpa-tick__box {
	width: 18px;
	height: 18px;
	border-radius: 5px;
	box-sizing: border-box;
	border: 1px solid var(--ent-rule-strong);
	background: var(--mpa-surface);
	transition: background-color 0.25s var(--mpa-ease), border-color 0.25s var(--mpa-ease);
}

.mpa-tick input:checked + .mpa-tick__box {
	border-color: var(--ent-ink);
	background: var(--ent-ink);
	-webkit-mask: none;
	box-shadow: inset 0 0 0 4px var(--ent-ink), inset 0 0 0 9px var(--ent-bg);
}

.mpa-tick input:checked ~ .mpa-tick__label {
	color: var(--ent-ink);
	font-weight: 500;
}

.mpa-tick input:focus-visible + .mpa-tick__box {
	outline: 2px solid var(--ent-accent);
	outline-offset: 2px;
}

.mpa-tick__n {
	color: var(--ent-muted);
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
}

.mpa-tick.is-none {
	opacity: 0.45;
}

.mpa-filters__go {
	padding-top: 1rem;
}

.mpa-filters.is-live .mpa-filters__go {
	display: none;
}

/* ---------------------------------------------------------------- Results */

.mpa-results__head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 1rem;
	min-height: 2.6rem;
	margin-bottom: 1.25rem;
}

.mpa-results__title {
	margin: 0;
	font-size: clamp(1.35rem, 2.4vw, 1.75rem);
	font-weight: 600;
	letter-spacing: -0.025em;
	line-height: 1.15;
}

.mpa-results__n {
	margin: 0.3rem 0 0;
	color: var(--ent-muted);
	font-size: 0.875rem;
	font-variant-numeric: tabular-nums;
}

.mpa-results__clear {
	flex: none;
	font-size: 0.875rem;
}

.mpa-courses {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mpa-course-item {
	display: grid;
	margin: 0;
}

.mpa-course {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 16px;
	background: var(--mpa-surface);
	box-shadow: 0 0 0 1px var(--ent-rule);
	color: var(--ent-ink);
	transition: box-shadow 0.45s var(--mpa-ease), transform 0.6s var(--mpa-ease);
}

.mpa-course:hover {
	box-shadow: 0 0 0 1px var(--ent-rule-strong), var(--mpa-lift);
	transform: translateY(-3px);
}

.mpa-course__tags {
	position: absolute;
	top: 0.7rem;
	left: 0.7rem;
	right: 0.7rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.mpa-course__tag {
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.94);
	color: #0a0a0a;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.4;
}

.mpa-course__tag--done {
	background: #dcfce7;
	color: #14532d;
}

.mpa-course__bar {
	position: absolute;
	inset: auto 0 0;
	height: 4px;
	background: rgba(255, 255, 255, 0.28);
}

.mpa-course__bar span {
	display: block;
	height: 100%;
	background: #fff;
}

.mpa-course__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 1.05rem 1.15rem 1.15rem;
}

.mpa-course__eyebrow {
	color: var(--ent-muted);
	font-size: 0.75rem;
}

.mpa-course__step {
	display: none;
}

/* Inside one certification every card belongs to it, so its place in the order says more. */
.mpa-catalog:not([data-track="all"]) .mpa-course__step {
	display: inline;
}

.mpa-catalog:not([data-track="all"]) .mpa-course__track:not(:only-child) {
	display: none;
}

.mpa-course__title {
	margin: 0.35rem 0 0.45rem;
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: -0.018em;
	line-height: 1.25;
	text-wrap: balance;
}

.mpa-course__text {
	display: -webkit-box;
	overflow: hidden;
	color: var(--ent-ink-soft);
	font-size: 0.875rem;
	line-height: 1.55;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.mpa-course__foot {
	margin-top: auto;
	padding-top: 0.95rem;
	color: var(--ent-muted);
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
}

.mpa-results .mpa-empty {
	margin-top: 0;
}

/* ---------------------------------------------------------------- A certification's introduction */

.mpa-path {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	overflow: hidden;
	margin-bottom: 1.5rem;
	border-radius: 18px;
	background: var(--mpa-surface);
	box-shadow: 0 0 0 1px var(--ent-rule);
}

.mpa-path .mpa-cover {
	height: 100%;
	min-height: 15rem;
	aspect-ratio: auto;
}

.mpa-path__body {
	padding: 1.6rem 1.7rem 1.7rem;
}

.mpa-path__lead {
	margin: 0;
	color: var(--ent-ink-soft);
	line-height: 1.6;
}

.mpa-path__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(7rem, auto));
	gap: 0.9rem 1.5rem;
	margin: 1.25rem 0 1.4rem;
}

.mpa-path__facts dt {
	color: var(--ent-muted);
	font-size: 0.75rem;
}

.mpa-path__facts dd {
	margin: 0.15rem 0 0;
	font-size: 0.9rem;
	font-weight: 500;
}

.mpa-path__suggest {
	margin: -0.4rem 0 1.4rem;
	color: var(--ent-ink-soft);
	font-size: 0.9rem;
	line-height: 1.55;
}

.mpa-path__suggest a {
	color: var(--ent-accent);
	text-underline-offset: 0.15em;
}

.mpa-path__go {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.9rem;
}

/* ---------------------------------------------------------------- Continue learning */

.mpa-resume .mpa-shell-card__core {
	overflow: hidden;
	padding: 0;
}

.mpa-resume__body {
	padding: 1.25rem 1.4rem 1.4rem;
}

.mpa-resume__k {
	margin: 0;
	color: var(--ent-muted);
	font-size: 0.78rem;
}

.mpa-resume__t {
	margin: 0.25rem 0 0.9rem;
	font-size: 1.15rem;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.mpa-resume .mpa-progress {
	margin-bottom: 1.1rem;
}

.mpa-hero--catalog .mpa-hero__aside:has(.mpa-resume)::before {
	display: none;
}

/* ---------------------------------------------------------------- Account */

/* The course page's cover is the header's background now (academy.css, "Course page header"). */
.mpa-acct-course__pic {
	flex: none;
	width: 104px;
	border-radius: 10px;
}

/* ---------------------------------------------------------------- Verify a credential */

.mpa-verify__inner > .mpa-signin__title + .mpa-shell-card {
	margin-top: 1.75rem;
}

.mpa-verify-form__lead,
.mpa-verify-form__foot {
	margin: 0;
	color: var(--ent-ink-soft);
	line-height: 1.6;
}

.mpa-verify-form__foot {
	margin-top: 1.5rem;
	color: var(--ent-muted);
	font-size: 0.875rem;
}

.mpa-verify-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1.5rem 0 0;
}

.mpa-verify-form input {
	box-sizing: border-box;
	flex: 1 1 18rem;
	height: 2.9rem;
	margin: 0;
	padding: 0 1rem;
	border: 1px solid var(--ent-rule-strong);
	border-radius: 999px;
	background: var(--ent-bg);
	color: var(--ent-ink);
	font: inherit;
	font-size: 0.9375rem;
}

.mpa-verify-form input:focus-visible {
	outline: 2px solid var(--ent-accent);
	outline-offset: 2px;
}

.mpa-verify-form__error {
	flex-basis: 100%;
	margin: 0;
	color: var(--mpa-bad);
	font-size: 0.875rem;
}

/* ---------------------------------------------------------------- Smaller screens */

@media (max-width: 1060px) {
	.mpa-hero--catalog .mpa-stats__more {
		display: none;
	}

	.mpa-courses {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.mpa-browse {
		grid-template-columns: minmax(0, 1fr);
	}

	.mpa-filters {
		position: static;
		max-height: none;
		overflow: visible;
	}

	.mpa-filters__more > summary {
		display: flex;
		align-items: center;
		gap: 0.5rem;
		margin-top: 0.75rem;
		padding: 0.7rem 0.9rem;
		border: 1px solid var(--ent-rule-strong);
		border-radius: 10px;
		font-size: 0.875rem;
		font-weight: 500;
		cursor: pointer;
		list-style: none;
	}

	.mpa-filters__more > summary::-webkit-details-marker {
		display: none;
	}

	.mpa-filters__more > summary::after {
		content: "";
		width: 7px;
		height: 7px;
		margin-left: auto;
		border: solid var(--ent-muted);
		border-width: 0 1.5px 1.5px 0;
		transform: rotate(45deg) translate(-2px, -2px);
	}

	.mpa-filters__more[open] > summary::after {
		transform: rotate(-135deg) translate(-2px, -2px);
	}

	.mpa-filters__n {
		min-width: 1.25rem;
		padding: 0.05rem 0.35rem;
		border-radius: 999px;
		background: var(--ent-ink);
		color: var(--ent-bg);
		font-size: 0.72rem;
		text-align: center;
	}

	.mpa-filters__groups {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
		gap: 0 2rem;
	}

	.mpa-tick {
		padding: 0.6rem 0;
	}

	.mpa-path {
		grid-template-columns: minmax(0, 1fr);
	}

	.mpa-path .mpa-cover {
		min-height: 0;
		aspect-ratio: 21 / 9;
	}
}

@media (min-width: 901px) {
	/* Always open beside the results: the summary is a phone control. */
	.mpa-filters__more:not([open]) > .mpa-filters__groups {
		display: block;
	}

	.mpa-filters__more::details-content {
		content-visibility: visible;
		display: contents;
	}

	.mpa-filters__n {
		display: none;
	}
}

@media (max-width: 820px) {
	/* A row to swipe, with the next tile showing, so it reads as more to see. */
	.mpa-tiles {
		grid-auto-columns: 62%;
		gap: 0.75rem;
		margin-inline: -1.5rem;
		padding: 3px 1.5rem 0.75rem;
		overflow-x: auto;
		scroll-padding-left: 1.5rem;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}

	.mpa-tile {
		scroll-snap-align: start;
	}

	.mpa-hero--catalog .mpa-stats {
		grid-template-columns: repeat(3, auto);
		justify-content: start;
		gap: 1.75rem;
		margin-top: 1.5rem;
	}

	.mpa-hero--catalog .mpa-stats__more {
		display: none;
	}

	/* The credential picture is for wide screens; a course to go back to is not. */
	.mpa-hero--catalog .mpa-hero__aside:not(:has(.mpa-resume)) {
		display: none;
	}
}

@media (max-width: 600px) {
	.mpa-courses {
		grid-template-columns: minmax(0, 1fr);
	}

	.mpa-acct-course__pic {
		display: none;
	}
}

@media (max-width: 480px) {
	.mpa-tiles {
		margin-inline: -1rem;
		padding-inline: 1rem;
		scroll-padding-left: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mpa-cover__img,
	.mpa-tile,
	.mpa-course {
		transition: none;
	}

	.mpa-tile:hover .mpa-cover__img,
	.mpa-course:hover .mpa-cover__img,
	.mpa-course:hover {
		transform: none;
	}
}
