/* Učna baza hub styles. Target: Safari 15 on iPad Air 2 (1024×768 / 768×1024).
   No nesting, no container queries, no color-mix(): the linter fails on them. */

:root {
  --bg: #EEF0F7;
  --ink: #151A35;
  --muted: #50567A;
  --card: #FFFFFF;
  --line-soft: #D5D9E8;
  --track: #E3E6F2;
  --sola: #2B54E0;
  --sola-soft: #DCE4FF;
  --interesi: #FF8A3D;
  --interesi-ink: #3A1A05;
  --interesi-bar: #E0631F;
  --interesi-text: #B5470E;
  --gold: #FFC83D;
  --flame: #D9480F;
  --good: #1C7A4C;
  --bad: #B3361F;
  --new: #3DDC84;
  --new-ink: #0C2A18;
  --dash: #9AA0BC;
  --radius: 20px;
  --shadow: 4px 4px 0 var(--ink);
  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

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

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

a { color: var(--ink); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; flex: none; }
h1, h2, p { margin: 0; }
.head { font-family: var(--font-head); font-weight: 800; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- page frame ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 40px 36px;
  padding-left: max(40px, env(safe-area-inset-left));
  padding-right: max(40px, env(safe-area-inset-right));
  padding-top: max(28px, env(safe-area-inset-top));
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; background: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 22px; }

.pills { display: flex; align-items: center; gap: 10px; }
.pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
  padding: 8px 16px; font-weight: 900; font-size: 16px; white-space: nowrap;
}
.pill--gold { background: var(--gold); }

.back-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 14px;
  padding: 10px 16px; font-weight: 900; font-size: 17px; min-height: 44px;
  box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- pressable feel (touch) ---------- */
.press { transition: transform 0.08s ease, box-shadow 0.08s ease; }
.press:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
@media (hover: hover) {
  .press:hover { transform: translate(-1px, -1px); }
}

/* ---------- Domov ---------- */
.greeting h1 { font-family: var(--font-head); font-weight: 800; font-size: 44px; letter-spacing: -0.5px; }
.greeting p { font-size: 19px; color: var(--muted); }

.continue {
  display: flex; align-items: center; gap: 20px;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow);
}
.continue .thumb { width: 88px; height: 88px; border-radius: 16px; flex: none; }
.continue-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.eyebrow { font-size: 13px; font-weight: 900; letter-spacing: 1px; color: var(--sola); }
.continue-title { font-family: var(--font-head); font-weight: 800; font-size: 24px; }
.continue-meta { display: flex; align-items: center; gap: 12px; }
.continue-meta .bar { flex: 1; max-width: 360px; height: 12px; }
.continue-meta span { font-weight: 800; font-size: 15px; color: var(--muted); }
.cta {
  flex: none; display: flex; align-items: center; gap: 8px;
  background: var(--sola); color: #FFFFFF; border-radius: 14px;
  padding: 14px 22px; font-weight: 900; font-size: 18px;
}

.doors { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; min-height: 280px; }
.doors--single { grid-template-columns: minmax(0, 1fr); }
.door {
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  border: 2px solid var(--ink); border-radius: 24px; padding: 26px;
  box-shadow: 6px 6px 0 var(--ink);
}
.door:active { box-shadow: 2px 2px 0 var(--ink); transform: translate(4px, 4px); }
.door--sola { background: var(--sola); color: #FFFFFF; }
.door--interesi { background: var(--interesi); color: var(--ink); }
.door-icon {
  width: 72px; height: 72px; border-radius: 18px; background: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
}
.door-text { display: flex; flex-direction: column; gap: 8px; }
.door-title { font-family: var(--font-head); font-weight: 800; font-size: 46px; line-height: 1; }
.door-sub { font-size: 18px; }
.door--sola .door-sub { color: var(--sola-soft); }
.door--interesi .door-sub { color: var(--interesi-ink); font-weight: 800; }
.door-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.count {
  background: #FFFFFF; color: var(--ink); border-radius: 999px;
  padding: 6px 14px; font-weight: 900; font-size: 15px;
}

.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border: 2px dashed var(--dash); border-radius: 24px; padding: 40px; text-align: center; color: var(--muted);
}
.empty strong { font-family: var(--font-head); font-weight: 800; font-size: 28px; color: var(--ink); }
.empty span { font-size: 18px; }

/* ---------- section pages ---------- */
.section-head { display: flex; align-items: center; gap: 16px; }
.section-icon {
  width: 60px; height: 60px; border-radius: 16px; border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.section-icon--sola { background: var(--sola); }
.section-icon--interesi { background: var(--interesi); }
.section-head h1 { font-family: var(--font-head); font-weight: 800; font-size: 40px; line-height: 1.05; }
.section-head span { font-size: 16px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-weight: 900; font-size: 16px; background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 999px; padding: 10px 18px; min-height: 44px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }

.subject { display: flex; flex-direction: column; gap: 14px; }
.subject h2 { font-family: var(--font-head); font-weight: 800; font-size: 24px; }
.subjects { display: flex; flex-direction: column; gap: 26px; }

.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.course-card {
  display: flex; flex-direction: column; background: var(--card);
  border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.cover { height: 150px; position: relative; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .dot { position: absolute; border-radius: 50%; }
.badge {
  position: absolute; right: 12px; top: 12px; border-radius: 999px;
  padding: 4px 10px; font-weight: 900; font-size: 13px;
  background: var(--gold); color: var(--ink);
}
.badge--new { background: var(--new); color: var(--new-ink); }
.badge--done { background: #FFFFFF; color: var(--good); border: 2px solid var(--good); }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-family: var(--font-head); font-weight: 800; font-size: 20px; line-height: 1.15; }
.card-desc { font-size: 15px; color: var(--muted); }
.card-prog { font-size: 14px; font-weight: 800; color: var(--sola); }
.theme-interesi .card-prog { color: var(--interesi-text); }

.bar { height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar > div { height: 100%; border-radius: 99px; background: var(--sola); }
.theme-interesi .bar > div { background: var(--interesi-bar); }
.card-body .bar { margin-top: 4px; }

.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed var(--dash); border-radius: var(--radius); padding: 20px; text-align: center;
  color: var(--muted); min-height: 290px; font-weight: 800; font-size: 16px;
}

.results-wrap { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.results-wrap h2 { font-family: var(--font-head); font-weight: 800; font-size: 20px; }
.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.result {
  background: var(--card); border: 2px solid var(--line-soft); border-radius: 14px;
  padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-weight: 800; font-size: 15px;
}
.result b { font-weight: 900; font-size: 16px; white-space: nowrap; }
.result .good { color: var(--good); }
.result .bad { color: var(--bad); }

.lang-switch { display: flex; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 3px; gap: 3px; }
.lang-switch button {
  font-weight: 900; font-size: 15px; min-width: 52px; min-height: 40px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink);
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }

.note {
  margin-top: auto; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 2px solid var(--line-soft); border-radius: 14px; padding: 14px 16px;
  font-size: 15px; color: #3B4160;
}

/* ---------- portrait / narrower ---------- */
@media (max-width: 900px) {
  .page { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .door-title { font-size: 40px; }
  .continue-title { font-size: 21px; }
}
@media (max-width: 900px) and (orientation: portrait) {
  .doors { grid-template-columns: minmax(0, 1fr); }
  .door { flex-direction: row; align-items: center; }
  .door-text { flex: 1; }
}
@media (max-width: 640px) {
  .course-grid, .results { grid-template-columns: minmax(0, 1fr); }
  .continue { flex-wrap: wrap; }
  .greeting h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .press, .door { transition: none; }
  .press:active, .door:active { transform: none; }
}
