/**
 * Authority Pro: Tutor LMS and Tutor Pro.
 *
 * Tutor keeps its own stylesheets. Colors and fonts come from the variables
 * printed with this file (see authority_tutor_variables_css()). The rules
 * below only cover what variables cannot: buttons, the dashboard shell, the
 * user menu, and a few Tutor Pro add-ons that hard-code Tutor's blue.
 *
 * See DESIGN.md.
 *
 * Table of Contents
 * - Buttons
 * - Typography
 * - Dashboard Layout
 * - Dashboard Sidebar
 * - Dashboard Page Header
 * - Dashboard Mobile Navigation
 * - Account Pages
 * - Cart
 * - User Menu
 * - Tutor Pro Add-ons
 */


/*
 * The theme's bare button, input, select and textarea rules (style.css and
 * lib/customizer/output.php) skip elements with a tutor- class through
 * :where(:not([class*="tutor-"])). Otherwise their borders, padding and hover
 * lift show through on Tutor controls, and a later stylesheet cannot undo a
 * hover rule without knowing each control's own values.
 */


/* Buttons
---------------------------------------------------------------------------- */

/*
 * Primary buttons use the theme's button: white with an accent border, filled
 * on hover. Tutor draws button borders with box-shadow through
 * --tutor-button-border-shadow, so the border is set there. Icon-only buttons
 * keep Tutor's filled style.
 */

/*
 * Tutor buttons inherit their font, which can be the serif body font.
 * The radius is set here too: Tutor's legacy stylesheet (tutor.min.css), used
 * on course, cart and checkout pages, hard-codes 6px instead of reading
 * --tutor-button-radius.
 */
.tutor-btn {
	border-radius: var(--tutor-button-radius);
	font-family: var(--tutor-font-family-body);
}

.tutor-btn.tutor-btn-primary:not(.tutor-btn-icon) {
	--tutor-button-border-shadow: inset 0 0 0 2px var(--authority-accent);
	background-color: #fff;
	color: var(--authority-accent);
	transition: background-color 0.25s ease-in, color 0.25s ease-in, transform 0.75s cubic-bezier(0.44, 0.51, 0.24, 0.99), box-shadow 1s cubic-bezier(0.44, 0.51, 0.24, 0.99);
}

.tutor-btn.tutor-btn-primary:not(.tutor-btn-icon) svg:not([class]) {
	color: currentColor;
}

.tutor-btn.tutor-btn-primary:not(.tutor-btn-icon):is(:focus, :hover):not(:disabled):not(.disabled) {
	--tutor-button-border-shadow: inset 0 0 0 2px var(--authority-accent), 0 6px 24px rgba(0, 0, 0, 0.14);
	background-color: var(--authority-accent);
	color: var(--authority-accent-contrast);
}

.tutor-btn.tutor-btn-primary:is(.tutor-btn-medium, .tutor-btn-large):not(.tutor-btn-icon):is(:focus, :hover):not(:disabled):not(.disabled) {
	transform: translate3d(0, -3px, 0);
}

.tutor-btn.tutor-btn-primary:not(.tutor-btn-icon):is(:disabled, .disabled) {
	--tutor-button-border-shadow: inset 0 0 0 2px var(--tutor-brand-400);
	background-color: #fff;
	color: var(--tutor-brand-500);
}


/* Typography
---------------------------------------------------------------------------- */

/*
 * Tutor expects the page font to be its own (it sets html), and many Tutor
 * elements use font-family: inherit. The theme body font is Libre
 * Baskerville, so Tutor markup gets the UI font here. :where() keeps this at
 * zero specificity, so Tutor's classes and the long-form rule below win.
 * body is excluded because Tutor adds tutor-lms to it on every page.
 */
:where([class*="tutor-"]:not(body)) {
	font-family: var(--tutor-font-family-body);
}

.tutor-h1,
.tutor-h2 {
	font-weight: 900;
	letter-spacing: -0.02em;
}

/* Course descriptions and lesson text read like theme posts. */
.tutor-course-details-content .tutor-fs-6,
.tutor-lesson-wrapper {
	font-family: "Libre Baskerville", Georgia, serif;
	font-size: 16px;
	line-height: 1.75;
}


/* Dashboard Layout
---------------------------------------------------------------------------- */

/*
 * The dashboard renders directly inside Genesis .site-inner, which already
 * matches the header width at every breakpoint. Tutor's full-height rules
 * assume Tutor owns the whole page, so they are reset here.
 */

.tutor-dashboard-layout,
body:has(#wpadminbar) .tutor-dashboard-layout {
	min-height: 0;
}

.tutor-dashboard-layout .tutor-dashboard-page {
	max-width: none;
	padding-inline: 0;
}

@media only screen and (min-width: 769px) {

	.tutor-dashboard-layout {
		column-gap: 40px;
		grid-template-columns: 240px minmax(0, 1fr);
	}

}

@media only screen and (min-width: 769px) and (max-width: 1250px) {

	.tutor-dashboard-layout {
		column-gap: 30px;
		grid-template-columns: 210px minmax(0, 1fr);
	}

}


/* Dashboard Sidebar
---------------------------------------------------------------------------- */

.tutor-dashboard-layout .tutor-dashboard-sidebar,
.tutor-dashboard-layout.tutor-has-site-shell .tutor-dashboard-sidebar,
body:has(#wpadminbar) .tutor-dashboard-layout.tutor-has-site-shell .tutor-dashboard-sidebar {
	border-inline-end: 0;
	border-top: 2px solid var(--tutor-text-primary);
	min-height: 0;
	top: calc(var(--tutor-site-header-offset, 0px) + 30px);
}

.tutor-dashboard-sidebar .tutor-dashboard-sidebar-nav {
	padding: 20px 0 0;
}

.tutor-dashboard-sidebar .tutor-dashboard-sidebar-nav ul {
	gap: 0;
}

.tutor-dashboard-sidebar .tutor-dashboard-sidebar-nav ul li a {
	border-inline-start: 3px solid transparent;
	border-radius: 0;
	color: var(--tutor-text-primary);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	padding: 10px 16px;
}

.tutor-dashboard-sidebar .tutor-dashboard-sidebar-nav ul li a:focus,
.tutor-dashboard-sidebar .tutor-dashboard-sidebar-nav ul li a:hover {
	background-color: transparent;
	color: var(--authority-accent);
}

.tutor-dashboard-sidebar .tutor-dashboard-sidebar-nav ul li a.active {
	background-color: transparent;
	border-inline-start-color: var(--authority-accent);
	color: var(--authority-accent);
}

.tutor-dashboard-sidebar .tutor-dashboard-sidebar-nav ul li:nth-of-type(5):not(:last-of-type)::after {
	margin-inline: 19px 0;
	width: calc(100% - 19px);
}

/* Tutor pins this link to the bottom of a full-height column. */
.tutor-dashboard-sidebar .tutor-see-all-courses {
	border-radius: 0;
	color: var(--authority-accent);
	font-size: 16px;
	font-weight: 700;
	margin-top: 20px;
	padding: 10px 19px;
	position: static;
	width: 100%;
}

.tutor-dashboard-sidebar .tutor-see-all-courses:focus,
.tutor-dashboard-sidebar .tutor-see-all-courses:hover {
	background-color: transparent;
	color: var(--tutor-text-primary);
}


/* Dashboard Page Header
---------------------------------------------------------------------------- */

/* Title-only header from lib/tutor/templates/dashboard/components/header.php. */

.authority-tutor-page-header {
	align-items: flex-end;
	border-bottom: 1px solid var(--tutor-border-idle);
	display: flex;
	gap: 20px;
	justify-content: space-between;
	padding-bottom: 20px;
}

.authority-tutor-page-note {
	color: var(--authority-accent);
	font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.07em;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.authority-tutor-page-title {
	color: var(--tutor-text-primary);
	font-size: 42px;
	letter-spacing: -0.02em;
	line-height: 1.1;
	margin: 0;
}

.authority-tutor-page-header-actions {
	align-items: center;
	display: flex;
	flex-shrink: 0;
	gap: 8px;
}

.authority-tutor-page-header-actions:empty {
	display: none;
}

@media only screen and (max-width: 860px) {

	.authority-tutor-page-title {
		font-size: 32px;
	}

}

/* Dashboard pages print their own heading on phones, except the index. */
@media only screen and (max-width: 576px) {

	.authority-tutor-page-header:not(.is-index) .authority-tutor-page-title {
		display: none;
	}

	.authority-tutor-page-header:not(.is-index) {
		border-bottom: 0;
		padding-bottom: 0;
	}

}


/* Dashboard Mobile Navigation
---------------------------------------------------------------------------- */

.tutor-dashboard-nav-mobile {
	border-top: 2px solid var(--tutor-text-primary);
}

.tutor-dashboard-nav-mobile-list > li > a,
.tutor-dashboard-nav-mobile-list > li > button {
	font-weight: 600;
}


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

/* The Genesis header does not stick, so the account bar does not either. */
.tutor-account-page-wrapper .tutor-account-header,
.tutor-account-page-wrapper.tutor-has-site-shell .tutor-account-header,
body:has(#wpadminbar) .tutor-account-page-wrapper.tutor-has-site-shell .tutor-account-header {
	position: static;
}

.tutor-account-page-wrapper,
body:has(#wpadminbar) .tutor-account-page-wrapper {
	min-height: 0;
}


/* Cart
---------------------------------------------------------------------------- */

/* Tutor's cart button in the primary menu. Tutor ships no styles for it. */

.genesis-nav-menu .authority-cart-link {
	align-items: center;
	display: flex;
	gap: 10px;
}

.authority-cart .tutor-btn-cart {
	align-items: center;
	display: inline-flex;
	position: relative;
}

.authority-cart .tutor-btn-cart svg {
	display: block;
	height: 22px;
	width: 22px;
}

/* Tutor's script shows and hides the count as courses are added or removed. */
.authority-cart .tutor-cart-count {
	background-color: var(--authority-accent);
	border-radius: 9px;
	color: var(--authority-accent-contrast);
	font-size: 11px;
	font-weight: 700;
	height: 18px;
	line-height: 18px;
	min-width: 18px;
	padding: 0 5px;
	position: absolute;
	right: -10px;
	text-align: center;
	top: -8px;
}

/*
 * Cart and checkout pages are regular pages. The theme caps full-width pages
 * at 680px, which left the cart summary column about 220px wide and wrapped
 * "Proceed to checkout" onto several lines. The body class comes from
 * authority_tutor_body_class(). Layouts with a sidebar are wide enough.
 */
.authority-tutor-wide.full-width-content.page .content {
	max-width: 1200px;
}

@media only screen and (min-width: 1076px) {

	/*
	 * Menu items sit on the text baseline. The cart (icon only) and the user
	 * menu (32px avatar) have no text line of their own height, so they get
	 * the height of a regular menu link (28px line + 12px padding) with
	 * centered content, aligned to the top of the row.
	 */
	.genesis-nav-menu > .authority-cart,
	.genesis-nav-menu > .authority-user-menu {
		vertical-align: top;
	}

	.genesis-nav-menu > .authority-cart > .authority-cart-link,
	.genesis-nav-menu > .authority-user-menu > .authority-user-menu-toggle {
		height: calc(1.75em + 24px);
	}

	/* Icon only on desktop. The label stays for screen readers. */
	.authority-cart-label {
		clip: rect(0, 0, 0, 0);
		height: 1px;
		overflow: hidden;
		position: absolute;
		width: 1px;
	}

}


/* User Menu
---------------------------------------------------------------------------- */

/* Avatar and dropdown at the end of the primary menu. See tutor.js. */

.genesis-nav-menu .authority-user-menu-toggle {
	align-items: center;
	display: flex;
	font-weight: 600;
	gap: 8px;
}

.authority-avatar {
	align-items: center;
	background-color: var(--authority-accent);
	border-radius: 50%;
	color: var(--authority-accent-contrast);
	display: inline-flex;
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 700;
	height: 32px;
	justify-content: center;
	letter-spacing: 0;
	line-height: 1;
	width: 32px;
}

.genesis-nav-menu .authority-user-menu-profile,
.genesis-nav-menu .authority-user-menu-note {
	background-color: #fff;
	display: block;
	font-size: 14px;
	line-height: 1.4;
	padding: 16px 20px;
}

.authority-user-menu-name {
	color: #111;
	display: block;
	font-weight: 700;
}

.authority-user-menu-email {
	color: #666;
	display: block;
	font-size: 13px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.genesis-nav-menu .authority-user-menu-note {
	border-top: 1px solid #eee;
	color: #666;
	font-style: italic;
}

/* Every row spans the panel. The theme sets menu items to inline-block. */
.genesis-nav-menu .authority-user-menu-panel > li {
	display: block;
}

/*
 * Icons come from Tutor's SVG set (see authority_tutor_menu_icon()). They draw
 * with currentColor, so they follow the link color and its hover color.
 */
.genesis-nav-menu .authority-user-menu-panel li:not(.authority-user-menu-profile):not(.authority-user-menu-note) > :is(a, button) {
	align-items: center;
	display: flex;
	gap: 12px;
}

.authority-user-menu-icon {
	flex-shrink: 0;
	height: 20px;
	width: 20px;
}

/* Matches .genesis-nav-menu .sub-menu a. */
.genesis-nav-menu .authority-user-menu-switch,
.genesis-nav-menu .authority-user-menu-switch:focus,
.genesis-nav-menu .authority-user-menu-switch:hover {
	background-color: #fff;
	border: 0;
	border-top: 1px solid #eee;
	box-shadow: none;
	color: #111;
	display: block;
	font-size: 14px;
	font-weight: inherit;
	line-height: inherit;
	padding: 16px 20px;
	text-align: left;
	transform: none;
	transition: color 0.25s ease-in;
	width: 100%;
}

.genesis-nav-menu .authority-user-menu-switch:focus,
.genesis-nav-menu .authority-user-menu-switch:hover {
	color: var(--authority-accent);
}

.genesis-nav-menu .authority-user-menu-switch:disabled {
	color: #999;
	cursor: wait;
}

.genesis-nav-menu .authority-user-menu-action > a,
.genesis-nav-menu .authority-user-menu-switch {
	color: var(--authority-accent);
	font-weight: 700;
}

/* The responsive menu's links have no left padding and no divider. */
@media only screen and (max-width: 1075px) {

	.genesis-nav-menu .authority-user-menu-profile,
	.genesis-nav-menu .authority-user-menu-note,
	.genesis-nav-menu .authority-user-menu-switch,
	.genesis-nav-menu .authority-user-menu-switch:focus,
	.genesis-nav-menu .authority-user-menu-switch:hover {
		border-top: 0;
		padding: 15px 20px 15px 0;
	}

}

@media only screen and (min-width: 1076px) {

	.genesis-nav-menu .authority-user-menu,
	.genesis-nav-menu .authority-user-menu:hover {
		position: relative;
	}

	.genesis-nav-menu .authority-user-menu > .authority-user-menu-toggle {
		padding-right: 0;
	}

	.genesis-nav-menu .authority-user-menu-panel,
	.genesis-nav-menu .authority-user-menu-panel a {
		width: 260px;
	}

	/* Open on hover, or through tutor.js for keyboard and touch. */
	.genesis-nav-menu .authority-user-menu:not(.is-open):not(:hover) > .sub-menu {
		left: -9999px;
		opacity: 0;
	}

	.genesis-nav-menu .authority-user-menu.is-open > .sub-menu,
	.genesis-nav-menu .authority-user-menu:hover > .sub-menu {
		left: auto;
		opacity: 1;
		right: 0;
	}

}


/* Tutor Pro Add-ons
---------------------------------------------------------------------------- */

/*
 * These add-on stylesheets use Tutor's default blue instead of its variables.
 * Re-check with: grep -rliE '#3e64de' --include='*.css' wp-content/plugins/tutor-pro
 */

/* Zoom */
.zoom-configure-wrapper i,
body button.tutor-zoom-search-action,
.tutor-zoom-frontend-buttons li a.button-outlined {
	color: var(--tutor-brand-600);
}

.tutor-zoom-frontend-buttons li a.button-fill,
.tutor-zoom-frontend-buttons li a.button-outlined {
	border-color: var(--tutor-brand-600);
}

/* The add-on sets this with !important. */
.tutor-zoom-frontend-buttons li a.button-fill {
	background-color: var(--tutor-brand-600) !important;
}

/* Subscriptions */
.tutor-membership-pricing-item .tutor-membership-pricing-featured-badge {
	background: var(--tutor-brand-600);
}

.tutor-membership-pricing-item.is-featured {
	border-color: var(--tutor-brand-600);
}

/* Notifications */
body #tutor-pn-permission button#tutor-pn-enable {
	background: var(--tutor-brand-600);
}

/* H5P analytics */
body .tutor-analytics-wrapper .tutor-pagination-wrapper .pagination a.next,
body .tutor-analytics-wrapper .tutor-pagination-wrapper .pagination a.prev {
	background: var(--tutor-brand-600);
}
