:root {
  --ink: #1d2521;
  --muted: #65716a;
  --line: #dce4de;
  --paper: #f7faf7;
  --surface: #ffffff;
  --surface-2: #e8eee9;
  --brand: #276b4f;
  --brand-dark: #174632;
  --button-bg: #276b4f;
  --accent: #c4572a;
  --white: #ffffff;
  --header-bg: rgba(247, 250, 247, .94);
  --danger-ink: #7b1f1f;
  --danger-bg: #f7dddd;
  --danger-line: #e7a9a9;
  --shadow: 0 14px 40px rgba(25, 42, 31, 0.14);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6ece8;
    --muted: #a3b0a8;
    --line: #35413a;
    --paper: #121815;
    --surface: #1a221d;
    --surface-2: #2b362f;
    --brand: #6cc39a;
    --brand-dark: #a9dcc2;
    --button-bg: #2f7c5a;
    --accent: #e58a5e;
    --header-bg: rgba(18, 24, 21, .94);
    --danger-ink: #f3b8b8;
    --danger-bg: #3a2020;
    --danger-line: #5c2f2f;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #e6ece8;
  --muted: #a3b0a8;
  --line: #35413a;
  --paper: #121815;
  --surface: #1a221d;
  --surface-2: #2b362f;
  --brand: #6cc39a;
  --brand-dark: #a9dcc2;
  --button-bg: #2f7c5a;
  --accent: #e58a5e;
  --header-bg: rgba(18, 24, 21, .94);
  --danger-ink: #f3b8b8;
  --danger-bg: #3a2020;
  --danger-line: #5c2f2f;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; font-weight: 700; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--button-bg);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
}

button:disabled { opacity: .5; cursor: not-allowed; }
.secondary { background: var(--surface-2); color: var(--ink); }
.danger { background: #9f2f2f; }

.theme-toggle {
  min-height: 36px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
}

.danger-badge {
  color: var(--danger-ink);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
}

.site-header nav { margin-left: auto; }

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-toggle {
  display: none;
  min-height: 36px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.brand { color: var(--ink); font-size: 20px; }

nav {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

nav form { margin: 0; }
.link-button { min-height: 0; padding: 0; background: transparent; color: var(--brand); }
.nav-cta { color: var(--accent); }

main { min-height: calc(100vh - 130px); }

.hero {
  min-height: 540px;
  display: grid;
  align-items: end;
  padding: 80px 28px;
  background:
    linear-gradient(90deg, rgba(20, 40, 31, .82), rgba(20, 40, 31, .22)),
    url("/uvodni-foto.jpeg") center/cover;
  color: white;
}

.hero > div, .section {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 86px);
  margin: 0 0 12px;
  letter-spacing: 0;
}

.hero p { max-width: 620px; font-size: 20px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.section {
  padding: 54px 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

h1, h2, h3 { line-height: 1.15; margin-top: 0; }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: 13px; }
.muted { color: var(--muted); }

.instructor-phone {
  margin: -8px 0 16px;
  color: var(--muted);
}

.instructor-phone summary {
  display: inline;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

.instructor-phone a {
  margin-left: 8px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.lesson-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.subsection {
  margin: 0 0 30px;
}

.compact-form {
  max-width: 720px;
}

.lesson-layout.has-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}

.lesson-main { min-width: 0; }

.lesson-aside {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
}

.side-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.page-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 420px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 0 0 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 28px;
}

.stat-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-card span {
  color: var(--muted);
}

.price-list {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.price-row:last-child {
  border-bottom: 0;
}

.price-row div {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
}

.price-row strong {
  flex: 0 0 auto;
  color: var(--brand);
  text-align: right;
  white-space: nowrap;
}

.lesson-detail-photo {
  width: 100%;
  max-height: 520px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  margin: 0 0 28px;
}

.lesson-body { padding: 18px; }
.lesson-meta { color: var(--accent); font-weight: 700; font-size: 14px; }
.article-body {
  white-space: normal;
  font-size: 17px;
}
.capacity { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0; color: var(--muted); }
.card-action-form { margin-top: 14px; }
.card-calendar-link { margin-top: 10px; }
.disabled-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.75;
  margin-top: 14px;
}

.auth-panel, .narrow {
  width: min(560px, calc(100% - 32px));
  margin: 46px auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 700; min-width: 0; }
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input { width: auto; }
input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
}

input:disabled {
  color: var(--muted);
  background: var(--surface-2);
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 320px;
}

.inline-form select {
  min-width: 190px;
}

.flash {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.flash.success { border-color: #89bd97; }
.flash.error { border-color: #d88989; }

.two-column {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 36px;
}

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
table:not(.price-table) { min-width: 720px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }

.detail-photo {
  width: min(720px, 100%);
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 28px;
}

.text-page { max-width: 780px; }
.info-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.info-strip span { padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.empty { color: var(--muted); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.cookie-notice {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.cookie-notice p {
  margin: 0;
  color: var(--muted);
}

.cookie-notice .actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .lesson-layout.has-aside { grid-template-columns: 1fr; }
  .lesson-aside { position: static; }
  .side-photo { width: min(420px, 100%); margin: 0 auto; }
}

@media (max-width: 760px) {
  .site-header { min-height: 0; padding: 10px 16px; }
  .site-header nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-left: 0;
    padding: 4px 0 10px;
  }
  .site-header.nav-open nav { display: flex; }
  .site-header nav a { display: block; width: 100%; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .site-header nav a:last-of-type { border-bottom: 0; }
  .site-header nav form { width: 100%; padding-top: 8px; }
  .nav-toggle { display: inline-flex; }
  .hero { min-height: 500px; padding: 60px 18px; }
  .section { padding: 38px 18px; }
  .section-head, .site-footer, .cookie-notice { align-items: flex-start; flex-direction: column; }
  .two-column, .form-row { grid-template-columns: 1fr; }
  .auth-panel { padding: 22px; }
  .cookie-notice { gap: 10px; padding: 12px 14px; }
  .cookie-notice p { font-size: 13px; }
  .cookie-notice .actions { width: 100%; justify-content: space-between; }
}
