/* Dedicated catalogues should use the full theme content canvas. Keep the
   toolbar and cards constrained while allowing the branded hero to meet the
   active theme header without a white article gutter around it. */
body.legend-page-courses .legend-public-app {
	max-width: none;
	padding-top: 0;
}

body.legend-page-courses .legend-catalog {
	max-width: none;
	margin: 0 0 50px;
	padding: 0;
}

body.legend-page-courses .legend-catalog-hero {
	width: 100%;
	min-height: 0;
	margin: 0 0 26px;
	padding: 44px clamp(24px, 4.5vw, 70px);
	border-radius: 0;
	box-shadow: none;
	justify-content: center;
	text-align: center;
}

body.legend-page-courses .legend-catalog-hero > div,
.legend-theme-bridge-page-catalog .legend-catalog-hero > div {
	max-width: 760px;
}

body.legend-page-courses .legend-catalog-toolbar,
body.legend-page-courses .legend-course-grid,
body.legend-page-courses .legend-catalog-empty {
	width: min(calc(100% - 44px), 1196px);
	margin-right: auto;
	margin-left: auto;
}

.legend-theme-bridge-page-catalog .legend-lms-theme-bridge > .legend-catalog {
	max-width: none;
	margin: 0 0 50px;
	padding: 0;
}

.legend-theme-bridge-page-catalog .legend-catalog-hero {
	width: 100%;
	margin: 0 0 26px;
	padding: 44px max(24px, calc((100vw - 1144px) / 2));
	border-radius: 0;
	box-shadow: none;
	justify-content: center;
	text-align: center;
}

.legend-theme-bridge-page-catalog .legend-catalog-toolbar,
.legend-theme-bridge-page-catalog .legend-course-grid,
.legend-theme-bridge-page-catalog .legend-catalog-empty {
	width: min(calc(100% - 44px), 1196px);
	margin-right: auto;
	margin-left: auto;
}

.legend-course-preview-document {
	margin: 0 !important;
	padding: 0 !important;
	background: #fff !important;
}

.legend-course-preview-document #wpadminbar {
	display: none !important;
}

.legend-course-preview-document .legend-course {
	margin-top: 0;
}

/* Keep the wishlist action available without taking purchase-card space. */
.legend-course-purchase .legend-wishlist {
	position: absolute;
	z-index: 3;
	top: 14px;
	right: 14px;
	display: grid;
	width: 42px;
	height: 42px;
	min-height: 0;
	margin: 0;
	padding: 0;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.75);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 8px 20px rgba(12, 27, 61, 0.2);
	color: var(--legend-secondary);
}

.legend-course-purchase .legend-wishlist > span:first-child {
	font-size: 23px;
	line-height: 1;
}

.legend-course-purchase .legend-wishlist:hover,
.legend-course-purchase .legend-wishlist:focus-visible {
	border-color: var(--legend-primary);
	box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.2), 0 8px 20px rgba(12, 27, 61, 0.2);
}

.legend-course-purchase .legend-wishlist.is-active {
	border-color: #efb5c2;
	background: #fff3f6;
	color: #b52e4b;
}

/* Let a tall sticky purchase card scroll under the pointer instead of running
   below the viewport. The narrow track keeps the card visually quiet. */
@media (min-width: 821px) {
	.legend-course-purchase {
		max-height: calc(100vh - 120px);
		overflow-x: hidden;
		overflow-y: auto;
		scrollbar-color: color-mix(in srgb, var(--legend-primary) 48%, #c9d2df) transparent;
		scrollbar-width: thin;
	}

	.admin-bar .legend-course-purchase {
		max-height: calc(100vh - 152px);
	}

	.legend-course-purchase::-webkit-scrollbar {
		width: 9px;
	}

	.legend-course-purchase::-webkit-scrollbar-track {
		background: transparent;
	}

	.legend-course-purchase::-webkit-scrollbar-thumb {
		border: 2px solid transparent;
		border-radius: 999px;
		background: color-mix(in srgb, var(--legend-primary) 48%, #c9d2df);
		background-clip: padding-box;
	}
}

/* Keep the review form approachable without making the feedback area feel
   like a long application form on desktop screens. */
@media (min-width: 681px) {
	.legend-reviews form {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px 16px;
		margin-top: 20px;
		padding-top: 20px;
	}

	.legend-reviews form > h3,
	.legend-reviews form label:nth-of-type(3),
	.legend-reviews form .legend-review-photo-field {
		grid-column: 1 / -1;
	}

	.legend-reviews form > h3 {
		margin: 0;
	}

	.legend-reviews form textarea {
		height: 112px;
		min-height: 112px;
	}

	.legend-reviews form .legend-review-photo-field {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: center;
		gap: 4px 12px;
		padding: 10px 12px;
	}

	.legend-reviews form .legend-review-photo-field > span {
		grid-row: 1 / 3;
	}

	.legend-reviews form .legend-review-photo-field input[type="file"],
	.legend-reviews form .legend-review-photo-field small {
		grid-column: 2;
	}

	.legend-reviews form .legend-review-photo-field input[type="file"] {
		padding: 4px;
	}

	.legend-reviews form button[type="submit"] {
		justify-self: start;
		align-self: center;
		margin: 0;
	}

	.legend-reviews form [data-legend-review-result] {
		align-self: center;
	}
}

@media (min-width: 1021px) {
	.legend-course-hero {
		box-sizing: border-box;
		min-height: 456px;
	}

	.legend-course-sidebar {
		margin-top: -452px;
	}
}

@media (min-width: 821px) {
	.legend-course-media {
		height: clamp(145px, 16vw, 172px);
		aspect-ratio: auto;
	}

	.legend-course-purchase__body {
		padding: 16px 18px 18px;
	}

	.legend-course-price {
		margin-bottom: 10px;
	}

	.legend-course-price strong {
		font-size: 28px;
	}

	.legend-course-purchase .legend-button--large {
		min-height: 50px;
	}

	.legend-wishlist {
		min-height: 42px;
		margin-top: 8px;
		padding: 7px 10px;
	}

	.legend-purchase-note {
		margin-top: 7px;
		font-size: 11px;
		line-height: 1.35;
	}

	.legend-course-includes {
		margin-top: 12px;
		padding-top: 12px;
	}

	.legend-course-includes h3 {
		margin-bottom: 9px;
	}

	.legend-course-includes ul {
		gap: 6px;
	}

	.legend-course-includes li {
		font-size: 11px;
		line-height: 1.35;
	}
}

@media (max-width: 640px) {
	body.legend-page-courses .legend-catalog-hero,
	.legend-theme-bridge-page-catalog .legend-catalog-hero {
		padding: 31px 20px;
	}

	body.legend-page-courses .legend-catalog-toolbar,
	body.legend-page-courses .legend-course-grid,
	body.legend-page-courses .legend-catalog-empty,
	.legend-theme-bridge-page-catalog .legend-catalog-toolbar,
	.legend-theme-bridge-page-catalog .legend-course-grid,
	.legend-theme-bridge-page-catalog .legend-catalog-empty {
		width: calc(100% - 28px);
	}
}
