/* Spectre storefront shortcodes. Buttons use Tutor's classes; colours inherit from the theme so light and dark modes both work. */
.spectre-buy__price {
	margin-bottom: 0.75rem;
}

.spectre-pricing {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: 1.5rem;
}

.spectre-pricing__plan {
	padding: 1.5rem;
	border: 1px solid rgba(127, 127, 127, 0.35);
	border-radius: 8px;
}

.spectre-pricing__name {
	margin: 0 0 0.5rem;
}

.spectre-pricing__price del,
.spectre-pricing__interval {
	margin-left: 0.5rem;
}

.spectre-pricing__note {
	font-size: 0.875em;
	opacity: 0.8;
}

.spectre-cart-icon .tutor-cart-count[hidden] {
	display: none;
}

.spectre-commerce-notice {
	display: inline-block;
	padding: 0.25rem 0.5rem;
	border-left: 4px solid #d63638;
}

/* [spectre_catalogue]: course cards. Colours inherit from the theme; the badge is the one fixed colour. */
.spectre-catalogue__grid {
	display: grid;
	grid-template-columns: repeat(var(--spectre-catalogue-columns, 2), minmax(0, 1fr));
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.spectre-catalogue__card {
	margin: 0;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	overflow: hidden;
}

.spectre-catalogue__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: #1b1b1b;
	text-decoration: none;
}

/* The theme colours links (and their hover) red; the card text stays dark. */
.spectre-catalogue a.spectre-catalogue__link,
.spectre-catalogue a.spectre-catalogue__link:visited,
.spectre-catalogue a.spectre-catalogue__link:hover,
.spectre-catalogue a.spectre-catalogue__link:focus-visible {
	color: #1b1b1b;
	text-decoration: none;
}

.spectre-catalogue .spectre-catalogue__body,
.spectre-catalogue .spectre-catalogue__title,
.spectre-catalogue .spectre-catalogue__excerpt,
.spectre-catalogue .spectre-catalogue__price {
	color: #1b1b1b;
}

.spectre-catalogue__media {
	position: relative;
	display: block;
}

.spectre-catalogue__media img {
	display: block;
	width: 100%;
	height: auto;
}

.spectre-catalogue__badge {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	padding: 0.2rem 0.6rem;
	border-radius: 3px;
	background: #5146d6;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
}

.spectre-catalogue__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem;
	text-align: center;
}

.spectre-catalogue__title {
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
}

.spectre-catalogue__excerpt {
	font-size: 0.9375rem;
	line-height: 1.45;
}

.spectre-catalogue__price {
	margin-top: auto;
	font-weight: 600;
}

.spectre-catalogue__price del {
	margin-left: 0.5rem;
	font-weight: 400;
	opacity: 0.65;
}

.spectre-catalogue__link:hover .spectre-catalogue__title,
.spectre-catalogue__link:focus-visible .spectre-catalogue__title {
	text-decoration: underline;
}

.spectre-catalogue__link:focus-visible {
	outline: 3px solid #5146d6;
	outline-offset: -3px;
}

.spectre-catalogue__pagination {
	margin-top: 2rem;
	text-align: center;
}

.spectre-catalogue__pagination .page-numbers {
	display: inline-block;
	margin: 0 0.2rem;
	padding: 0.3rem 0.7rem;
}

.spectre-catalogue__pagination .page-numbers.current {
	font-weight: 700;
	text-decoration: underline;
}

@media (max-width: 1024px) {
	.spectre-catalogue__grid {
		grid-template-columns: repeat(min(var(--spectre-catalogue-columns, 2), 2), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.spectre-catalogue__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* [spectre_catalogue] filters: the same columns and gap as the cards below, so each field sits above a card column; the Filter button gets its own row. */
.spectre-catalogue__filters {
	display: grid;
	grid-template-columns: repeat(var(--spectre-catalogue-columns, 3), minmax(0, 1fr));
	gap: 1rem 1.5rem;
	align-items: start;
	margin: 0 0 1.5rem;
}

.spectre-catalogue__filters p {
	margin: 0;
}

.spectre-catalogue__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.spectre-catalogue__field label {
	font-size: 0.875rem;
	font-weight: 600;
}

.spectre-catalogue__field input,
.spectre-catalogue__field select {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.4rem 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	background: #fff;
	color: #1b1b1b;
}

/* The last column holds the Instructor field with the Filter button beside it (and Clear under them), so the bar stays one row. */
.spectre-catalogue__last {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	align-items: flex-end;
}

.spectre-catalogue__last .spectre-catalogue__field {
	flex: 1 1 0;
	min-width: 0;
}

.spectre-catalogue__actions {
	display: contents;
}

/* The results line: the count on the left, Clear filters on the right. */
.spectre-catalogue__summary {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	align-items: baseline;
	justify-content: space-between;
	margin: 0 0 1rem;
}

.spectre-catalogue__summary .spectre-catalogue__count {
	margin: 0;
}

.spectre-catalogue__clear {
	font-size: 0.9375rem;
	font-weight: 600;
}

.spectre-catalogue button.spectre-catalogue__apply {
	min-height: 2.75rem;
	padding: 0 1.25rem;
	border: 0;
	border-radius: 4px;
	background: #5146d6;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.spectre-catalogue button.spectre-catalogue__apply:hover,
.spectre-catalogue button.spectre-catalogue__apply:focus-visible {
	background: #3f35b8;
	color: #fff;
}

.spectre-catalogue__empty {
	padding: 2rem 0;
	text-align: center;
}

@media (max-width: 1024px) {
	.spectre-catalogue__filters {
		grid-template-columns: repeat(min(var(--spectre-catalogue-columns, 3), 2), minmax(0, 1fr));
	}

	/* Two columns: the search takes the first row, the two dropdowns share the second. */
	.spectre-catalogue__field:first-child {
		grid-column: 1 / -1;
	}
}

@media (max-width: 640px) {
	.spectre-catalogue__filters {
		grid-template-columns: minmax(0, 1fr);
	}

	.spectre-catalogue__field:first-child {
		grid-column: auto;
	}
}

/* Results count and the loading state while a filter is fetched in the background. */
.spectre-catalogue__count {
	margin: 0 0 1rem;
	font-size: 0.9375rem;
	opacity: 0.8;
}

.spectre-catalogue.is-loading .spectre-catalogue__grid {
	opacity: 0.45;
	transition: opacity 0.15s ease-out;
}

@media (prefers-reduced-motion: reduce) {
	.spectre-catalogue.is-loading .spectre-catalogue__grid {
		transition: none;
	}
}
