/*
 * MFT Brand Layer v0.2.0
 * Scope: LearnPress and BuddyPress templates only. Divi-built pages are styled in Divi.
 * Reference: measured from the site's own Divi pages (Oct 13, 2026):
 *   Headings  Lato, Magenta; page H1 weight 900, all caps
 *   Body      Poppins
 *   Buttons   Poppins 500 16px, 3px radius, 10px 30px padding, Crimson bg, #F5F5F5 text
 * Specificity: "body:not(#mft-brand)" adds ID-level weight so these rules beat LearnPress,
 * BuddyPress and Divi's .et-db link rules without !important.
 */

/* ---------- Divi global colors: zero-specificity fallbacks ----------
   Divi only prints the custom globals a page uses, and skips them on BuddyPress pages
   (footer links rendered invisible). :where() has zero specificity, so wherever Divi does
   print a value, Divi's value wins and palette edits in Divi still flow through. */
:where(html) {
	--gcid-primary-color: #e5103b;
	--gcid-secondary-color: #ef27a5;
	--gcid-heading-color: #ef27a5;
	--gcid-body-color: #1e1b18;
	--gcid-link-color: #e5103b;
	--gcid-qroh2vk5ui: #e6da10;
	--gcid-nwr7r8f7hc: #6f3340;
	--gcid-s9fsp6fsw6: #1e1b18;
	--gcid-lr8eg2t134: #f5f5f5;
	--gcid-wovr5vfs3x: #ffffff;
	--gcid-da9xgr5e4m: #d3bec0;
}

/* ---------- Tokens ---------- */
:root {
	--mft-crimson: var(--gcid-primary-color, #e5103b);
	--mft-magenta: var(--gcid-secondary-color, #ef27a5);
	--mft-ink: var(--gcid-body-color, #1e1b18);
	--mft-offwhite: var(--gcid-lr8eg2t134, #f5f5f5);
	--mft-white: var(--gcid-wovr5vfs3x, #ffffff);
	--mft-gray: #9a948c;
	--mft-font-heading: 'Lato', Helvetica, Arial, Lucida, sans-serif;
	--mft-font-body: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
}

body {
	--lp-primary-color: var(--mft-crimson);
	--lp-secondary-color: var(--mft-magenta);
	--lp-button-background-color: var(--mft-crimson);
	--lp-button-color: var(--mft-offwhite);
	--lp-color-base: var(--mft-ink);
	--lp-border-radius: 3px;
}

/* ---------- Shared button (matches the site's primary Divi button) ---------- */
body:not(#mft-brand) :is(
	.lp-button,
	.learn-press-courses .course-readmore a,
	.lp-single-course .course-buttons .lp-button,
	.buddypress-wrap .button,
	.buddypress-wrap button[type="submit"],
	.buddypress-wrap input[type="submit"]
) {
	display: inline-block;
	padding: 10px 30px;
	border: 0;
	border-radius: 3px;
	background: var(--mft-crimson);
	color: var(--mft-offwhite);
	font-family: var(--mft-font-body);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.7;
	text-transform: none;
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.2s ease;
}

body:not(#mft-brand) :is(
	.lp-button,
	.learn-press-courses .course-readmore a,
	.lp-single-course .course-buttons .lp-button,
	.buddypress-wrap .button,
	.buddypress-wrap button[type="submit"],
	.buddypress-wrap input[type="submit"]
):is(:hover, :focus-visible) {
	background: var(--mft-magenta);
	color: var(--mft-offwhite);
	border: 0;
}

body:not(#mft-brand) .lp-button:is(.completed, :disabled) {
	background: var(--mft-offwhite);
	color: var(--mft-ink);
	border: 1px solid var(--mft-gray);
}

/* ---------- LearnPress: archive (/courses) ---------- */
body:not(#mft-brand) .lp-archive-courses .learn-press-courses-header h1 {
	font-family: var(--mft-font-heading);
	font-size: 48px;
	font-weight: 900;
	text-transform: uppercase;
	color: var(--mft-magenta);
	line-height: 1.1;
}

body:not(#mft-brand) .learn-press-courses .wap-course-title,
body:not(#mft-brand) .learn-press-courses .wap-course-title a {
	font-family: var(--mft-font-heading);
	font-size: 24px;
	font-weight: 900;
	text-transform: uppercase;
	color: var(--mft-magenta);
}

body:not(#mft-brand) .learn-press-courses .course-content .course-readmore a {
	display: block;
	width: 100%;
	text-align: center;
}

/* Members-only catalog: hide instructor (shows an admin email), price ("Free"),
   student count, duration and level on cards and the single course page. */
body:not(#mft-brand) :is(.learn-press-courses, .lp-single-course, .lp-single-course__header, .course-summary-sidebar) :is(
	.course-instructor-category,
	.course-price,
	.meta-item-student,
	.meta-item-duration,
	.meta-item-level
) {
	display: none;
}

/* ---------- LearnPress: single course + lesson ---------- */
body:not(#mft-brand) :is(h1.course-title, h1.course-item-title) {
	font-family: var(--mft-font-heading);
	font-weight: 900;
	text-transform: uppercase;
	color: var(--mft-magenta);
	line-height: 1.1;
}

body:not(#mft-brand) :is(#learn-press-course, #popup-course .content-item-wrap) :is(h2, h3, h4, h5, h6) {
	font-family: var(--mft-font-heading);
	color: var(--mft-magenta);
}

body:not(#mft-brand) :is(#learn-press-course, #popup-course, .lp-archive-courses) {
	font-family: var(--mft-font-body);
	color: var(--mft-ink);
}

/* Lesson popup header bar: keep LearnPress layout, brand the type */
body:not(#mft-brand) #popup-course #popup-header .course-title,
body:not(#mft-brand) #popup-course #popup-header .course-title a {
	font-family: var(--mft-font-heading);
	font-weight: 900;
	text-transform: uppercase;
	color: var(--mft-white);
}

/* ---------- LearnPress: messages (locked / protected / gate) ----------
   LearnPress sets display:flex, which drops the spaces around links
   ("pleaseloginandenroll"). Block layout restores normal text flow. */
body:not(#mft-brand) .learn-press-message,
body:not(#mft-brand) .learn-press-message.error {
	display: block;
	padding: 14px 20px;
	border: 1px solid var(--mft-magenta);
	border-left-width: 4px;
	border-radius: 3px;
	background: var(--mft-white);
	color: var(--mft-ink);
	font-family: var(--mft-font-body);
	font-size: 16px;
	line-height: 1.6;
}

body:not(#mft-brand) .learn-press-message::before,
body:not(#mft-brand) .learn-press-message.error::before {
	display: inline-block;
	margin-right: 8px;
	color: var(--mft-magenta);
	vertical-align: -2px;
}

body:not(#mft-brand) .learn-press-message a {
	color: var(--mft-crimson);
	font-weight: 500;
	text-decoration: underline;
}

/* ---------- BuddyPress ---------- */
body:not(#mft-brand).buddypress :is(h1.entry-title, h1.main_title, .entry-title, .main_title) {
	font-family: var(--mft-font-heading);
	font-weight: 900;
	text-transform: uppercase;
	color: var(--mft-magenta);
}

body:not(#mft-brand) .buddypress-wrap {
	font-family: var(--mft-font-body);
	color: var(--mft-ink);
}

body:not(#mft-brand) .buddypress-wrap :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--mft-font-heading);
	color: var(--mft-magenta);
}

body:not(#mft-brand) .buddypress-wrap .bp-navs a {
	color: var(--mft-ink);
}

body:not(#mft-brand) .buddypress-wrap .bp-navs :is(li.selected, li.current) a,
body:not(#mft-brand) .buddypress-wrap .bp-navs a:hover {
	color: var(--mft-crimson);
}

body:not(#mft-brand) .buddypress-wrap :is(.activity-content, .item-meta) a {
	color: var(--mft-crimson);
}

/* Activity icon actions (comment, favorite, delete) stay small icon links, not full buttons */
body:not(#mft-brand) .buddypress-wrap :is(.activity-meta, .bp-generic-meta) :is(.button, a, button) {
	display: inline-flex;
	padding: 4px 8px;
	border: 0;
	background: transparent;
	color: var(--mft-ink);
	font-size: 14px;
	line-height: 1.4;
}

body:not(#mft-brand) .buddypress-wrap :is(.activity-meta, .bp-generic-meta) :is(.button, a, button):is(:hover, :focus-visible) {
	background: transparent;
	color: var(--mft-crimson);
}

/* Search submit buttons stay inline icons inside their fields */
body:not(#mft-brand) .buddypress-wrap :is(.bp-dir-search-form, .bp-search, .dir-search, .subnav-search, form.bp-messages-search-form) :is(button, input[type="submit"]) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	padding: 0 10px;
	border: 0;
	background: transparent;
	color: var(--mft-ink);
	font-size: 16px;
	line-height: 1;
}

/* Activity filter bar: drop the theme's list bullets around the RSS link and search */
body:not(#mft-brand) .buddypress-wrap .subnav-filters :is(ul, li) {
	list-style: none;
	margin-left: 0;
	padding-left: 0;
}

body:not(#mft-brand) .buddypress-wrap .subnav-filters li::before,
body:not(#mft-brand) .buddypress-wrap .subnav-filters li::marker {
	content: none;
}
