/* Formations — student space (/mes-formations). Colours from the theme's :root. */

.jsf-space,
.jsf-cards {
	--jsf-accent: var(--accent, #059669);
	--jsf-accent-strong: var(--accent-strong, #047857);
	--jsf-accent-soft: var(--accent-soft, #e7f6f0);
}

.jsf-space {
	margin-top: calc(-1 * clamp(8px, 3vw, 32px)); /* .site-main already has its own padding */
}

.jsf-space .entry-content > * {
	max-width: none;
}

.jsf-tone--amber {
	--jsf-accent: #c2410c;
	--jsf-accent-strong: #9a3412;
	--jsf-accent-soft: #fff1e8;
}

.jsf-tone--club {
	--jsf-accent: var(--club, #7c3aed);
	--jsf-accent-strong: var(--club-strong, #5b21b6);
	--jsf-accent-soft: var(--club-soft, #f3edff);
}

.jsf-tone--amber .button:not(.button--ghost),
.jsf-tone--club .button:not(.button--ghost) {
	background: var(--jsf-accent);
}

.jsf-tone--amber .button:not(.button--ghost):hover,
.jsf-tone--club .button:not(.button--ghost):hover {
	background: var(--jsf-accent-strong);
}

.jsf-eyebrow {
	margin: 0 0 6px;
	color: var(--jsf-accent);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.jsf-title {
	margin: 0;
	color: var(--heading, #0b1a33);
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem);
	line-height: 1.2;
}

.jsf-subtitle {
	margin: 40px 0 16px;
	font-size: 1.2rem;
}

.jsf-head {
	margin-bottom: 24px;
}

.jsf-crumbs {
	margin: 0 0 16px;
	color: var(--text-muted, #5b6b7f);
	font-size: 0.9rem;
}

.jsf-crumbs a {
	color: inherit;
}

.jsf-card {
	padding: clamp(18px, 3vw, 28px);
	border: 1px solid var(--border, #e3e8ee);
	border-radius: var(--radius, 14px);
	background: var(--surface, #ffffff);
	box-shadow: var(--shadow);
}

.jsf-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 0;
}

.jsf-access-line {
	margin: 12px 0 0;
	color: var(--text-muted, #5b6b7f);
	font-size: 0.88rem;
}

/* ---------- Locked / logged out ---------- */

.jsf-lock {
	max-width: 640px;
}

.jsf-lock__title {
	margin: 0 0 8px;
	color: var(--heading, #0b1a33);
	font-size: 1.25rem;
	font-weight: 700;
}

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

.jsf-progress {
	overflow: hidden;
	height: 8px;
	margin-top: 14px;
	border-radius: 999px;
	background: var(--jsf-accent-soft);
}

.jsf-progress__bar {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--jsf-accent);
	transition: width 0.4s ease;
}

.jsf-progress__label {
	margin: 6px 0 0;
	color: var(--text-muted, #5b6b7f);
	font-size: 0.85rem;
}

/* ---------- My courses ---------- */

.jsf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 20px;
}

.jsf-course-card {
	display: flex;
	overflow: hidden;
	flex-direction: column;
	border: 1px solid var(--border, #e3e8ee);
	border-radius: var(--radius, 14px);
	background: var(--surface, #ffffff);
	box-shadow: var(--shadow);
}

.jsf-course-card__media {
	display: block;
	text-decoration: none;
	aspect-ratio: 16 / 9;
	background: var(--jsf-accent-soft);
}

.jsf-course-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.jsf-course-card__placeholder {
	display: grid;
	height: 100%;
	padding: 20px;
	place-items: center;
	color: var(--jsf-accent-strong);
	font-size: 1.3rem;
	font-weight: 800;
	text-align: center;
}

.jsf-course-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 18px 20px 20px;
}

/* Titles of one or two lines: progress, button and access line stay aligned from card to card. */
.jsf-course-card__body > .jsf-progress {
	margin-top: auto;
}

.jsf-course-card__title {
	margin: 0;
	font-size: 1.15rem;
}

.jsf-course-card__title a {
	color: var(--heading, #0b1a33);
	text-decoration: none;
}

.jsf-course-card__meta {
	margin: 4px 0 14px;
	color: var(--text-muted, #5b6b7f);
	font-size: 0.9rem;
}

.jsf-course-card .button {
	margin-top: 16px;
}

.jsf-other {
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: var(--text, #0f1b2d);
	text-decoration: none;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.jsf-other:hover {
	box-shadow: var(--shadow-hover);
	transform: translateY(-2px);
}

.jsf-other span {
	color: var(--text-muted, #5b6b7f);
	font-size: 0.92rem;
}

.jsf-other .jsf-other__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--jsf-accent);
	font-weight: 650;
}

.jsf-other .icon,
.jsf-course-card .icon {
	width: 1em;
	height: 1em;
}

/* ---------- Course page ---------- */

.jsf-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	gap: clamp(20px, 4vw, 40px);
	align-items: center;
	margin-bottom: 28px;
	padding: clamp(20px, 4vw, 36px);
	border-radius: var(--radius, 14px);
	background: linear-gradient(135deg, var(--jsf-accent-soft), var(--bg, #ffffff) 70%);
	border: 1px solid var(--border, #e3e8ee);
}

.jsf-hero__lead {
	margin: 10px 0 0;
	color: var(--text, #0f1b2d);
	font-size: 1.05rem;
}

.jsf-hero__meta {
	margin: 10px 0 0;
	color: var(--text-muted, #5b6b7f);
	font-weight: 600;
}

.jsf-hero__media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--radius-sm, 8px);
	box-shadow: var(--shadow);
}

.jsf-hero .jsf-progress {
	max-width: 420px;
}

.jsf-intro {
	margin-bottom: 24px;
}

.jsf-modules {
	display: grid;
	gap: 12px;
}

.jsf-module {
	border: 1px solid var(--border, #e3e8ee);
	border-radius: var(--radius, 14px);
	background: var(--surface, #ffffff);
}

.jsf-module > summary {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 20px;
	cursor: pointer;
	list-style: none;
}

.jsf-module > summary::-webkit-details-marker {
	display: none;
}

.jsf-module > summary::after {
	content: "";
	width: 9px;
	height: 9px;
	margin-left: 4px;
	border-right: 2px solid var(--text-muted, #5b6b7f);
	border-bottom: 2px solid var(--text-muted, #5b6b7f);
	transform: rotate(45deg) translateY(-3px);
	transition: transform 0.2s ease;
}

.jsf-module[open] > summary::after {
	transform: rotate(225deg) translateY(-2px);
}

.jsf-module__num {
	display: grid;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 50%;
	background: var(--jsf-accent-soft);
	color: var(--jsf-accent-strong);
	font-weight: 800;
}

.jsf-module__title {
	flex: 1;
	color: var(--heading, #0b1a33);
	font-weight: 700;
}

.jsf-module__count {
	color: var(--text-muted, #5b6b7f);
	font-size: 0.85rem;
	white-space: nowrap;
}

/* ---------- Lesson lists ---------- */

.jsf-lessons {
	margin: 0;
	padding: 0 12px 12px;
	list-style: none;
}

.jsf-lesson > a,
.jsf-lesson > span {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: var(--radius-sm, 8px);
	color: var(--text, #0f1b2d);
	text-decoration: none;
}

.jsf-lesson > a:hover {
	background: var(--bg-soft, #f6f8f7);
}

.jsf-lesson.is-current > a {
	background: var(--jsf-accent-soft);
	color: var(--jsf-accent-strong);
	font-weight: 700;
}

.jsf-lesson.is-locked > span {
	color: var(--text-muted, #5b6b7f);
}

.jsf-lesson__check {
	display: grid;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	place-items: center;
	border: 2px solid var(--border, #e3e8ee);
	border-radius: 50%;
	font-size: 12px;
	line-height: 1;
}

.jsf-lesson.is-done .jsf-lesson__check {
	border-color: var(--jsf-accent);
	background: var(--jsf-accent);
}

.jsf-lesson.is-done .jsf-lesson__check::before {
	content: "✓";
	color: #ffffff;
	font-weight: 800;
}

.jsf-lesson.is-locked .jsf-lesson__check::before {
	content: "🔒";
	font-size: 10px;
}

.jsf-lesson.is-locked .jsf-lesson__check {
	border-color: transparent;
}

.jsf-lesson__title {
	flex: 1;
	min-width: 0;
}

.jsf-lesson__time {
	color: var(--text-muted, #5b6b7f);
	font-size: 0.82rem;
	font-weight: 400;
	white-space: nowrap;
}

.jsf-badge {
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--bg-soft, #f6f8f7);
	color: var(--text-muted, #5b6b7f);
	font-size: 0.72rem;
	font-weight: 700;
	white-space: nowrap;
}

.jsf-badge--free {
	background: var(--jsf-accent-soft);
	color: var(--jsf-accent-strong);
}

.jsf-lessons--compact .jsf-lesson > a,
.jsf-lessons--compact .jsf-lesson > span {
	gap: 10px;
	padding: 8px 10px;
	font-size: 0.9rem;
}

.jsf-lessons--compact .jsf-lesson__check {
	width: 16px;
	height: 16px;
	font-size: 10px;
}

/* ---------- Lesson page ---------- */

.jsf-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 28px;
	align-items: start;
}

.jsf-player {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius, 14px);
	background: #0b1a33;
	box-shadow: var(--shadow);
}

.jsf-player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.jsf-player--empty {
	display: grid;
	padding: 20px;
	place-items: center;
	color: #ffffff;
	text-align: center;
}

.jsf-lesson-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin: 22px 0 8px;
}

.jsf-lesson-head .jsf-title {
	font-size: clamp(1.3rem, 1rem + 1.2vw, 1.8rem);
}

/* "Mark as done": a small pill with a check, filled once the lesson is done. */
.jsf-done {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	padding: 7px 14px 7px 8px;
	border: 1px solid var(--border, #e3e8ee);
	border-radius: 999px;
	background: var(--surface, #ffffff);
	color: var(--heading, #0b1a33);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 650;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.jsf-done:hover {
	border-color: var(--jsf-accent);
	color: var(--jsf-accent-strong);
}

.jsf-done:focus-visible {
	outline: 2px solid var(--jsf-accent);
	outline-offset: 2px;
}

.jsf-done:disabled {
	opacity: 0.6;
	cursor: progress;
}

.jsf-done__check {
	display: grid;
	width: 20px;
	height: 20px;
	place-items: center;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	color: var(--text-muted, #8a97a8);
	transition: inherit;
}

.jsf-done__check svg {
	opacity: 0;
	transition: opacity 0.15s ease;
}

.jsf-done:hover .jsf-done__check {
	color: var(--jsf-accent);
}

.jsf-done:hover .jsf-done__check svg {
	opacity: 0.45;
}

.jsf-done .jsf-done__on,
.jsf-done.is-done .jsf-done__off {
	display: none;
}

.jsf-done.is-done .jsf-done__on {
	display: inline;
}

.jsf-done.is-done {
	border-color: var(--jsf-accent);
	background: var(--jsf-accent-soft);
	color: var(--jsf-accent-strong);
}

.jsf-done.is-done .jsf-done__check {
	border-color: var(--jsf-accent);
	background: var(--jsf-accent);
	color: #ffffff;
}

.jsf-done.is-done .jsf-done__check svg {
	opacity: 1;
}

.jsf-text {
	margin-top: 12px;
}

/* Lesson resources: a light list, one slim row per document. */
.jsf-resources {
	margin-top: 22px;
	padding: 14px;
	border: 1px solid var(--border, #e3e8ee);
	border-radius: var(--radius, 14px);
	background: var(--bg-soft, #f6f8f7);
}

.jsf-resources__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px 4px;
	color: var(--text-muted, #5b6b7f);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.jsf-resources__count {
	display: inline-grid;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	place-items: center;
	border-radius: 999px;
	background: var(--jsf-accent-soft);
	color: var(--jsf-accent-strong);
	font-size: 0.7rem;
	letter-spacing: 0;
}

.jsf-resources ul {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.jsf-resources a {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 100%;
	padding: 7px 10px 7px 7px;
	border: 1px solid var(--border, #e3e8ee);
	border-radius: 10px;
	background: var(--surface, #ffffff);
	color: var(--heading, #0b1a33);
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jsf-resources a:hover {
	border-color: var(--jsf-accent);
	box-shadow: 0 2px 8px rgba(15, 27, 45, 0.06);
}

.jsf-resources__icon {
	display: grid;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	place-items: center;
	border-radius: 8px;
	background: var(--jsf-accent-soft);
	color: var(--jsf-accent);
}

.jsf-resources__icon .icon {
	width: 15px;
	height: 15px;
}

.jsf-resources__label {
	flex: 1;
	min-width: 0;
}

.jsf-resources__ext {
	flex: 0 0 auto;
	padding: 2px 6px;
	border-radius: 6px;
	background: var(--bg-soft, #f2f5f4);
	color: var(--text-muted, #5b6b7f);
	font-size: 0.66rem;
	font-weight: 800;
	letter-spacing: 0.04em;
}

/* Previous / next lesson, with an arrow in a round badge. */
.jsf-pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 26px;
}

.jsf-pager a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--border, #e3e8ee);
	border-radius: var(--radius, 14px);
	background: var(--surface, #ffffff);
	color: var(--heading, #0b1a33);
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.jsf-pager a:hover {
	border-color: var(--jsf-accent);
	box-shadow: 0 4px 14px rgba(15, 27, 45, 0.07);
}

.jsf-pager__text {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.jsf-pager small {
	color: var(--text-muted, #5b6b7f);
	font-size: 0.75rem;
	font-weight: 600;
}

.jsf-pager__label {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
}

.jsf-pager__arrow {
	display: grid;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 50%;
	background: var(--bg-soft, #f2f5f4);
	color: var(--heading, #0b1a33);
	transition: transform 0.2s ease, background-color 0.15s ease, color 0.15s ease;
}

.jsf-pager__arrow .icon {
	width: 16px;
	height: 16px;
}

.jsf-pager__prev .jsf-pager__arrow .icon {
	transform: scaleX(-1);
}

.jsf-pager__prev:hover .jsf-pager__arrow {
	transform: translateX(-3px);
}

.jsf-pager__next {
	text-align: right;
	border-color: transparent !important;
	background: var(--jsf-accent-soft) !important;
}

.jsf-pager__next small {
	color: var(--jsf-accent-strong);
}

.jsf-pager__next .jsf-pager__arrow {
	background: var(--jsf-accent);
	color: #ffffff;
}

.jsf-pager__next:hover .jsf-pager__arrow {
	transform: translateX(3px);
}

.jsf-side {
	position: sticky;
	top: calc(var(--header-h, 72px) + 16px);
}

.jsf-side__box {
	overflow: auto;
	max-height: calc(100vh - var(--header-h, 72px) - 40px);
	padding: 16px;
	border: 1px solid var(--border, #e3e8ee);
	border-radius: var(--radius, 14px);
	background: var(--surface, #ffffff);
	box-shadow: var(--shadow);
}

.jsf-side__box > summary {
	cursor: pointer;
	list-style: none;
}

.jsf-side__box > summary::-webkit-details-marker {
	display: none;
}

.jsf-side__title {
	color: var(--heading, #0b1a33);
	font-weight: 800;
}

.jsf-side__module {
	margin-top: 10px;
}

.jsf-side__module > summary {
	padding: 8px 4px;
	color: var(--heading, #0b1a33);
	font-size: 0.92rem;
	font-weight: 700;
	cursor: pointer;
}

.jsf-side__module .jsf-lessons {
	padding: 0;
}

@media (max-width: 960px) {
	.jsf-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.jsf-side {
		position: static;
	}

	.jsf-side__box {
		max-height: none;
	}
}

@media (max-width: 760px) {
	.jsf-hero {
		grid-template-columns: minmax(0, 1fr);
	}

	.jsf-hero__media {
		order: -1;
	}

	.jsf-module > summary {
		gap: 10px;
		padding: 14px 14px;
	}

	.jsf-module__count {
		display: none;
	}

	.jsf-lessons {
		padding: 0 6px 8px;
	}

	.jsf-pager {
		grid-template-columns: minmax(0, 1fr);
	}

	.jsf-lesson-head .jsf-done {
		margin-top: 0;
	}
}
