/*
 * Free Courses: visitor pages.
 *
 * Mobile-first (D-017). Logical properties only (inline-start/end), so RTL
 * and LTR both work. Fonts are inherited from the theme (Publisher);
 * headings use Publisher's .heading-typo class in the markup.
 * Colors come from --frc-accent, set inline from the theme color.
 */

/*
 * Type scale base (D-065). Publisher sets html { font-size: 10px }, so plain
 * rem made every size 37.5% smaller. --frc-rem is 16px on such themes and
 * still follows a larger browser font setting (max).
 */
:root {
	--frc-rem: max(1rem, 16px);
}

.frc {
	--frc-accent: #1e73be;
	--frc-on-accent: #fff;
	--frc-accent-soft: color-mix(in srgb, var(--frc-accent) 10%, transparent);
	--frc-text: #1d2327;
	--frc-muted: #5f6b76;
	--frc-border: #e2e6ea;
	--frc-surface: #fff;
	--frc-soft: #f6f7f9;
	--frc-radius: 12px;
	--frc-space: clamp(16px, 3vw, 28px);

	color: var(--frc-text);
	margin-block: 0 var(--frc-space);
}

.frc *,
.frc *::before,
.frc *::after {
	box-sizing: border-box;
}

.frc img {
	max-width: 100%;
	height: auto;
}

.frc a:focus-visible,
.frc button:focus-visible,
.frc summary:focus-visible {
	outline: 3px solid var(--frc-accent);
	outline-offset: 2px;
}

/* ---------- Breadcrumb ---------- */

.frc-breadcrumb {
	margin-block: 16px 8px;
	font-size: calc(0.875 * var(--frc-rem));
	color: var(--frc-muted, #5f6b76);
}

.frc-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.frc-breadcrumb li {
	display: inline-flex;
	align-items: center;
	min-width: 0;
}

.frc-breadcrumb li + li::before {
	content: "/";
	margin-inline: 8px;
	opacity: 0.5;
}

.frc-breadcrumb a {
	color: inherit;
	text-decoration: none;
}

.frc-breadcrumb a:hover {
	color: var(--frc-accent, #1e73be);
	text-decoration: underline;
}

.frc-breadcrumb [aria-current] {
	overflow: hidden;
	max-width: 60vw;
	color: #1d2327;
	text-overflow: ellipsis;
	white-space: nowrap;
}

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

.frc-page-title,
.frc-section-title {
	margin: 0 0 16px;
	line-height: 1.35;
}

.frc-page-title {
	font-size: clamp(calc(1.6 * var(--frc-rem)), calc(1.2 * var(--frc-rem)) + 1.6vw, calc(2.25 * var(--frc-rem)));
}

.frc-section-title {
	font-size: clamp(calc(1.2 * var(--frc-rem)), calc(1.05 * var(--frc-rem)) + 0.6vw, calc(1.45 * var(--frc-rem)));
}

.frc-section {
	margin-block-start: var(--frc-space);
}

.frc-empty {
	padding: 20px;
	border: 1px dashed var(--frc-border);
	border-radius: var(--frc-radius);
	background: var(--frc-soft);
	color: var(--frc-muted);
	text-align: center;
}

.frc-content {
	line-height: 1.85;
	overflow-wrap: anywhere;
}

.frc-content > :first-child {
	margin-top: 0;
}

/* Buttons: 44px minimum touch target. */
.frc .frc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 20px;
	border: 2px solid transparent;
	border-radius: 10px;
	font: inherit;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.frc .frc-btn:hover {
	text-decoration: none;
}

.frc .frc-btn:active {
	transform: translateY(1px);
}

.frc .frc-btn--primary,
.frc .frc-btn--primary:visited {
	background: var(--frc-accent);
	color: var(--frc-on-accent);
}

.frc .frc-btn--primary:hover,
.frc .frc-btn--primary:focus {
	background: color-mix(in srgb, var(--frc-accent) 85%, #000);
	color: var(--frc-on-accent);
}

.frc .frc-btn--ghost,
.frc .frc-btn--ghost:visited {
	border-color: var(--frc-border);
	background: var(--frc-surface);
	color: var(--frc-text);
}

.frc .frc-btn--ghost:hover,
.frc .frc-btn--ghost:focus {
	border-color: var(--frc-accent);
	color: var(--frc-accent);
}

.frc .frc-btn--large {
	min-height: 52px;
	padding-inline: 28px;
	font-size: calc(1.05 * var(--frc-rem));
}

/* Share button icon (drawn with currentColor). */
.frc .frc-share {
	padding-inline: 14px;
}

.frc .frc-share__icon {
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 16.1c-.8 0-1.4.3-2 .8l-7.1-4.2c.1-.2.1-.5.1-.7s0-.5-.1-.7L16 7.2c.5.5 1.2.8 2 .8 1.7 0 3-1.3 3-3s-1.3-3-3-3-3 1.3-3 3c0 .2 0 .5.1.7L8 9.8C7.5 9.3 6.8 9 6 9c-1.7 0-3 1.3-3 3s1.3 3 3 3c.8 0 1.5-.3 2-.8l7.1 4.2c-.1.2-.1.4-.1.6 0 1.6 1.3 2.9 2.9 2.9s2.9-1.3 2.9-2.9-1.2-2.9-2.8-2.9z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 16.1c-.8 0-1.4.3-2 .8l-7.1-4.2c.1-.2.1-.5.1-.7s0-.5-.1-.7L16 7.2c.5.5 1.2.8 2 .8 1.7 0 3-1.3 3-3s-1.3-3-3-3-3 1.3-3 3c0 .2 0 .5.1.7L8 9.8C7.5 9.3 6.8 9 6 9c-1.7 0-3 1.3-3 3s1.3 3 3 3c.8 0 1.5-.3 2-.8l7.1 4.2c-.1.2-.1.4-.1.6 0 1.6 1.3 2.9 2.9 2.9s2.9-1.3 2.9-2.9-1.2-2.9-2.8-2.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.frc .frc-share.is-copied {
	border-color: #00a32a;
	color: #00a32a;
}

/* ---------- Archive: course cards ---------- */

.frc-page-header {
	margin-block-end: var(--frc-space);
}

.frc-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: var(--frc-space);
}

.frc-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--frc-border);
	border-radius: var(--frc-radius);
	background: var(--frc-surface);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.frc-card:hover {
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.frc-card__media {
	display: block;
	aspect-ratio: 16 / 9;
	background: var(--frc-soft);
}

.frc-card__image,
.frc-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.frc-card__placeholder {
	background: linear-gradient(135deg, var(--frc-accent-soft), var(--frc-soft));
}

.frc-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
}

.frc-card__title {
	margin: 0;
	font-size: calc(1.2 * var(--frc-rem));
	line-height: 1.4;
}

.frc-card__title a {
	color: inherit;
	text-decoration: none;
}

.frc-card__title a:hover {
	color: var(--frc-accent);
}

.frc-card__excerpt,
.frc-card__meta {
	margin: 0;
	color: var(--frc-muted);
}

.frc-card__meta {
	font-size: calc(0.9 * var(--frc-rem));
}

.frc-card .frc-btn {
	align-self: flex-start;
	margin-block-start: auto;
}

/* One course only (D-026): a wide card, so the page never looks empty. */
@media (min-width: 768px) {
	.frc-cards--single {
		grid-template-columns: 1fr;
	}

	.frc-cards--single .frc-card {
		flex-direction: row;
	}

	.frc-cards--single .frc-card__media {
		flex: 0 0 48%;
		aspect-ratio: auto;
		min-height: 280px;
	}

	.frc-cards--single .frc-card__body {
		justify-content: center;
		padding: clamp(20px, 3vw, 40px);
	}

	.frc-cards--single .frc-card__title {
		font-size: clamp(calc(1.4 * var(--frc-rem)), calc(1.1 * var(--frc-rem)) + 1vw, calc(1.9 * var(--frc-rem)));
	}
}

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

.frc-hero {
	display: grid;
	gap: var(--frc-space);
	align-items: center;
	padding: var(--frc-space);
	border-radius: calc(var(--frc-radius) + 4px);
	background: var(--frc-soft);
}

.frc-hero__media {
	overflow: hidden;
	border-radius: var(--frc-radius);
	aspect-ratio: 16 / 9;
}

.frc-hero__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.frc-hero__title {
	margin: 0 0 12px;
	font-size: clamp(calc(1.6 * var(--frc-rem)), calc(1.2 * var(--frc-rem)) + 1.8vw, calc(2.4 * var(--frc-rem)));
	line-height: 1.3;
}

.frc-hero__excerpt {
	margin: 0 0 12px;
	font-size: calc(1.05 * var(--frc-rem));
	line-height: 1.8;
}

.frc-hero__meta {
	margin: 0 0 20px;
	color: var(--frc-muted);
}

.frc-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

@media (min-width: 768px) {
	.frc-hero {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	}

	.frc-hero--no-image {
		grid-template-columns: 1fr;
	}
}

/* ---------- Lesson list (course page + lesson sidebar) ---------- */

.frc-lesson-list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.frc-lesson-list__item {
	margin: 0;
	border-block-end: 1px solid var(--frc-border);
}

.frc-lesson-list__item:last-child {
	border-block-end: 0;
}

.frc-lesson-list__item a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 52px;
	padding: 10px 12px;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.frc-lesson-list__item a:hover {
	background: var(--frc-soft);
}

.frc-lesson-list__num {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--frc-soft);
	color: var(--frc-muted);
	font-size: calc(0.9 * var(--frc-rem));
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.frc-lesson-list__title {
	flex: 1;
	min-width: 0;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

/* Progress (phase 6): a done lesson shows a green ✓ instead of its number. */
.frc-lesson-list__item.is-done .frc-lesson-list__num {
	position: relative;
	background: #00a32a;
	color: transparent;
}

.frc-lesson-list__item.is-done .frc-lesson-list__num::after {
	content: "✓";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: calc(1 * var(--frc-rem));
}

.frc-lesson-list__state:empty {
	display: none;
}

.frc-lesson-list__item.is-retry .frc-lesson-list__state {
	flex: 0 0 auto;
	padding: 0 8px;
	border-radius: 10px;
	background: #fcf0c3;
	color: #6e4e00;
	font-size: calc(0.8125 * var(--frc-rem)); /* 13px: smallest size we use (D-065). */
	font-weight: 700;
	line-height: 22px;
}

.frc-outline-group__progress {
	color: #008a20;
	font-weight: 700;
}

/* Progress bar (course page + archive cards) */
.frc-progress {
	margin: 0 0 18px;
}

.frc-progress[hidden],
.frc-progress__done[hidden],
.frc-reset-wrap[hidden],
.frc-mark[hidden] {
	display: none;
}

.frc-progress__bar {
	overflow: hidden;
	height: 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--frc-accent) 15%, #e2e6ea);
}

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

.frc-progress__text {
	margin: 6px 0 0;
	color: var(--frc-muted);
	font-size: calc(0.9 * var(--frc-rem));
}

.frc .frc-progress__done {
	margin: 8px 0 0;
	color: #008a20;
	font-size: calc(1.1 * var(--frc-rem));
	font-weight: 700;
}

.frc-progress--small {
	margin: 0;
}

.frc-progress--small .frc-progress__bar {
	height: 6px;
}

.frc-progress--small .frc-progress__text {
	font-size: calc(0.85 * var(--frc-rem));
}

/* "Clear my progress" */
.frc-reset-wrap {
	margin: 14px 0 0;
	text-align: end;
}

.frc .frc-reset {
	min-height: 44px;
	padding: 0 4px;
	border: 0;
	background: none;
	color: var(--frc-muted);
	font: inherit;
	font-size: calc(0.85 * var(--frc-rem));
	text-decoration: underline;
	cursor: pointer;
}

.frc .frc-reset:hover {
	color: #b32d2e;
}

/* Lesson header tools: "Mark as complete" + Share */
.frc-lesson__tools {
	display: inline-flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 8px;
}

.frc .frc-mark {
	padding-inline: 14px;
	font-size: calc(0.9 * var(--frc-rem));
}

.frc .frc-mark.is-done {
	border-color: #00a32a;
	background: #edfaef;
	color: #00752a;
}

/* Quiz start card: best score */
.frc-quiz__best {
	margin: -6px 0 16px;
	color: var(--frc-muted);
	font-weight: 700;
}

.frc-quiz__best.is-passed {
	color: #008a20;
}

.frc-lesson-list__item.is-current a {
	background: var(--frc-accent-soft);
	font-weight: 700;
}

.frc-lesson-list__item.is-current .frc-lesson-list__num {
	background: var(--frc-accent);
	color: var(--frc-on-accent);
}

/* Sections (D-042) */
.frc-outline-groups {
	display: grid;
	gap: 16px;
}

.frc-course .frc-outline-group {
	overflow: hidden;
	border: 1px solid var(--frc-border);
	border-radius: var(--frc-radius);
	background: var(--frc-surface);
}

/* Section header: a <summary> row that opens and closes the section (D-064). */
.frc-outline-group__title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	min-height: 48px;
	margin: 0;
	padding: 12px 14px;
	border-block-end: 1px solid var(--frc-border);
	background: var(--frc-soft);
	font-size: calc(1 * var(--frc-rem));
	line-height: 1.5;
	cursor: pointer;
	list-style: none;
}

.frc-outline-group__title::-webkit-details-marker {
	display: none;
}

.frc-outline-group:not([open]) > .frc-outline-group__title {
	border-block-end: 0;
}

.frc-outline-group__title:hover {
	background: var(--frc-border);
}

.frc-outline-group__name {
	flex: 1 1 12em;
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: inherit;
	font-weight: 700;
	line-height: inherit;
}

.frc-outline-group__count {
	color: var(--frc-muted);
	font-size: calc(0.85 * var(--frc-rem));
	font-weight: 400;
}

/* Chevron: physical sides on purpose, a down-chevron must point down in RTL too. */
.frc-outline-group__title::after {
	content: "";
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	margin-inline-start: 4px;
	border-bottom: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.2s ease;
}

.frc-outline-group[open] > .frc-outline-group__title::after {
	transform: translateY(2px) rotate(-135deg);
}

/* In the lesson sidebar, sections are lighter: just a heading row. */
.frc-outline .frc-outline-groups {
	gap: 0;
}

.frc-outline .frc-outline-group + .frc-outline-group {
	border-block-start: 1px solid var(--frc-border);
}

.frc-outline .frc-outline-group__title {
	padding: 10px 12px;
	font-size: calc(0.9 * var(--frc-rem));
}

/* Lesson type icon: play for video lessons, pencil for "Check your understanding",
   nothing for text-only lessons. */
.frc-lesson-list__item:not(.is-video):not(.is-quiz) .frc-lesson-list__type {
	display: none;
}

.frc-lesson-list__type {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background-color: var(--frc-muted);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.frc-lesson-list__item.is-quiz .frc-lesson-list__type {
	background-color: var(--frc-accent);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E");
}

.frc-lesson__section {
	color: var(--frc-text);
	font-weight: 700;
}

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

/*
 * Grid areas (D-028). Spacing uses margins, not grid gap, so an area with
 * nothing in it (e.g. a lesson without a video) leaves no empty space.
 */
.frc-lesson__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"player"
		"header"
		"outline"
		"body"
		"nav";
}

.frc-lesson__player { grid-area: player; }
.frc-lesson__header { grid-area: header; }
.frc-lesson__outline { grid-area: outline; }
.frc-lesson__body { grid-area: body; }
.frc-lesson__nav { grid-area: nav; }

.frc-lesson__player:empty {
	display: none;
}

.frc-lesson__player,
.frc-lesson__header,
.frc-lesson__outline,
.frc-lesson__body {
	margin-block-end: 20px;
}

.frc-lesson__eyebrow {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 6px;
	color: var(--frc-muted);
	font-size: calc(0.9 * var(--frc-rem));
}

.frc-lesson__eyebrow a {
	color: var(--frc-accent);
	text-decoration: none;
}

.frc-lesson__title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.frc-lesson__title {
	margin: 0;
	font-size: clamp(calc(1.4 * var(--frc-rem)), calc(1.15 * var(--frc-rem)) + 1.2vw, calc(2 * var(--frc-rem)));
	line-height: 1.35;
}

.frc-lesson__title-row .frc-share__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Collapsible lesson list ("Course lessons · Lesson 2 of 5"). */
.frc-outline {
	overflow: hidden;
	border: 1px solid var(--frc-border);
	border-radius: var(--frc-radius);
	background: var(--frc-surface);
}

.frc-outline__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 52px;
	padding: 12px 16px;
	background: var(--frc-soft);
	cursor: pointer;
	list-style: none;
}

.frc-outline__summary::-webkit-details-marker {
	display: none;
}

.frc-outline__summary::after {
	content: "";
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	/* Physical sides on purpose: a down-chevron must point down in RTL too. */
	border-bottom: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.frc-outline[open] > .frc-outline__summary::after {
	transform: rotate(-135deg);
}

.frc-outline__label {
	font-weight: 700;
}

.frc-outline__count {
	margin-inline-start: auto;
	color: var(--frc-muted);
	font-size: calc(0.875 * var(--frc-rem));
}

/* One scroll area for the whole list (all sections), not one per section. */
.frc-outline .frc-outline-groups {
	max-height: 60vh;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* Files */
.frc-files {
	margin-block-start: var(--frc-space);
}

.frc-files__list {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.frc-files__link {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 52px;
	padding: 10px 14px;
	border: 1px solid var(--frc-border);
	border-radius: 10px;
	color: inherit;
	text-decoration: none;
}

.frc-files__link:hover {
	border-color: var(--frc-accent);
}

.frc-files__icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	background-color: var(--frc-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.frc-files__name {
	flex: 1;
	min-width: 0;
	overflow-wrap: anywhere;
}

.frc-files__meta {
	flex: 0 0 auto;
	color: var(--frc-muted);
	font-size: calc(0.85 * var(--frc-rem));
	direction: ltr;
}

/* Previous / next: a bar stuck to the bottom of the screen on phones. */
.frc-lesson__nav {
	position: sticky;
	bottom: 0;
	z-index: 20;
	display: flex;
	gap: 10px;
	padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--frc-border);
	background: var(--frc-surface);
	box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06);
}

.frc-lesson__nav > * {
	flex: 1 1 0;
	min-width: 0;
}

.frc-nav__prev,
.frc-nav__next {
	flex-direction: column;
	gap: 0;
}

.frc-nav__title {
	display: none;
	overflow: hidden;
	max-width: 100%;
	font-size: calc(0.85 * var(--frc-rem));
	font-weight: 400;
	text-overflow: ellipsis;
	white-space: nowrap;
	opacity: 0.85;
}

.frc-nav__finish .frc-nav__title {
	display: block;
}

@media (min-width: 600px) {
	.frc-nav__title {
		display: block;
	}
}

/* ---------- Video player (facade, phase 3) ---------- */

.frc-player {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--frc-radius);
	background: #000;
}

.frc .frc-player__facade {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: #111;
	cursor: pointer;
}

.frc-player__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Centred with physical left/top: centring is the same in RTL and LTR. */
.frc-player__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: clamp(56px, 10vw, 76px);
	transform: translate(-50%, -50%);
	transition: transform 0.15s ease;
}

.frc-player__play svg {
	display: block;
	width: 100%;
	height: auto;
}

.frc-player__play-bg {
	fill: var(--frc-accent);
	fill-opacity: 0.92;
}

.frc .frc-player__facade:hover .frc-player__play,
.frc .frc-player__facade:focus-visible .frc-player__play {
	transform: translate(-50%, -50%) scale(1.08);
}

/* The YouTube iframe (plain embed, or created by the IFrame API). */
.frc-player iframe,
.frc-player__host {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* "Starts at 03:25" badge on the thumbnail (links from the quiz review). */
.frc-player__start {
	position: absolute;
	inset-block-end: 12px;
	inset-inline-start: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	font-size: calc(0.875 * var(--frc-rem));
	font-weight: 700;
}

/*
 * Optional pause overlay (D-032). The bottom 56px stay uncovered so
 * YouTube's controls bar (seek, volume, fullscreen) remains usable.
 */
.frc-player__pause {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 56px;
	left: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.78);
}

.frc-player__pause[hidden] {
	display: none;
}

.frc .frc-player__resume {
	display: block;
	width: clamp(64px, 12vw, 96px);
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: transform 0.15s ease;
}

.frc .frc-player__resume:hover,
.frc .frc-player__resume:focus-visible {
	transform: scale(1.08);
}

.frc-player__resume svg {
	display: block;
	width: 100%;
	height: auto;
}

/*
 * End screen (D-033). The box may grow taller than 16:9 on small phones,
 * so its buttons always fit.
 */
.frc-player.is-ended {
	aspect-ratio: auto;
	min-height: min(56.25vw, 430px);
	background: linear-gradient(160deg, #1d2327, #0b0f12);
}

.frc-endscreen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	min-height: inherit;
	padding: clamp(20px, 4vw, 40px);
	color: #fff;
	text-align: center;
}

.frc-endscreen:focus {
	outline: none;
}

/* Scoped: Publisher's .heading-typo sets a dark heading color. */
.frc .frc-endscreen__title {
	color: #fff;
	margin: 0;
	font-size: clamp(calc(1.2 * var(--frc-rem)), calc(1 * var(--frc-rem)) + 1vw, calc(1.6 * var(--frc-rem)));
	font-weight: 700;
}

.frc-endscreen__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	width: 100%;
	max-width: 640px;
}

.frc-endscreen__actions .frc-btn {
	flex: 1 1 200px;
	flex-direction: column;
	gap: 2px;
}

.frc-endscreen__sub {
	overflow: hidden;
	max-width: 100%;
	font-size: calc(0.85 * var(--frc-rem));
	font-weight: 400;
	text-overflow: ellipsis;
	white-space: nowrap;
	opacity: 0.85;
}

.frc .frc-endscreen .frc-btn--ghost,
.frc .frc-endscreen .frc-btn--ghost:visited {
	border-color: rgba(255, 255, 255, 0.35);
	background: transparent;
	color: #fff;
}

.frc .frc-endscreen .frc-btn--ghost:hover,
.frc .frc-endscreen .frc-btn--ghost:focus {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.frc-player__fallback {
	position: absolute;
	inset-block-end: 12px;
	inset-inline-start: 12px;
	padding: 6px 10px;
	border-radius: 6px;
	background: #fff;
	color: #000;
}

/* ---------- Desktop: lesson list beside the content ---------- */

@media (min-width: 1024px) {
	.frc-lesson__grid {
		grid-template-columns: minmax(0, 1fr) 320px;
		grid-template-rows: auto auto 1fr auto;
		grid-template-areas:
			"player  outline"
			"header  outline"
			"body    outline"
			"nav     outline";
		column-gap: 32px;
	}

	.frc-lesson__outline {
		position: sticky;
		top: 24px;
		align-self: start;
	}

	.frc-outline .frc-outline-groups {
		max-height: calc(100vh - 160px);
	}

	.frc-lesson__nav {
		position: static;
		padding: 20px 0 0;
		border-top: 0;
		box-shadow: none;
		background: transparent;
	}

	.frc-lesson__title-row .frc-share__label {
		position: static;
		width: auto;
		height: auto;
		clip: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.frc *,
	.frc *::before,
	.frc *::after {
		transition: none !important;
	}
}

/* ---------- Quiz (phase 5) ---------- */

.frc-quiz {
	margin-block: var(--frc-space);
	scroll-margin-top: 24px;
}

.frc-quiz:focus {
	outline: none;
}

.frc-quiz__intro,
.frc-quiz__card {
	padding: clamp(16px, 3vw, 28px);
	border: 1px solid var(--frc-border);
	border-radius: var(--frc-radius);
	background: var(--frc-surface);
}

.frc-quiz__intro {
	border-inline-start: 4px solid var(--frc-accent);
	background: var(--frc-soft);
}

.frc-quiz__eyebrow {
	margin: 0 0 4px;
	color: var(--frc-accent);
	font-size: calc(0.85 * var(--frc-rem));
	font-weight: 700;
}

.frc .frc-quiz__title {
	margin: 0 0 8px;
	font-size: clamp(calc(1.2 * var(--frc-rem)), calc(1.05 * var(--frc-rem)) + 0.8vw, calc(1.5 * var(--frc-rem)));
}

.frc-quiz__meta {
	margin: 0 0 16px;
	color: var(--frc-muted);
}

/* Timers */
.frc-quiz__timer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 16px;
	margin-block-end: 16px;
	padding: 10px 14px;
	border-radius: 10px;
	background: var(--frc-soft);
	font-size: calc(0.9 * var(--frc-rem));
}

.frc-quiz__timer-item[hidden] {
	display: none;
}

.frc-quiz__timer strong {
	font-variant-numeric: tabular-nums;
}

.frc-quiz__timer.is-low .frc-quiz__timer-q,
.frc-quiz__timer.is-low .frc-quiz__timer-t {
	color: #b32d2e;
}

.frc-quiz__timer.is-over .frc-quiz__timer-q {
	color: #b32d2e;
	font-weight: 700;
}

/* Question */
.frc-quiz__question {
	min-width: 0;
	margin: 0 0 20px;
	padding: 0;
	border: 0;
}

.frc-quiz__legend {
	display: block;
	width: 100%;
	margin-block-end: 14px;
	padding: 0;
}

.frc-quiz__legend:focus {
	outline: none;
}

.frc-quiz__qnum {
	display: block;
	margin-block-end: 6px;
	color: var(--frc-muted);
	font-size: calc(0.85 * var(--frc-rem));
}

.frc-quiz__qtext {
	display: block;
	font-size: clamp(calc(1.05 * var(--frc-rem)), calc(1 * var(--frc-rem)) + 0.4vw, calc(1.2 * var(--frc-rem)));
	font-weight: 700;
	line-height: 1.7;
	overflow-wrap: anywhere;
}

.frc-quiz__qmedia {
	margin-block-end: 14px;
}

.frc-quiz__qmedia img {
	display: block;
	max-width: 100%;
	max-height: 360px;
	height: auto;
	border-radius: 8px;
	object-fit: contain;
}

/* Options: one per row; image options in a grid (2 on phones). */
.frc-quiz__options {
	display: grid;
	gap: 10px;
}

.frc-quiz__options.has-images {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
}

.frc-quiz__option {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 52px;
	padding: 10px 14px;
	border: 2px solid var(--frc-border);
	border-radius: 10px;
	background: var(--frc-surface);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.frc-quiz__options.has-images .frc-quiz__option {
	align-items: flex-start;
}

.frc-quiz__option:hover {
	border-color: var(--frc-accent);
}

.frc-quiz__option input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--frc-accent);
}

.frc-quiz__option:has(input:checked) {
	border-color: var(--frc-accent);
	background: var(--frc-accent-soft);
}

.frc-quiz__option:has(input:focus-visible) {
	outline: 3px solid var(--frc-accent);
	outline-offset: 2px;
}

.frc-quiz__option-label {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.frc-quiz__option-media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

.frc-quiz__question.is-graded .frc-quiz__option {
	cursor: default;
}

/*
 * Graded states must beat the "selected" style (:has(input:checked) is
 * 0,2,1), or a wrong choice keeps the accent color - green on this site,
 * which would look like a right answer.
 */
.frc-quiz__question.is-graded .frc-quiz__option {
	border-color: var(--frc-border);
	background: var(--frc-surface);
	opacity: 0.75;
}

.frc-quiz__question.is-graded .frc-quiz__option.is-answer {
	border-color: #00a32a;
	background: #edfaef;
	opacity: 1;
}

.frc-quiz__question.is-graded .frc-quiz__option.is-wrong {
	border-color: #d63638;
	background: #fcf0f1;
	opacity: 1;
}

.frc-quiz__question.is-graded .frc-quiz__option.is-answer::after,
.frc-quiz__question.is-graded .frc-quiz__option.is-wrong::after {
	margin-inline-start: auto;
	font-weight: 700;
}

.frc-quiz__question.is-graded .frc-quiz__option.is-answer::after {
	content: "✓";
	color: #00a32a;
}

.frc-quiz__question.is-graded .frc-quiz__option.is-wrong::after {
	content: "✗";
	color: #d63638;
}

/* Feedback */
.frc-quiz__feedback:empty {
	display: none;
}

.frc-quiz__feedback {
	margin-block-start: 14px;
	padding: 14px;
	border-radius: 10px;
	background: var(--frc-soft);
}

.frc-quiz__verdict {
	margin: 0 0 6px;
	font-weight: 700;
}

.is-correct > .frc-quiz__feedback .frc-quiz__verdict {
	color: #008a20;
}

.is-incorrect > .frc-quiz__feedback .frc-quiz__verdict {
	color: #b32d2e;
}

.frc-quiz__explanation {
	line-height: 1.8;
}

.frc-quiz__related {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-block-start: 6px;
	color: var(--frc-accent);
	font-weight: 700;
	text-decoration: none;
}

.frc-quiz__late {
	display: inline-block;
	margin: 4px 0;
	padding: 0 8px;
	border-radius: 10px;
	background: #fcf0c3;
	color: #6e4e00;
	font-size: calc(0.8125 * var(--frc-rem));
	line-height: 22px;
}

.frc-quiz__footer,
.frc-quiz__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.frc-quiz__footer .frc-btn {
	flex: 1 1 220px;
}

.frc-quiz__error {
	flex-basis: 100%;
	margin-block-start: 10px;
	padding: 12px;
	border-radius: 10px;
	background: #fcf0f1;
	color: #8a2424;
}

.frc-quiz__error p {
	margin: 0 0 8px;
}

.frc-quiz__loading {
	padding: 24px;
	color: var(--frc-muted);
	text-align: center;
}

/* Summary */
.frc-quiz__summary {
	text-align: center;
}

.frc-quiz__score {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 8px;
}

.frc-quiz__score-num {
	font-size: clamp(calc(1.8 * var(--frc-rem)), calc(1.4 * var(--frc-rem)) + 2vw, calc(2.6 * var(--frc-rem)));
	font-weight: 800;
}

.frc-quiz__score-pct {
	color: var(--frc-muted);
	font-size: calc(1.1 * var(--frc-rem));
	font-weight: 700;
}

.is-passed .frc-quiz__score-num {
	color: #008a20;
}

.is-failed .frc-quiz__score-num {
	color: #b32d2e;
}

.frc .frc-quiz__message {
	margin: 0 0 18px;
	font-size: calc(1.15 * var(--frc-rem));
}

.frc-quiz__summary .frc-quiz__actions {
	justify-content: center;
}

/* Review */
.frc-quiz__review {
	display: grid;
	gap: 12px;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
	text-align: start;
}

.frc-quiz__review:focus {
	outline: none;
}

.frc-quiz__review-item {
	padding: 14px;
	border: 1px solid var(--frc-border);
	border-inline-start-width: 4px;
	border-radius: 10px;
}

.frc-quiz__review-item.is-correct {
	border-inline-start-color: #00a32a;
}

.frc-quiz__review-item.is-incorrect {
	border-inline-start-color: #d63638;
}

.frc-quiz__review-num {
	margin: 0 0 4px;
	color: var(--frc-muted);
	font-size: calc(0.85 * var(--frc-rem));
	font-weight: 700;
}

.frc-quiz__review-q {
	margin-block-end: 8px;
	font-weight: 700;
	line-height: 1.7;
}

.frc-quiz__review-line {
	margin: 0 0 4px;
}

.frc-quiz__noscript {
	color: #b32d2e;
}
