/* Studentská část a stránky webu, které staví aplikace.
   Používají bloky šablony paulina (page-hero, free, courses/course, syllabus/block, blog-hero, plan, review)
   a tady jsou jen doplňky, které šablona nemá (průběh, odškrtnutí, video, materiály, seznam lekcí). */

.k-wrap { max-width: 1152px; margin: 0 auto; padding: 0 var(--pad-x); box-sizing: content-box; }
.k-linkbtn { border: 0; background: none; padding: 0; min-height: 44px; font: 600 16px/24px var(--sans); color: var(--malina); cursor: pointer; }
.k-linkbtn:hover { text-decoration: underline; }
.k-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font: 600 15px/24px var(--sans); color: var(--malina); text-decoration: none; }
.k-back::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 2px; }
.k-back:hover { text-decoration: underline; }
.k-h3 { font: 400 28px/36px var(--serif); color: var(--ink); }
.input:focus-visible { outline: 2px solid var(--malina); outline-offset: 2px; }
.btn .ico { flex: none; }

/* ---------- Úvodní pás (page-hero) ---------- */
.k-hero { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.k-hero .lead { max-width: 600px; text-align: center; }
.k-hero .k-back { margin-top: -40px; }
.k-hero__progress { width: 100%; max-width: 420px; margin: 8px 0; }
.k-hero__progress .k-progress { margin: 0 auto; }
.k-hero__progress .k-progress__text { text-align: center; }

/* ---------- Průběh ---------- */
.k-progress { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 420px; }
.k-progress__text { font: 400 16px/24px var(--sans); color: var(--text); }
.k-progress__text strong { color: var(--ink); font-weight: 700; }
.k-progress__bar { height: 10px; border-radius: 5px; background: var(--cream); overflow: hidden; }
.k-progress__bar span { display: block; height: 100%; background: var(--malina); border-radius: 5px; transition: width .3s ease-in-out; }

/* ---------- Pokračovat (pás „free“ ze šablony) ---------- */
.k-continue .free__card { grid-template-columns: 1fr 360px; }
.k-continue__cta { display: flex; flex-direction: column; gap: 16px; }
.k-continue__cta .btn { gap: 10px; }

/* ---------- Karty kurzů (courses / course ze šablony) ---------- */
.k-courses { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
.k-courses .course__title { min-height: 0; }
.k-courses .course__text { min-height: 0; }
.k-courses .course__price { margin: 24px 0; }
.k-logout { margin-top: 40px; text-align: center; }

/* ---------- Seznam lekcí (syllabus / block ze šablony) ---------- */
.k-syllabus .block__lessons li { padding: 8px 24px 8px 12px; gap: 12px; }
.k-syllabus .block__lessons li:first-child { border-top: 0; }
.k-lesson__link { flex: 1; display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 56px; color: var(--text); text-decoration: none; }
.k-lesson__link strong { width: auto; font-weight: 600; color: var(--ink); }
.k-lesson__link:hover strong { color: var(--malina); text-decoration: underline; }
.k-lesson__sub { color: var(--text); }
.k-lesson__state { font-size: 15px; line-height: 22px; color: var(--muted); text-align: right; white-space: nowrap; }
.k-lesson.is-done .k-lesson__state { color: var(--malina); font-weight: 600; }

/* kolečko s číslem lekce = odškrtnutí */
.k-check-form { margin: 0; }
.k-check { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.k-check .num { transition: background-color .15s, color .15s, box-shadow .15s; }
.k-check .ico { position: absolute; opacity: 0; color: #fff; transition: opacity .15s; }
.k-check:hover .num { box-shadow: inset 0 0 0 2px var(--malina); }
.k-check.is-done .num { background: var(--malina); color: transparent; }
.k-check.is-done .ico { opacity: 1; }

/* ---------- Lekce ---------- */
.k-lesson-hero { padding-top: 32px; padding-bottom: 40px; }
.k-lesson-hero .eyebrow { margin-bottom: 8px; }
.k-lesson-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.k-lesson-hero .h1--page { text-align: left; }
.k-done-form { margin: 0; }
.k-done { gap: 10px; }
.k-done.btn--sun { box-shadow: none; }
.k-done__box { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 6px; box-sizing: border-box; }
.k-done__box .ico { opacity: 0; }
.k-done[aria-pressed="true"] .k-done__box { background: var(--malina); border-color: var(--malina); color: #fff; }
.k-done[aria-pressed="true"] .k-done__box .ico { opacity: 1; }
.k-done[aria-busy="true"] { opacity: .7; cursor: progress; }

.k-lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; padding-top: 48px; padding-bottom: 96px; align-items: start; }
.k-lesson-main { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.k-video { border-radius: 16px; overflow: hidden; background: var(--ink); }
.k-video video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.k-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.k-video__resume { margin: 0; padding: 4px 16px; background: var(--ink); color: #fff; font-size: 15px; line-height: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.k-video__resume .k-linkbtn { color: var(--sun); text-decoration: underline; }
.k-video--missing { aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; background: var(--cream-2); border: 1px dashed var(--stone); color: var(--text); padding: 24px; }
.k-video--missing .ico { margin: 0 auto 12px; color: var(--malina); }

.k-block { display: flex; flex-direction: column; gap: 12px; }
.k-block__text { max-width: 680px; color: var(--text); }
.k-block__text p + p { margin-top: 8px; }
.k-files { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.k-file { display: grid; grid-template-columns: 40px minmax(0, 1fr) 44px; align-items: center; gap: 12px; padding: 8px 16px; background: var(--cream-2); }
.k-file + .k-file { border-top: 1px solid var(--line); }
.k-file__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--cream); color: var(--malina); }
.k-file__main { display: flex; flex-direction: column; min-width: 0; }
.k-file__name { font: 600 16px/24px var(--sans); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.k-file__name { display: flex; align-items: center; min-height: 44px; }
a.k-file__name:hover { color: var(--malina); text-decoration: underline; }
.k-file__main a.k-file__name + .k-file__type { margin-top: -10px; }
.k-file__type { font-size: 14px; line-height: 20px; color: var(--muted); }
.k-file--audio .k-file__main { gap: 6px; padding: 6px 0; }
.k-file audio { width: 100%; max-width: 440px; height: 40px; }
.k-file__dl { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; color: var(--malina); }
.k-file__dl:hover { background: var(--cream); }

.k-pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 8px; }

.k-side { position: sticky; top: 24px; }
.k-side__summary { display: none; }
.k-side__head { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 16px; }
.k-side__title { font: 400 22px/28px var(--serif); color: var(--ink); }
.k-side__list { display: flex; flex-direction: column; max-height: 60vh; overflow: auto; border-top: 1px solid var(--line); }
.k-side__list li + li { border-top: 1px solid var(--line); }
.k-side__list a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 16px; background: var(--cream-2); color: var(--text); text-decoration: none; font-size: 15px; line-height: 20px; }
.k-side__list a:hover { background: #fff; }
.k-side__list small { display: block; font-size: 14px; line-height: 20px; color: var(--muted); }
.k-side__list .num { width: 28px; height: 28px; font-size: 14px; }
.k-side__list .k-dot { position: absolute; left: 16px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--malina); color: #fff; opacity: 0; }
.k-side__list .is-done .k-dot { opacity: 1; }
.k-side__list .is-current a { background: #fff; color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--malina); }

/* ---------- Přihlášení ---------- */
.k-auth main { background: var(--cream); padding: 72px var(--pad-x) 96px; }
.k-auth-box { max-width: 480px; margin: 0 auto; padding: 40px; background: #fff; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 16px; }
.k-auth-box .k-lead { font: 400 17px/26px var(--sans); color: var(--text); }
.k-auth-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--sun); color: var(--malina); }
.k-form { margin-top: 8px; }
.k-form .btn { margin-top: 20px; }
.k-error { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; color: var(--malina-tmava); font-size: 15px; line-height: 22px; }
.k-error .ico { flex: none; margin-top: 2px; }
.k-note { color: var(--muted); }
.k-dev { padding: 16px; border: 1px dashed var(--stone); border-radius: 8px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 20px; }

/* ---------- Individuální výuka (stránka z bloků šablony) ---------- */
.page-hero--vyuka { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.page-hero--vyuka .h1--page { max-width: 880px; }
.page-hero--vyuka .lead { max-width: 600px; margin-bottom: 8px; }
.pricing__plans--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1152px; }
.pricing__plans--3 .plan { padding: 32px 28px; }
.pricing__plans--3 .plan--featured { padding: 31px 27px; }

/* ---------- Menší obrazovky ---------- */
@media (max-width: 1024px) {
	.pricing__plans--3 { grid-template-columns: 1fr; max-width: 520px; }
	.k-continue .free__card { grid-template-columns: 1fr; }
	.k-lesson-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
	.k-side { position: static; order: -1; }
	.k-side__summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 0 20px; cursor: pointer; font: 600 16px/24px var(--sans); color: var(--ink); list-style: none; }
	.k-side__summary::-webkit-details-marker { display: none; }
	.k-side__more { display: inline-flex; align-items: center; gap: 8px; color: var(--malina); }
	.k-side__more::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
	.k-side__details[open] .k-side__more::after { transform: rotate(-135deg); }
	.k-side__list { max-height: none; }
	.k-lesson__link { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 6px 0; }
	.k-lesson__link strong { grid-column: 1; }
	.k-lesson__sub { grid-column: 1; }
	.k-lesson__state { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 760px) {
	.k-courses { grid-template-columns: 1fr; }
	.k-hero .k-back { margin-top: -24px; }
	.k-lesson-head { flex-direction: column; align-items: stretch; }
	.k-lesson-head .btn, .k-pager .btn { width: 100%; }
	.k-pager { flex-direction: column-reverse; }
	.k-pager > span { display: none; }
	.k-video:not(.k-video--missing) { margin: 0 calc(-1 * var(--pad-x)); border-radius: 0; }
	.k-h3 { font-size: 24px; line-height: 32px; }
	.k-syllabus .block__lessons li { padding: 8px 12px 8px 4px; }
	.k-lesson__link { grid-template-columns: minmax(0, 1fr); }
	.k-lesson__state { grid-column: 1; grid-row: auto; text-align: left; }
	.k-lesson__state:empty { display: none; }
	.k-auth main { padding: 32px var(--pad-x) 64px; }
	.k-auth-box { padding: 28px 20px; }
	.k-file { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.k-progress__bar span, .k-check .num, .k-check .ico { transition: none; }
}

/* doladění po kontrole screenshotů */
.page-hero .k-progress__bar, .blog-hero .k-progress__bar { background: #fff; }
.k-side__list .num { flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--cream); font-weight: 600; color: var(--malina); }

/* Přihlášení heslem / odkazem, nastavení hesla */
.k-form .label, .k-form .k-label-row { margin-top: 20px; }
.k-form > label.label:first-of-type, .k-label-row .label { margin-top: 0; }
.k-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.k-label-row .label { margin-bottom: 0; }
.k-small-link { font: 500 14px/20px var(--sans); color: var(--malina); padding: 12px 0; margin: -12px 0; }
.k-pass { position: relative; }
.k-pass .input { padding-right: 104px; }
.k-pass__toggle { position: absolute; top: 2px; right: 2px; height: 44px; min-width: 88px; padding: 0 12px; border: 0; border-radius: 6px; background: none; font: 600 14px/20px var(--sans); color: var(--malina); cursor: pointer; }
.k-pass__toggle:hover { background: var(--cream-2); }
.k-pass__toggle:focus-visible { outline: 2px solid var(--malina); outline-offset: -2px; }
.k-or { display: flex; align-items: center; gap: 12px; margin: 24px 0 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.k-or::before, .k-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.k-form .k-or + .btn { margin-top: 16px; }
.k-hint { margin-top: 8px; }
.k-skryte { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Můj účet: záložky, přehled, další kurzy, hodnocení, nastavení */
.k-tabs { justify-content: center; margin-top: 8px; max-width: 100%; }
.k-tabs .pill, .k-tabs .pill.is-active { height: auto; min-height: 44px; }
.k-tabs .pill:focus-visible { outline: 2px solid var(--malina); outline-offset: 2px; }
.k-stats-section { padding: 48px var(--pad-x); }
.k-stats { max-width: 1110px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.k-stat { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 8px; }
.k-stat dt { font: 500 14px/20px var(--sans); color: var(--muted); }
.k-stat dd { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.k-stat strong { font: 400 36px/44px var(--serif); color: var(--ink); }
.k-stat span { font-size: 15px; line-height: 22px; color: var(--text); }
.k-rate-link { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.k-zajem { margin: 0; }
.k-zajem--ok { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 8px; background: var(--cream-2); border: 1px solid var(--line); }
.k-zajem--ok p { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 15px; line-height: 22px; color: var(--ink); }
.k-zajem--ok .ico { flex: none; margin-top: 1px; color: var(--malina); }
.k-zajem--ok strong { word-break: break-all; }
.k-zajem--ok form { margin: 0; }
.k-zajem--ok .k-linkbtn { font-size: 15px; }
.k-account-section { padding-top: 56px; }
.k-cards { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.k-card { padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 96px; }
.k-card .k-lead { font: 400 17px/26px var(--sans); color: var(--text); }
.k-card .k-form { margin-top: 0; }
.k-card .btn { align-self: flex-start; }
.k-card .k-form .btn { margin-top: 24px; }
.k-card p { margin: 0; }
.k-field-static { margin-top: 20px; }
.k-static { font-size: 16px; line-height: 24px; color: var(--ink); padding: 12px 16px; border-radius: 8px; background: var(--cream-2); border: 1px solid var(--line); word-break: break-all; }
.k-thanks { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 8px; background: var(--sun); color: var(--ink); font-weight: 500; }
.k-thanks .ico { flex: none; color: var(--malina); }
.k-card .k-thanks { margin-top: 20px; }
.k-review { min-height: 0; gap: 16px; }
.k-stars { display: inline-flex; gap: 2px; color: var(--malina); }
.k-star.is-on { fill: currentColor; }
.k-rate { border: 0; padding: 0; margin: 0; min-width: 0; }
.k-rate legend { padding: 0; }
.k-rate__stars { display: inline-flex; gap: 4px; }
.k-rate__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.k-rate__label { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; color: var(--malina); cursor: pointer; }
.k-rate__label .k-star { transition: transform .15s; }
/* vybraná hvězdička a všechny před ní (pořadí v HTML 1→5 kvůli klávesnici) */
.k-rate__input:checked + .k-rate__label .k-star { fill: currentColor; }
.k-rate__stars:has(.k-rate__input:checked) .k-star { fill: currentColor; }
.k-rate__stars .k-rate__input:checked + .k-rate__label ~ .k-rate__label .k-star { fill: none; }
.k-rate__label:hover .k-star { transform: scale(1.1); }
.k-rate .k-error { margin-top: 4px; }
.k-app .nav-toggle { padding: 10px; margin-right: -2px; }  /* dotykový cíl 44 px (ikona 24 + 2× 10) */
.k-rate__input:focus-visible + .k-rate__label { outline: 2px solid var(--malina); outline-offset: 2px; }
.k-consent { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; font-size: 15px; line-height: 22px; color: var(--text); cursor: pointer; }
.k-consent input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--malina); }
@media (max-width: 1024px) {
	.k-stats { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.k-stat { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; padding: 16px 20px; }
	.k-stat dd { align-items: flex-end; text-align: right; }
	.k-stat strong { font-size: 28px; line-height: 36px; }
}
@media (max-width: 767px) {
	.k-stats-section { padding-top: 32px; padding-bottom: 0; }
	.k-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.k-stat { flex-direction: column-reverse; align-items: center; justify-content: flex-end; gap: 2px; padding: 12px 8px; text-align: center; border-radius: 12px; }
	.k-stat dt { font-size: 14px; line-height: 20px; }
	.k-stat dd { align-items: center; text-align: center; }
	.k-stat strong { font-size: 26px; line-height: 32px; }
	.k-stat span { display: none; }
	.k-account-section { padding-top: 32px; }
	.k-card { padding: 24px 20px; }
	.k-card .btn { align-self: stretch; width: 100%; }
	.k-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
	.k-tabs .pill { justify-content: center; padding: 8px 12px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .k-rate__label .k-star { transition: none; } }
