/*
 * Reign LifterLMS Add-on: the catalog search and the Detail card.
 * Loaded after the theme's LifterLMS sheet (reign-lifterlms); it only adds what that sheet does not draw, from the
 * same tokens, so light, dark, palettes and RTL follow the theme.
 */

.rllms-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-block-end: 1.5rem;
}

.rllms-toolbar__field {
	flex: 1 1 14rem;
	min-width: 0;
}

.rllms-toolbar__submit {
	flex: 0 0 auto;
}

.rllms-toolbar__clear {
	flex: 0 0 auto;
	color: var(--reign-site-alternate-text-color);
}

.rllms-card__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.75rem;
	margin: 0.5rem 0 0;
	padding: 0 1rem; /* Lines up with the title and footer padding of the theme card. */
	list-style: none;
	color: var(--reign-site-alternate-text-color);
	font-size: 0.875rem;
}

.rllms-card__fact--rating {
	color: var(--reign-site-headings-color);
	font-weight: 600;
}

.rllms-card__count {
	font-weight: 400;
	color: var(--reign-site-alternate-text-color);
}

.rllms-card--detail .rllms-card__price { /* The theme zeroes paragraph margins inside a loop item; the extra class wins that. */
	margin: 0.5rem 0 0.75rem; /* Air between the price and the instructor row of the theme footer. */
	padding-inline: 1rem;
	color: var(--reign-site-headings-color);
	font-weight: 700;
}

@media (max-width: 640px) {
	.rllms-toolbar__field {
		flex-basis: 100%;
	}

	.rllms-toolbar__submit {
		flex: 1 1 auto;
	}
}

/* ## Instructors directory ([reign_lifterlms_instructors]). Loaded with the catalog sheet; see Reign_LLMS_Cards::assets(). */

.rllms-instructors {
	display: grid;
	grid-template-columns: repeat(var(--rllms-cols, 4), minmax(0, 1fr));
	gap: 1.5rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}

.rllms-instructor {
	padding: 1.25rem;
	text-align: center;
	background: var(--reign-site-sections-bg-color);
	border: 1px solid var(--reign-site-border-color);
	border-radius: var(--reign-global-border-radius);
}

.rllms-instructor__avatar {
	border-radius: 50%;
}

.rllms-instructor__name {
	margin: 0.75rem 0 0.25rem;
	font-size: 1.125rem;
}

.rllms-instructor__bio,
.rllms-instructor__link {
	margin: 0.25rem 0 0;
	color: var(--reign-site-alternate-text-color);
}

@media (max-width: 1024px) {
	.rllms-instructors {
		grid-template-columns: repeat(min(var(--rllms-cols, 4), 3), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.rllms-instructors {
		grid-template-columns: repeat(min(var(--rllms-cols, 4), 2), minmax(0, 1fr));
	}
}

/* A meta part ("4 hours 30 minutes", "Intermediate") wraps as one unit, never across two lines. */
.rllms-card__part {
	white-space: nowrap;
}

/* ## Profile Courses tab (BuddyPress, BuddyBoss, PeepSo). Loaded by Reign_LLMS_Community::tab(). The cards are
   LifterLMS's own loop, styled by the theme like the catalog; this only spaces the Teaching and Learning sections. */

.rllms-profile-courses {
	display: grid;
	gap: 1.25rem;
	margin: 0 0 1.5rem;
	min-width: 0;
}

/* Learning / Teaching links (PeepSo) and the progress filter: pills, the same as the other Reign LMS add-ons. */
.rllms-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.rllms-filter a {
	padding: 0.375rem 0.875rem;
	border: 1px solid var(--reign-site-border-color);
	border-radius: 999px;
	color: var(--reign-site-body-text-color);
	font-size: 0.875rem;
	line-height: 1.4;
	text-decoration: none;
}

.rllms-filter a:is(:hover, :focus-visible) {
	border-color: var(--reign-colors-theme);
	color: var(--reign-colors-theme);
}

.rllms-filter a[aria-current="page"] {
	border-color: var(--reign-colors-theme);
	background: var(--reign-colors-theme);
	color: var(--reign-site-button-text-color);
}

@media (max-width: 640px) {
	.rllms-filter a {
		display: inline-flex;
		align-items: center;
		min-height: 2.5rem;
	}
}

.rllms-profile-courses .llms-loop {
	margin: 0;
}

/* BuddyPress's `.buddypress-wrap h2` rule (padding 0, margin 1rem) outranks LifterLMS's card title spacing on
   profile pages: give the title back the catalog card's spacing. */
.rllms-profile-courses .llms-loop-item-content .llms-loop-title {
	margin: 15px 0;
	padding: 0 15px;
}

.rllms-profile-courses__empty {
	margin: 0;
	padding: 1.25rem 1.5rem;
	border: 1px dashed var(--reign-site-border-color);
	border-radius: var(--reign-global-border-radius);
	color: var(--reign-site-alternate-text-color);
	text-align: center;
}

/* Same link look as the other Reign LMS add-ons; the id beats BuddyPress's `body #buddypress * a` reset. */
#buddypress .rllms-profile-courses__browse:is(:link, :visited),
.rllms-profile-courses__browse:is(:link, :visited) {
	margin-inline-start: 0.25em;
	color: var(--reign-site-link-color);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.rllms-pagination {
	margin-block-end: 0;
}

/* Student dashboard menu icons (Reign LifterLMS > Student dashboard > Section icons). Masks take the link colour, so dark mode and hover follow the theme. */
body.rllms-nav-icons .llms-sd-item>.llms-sd-link::before{content:"";display:inline-block;inline-size:1.1em;block-size:1.1em;margin-inline-end:.5em;vertical-align:-.2em;background:currentColor;-webkit-mask:var(--rllms-icon) center/contain no-repeat;mask:var(--rllms-icon) center/contain no-repeat}
body.rllms-nav-icons .llms-sd-item{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.dashboard{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect width=%227%22 height=%229%22 x=%223%22 y=%223%22 rx=%221%22/%3E%3Crect width=%227%22 height=%225%22 x=%2214%22 y=%223%22 rx=%221%22/%3E%3Crect width=%227%22 height=%229%22 x=%2214%22 y=%2212%22 rx=%221%22/%3E%3Crect width=%227%22 height=%225%22 x=%223%22 y=%2216%22 rx=%221%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.view-courses{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 7v14%22/%3E%3Cpath d=%22M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.my-grades{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 3v16a2 2 0 0 0 2 2h16%22/%3E%3Cpath d=%22M18 17V9%22/%3E%3Cpath d=%22M13 17V5%22/%3E%3Cpath d=%22M8 17v-3%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.view-memberships{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m2 4 3 12h14l3-12-6 5-4-7-4 7z%22/%3E%3Cpath d=%22M5 20h14%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.view-achievements{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%228%22 r=%226%22/%3E%3Cpath d=%22M15.477 12.89 17 22l-5-3-5 3 1.523-9.11%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.view-certificates{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z%22/%3E%3Cpath d=%22M14 2v4a2 2 0 0 0 2 2h4%22/%3E%3Cpath d=%22m9 15 2 2 4-4%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.notifications{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9%22/%3E%3Cpath d=%22M10.3 21a1.94 1.94 0 0 0 3.4 0%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.edit-account{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2%22/%3E%3Ccircle cx=%2212%22 cy=%227%22 r=%224%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.redeem-voucher{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2z%22/%3E%3Cpath d=%22M13 5v2%22/%3E%3Cpath d=%22M13 17v2%22/%3E%3Cpath d=%22M13 11v2%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.orders{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1z%22/%3E%3Cpath d=%22M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8%22/%3E%3Cpath d=%22M12 17.5v-11%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.signout{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4%22/%3E%3Cpath d=%22m16 17 5-5-5-5%22/%3E%3Cpath d=%22M21 12H9%22/%3E%3C/svg%3E")}
body.rllms-nav-icons .llms-sd-item.view-favorites{--rllms-icon:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z%22/%3E%3C/svg%3E")}
[dir="rtl"] body.rllms-nav-icons .llms-sd-item.signout .llms-sd-link::before{transform:scaleX(-1)}

/* Student dashboard home: courses, certificates and achievements as a row of counts, each opening its tab. */
.rllms-dash-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rllms-dash-stats__item {
	margin: 0;
}

.rllms-dash-stats__link {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 16px;
	border: 1px solid var(--reign-site-border-color);
	border-radius: var(--reign-global-border-radius);
	background: var(--reign-site-sections-bg-color);
	color: var(--reign-site-alternate-text-color);
	text-decoration: none;
	transition: border-color 0.15s ease;
}

.rllms-dash-stats__link:hover,
.rllms-dash-stats__link:focus-visible {
	border-color: var(--reign-colors-theme);
}

.rllms-dash-stats__link:focus-visible {
	outline: 2px solid var(--reign-site-link-color);
	outline-offset: 2px;
}

.rllms-dash-stats__value {
	color: var(--reign-site-headings-color);
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.rllms-dash-stats__label {
	font-size: 0.8125rem;
}

@media (max-width: 600px) {
	.rllms-dash-stats {
		gap: 8px;
	}

	.rllms-dash-stats__link {
		padding: 10px 12px;
	}

	.rllms-dash-stats__value {
		font-size: 1.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rllms-dash-stats__link {
		transition: none;
	}
}
