/*
 * Mystic Luxury A — LearnDash (LD30 templates) + "Mis Cursos".
 * Scoped to body.lm-ld (course, lesson, topic, quiz, group and ld-profile pages).
 * Selectors mirror LD30's own with the body prefix so they win without !important,
 * except where LD or the legacy header.php CSS already uses it.
 * Accent colours also flow through the learndash_30_custom_colors filter (inc/learndash.php).
 */

body.lm-ld {
	--lm-ld-surface: rgba(40, 20, 47, 0.38);
	--lm-ld-line: var(--lm-gold-hair);
	--lm-ld-radius: 4px;
}

body.lm-ld .content-bg,
body.lm-ld .site .entry-content-wrap {
	background: transparent;
	box-shadow: none;
}

body.lm-ld .site-main,
body.lm-ld .learndash-wrapper {
	color: var(--lm-ivory-muted); /* legacy header.php forces .learndash-wrapper white */
	font-family: var(--lm-font-body);
}

/* ---------- Course / lesson titles ---------- */

body.lm-ld:not(.lm-inner) .entry-header {
	margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
	padding-bottom: clamp(1.25rem, 2.5vw, 2rem);
	border-bottom: 1px solid var(--lm-ld-line);
	text-align: center;
}

body.lm-ld:not(.lm-inner) .entry-header .entry-title {
	margin: 0;
	color: var(--lm-ivory);
	font-family: var(--lm-font-display);
	font-size: var(--lm-h2);
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1.08;
	text-transform: none;
	overflow-wrap: anywhere;
}

body.lm-ld .entry-content h2,
body.lm-ld .entry-content h3,
body.lm-ld .entry-content h4 {
	color: var(--lm-ivory);
	font-family: var(--lm-font-display);
	font-weight: 500;
	text-transform: none;
}

body.lm-ld .entry-content .learndash-wrapper a:not(.ld-button):not(.btn-join):not(.lm-btn),
body.lm-ld .entry-content > p a {
	color: var(--lm-gold);
}

/* ---------- Breadcrumbs ---------- */

body.lm-ld .learndash-wrapper .ld-lesson-status,
body.lm-ld .learndash-wrapper .ld-topic-status {
	background: transparent;
}

body.lm-ld .learndash-wrapper .ld-breadcrumbs {
	padding: 0.85rem 1.1rem;
	border: 1px solid var(--lm-ld-line);
	border-radius: var(--lm-ld-radius);
	background: var(--lm-ld-surface);
	font-size: var(--lm-text-xs);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

body.lm-ld .learndash-wrapper .ld-breadcrumbs a {
	color: var(--lm-ivory-muted);
	text-decoration: none;
}

body.lm-ld .learndash-wrapper .ld-breadcrumbs a:hover {
	color: var(--lm-gold);
}

body.lm-ld .learndash-wrapper .ld-breadcrumbs-segments span:last-child a {
	color: var(--lm-gold);
}

/* ---------- Status badges ---------- */

body.lm-ld .learndash-wrapper .ld-status {
	border-radius: 999px;
	font-family: var(--lm-font-body);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

body.lm-ld .learndash-wrapper .ld-status.ld-status-waiting,
body.lm-ld .learndash-wrapper .ld-status.ld-status-progress {
	border: 1px solid var(--lm-gold-soft);
	background: transparent;
	color: var(--lm-gold);
}

body.lm-ld .learndash-wrapper .ld-course-status .ld-status.ld-status-complete,
body.lm-ld .learndash-wrapper .ld-breadcrumbs .ld-status.ld-status-complete {
	background: var(--lm-gold);
	color: var(--lm-obsidian);
}

/* ---------- Course status panel (not enrolled / enrolled) ---------- */

body.lm-ld .learndash-wrapper .ld-course-status.ld-course-status-not-enrolled,
body.lm-ld .learndash-wrapper .ld-course-status.ld-course-status-enrolled {
	margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
	padding: 1.25rem 0;
	border: 1px solid var(--lm-ld-line);
	border-radius: var(--lm-ld-radius);
	background:
		radial-gradient(80% 140% at 100% 0%, rgba(117, 85, 120, 0.22), transparent 60%),
		var(--lm-ld-surface);
}

body.lm-ld .learndash-wrapper .ld-course-status.ld-course-status-not-enrolled > * {
	border-right-color: var(--lm-ld-line);
	border-bottom-color: var(--lm-ld-line);
}

body.lm-ld .learndash-wrapper .ld-course-status.ld-course-status-not-enrolled .ld-course-status-label,
body.lm-ld .learndash-wrapper .ld-course-status .ld-course-status-label {
	color: var(--lm-ivory-faint);
	font-size: var(--lm-text-xs);
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

body.lm-ld .learndash-wrapper .ld-course-status.ld-course-status-not-enrolled .ld-course-status-price {
	color: var(--lm-ivory);
	font-family: var(--lm-font-display);
	font-size: 1.9rem;
	font-weight: 500;
}

/* ---------- Buttons (join, next/previous, mark complete, alerts) ---------- */

body.lm-ld .learndash-wrapper .ld-button,
body.lm-ld .learndash-wrapper #btn-join,
body.lm-ld .learndash-wrapper .btn-join,
body.lm-ld .learndash-wrapper #learndash_mark_complete_button,
body.lm-ld .learndash-wrapper .learndash_mark_complete_button,
body.lm-ld .learndash-wrapper .ld-expand-button {
	min-height: 44px;
	padding: 0.7rem 1.4rem;
	border: 1px solid var(--lm-gold);
	border-radius: var(--lm-ld-radius);
	background: var(--lm-gold);
	color: var(--lm-obsidian);
	font-family: var(--lm-font-body);
	font-size: var(--lm-text-xs);
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	transition: background-color 0.3s var(--lm-ease), color 0.3s var(--lm-ease);
}

body.lm-ld .learndash-wrapper .ld-button:hover,
body.lm-ld .learndash-wrapper #btn-join:hover,
body.lm-ld .learndash-wrapper .btn-join:hover,
body.lm-ld .learndash-wrapper #learndash_mark_complete_button:hover,
body.lm-ld .learndash-wrapper .learndash_mark_complete_button:hover,
body.lm-ld .learndash-wrapper .ld-expand-button:hover {
	background: transparent;
	color: var(--lm-gold);
	opacity: 1;
}

body.lm-ld .learndash-wrapper .ld-button .ld-icon,
body.lm-ld .learndash-wrapper .ld-expand-button .ld-icon {
	color: inherit;
}

body.lm-ld .learndash-wrapper .ld-button.ld-button-transparent,
body.lm-ld .learndash-wrapper .ld-button.ld-button-alternate,
body.lm-ld .learndash-wrapper .ld-expand-button.ld-button-alternate {
	border-color: transparent;
	background: transparent;
	color: var(--lm-gold);
}

body.lm-ld .learndash-wrapper .ld-expand-button.ld-button-alternate .ld-icon {
	background: var(--lm-gold);
	color: var(--lm-obsidian);
}

/* ---------- Course content list (lessons, sections, topics) ---------- */

body.lm-ld .learndash-wrapper .ld-item-list .ld-section-heading h2,
body.lm-ld .learndash-wrapper .ld-item-list .ld-section-heading h3 {
	color: var(--lm-ivory);
	font-family: var(--lm-font-display);
	font-size: var(--lm-h3, 1.75rem);
	font-weight: 500;
	text-transform: none;
}

body.lm-ld .learndash-wrapper .ld-lesson-section-heading {
	margin: 2rem 0 0.25rem;
	color: var(--lm-gold);
	font-family: var(--lm-font-body);
	font-size: var(--lm-text-xs);
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

body.lm-ld .learndash-wrapper .ld-item-list .ld-item-list-item {
	margin: 0.6rem 0;
	border: 1px solid var(--lm-ld-line);
	border-radius: var(--lm-ld-radius);
	background: var(--lm-ld-surface);
	transition: border-color 0.3s var(--lm-ease), background-color 0.3s var(--lm-ease);
}

body.lm-ld .learndash-wrapper .ld-item-list .ld-item-list-item:hover {
	border-color: var(--lm-gold-soft);
	background: rgba(40, 20, 47, 0.6);
}

body.lm-ld .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-name {
	color: var(--lm-ivory);
	font-weight: 500;
}

body.lm-ld .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-name:hover {
	color: var(--lm-gold);
}

body.lm-ld .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-title .ld-item-components {
	color: var(--lm-ivory-faint);
	font-weight: 500;
}

body.lm-ld .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-title .ld-status {
	padding: 0.2em 0.7em;
	border: 1px solid var(--lm-gold-hair);
	background: transparent;
	color: var(--lm-gold);
	font-size: 0.68rem;
}

body.lm-ld .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-list-item-expanded:before {
	background: var(--lm-plum);
}

body.lm-ld .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-list-item-expanded .ld-progress {
	background: rgba(16, 12, 20, 0.5);
}

body.lm-ld .learndash-wrapper .ld-table-list .ld-table-list-header {
	background: var(--lm-plum);
	color: var(--lm-ivory);
	font-weight: 600;
}

body.lm-ld .learndash-wrapper .ld-table-list .ld-table-list-items {
	border-color: var(--lm-ld-line);
}

body.lm-ld .learndash-wrapper .ld-table-list .ld-table-list-item {
	border-bottom-color: var(--lm-ld-line);
}

body.lm-ld .learndash-wrapper .ld-table-list a.ld-table-list-item-preview,
body.lm-ld .learndash-wrapper .ld-table-list .ld-table-list-item .ld-table-list-title a {
	color: var(--lm-ivory-muted);
}

body.lm-ld .learndash-wrapper .ld-table-list a.ld-table-list-item-preview:hover,
body.lm-ld .learndash-wrapper .ld-table-list .ld-table-list-item .ld-table-list-title a:hover {
	color: var(--lm-gold);
}

/* Completion icons: incomplete = gold hairline ring, complete = solid gold */
body.lm-ld .learndash-wrapper .ld-status-icon.ld-status-incomplete {
	border: 1px solid var(--lm-gold-soft);
	background: transparent;
}

body.lm-ld .learndash-wrapper .ld-status-icon.ld-status-complete {
	background: var(--lm-gold);
	color: var(--lm-obsidian);
}

body.lm-ld .learndash-wrapper .ld-status-icon.ld-status-in-progress {
	border-color: var(--lm-gold);
}

body.lm-ld .learndash-wrapper .ld-item-list-item.learndash-complete .ld-item-name {
	color: var(--lm-ivory-muted);
}

/* ---------- Progress bars ---------- */

body.lm-ld .learndash-wrapper .ld-progress .ld-progress-bar,
body.lm-ld .learndash-wrapper .ld-item-list .ld-section-heading .ld-item-list-actions .ld-progress .ld-progress-bar {
	height: 4px;
	border-radius: 999px;
	background: rgba(243, 235, 221, 0.1);
}

body.lm-ld .learndash-wrapper .ld-progress .ld-progress-bar .ld-progress-bar-percentage {
	border-radius: inherit;
	background: linear-gradient(90deg, var(--lm-gold-soft), var(--lm-gold));
}

body.lm-ld .learndash-wrapper .ld-progress .ld-progress-heading .ld-progress-label,
body.lm-ld .learndash-wrapper .ld-progress .ld-progress-stats {
	color: var(--lm-ivory-faint);
}

body.lm-ld .learndash-wrapper .ld-progress .ld-progress-percentage {
	color: var(--lm-gold);
}

/* ---------- Alerts / restricted access ---------- */

body.lm-ld .learndash-wrapper .ld-alert {
	border: 1px solid var(--lm-gold-hair);
	border-radius: var(--lm-ld-radius);
	background: var(--lm-ld-surface);
	color: var(--lm-ivory-muted);
}

body.lm-ld .learndash-wrapper .ld-alert .ld-alert-icon {
	background: transparent;
	color: var(--lm-gold);
	border: 1px solid var(--lm-gold-soft);
}

body.lm-ld .learndash-wrapper .ld-alert-warning .ld-button,
body.lm-ld .learndash-wrapper .ld-alert-success .ld-button {
	background: var(--lm-gold);
	color: var(--lm-obsidian);
}

/* ---------- Tabs and lesson content ---------- */

body.lm-ld .learndash-wrapper .ld-tabs .ld-tabs-navigation {
	border-bottom: 1px solid var(--lm-ld-line);
}

body.lm-ld .learndash-wrapper .ld-tabs .ld-tabs-navigation .ld-tab {
	color: var(--lm-ivory-faint);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

body.lm-ld .learndash-wrapper .ld-tabs .ld-tabs-navigation .ld-tab.ld-active {
	color: var(--lm-ivory);
}

body.lm-ld .learndash-wrapper .ld-tabs .ld-tabs-navigation .ld-tab.ld-active:after {
	background: var(--lm-gold);
	height: 1px;
}

body.lm-ld .learndash-wrapper .ld-tabs .ld-tabs-content {
	color: var(--lm-ivory-muted);
	font-size: var(--lm-text-base);
	line-height: 1.75;
}

body.lm-ld .learndash-wrapper .ld-video {
	overflow: hidden;
	border: 1px solid var(--lm-ld-line);
	border-radius: var(--lm-ld-radius);
	background: #000;
}

/* Previous / back / next navigation */
body.lm-ld .learndash-wrapper .ld-content-actions {
	gap: 1rem;
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
	padding: 1.25rem 0 0;
	border-top: 1px solid var(--lm-ld-line);
}

body.lm-ld .learndash-wrapper .ld-content-actions .ld-course-step-back {
	color: var(--lm-gold);
	font-size: var(--lm-text-sm);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---------- Quizzes (legacy WPProQuiz markup) ---------- */

body.lm-ld .wpProQuiz_content {
	color: var(--lm-ivory-muted);
}

body.lm-ld .wpProQuiz_content .wpProQuiz_question_text,
body.lm-ld .wpProQuiz_content h2,
body.lm-ld .wpProQuiz_content h3 {
	color: var(--lm-ivory);
}

body.lm-ld .wpProQuiz_content .wpProQuiz_questionListItem {
	border: 1px solid var(--lm-ld-line);
	border-radius: var(--lm-ld-radius);
	background: var(--lm-ld-surface);
}

body.lm-ld .wpProQuiz_content .wpProQuiz_questionListItem label {
	color: var(--lm-ivory-muted);
}

body.lm-ld .wpProQuiz_content .wpProQuiz_button,
body.lm-ld .wpProQuiz_content .wpProQuiz_button2,
body.lm-ld .wpProQuiz_content input[type="button"].wpProQuiz_button {
	border: 1px solid var(--lm-gold);
	border-radius: var(--lm-ld-radius);
	background: var(--lm-gold);
	color: var(--lm-obsidian);
	font-family: var(--lm-font-body);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-shadow: none;
	box-shadow: none;
}

body.lm-ld .wpProQuiz_content .wpProQuiz_response {
	border: 1px solid var(--lm-ld-line);
	background: var(--lm-ld-surface);
	color: var(--lm-ivory-muted);
}

/* ---------- "Mis Cursos": guest access state ---------- */

.lm-ld-access {
	display: grid;
	gap: var(--lm-space-2);
	justify-items: center;
	max-width: 34rem;
	margin: clamp(1rem, 3vw, 2.5rem) auto clamp(2rem, 5vw, 4rem);
	padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
	border: 1px solid var(--lm-ld-line);
	border-radius: var(--lm-ld-radius);
	background:
		radial-gradient(70% 90% at 50% 0%, rgba(117, 85, 120, 0.25), transparent 70%),
		var(--lm-ld-surface);
	text-align: center;
}

.lm-ld-access__seal {
	width: 56px;
	height: 56px;
	color: var(--lm-gold);
}

.lm-ld-access__title {
	margin: 0;
	color: var(--lm-ivory);
	font-family: var(--lm-font-display);
	font-size: var(--lm-h3, 1.9rem);
	font-weight: 500;
	line-height: 1.1;
	text-transform: none;
}

.lm-ld-access__text {
	margin: 0;
	color: var(--lm-ivory-muted);
	line-height: 1.65;
}

.lm-ld-access__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
	margin-top: 0.5rem;
}

.lm-ld-access--inline {
	margin-top: 0;
}

/* ---------- "Mis Cursos": course cards ---------- */

.lm-ld-courses {
	margin-bottom: var(--lm-section);
}

.lm-ld-courses__head {
	display: grid;
	gap: 0.5rem;
	margin-bottom: var(--lm-head-gap);
}

.lm-ld-courses__title,
.lm-ld-native__title {
	margin: 0;
	color: var(--lm-ivory);
	font-family: var(--lm-font-display);
	font-size: var(--lm-h3, 1.9rem);
	font-weight: 500;
	text-transform: none;
}

body.lm-ld .entry-content .lm-ld-courses__head > *,
body.lm-ld .entry-content .lm-ld-access > * {
	margin: 0;
}

body.lm-ld .entry-content ul.lm-ld-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
	gap: clamp(1rem, 2vw, 1.75rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

body.lm-ld .entry-content .lm-ld-card .lm-ld-card__title a {
	color: var(--lm-ivory);
}

body.lm-ld .entry-content .lm-ld-card .lm-ld-card__title a:hover {
	color: var(--lm-gold);
}

.lm-ld-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--lm-ld-line);
	border-radius: var(--lm-ld-radius);
	background: var(--lm-ld-surface);
	transition: border-color 0.4s var(--lm-ease), transform 0.4s var(--lm-ease);
}

.lm-ld-card:hover {
	border-color: var(--lm-gold-soft);
	transform: translateY(-3px);
}

.lm-ld-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--lm-plum);
	text-decoration: none;
}

.lm-ld-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s var(--lm-ease);
}

.lm-ld-card:hover .lm-ld-card__media img {
	transform: scale(1.04);
}

.lm-ld-card__monogram {
	display: grid;
	place-items: center;
	height: 100%;
	color: var(--lm-gold);
	font-family: var(--lm-font-display);
	font-size: 3.5rem;
	background: radial-gradient(circle at 50% 40%, rgba(197, 164, 109, 0.14), transparent 60%);
}

.lm-ld-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.25rem 1.25rem 1.4rem;
}

.lm-ld-card__status {
	align-self: flex-start;
	padding: 0.25em 0.75em;
	border: 1px solid var(--lm-gold-hair);
	border-radius: 999px;
	color: var(--lm-ivory-faint);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.lm-ld-card.is-in-progress .lm-ld-card__status {
	border-color: var(--lm-gold-soft);
	color: var(--lm-gold);
}

.lm-ld-card.is-completed .lm-ld-card__status {
	border-color: var(--lm-gold);
	background: var(--lm-gold);
	color: var(--lm-obsidian);
}

.lm-ld-card.is-completed .lm-ld-card__media img {
	filter: saturate(0.6);
}

.lm-ld-card__title {
	margin: 0;
	font-family: var(--lm-font-display);
	font-size: 1.45rem;
	font-weight: 500;
	line-height: 1.15;
	text-transform: none;
}

.lm-ld-card__title a {
	color: var(--lm-ivory);
	text-decoration: none;
}

.lm-ld-card__title a:hover {
	color: var(--lm-gold);
}

.lm-ld-bar {
	height: 4px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(243, 235, 221, 0.1);
}

.lm-ld-bar > span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--lm-gold-soft), var(--lm-gold));
}

.lm-ld-card__meta {
	margin: 0.4rem 0 0;
	color: var(--lm-ivory-faint);
	font-size: var(--lm-text-xs);
	letter-spacing: 0.04em;
}

.lm-ld-card__cta {
	align-self: flex-start;
	margin-top: auto;
}

/* Native LearnDash profile below the cards (logged-in) */
.lm-ld-native {
	padding-top: clamp(2rem, 4vw, 3rem);
	border-top: 1px solid var(--lm-ld-line);
}

body.lm-ld .learndash-wrapper .ld-profile-summary {
	color: var(--lm-ivory-muted);
}

body.lm-ld .learndash-wrapper .ld-profile-summary .ld-profile-card .ld-profile-heading {
	color: var(--lm-ivory);
	font-family: var(--lm-font-display);
}

body.lm-ld .learndash-wrapper .ld-profile-summary .ld-profile-stats .ld-profile-stat {
	border-color: var(--lm-ld-line);
}

body.lm-ld .learndash-wrapper .ld-profile-summary .ld-profile-stats .ld-profile-stat strong {
	color: var(--lm-gold);
	font-family: var(--lm-font-display);
}

/* ---------- Responsive ---------- */

@media (max-width: 767px) {
	body.lm-ld .learndash-wrapper .ld-course-status.ld-course-status-not-enrolled {
		padding: 0.5rem 1rem;
	}

	body.lm-ld .learndash-wrapper .ld-content-actions .ld-content-action {
		width: 100%;
	}

	body.lm-ld .learndash-wrapper .ld-content-actions .ld-button {
		justify-content: center;
		width: 100%;
	}

	.lm-ld-access__actions .lm-btn {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lm-ld-card,
	.lm-ld-card__media img {
		transition: none;
	}

	.lm-ld-card:hover {
		transform: none;
	}
}
