/* Veřejné stránky kurzů: tokeny, písmo, lišta a tlačítka z ../landing/landing.css, tady jen katalog
   a stránka kurzu. Vzhled jako karty kurzů v aplikaci. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon { display: inline-flex; flex: none; }
.icon svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.nav-links a[aria-current="page"] { color: var(--ink); }

.cc-main { min-height: 70vh; padding-top: 40px; padding-bottom: 96px; outline: none; }

html.is-leaving body { cursor: progress; }

/* --- Katalog --- */

.cc-hero { max-width: 760px; margin-bottom: 28px; }
.cc-hero h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
.cc-hero .section-lead { margin-top: 14px; font-size: 18px; }

.cc-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 28px; }
.cc-search { position: relative; flex: 1 1 320px; display: flex; align-items: center; }
.cc-search .icon { position: absolute; left: 16px; color: var(--muted); font-size: 18px; pointer-events: none; }
.cc-search-input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px 0 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.cc-search-input::placeholder { color: var(--muted); }
.cc-selects { display: flex; flex-wrap: wrap; gap: 12px; }
.cc-select { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cc-select select {
  min-height: 50px;
  max-width: 100%;
  padding: 0 36px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23768099' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 550;
  appearance: none;
  cursor: pointer;
}

.cc-results { min-height: 240px; }
.cc-count { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.cc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cc-more { display: flex; justify-content: center; margin-top: 28px; }
.cc-state { padding: 56px 0; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cc-state h1 { color: var(--ink); font-size: 28px; letter-spacing: -.02em; }

.cc-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cc-card:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.cc-card-media { position: relative; display: block; }
.cc-card-body { display: flex; flex-direction: column; gap: 8px; padding: 26px 18px 18px; flex: 1; }
.cc-card-title { font-size: 18px; line-height: 1.25; letter-spacing: -.015em; overflow-wrap: anywhere; }
.cc-card-subtitle { color: var(--muted); font-size: 14.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cc-card-logo { position: absolute; left: 16px; bottom: -20px; }
.cc-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 8px; }
.cc-card-cta { color: var(--blue); font-weight: 650; font-size: 15px; white-space: nowrap; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13.5px; }
.cc-members { display: inline-flex; align-items: center; gap: 6px; }
.cc-price { font-weight: 750; font-size: 16px; }
.cc-price.is-free { color: var(--done); }
.cc-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.cc-badge { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #fff; background: #16A34A; }
.cc-badge.is-featured { background: #D97706; }

.cc-card.is-featured { flex-direction: row; margin-bottom: 24px; }
.cc-card.is-featured .cc-card-media { flex: 0 0 52%; }
.cc-card.is-featured .cc-cover { height: 100%; aspect-ratio: auto; min-height: 260px; }
.cc-card.is-featured .cc-card-body { padding: 32px; justify-content: center; }
.cc-card.is-featured .cc-card-title { font-size: 28px; letter-spacing: -.025em; }
.cc-card.is-featured .cc-card-logo { left: 24px; bottom: 24px; }

.cc-cover { position: relative; display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1D4ED8, #0B1222); overflow: hidden; }
.cc-cover[data-cat="1"] { background: linear-gradient(135deg, #16A34A, #0B1222); }
.cc-cover[data-cat="2"] { background: linear-gradient(135deg, #D97706, #2A1608); }
.cc-cover[data-cat="3"] { background: linear-gradient(135deg, #DB2777, #1F0B18); }
.cc-cover[data-cat="4"] { background: linear-gradient(135deg, #0891B2, #082029); }
.cc-cover[data-cat="5"] { background: linear-gradient(135deg, #7C3AED, #160B2A); }
.cc-cover img { width: 100%; height: 100%; object-fit: cover; }
/* Banner 1440 × 320; výška podle šířky, ale ne pod 120 px (bez aspect-ratio, které by s min-height rozšířilo stránku) */
.cc-cover.is-banner { aspect-ratio: auto; width: 100%; height: clamp(120px, 22.2vw, 280px); border-radius: 22px; }

.cc-logo {
  --size: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: calc(var(--size) * .26);
  border: 3px solid var(--surface);
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  font-size: calc(var(--size) * .42);
  overflow: hidden;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5);
}
.cc-logo img { width: 100%; height: 100%; object-fit: cover; }

.cc-creator { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 14.5px; font-weight: 600; }
.cc-creator-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--empty); color: var(--ink); font-size: 13px; font-weight: 750; }
.cc-verified { color: var(--blue); font-size: 17px; }
.cc-verified svg { fill: currentColor; stroke: none; }
.cc-verified svg .cut { fill: none; stroke: var(--surface); stroke-width: 2.2; }

.cc-skeleton { background: linear-gradient(90deg, var(--empty), color-mix(in srgb, var(--empty) 55%, var(--surface)), var(--empty)); background-size: 200% 100%; animation: cc-shimmer 1.2s linear infinite; border-color: transparent; }
.cc-grid .cc-skeleton { min-height: 340px; }
.cc-skeleton-line { height: 28px; border-radius: 8px; margin-top: 18px; max-width: 520px; }
.cc-skeleton-line.is-short { max-width: 300px; }
@keyframes cc-shimmer { to { background-position: -200% 0; } }

/* --- Stránka kurzu --- */

.cc-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--muted); font-weight: 600; text-decoration: none; }
.cc-back:hover { color: var(--ink); }
.cc-banner { margin-bottom: 8px; }
.cc-course-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.cc-course-head { display: flex; gap: 20px; align-items: flex-start; margin-top: -28px; padding-left: 20px; }
.cc-course-head h1 { margin-top: 36px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; overflow-wrap: anywhere; text-wrap: balance; }
.cc-subtitle { margin: 10px 0 14px; color: var(--muted); font-size: 18px; overflow-wrap: anywhere; }
.cc-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.cc-facts li { padding: 5px 12px; border-radius: 999px; background: var(--empty); font-size: 13.5px; font-weight: 600; }

.cc-section { margin-top: 44px; }
.cc-section h2 { font-size: 24px; letter-spacing: -.02em; max-width: none; margin-bottom: 16px; }
.cc-text p { margin: 0 0 14px; white-space: pre-line; overflow-wrap: anywhere; }
.cc-checks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cc-checks li { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.cc-checks .icon { margin-top: 4px; color: var(--done); font-size: 18px; }
#cc-learn ~ .cc-checks, .cc-section .cc-checks { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.cc-modules { display: grid; gap: 12px; }
.cc-module { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.cc-module summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 16px 18px; cursor: pointer; list-style: none; }
.cc-module summary::-webkit-details-marker { display: none; }
.cc-module-title { font-weight: 700; overflow-wrap: anywhere; }
.cc-module-meta { color: var(--muted); font-size: 14px; }
.cc-module-text { padding: 0 18px 10px; color: var(--muted); font-size: 15px; }
.cc-lessons { margin: 0; padding: 0 18px 14px; list-style: none; counter-reset: lesson; }
.cc-lessons li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; counter-increment: lesson; }
.cc-lessons li::before { content: counter(lesson); width: 26px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.cc-lesson-title { flex: 1 1 200px; overflow-wrap: anywhere; }
.cc-lesson-time { color: var(--muted); font-size: 13.5px; }
.cc-preview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--done) 50%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--done) 12%, transparent);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.cc-preview .icon svg { fill: currentColor; stroke: none; }

.cc-creator-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.cc-creator-card p { margin-top: 12px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.cc-creator-card .cc-creator-headline { color: var(--ink); font-weight: 600; }
.cc-faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.cc-faq summary { cursor: pointer; font-weight: 650; overflow-wrap: anywhere; }
.cc-faq p { margin-top: 8px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.cc-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cc-tags li { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }

.cc-join {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--raised);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cc-join-kicker { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.cc-join-price { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.cc-join-price.is-free { color: var(--done); }
.cc-plans { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cc-plan { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.cc-plan.is-sold-out { opacity: .6; }
.cc-plan-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cc-plan-head strong { overflow-wrap: anywhere; }
.cc-plan-price { text-align: right; font-weight: 800; font-size: 18px; white-space: nowrap; }
.cc-plan-price small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.cc-plan-text { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.cc-plan .cc-checks { margin-top: 8px; font-size: 14px; gap: 6px; grid-template-columns: 1fr; }
.cc-join-button { width: 100%; white-space: normal; text-align: center; }
.cc-join-button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.cc-join-note { color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* --- Šířky --- */

@media (max-width: 1000px) {
  .cc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-course-grid { display: flex; flex-direction: column; gap: 0; }
  .cc-course-main { display: contents; }
  .cc-course-head { order: 0; }
  .cc-join { order: 1; position: static; margin-top: 28px; }
  .cc-section { order: 2; }
}

@media (max-width: 720px) {
  .cc-main { padding-top: 24px; }
  .cc-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cc-card.is-featured { flex-direction: column; }
  .cc-card.is-featured .cc-cover { min-height: 0; aspect-ratio: 16 / 9; }
  .cc-card.is-featured .cc-card-body { padding: 26px 18px 18px; }
  .cc-card.is-featured .cc-card-title { font-size: 22px; }
  .cc-card.is-featured .cc-card-logo { left: 16px; bottom: -20px; }
  .cc-selects { width: 100%; }
  .cc-select { flex: 1 1 140px; min-width: 0; }
  .cc-select select { width: 100%; }
  .cc-course-head { flex-direction: column; gap: 0; margin-top: -24px; padding-left: 14px; }
  .cc-course-head h1 { margin-top: 14px; }
  .cc-cover.is-banner { border-radius: 16px; }
  .cc-section { margin-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-card, .cc-card:hover { transition: none; transform: none; }
  .cc-skeleton { animation: none; }
}
