/**
 * Shared shell: CSS variables, layout (sidebar + main), nav, and base
 * card/button/typography styles used by both the Dashboard, Curriculum,
 * Saved Lessons, My Notes, and Institute Library.
 * Everything is scoped under .tri-sp-dashboard / .tri-sp-curriculum /
 * .tri-sp-saved-lessons / .tri-sp-my-notes / .tri-sp-institute-library /
 * .tri-sp-student-nav — nothing here touches body, LearnDash's own markup,
 * theme files, or Elementor-generated CSS (see docs/update-safety.md).
 *
 * Colour/font/radius values below are the site's own real design tokens —
 * extracted from the live Trama theme + Elementor Global Kit, not invented.
 * See docs/theme-design-reference.md for the exact source of every value
 * (Chunk 5, Part A).
 */

.tri-sp-dashboard,
.tri-sp-curriculum,
.tri-sp-saved-lessons,
.tri-sp-my-notes,
.tri-sp-institute-library,
.tri-sp-live-lectures,
.tri-sp-supervision,
.tri-sp-calendar,
.tri-sp-discussions,
.tri-sp-messages,
.tri-sp-account {
	/* Elementor Global Kit system colours (post 47604): accent, primary,
	   secondary, text — same variables trama/style.css's own
	   .elementor-47125 dark-dashboard block references. */
	--tri-sp-bg: #03090b;
	--tri-sp-sidebar-bg: #060d0f;
	--tri-sp-card-bg: #0e1416;
	--tri-sp-card-bg-translucent: rgba(3, 9, 11, 0.52);
	--tri-sp-border: rgba(202, 150, 79, 0.28);
	--tri-sp-border-hover: rgba(202, 150, 79, 0.65);
	--tri-sp-gold: #ca964f;
	--tri-sp-gold-strong: #ca964f;
	--tri-sp-text: #f0e6d3;
	--tri-sp-text-muted: #beb4a6;
	--tri-sp-focus: #6ea8fe;
	--tri-sp-card-radius: 10px;
	--tri-sp-card-radius-sm: 8px;
	--tri-sp-button-radius: 3px;
	--tri-sp-font-heading: Georgia, "Times New Roman", serif;
	--tri-sp-font-body: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;

	display: flex;
	align-items: flex-start;
	background: var(--tri-sp-bg);
	color: var(--tri-sp-text-muted);
	font-family: var(--tri-sp-font-body);
	line-height: 1.5;
	min-height: 100vh;
	width: 100%;
	max-width: 100%;
	position: relative;
	overflow-x: hidden;
}

.tri-sp-dashboard::before,
.tri-sp-curriculum::before,
.tri-sp-saved-lessons::before,
.tri-sp-my-notes::before,
.tri-sp-institute-library::before,
.tri-sp-live-lectures::before,
.tri-sp-supervision::before,
.tri-sp-calendar::before,
.tri-sp-discussions::before,
.tri-sp-messages::before,
.tri-sp-account::before {
	content: "";
	position: absolute;
	top: -10%;
	right: -10%;
	width: 640px;
	height: 640px;
	background: radial-gradient(circle, rgba(201, 151, 74, 0.16) 0%, rgba(201, 151, 74, 0) 70%);
	pointer-events: none;
	z-index: 0;
}

.tri-sp-dashboard *,
.tri-sp-curriculum *,
.tri-sp-saved-lessons *,
.tri-sp-my-notes *,
.tri-sp-institute-library *,
.tri-sp-live-lectures *,
.tri-sp-supervision *,
.tri-sp-calendar *,
.tri-sp-discussions *,
.tri-sp-messages *,
.tri-sp-account * {
	box-sizing: border-box;
}

.tri-sp-dashboard a,
.tri-sp-curriculum a,
.tri-sp-saved-lessons a,
.tri-sp-my-notes a,
.tri-sp-institute-library a,
.tri-sp-live-lectures a,
.tri-sp-supervision a,
.tri-sp-calendar a,
.tri-sp-discussions a,
.tri-sp-messages a,
.tri-sp-account a {
	color: inherit;
	text-decoration: none;
}

.tri-sp-dashboard *:focus-visible,
.tri-sp-curriculum *:focus-visible,
.tri-sp-saved-lessons *:focus-visible,
.tri-sp-my-notes *:focus-visible,
.tri-sp-institute-library *:focus-visible,
.tri-sp-live-lectures *:focus-visible,
.tri-sp-supervision *:focus-visible,
.tri-sp-calendar *:focus-visible,
.tri-sp-discussions *:focus-visible,
.tri-sp-messages *:focus-visible,
.tri-sp-account *:focus-visible {
	outline: 2px solid var(--tri-sp-focus);
	outline-offset: 2px;
}

/* Gate states (logged out / not enrolled) render without the shell. */
.tri-sp-dashboard--gate,
.tri-sp-curriculum--gate,
.tri-sp-saved-lessons--gate,
.tri-sp-my-notes--gate,
.tri-sp-institute-library--gate,
.tri-sp-live-lectures--gate,
.tri-sp-supervision--gate,
.tri-sp-calendar--gate,
.tri-sp-discussions--gate,
.tri-sp-messages--gate,
.tri-sp-account--gate {
	display: block;
	max-width: 640px;
	margin: 0 auto;
	padding: 60px 24px;
	text-align: center;
}

/* --- Sidebar navigation --- */

.tri-sp-student-nav {
	flex: 0 0 230px;
	background: var(--tri-sp-sidebar-bg);
	min-height: 100vh;
	padding: 32px 16px;
	position: relative;
	z-index: 1;
}

.tri-sp-student-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tri-sp-student-nav__item--logout {
	margin-top: 24px;
}

.tri-sp-student-nav__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 14px;
	border-radius: 8px;
	font-size: 14px;
	color: var(--tri-sp-text-muted);
}

.tri-sp-student-nav__link.is-disabled {
	opacity: 0.45;
	cursor: default;
}

.tri-sp-student-nav__link:not(.is-disabled):hover {
	background: rgba(255, 255, 255, 0.04);
	color: var(--tri-sp-text);
}

.tri-sp-student-nav__link.is-active {
	background: var(--tri-sp-gold);
	color: #1a1206;
	font-weight: 600;
}

.tri-sp-student-nav__icon {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	opacity: 0.9;
}

/* --- Shared page main/header --- */

.tri-sp-dashboard__main,
.tri-sp-curriculum__main,
.tri-sp-saved-lessons__main,
.tri-sp-my-notes__main,
.tri-sp-institute-library__main,
.tri-sp-live-lectures__main,
.tri-sp-supervision__main,
.tri-sp-calendar__main,
.tri-sp-discussions__main,
.tri-sp-messages__main,
.tri-sp-account__main {
	flex: 1 1 auto;
	padding: 44px 48px;
	position: relative;
	z-index: 1;
	min-width: 0;
	max-width: 100%;
	overflow-x: hidden;
}

.tri-sp-dashboard__title,
.tri-sp-curriculum__title {
	font-family: var(--tri-sp-font-heading);
	color: var(--tri-sp-text);
	font-size: 40px;
	font-weight: 400;
	margin: 0 0 12px;
}

.tri-sp-dashboard__subtitle,
.tri-sp-curriculum__subtitle {
	color: var(--tri-sp-text-muted);
	margin: 0 0 32px;
	max-width: 640px;
}

/* --- Shared card --- */

.tri-sp-card {
	background: var(--tri-sp-card-bg);
	border: 1px solid var(--tri-sp-border);
	border-radius: var(--tri-sp-card-radius);
	padding: 24px;
	transition: border-color 0.25s ease;
}

.tri-sp-card:hover {
	border-color: var(--tri-sp-border-hover);
}

.tri-sp-card__title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tri-sp-gold-strong);
	margin: 0 0 16px;
}

.tri-sp-empty-state {
	color: var(--tri-sp-text-muted);
	font-size: 14px;
	margin: 0;
}

.tri-sp-link {
	color: var(--tri-sp-gold-strong);
	font-size: 13px;
	font-weight: 600;
}

.tri-sp-link:hover {
	text-decoration: underline;
}

.tri-sp-button {
	display: inline-block;
	background: var(--tri-sp-gold);
	border: 1px solid var(--tri-sp-gold);
	color: #1a1206;
	font-family: var(--tri-sp-font-body);
	font-weight: 600;
	padding: 6px 20px;
	border-radius: var(--tri-sp-button-radius);
	text-transform: capitalize;
}

/*
 * Chunk 6.6 — since restoring the theme's normal header/footer (Chunk 6.5),
 * Elementor's Global Kit CSS (`.elementor-kit-47604 button, ...`, printed
 * site-wide whenever Elementor is active, matched by real specificity
 * (0,1,1)) now wins over the bare `.tri-sp-button` rule above (0,1,0)
 * whenever `.tri-sp-button` sits on a real <button> element (My Notes'
 * Save/Update/Filter, Institute Library's Filter) — never on the <a
 * class="tri-sp-button"> links most of the app uses instead, which
 * Elementor's selector doesn't match at all. Re-declared here at (0,2,1),
 * using only the real TRI page-root class every such <button> already sits
 * inside — no !important needed. See
 * docs/reviews/chunk-6-6-login-and-theme-css-regression.md.
 */
.tri-sp-dashboard button.tri-sp-button,
.tri-sp-curriculum button.tri-sp-button,
.tri-sp-saved-lessons button.tri-sp-button,
.tri-sp-my-notes button.tri-sp-button,
.tri-sp-institute-library button.tri-sp-button,
.tri-sp-live-lectures button.tri-sp-button,
.tri-sp-supervision button.tri-sp-button,
.tri-sp-calendar button.tri-sp-button,
.tri-sp-discussions button.tri-sp-button,
.tri-sp-messages button.tri-sp-button,
.tri-sp-account button.tri-sp-button {
	background: var(--tri-sp-gold);
	color: #1a1206;
	padding: 14px 20px;
}

/* --- Shared Lesson row (Curriculum + Saved Lessons, Chunk 5) --- */

.tri-sp-lesson-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tri-sp-lesson-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.tri-sp-lesson-row__link {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
	padding: 8px 4px;
	font-size: 13px;
	color: var(--tri-sp-text-muted);
	border-radius: 6px;
}

.tri-sp-lesson-row__link:hover {
	background: rgba(255, 255, 255, 0.03);
	color: var(--tri-sp-text);
}

.tri-sp-lesson-row__state {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1.5px solid var(--tri-sp-text-muted);
}

.tri-sp-lesson-row.is-completed .tri-sp-lesson-row__state {
	background: var(--tri-sp-gold);
	border-color: var(--tri-sp-gold);
}

.tri-sp-lesson-row.is-completed .tri-sp-lesson-row__link {
	color: var(--tri-sp-text);
}

.tri-sp-lesson-row.is-locked .tri-sp-lesson-row__state {
	border-style: dashed;
	opacity: 0.6;
}

.tri-sp-lesson-row.is-locked .tri-sp-lesson-row__link {
	opacity: 0.6;
}

.tri-sp-lesson-row__number {
	flex: 0 0 auto;
	color: var(--tri-sp-text-muted);
	font-variant-numeric: tabular-nums;
}

.tri-sp-lesson-row__title {
	flex: 1 1 auto;
	min-width: 0;
}

.tri-sp-lesson-row__context {
	display: block;
	color: var(--tri-sp-text-muted);
	font-size: 11px;
	font-weight: 400;
}

.tri-sp-lesson-row__duration {
	flex: 0 0 auto;
	color: var(--tri-sp-text-muted);
	font-size: 12px;
}

/* --- Save/Unsave toggle button (Chunk 5) — a plain <a>, not a <form>; see
   templates/partials/save-toggle.php for why. --- */

.tri-sp-save-toggle__button {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: transparent;
	border: 1px solid var(--tri-sp-border);
	border-radius: 50%;
	color: var(--tri-sp-text-muted);
	cursor: pointer;
	text-decoration: none;
	font-size: 14px;
	line-height: 1;
}

.tri-sp-save-toggle__button:hover {
	border-color: var(--tri-sp-border-hover);
	color: var(--tri-sp-gold);
}

.tri-sp-save-toggle__button.is-saved {
	background: var(--tri-sp-gold);
	border-color: var(--tri-sp-gold);
	color: #1a1206;
}

.tri-sp-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	padding: 0;
	margin: -1px;
}

/* --- Progress bar / ring, shared by Dashboard cards --- */

.tri-sp-progress-bar {
	background: rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	height: 6px;
	margin: 16px 0;
	overflow: hidden;
}

.tri-sp-progress-bar__fill {
	display: block;
	height: 100%;
	background: var(--tri-sp-gold);
	border-radius: 999px;
}

.tri-sp-progress-ring {
	--size: 120px;
	width: var(--size);
	height: var(--size);
	border-radius: 50%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: conic-gradient(var(--tri-sp-gold) calc(var(--tri-sp-progress, 0) * 1%), rgba(255, 255, 255, 0.08) 0);
	flex: 0 0 auto;
}

.tri-sp-progress-ring::before {
	content: "";
	position: absolute;
}

.tri-sp-progress-ring__value {
	font-size: 22px;
	font-weight: 700;
}

.tri-sp-progress-ring__label {
	font-size: 11px;
	color: var(--tri-sp-text-muted);
	max-width: 80px;
}

@media (max-width: 768px) {
	.tri-sp-dashboard,
	.tri-sp-curriculum,
	.tri-sp-saved-lessons,
	.tri-sp-my-notes,
	.tri-sp-institute-library,
	.tri-sp-live-lectures,
	.tri-sp-supervision,
	.tri-sp-calendar,
	.tri-sp-discussions,
	.tri-sp-messages,
	.tri-sp-account {
		flex-direction: column;
	}

	.tri-sp-student-nav {
		flex: none;
		width: 100%;
		max-width: 100%;
		min-height: 0;
		min-width: 0;
		padding: 12px;
		box-sizing: border-box;
	}

	.tri-sp-student-nav__list {
		flex-direction: row;
		flex-wrap: wrap;
		min-width: 0;
	}

	.tri-sp-student-nav__item {
		min-width: 0;
	}

	/* Icon-only at narrow widths — the label stays in the accessibility
	   tree (same clip technique as .tri-sp-visually-hidden) rather than
	   `display: none`, which would remove it for screen readers too. */
	.tri-sp-student-nav__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
		padding: 0;
		margin: -1px;
	}

	.tri-sp-student-nav__item--logout {
		margin-top: 0;
	}

	.tri-sp-dashboard__main,
	.tri-sp-curriculum__main,
	.tri-sp-saved-lessons__main,
	.tri-sp-my-notes__main,
	.tri-sp-institute-library__main,
	.tri-sp-live-lectures__main,
	.tri-sp-supervision__main,
	.tri-sp-calendar__main {
		padding: 24px 16px;
	}

	.tri-sp-dashboard__title,
	.tri-sp-curriculum__title,
	.tri-sp-saved-lessons__title,
	.tri-sp-my-notes__title,
	.tri-sp-institute-library__title,
	.tri-sp-live-lectures__title,
	.tri-sp-supervision__title,
	.tri-sp-calendar__title {
		font-size: 28px;
	}
}

/* Native bbPress URLs (BBPressIntegration) render through the theme's own
   page.php, which prints its own .entry-title (e.g. "Forums", a topic
   title) — theme furniture the TRI shell doesn't need alongside bbPress's
   own content. Scoped to body.bbpress only, so no other page's title is
   affected. */
body.bbpress .entry-title {
	display: none;
}

/* The theme's "Edit" affordance (`edit_post_link()` in
   template-parts/content-page.php's .entry-footer).

   Support\StudentPageShell already filters the anchor away on TRI student
   pages, but WordPress applies the `edit_post_link` filter to the <a> only
   and echoes the theme's own `$before`/`$after` around the result — so an
   empty `<span class="edit-link"></span>` and its `.entry-footer` wrapper
   still ship. This clears both, and also covers routes the PHP filter does
   not reach (bbPress topic/forum pages, WooCommerce account screens), which
   render through the same template part but are not TRI "pages".

   Deliberately unscoped: this stylesheet is only ever enqueued on TRI
   student pages, bbPress pages and WooCommerce account screens, so the rule
   cannot reach the site's marketing pages, where the Edit link stays
   available to administrators. */
.edit-link,
.entry-footer:empty {
	display: none;
}
