/* Õppimise lehed ja tootelehe kast "Robbi aitab alustada". Värvid ja ümarused nagu poe nuppudel (WoodMart, Manrope). */
.rk-hub,
.rk-lesson,
.rk-robbi-box {
	--rk-brand: #5b3ff0;
	--rk-brand-dark: #4933d1;
	--rk-ink: #1b1f3b;
	--rk-muted: #5c6075;
	--rk-soft: #f3f1ff;
	--rk-line: #e6e3f7;
	--rk-ok: #1f8a4c;
	color: var(--rk-ink);
	font-family: Manrope, Arial, Helvetica, sans-serif;
}

/* ------------------------------------------------------------------ Õppimise avaleht */
.rk-hub {
	max-width: 1100px;
	margin: 0 auto;
	padding: 8px 0 40px;
}

.rk-hub h1 {
	margin: 0 0 12px;
	font-size: clamp(30px, 6vw, 44px);
	font-weight: 800;
	line-height: 1.15;
}

.rk-hub__intro {
	max-width: 760px;
	margin: 0 0 10px;
	font-size: 18px;
	line-height: 1.6;
}

.rk-hub__how,
.rk-hub__more {
	max-width: 760px;
	color: var(--rk-muted);
	font-size: 15px;
	line-height: 1.6;
}

.rk-hub__more {
	margin-top: 28px;
}

.rk-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.rk-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1000px) {
	.rk-cards {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px;
	}
}

.rk-card {
	margin: 0;
	list-style: none;
}

.rk-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1.5px solid var(--rk-line);
	border-radius: 20px;
	background: #fff;
	color: var(--rk-ink);
	text-decoration: none;
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.rk-card__link:hover,
.rk-card__link:focus-visible {
	border-color: var(--rk-brand);
	box-shadow: 0 14px 34px rgba(91, 63, 240, .14);
	color: var(--rk-ink);
	transform: translateY(-2px);
}

.rk-card__link:focus-visible {
	outline: 3px solid var(--rk-ink);
	outline-offset: 3px;
}

.rk-card__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	padding: 16px;
	background: var(--rk-soft);
}

.rk-card__media img {
	width: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

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

.rk-card__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.rk-pill {
	padding: 3px 10px;
	border-radius: 35px;
	background: var(--rk-soft);
	color: var(--rk-brand-dark);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.5;
}

.rk-card__title {
	flex: 1;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
}

.rk-card__btn,
.rk-kit__btn,
.rk-robbi-box__link {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	justify-content: center;
	min-height: 42px;
	padding: 0 22px;
	border-radius: 35px;
	background: var(--rk-brand);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: background .15s ease;
}

.rk-card__link:hover .rk-card__btn,
.rk-kit__btn:hover,
.rk-robbi-box__link:hover {
	background: var(--rk-brand-dark);
	color: #fff;
}

/* ------------------------------------------------------------------ Õppetund */
.rk-lesson {
	display: grid;
	grid-template-areas: "head" "aside" "body";
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 4px 0 48px;
	font-size: 16px;
	line-height: 1.65;
}

@media (min-width: 1025px) {
	.rk-lesson {
		grid-template-areas: "head aside" "body aside";
		grid-template-columns: minmax(0, 1fr) 320px;
		grid-template-rows: auto 1fr;
		column-gap: 48px;
	}
}

.rk-lesson-head {
	grid-area: head;
}

.rk-lesson-aside {
	grid-area: aside;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

@media (min-width: 1025px) {
	.rk-lesson-aside {
		position: sticky;
		top: 96px; /* WoodMarti kleepuva päise all */
		align-self: start;
		max-height: calc(100vh - 116px);
		overflow-y: auto;
		scrollbar-width: thin;
	}

	.admin-bar .rk-lesson-aside {
		top: 128px;
	}
}

.rk-lesson-body {
	grid-area: body;
	min-width: 0;
	max-width: 780px;
}

.rk-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	color: var(--rk-brand-dark);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.rk-back::before {
	content: "";
	width: 8px;
	height: 8px;
	border-bottom: 2px solid currentColor;
	border-left: 2px solid currentColor;
	transform: rotate(45deg);
}

.rk-lesson h1 {
	margin: 0 0 14px;
	font-size: clamp(28px, 5.4vw, 40px);
	font-weight: 800;
	line-height: 1.15;
}

.rk-lesson-head p {
	max-width: 780px;
	margin: 0 0 10px;
	font-size: 17px;
}

.rk-lesson-body h2 {
	margin: 40px 0 12px;
	padding-top: 4px;
	font-size: clamp(22px, 4vw, 28px);
	font-weight: 800;
	line-height: 1.25;
}

.rk-lesson-body h3 {
	margin: 0 0 10px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
}

.rk-lesson-body h2:first-child {
	margin-top: 8px;
}

.rk-lesson-body [id] {
	scroll-margin-top: 90px;
}

.rk-lesson-body p,
.rk-lesson-body ul,
.rk-lesson-body ol {
	margin: 0 0 14px;
}

.rk-lesson-body ul,
.rk-lesson-body ol {
	padding-left: 24px;
}

.rk-lesson-body li {
	margin-bottom: 6px;
}

.rk-lesson-body li::marker {
	color: var(--rk-brand);
	font-weight: 700;
}

.rk-lesson a {
	color: var(--rk-brand-dark);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.rk-lesson a:hover {
	color: var(--rk-ink);
}

/* Samm: kaart, mille all on nupud. */
.rk-samm {
	position: relative;
	margin: 28px 0;
	padding: 20px 18px 18px;
	border: 1.5px solid var(--rk-line);
	border-radius: 20px;
	background: #fff;
	transition: border-color .2s ease, background .2s ease;
}

@media (min-width: 769px) {
	.rk-samm {
		padding: 24px 26px 22px;
	}
}

.rk-samm > h2,
.rk-samm > h3 {
	margin-top: 0;
	padding-right: 40px;
}

.rk-samm.is-done {
	border-color: rgba(31, 138, 76, .45);
	background: #f6fbf8;
}

.rk-samm.is-done::after {
	content: "";
	position: absolute;
	top: 20px;
	right: 18px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--rk-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.rk-samm-actions {
	display: none;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--rk-line);
}

.rk-lesson.is-ready .rk-samm-actions {
	display: flex;
}

.rk-lesson .rk-done,
.rk-lesson .rk-ask,
.rk-lesson .rk-reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 0 20px;
	border: 1.5px solid var(--rk-brand);
	border-radius: 35px;
	background: #fff;
	color: var(--rk-brand);
	font: 700 15px/1 Manrope, Arial, Helvetica, sans-serif;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.rk-lesson .rk-done {
	background: var(--rk-brand);
	color: #fff;
}

.rk-lesson .rk-done:hover {
	background: var(--rk-brand-dark);
	border-color: var(--rk-brand-dark);
	color: #fff;
}

.rk-lesson .rk-done svg {
	display: none;
}

.rk-lesson .rk-done[aria-pressed="true"] {
	border-color: var(--rk-ok);
	background: #fff;
	color: var(--rk-ok);
}

.rk-lesson .rk-done[aria-pressed="true"] svg {
	display: block;
}

.rk-lesson .rk-ask {
	display: none;
}

.rk-lesson.has-robbi .rk-ask {
	display: inline-flex;
}

.rk-lesson .rk-ask:hover,
.rk-lesson .rk-reset:hover {
	background: var(--rk-soft);
	color: var(--rk-brand-dark);
}

.rk-lesson button:focus-visible {
	outline: 3px solid var(--rk-ink);
	outline-offset: 2px;
}

/* Kood: tume plokk, kopeerimise nupp paremal üleval. */
.rk-code {
	position: relative;
	margin: 0 0 16px;
}

.rk-code pre {
	margin: 0;
	padding: 18px 18px 18px;
	padding-top: 44px;
	overflow-x: auto;
	border-radius: 14px;
	background: var(--rk-ink);
	color: #f4f3ff;
	font: 14px/1.6 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
	tab-size: 4;
	white-space: pre;
}

.rk-code code {
	padding: 0;
	background: none;
	color: inherit;
	font: inherit;
}

.rk-lesson .rk-copy {
	display: none;
	position: absolute;
	top: 8px;
	right: 8px;
	min-height: 30px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 35px;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	font: 600 13px/1 Manrope, Arial, Helvetica, sans-serif;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}

.rk-lesson.is-ready .rk-copy {
	display: inline-flex;
	align-items: center;
}

.rk-lesson .rk-copy:hover,
.rk-lesson .rk-copy.is-copied {
	background: #fff;
	color: var(--rk-ink);
}

/* Komplekti kast ja edenemine. */
.rk-kit,
.rk-progress {
	padding: 16px 18px;
	border: 1.5px solid var(--rk-line);
	border-radius: 20px;
	background: #fff;
}

.rk-kit__label,
.rk-progress__title {
	margin: 0 0 10px;
	color: var(--rk-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
}

.rk-kit__row {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 12px;
}

.rk-kit__img {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: 14px;
	background: var(--rk-soft);
}

.rk-kit__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.rk-kit__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	line-height: 1.35;
}

.rk-lesson .rk-kit__name {
	color: var(--rk-ink);
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
}

.rk-kit__price {
	color: var(--rk-brand-dark);
	font-size: 17px;
	font-weight: 800;
}

.rk-kit__price del {
	color: var(--rk-muted);
	font-size: 14px;
	font-weight: 500;
}

.rk-kit__status {
	color: var(--rk-muted);
	font-size: 13px;
}

.rk-lesson .rk-kit__btn {
	width: 100%;
	color: #fff;
	text-decoration: none;
}

.rk-meter {
	height: 10px;
	overflow: hidden;
	border-radius: 10px;
	background: var(--rk-soft);
}

.rk-meter span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 10px;
	background: linear-gradient(90deg, var(--rk-brand) 0%, #8b74ff 100%);
	transition: width .3s ease;
}

.rk-progress__text {
	margin: 8px 0 4px;
	font-size: 15px;
	font-weight: 700;
}

.rk-progress__note {
	margin: 10px 0 0;
	color: var(--rk-muted);
	font-size: 12px;
	line-height: 1.45;
}

.rk-lesson .rk-reset {
	min-height: 36px;
	margin-top: 10px;
	padding: 0 16px;
	font-size: 14px;
}

.rk-lesson .rk-reset[hidden] {
	display: none;
}

.rk-toc {
	margin-top: 10px;
	border-top: 1px solid var(--rk-line);
}

.rk-toc summary {
	padding: 10px 0 4px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.rk-toc ol {
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.rk-toc li {
	position: relative;
	margin: 0;
	padding: 5px 0 5px 28px;
	font-size: 14px;
	line-height: 1.4;
}

.rk-toc li::before {
	content: "";
	position: absolute;
	top: 7px;
	left: 0;
	width: 16px;
	height: 16px;
	border: 2px solid var(--rk-line);
	border-radius: 50%;
	background: #fff;
}

.rk-toc li.is-done::before {
	border-color: var(--rk-ok);
	background: var(--rk-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.rk-lesson .rk-toc a {
	color: var(--rk-ink);
	font-weight: 600;
	text-decoration: none;
}

.rk-lesson .rk-toc a:hover {
	color: var(--rk-brand-dark);
	text-decoration: underline;
}

.rk-lesson:not(.is-ready) .rk-meter,
.rk-lesson:not(.is-ready) .rk-progress__text,
.rk-lesson:not(.is-ready) .rk-progress__note {
	display: none;
}

/* ------------------------------------------------------------------ Tooteleht */
.rk-robbi-box {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	margin: 16px 0 6px;
	padding: 16px;
	border: 1.5px solid var(--rk-line);
	border-radius: 20px;
	background: var(--rk-soft);
}

.rk-robbi-box__icon {
	display: flex;
	flex: 0 0 44px;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--rk-brand);
	color: #fff;
}

.rk-robbi-box__icon circle[fill="#fff"] {
	fill: var(--rk-brand);
}

.rk-robbi-box__icon path[stroke="#fff"] {
	stroke: var(--rk-brand);
}

.rk-robbi-box__icon svg {
	color: #fff;
}

.rk-robbi-box__body {
	min-width: 0;
}

.rk-robbi-box__title {
	margin: 0 0 4px;
	color: var(--rk-ink);
	font-size: 16px;
	font-weight: 800;
	line-height: 1.3;
}

.rk-robbi-box__text {
	margin: 0 0 12px;
	color: var(--rk-ink);
	font-size: 14px;
	line-height: 1.5;
}

.rk-robbi-box .rk-robbi-box__link {
	min-height: 38px;
	padding: 0 18px;
	color: #fff;
	font-size: 14px;
}

/* ------------------------------------------------------------------ Robbi õpetaja õppetunni lehel */
@media (min-width: 769px) and (max-width: 1024px) {
	html.robbi-open .rk-lesson {
		padding-right: 400px;
	}
}

@media print {
	.rk-samm-actions,
	.rk-copy,
	.rk-progress,
	.rk-robbi-box {
		display: none !important;
	}
}
