/* Page layout: sticky top bar, course shell (sidebar + content + table of contents), page column,
   footer and the off-canvas sidebar on narrow screens. Components live in komponenty/. */

.top {
  position: sticky; top: 0; z-index: 20;
  height: 56px; display: flex; align-items: center; gap: 18px;
  padding: 0 var(--s-5); background: var(--surface); border-bottom: 1px solid var(--border);
}
/* overlay below the off-canvas menu: hidden globally, otherwise it would be a grid item of .shell on desktop */
.backdrop { display: none; position: fixed; inset: 56px 0 0 0; background: var(--backdrop); z-index: 14; border: 0; padding: 0; }

.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr) 220px; min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); }
.side {
  border-right: 1px solid var(--border); background: var(--surface);
  padding: var(--s-5) 14px var(--s-8); position: sticky; top: 56px; overflow: auto;
  height: calc(100vh - 56px); height: calc(100dvh - 56px);
}
.side-h { margin: 0 0 10px 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); font-weight: 600; }
.side .course { margin: 0 10px 18px; }
.side .course b { display: block; font-size: 15px; }
.side .course small { color: var(--muted); }

.toc { padding: var(--s-6) var(--s-4); position: sticky; top: 56px; overflow: auto; height: calc(100vh - 56px); height: calc(100dvh - 56px); }
.toc a { display: block; padding: 6px 10px; font-size: 13px; color: var(--muted); border-left: 2px solid transparent; }
.toc a.l2 { padding-left: var(--s-5); }
.toc a:hover, .toc a.active { color: var(--accent); border-left-color: var(--accent); text-decoration: none; }

.page { padding: 32px var(--s-8) 80px; max-width: 820px; width: 100%; margin: 0 auto; }
.page.wide { max-width: 980px; }

footer { border-top: 1px solid var(--border); padding: var(--s-6) var(--s-5); color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 260px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .top { gap: 10px; padding: 0 var(--s-3); }
  .side {
    position: fixed; left: 0; top: 56px; width: min(300px, 85vw); z-index: 15; box-shadow: var(--shadow-lg);
    transform: translateX(-100%); visibility: hidden; transition: transform .18s, visibility .18s;
  }
  body.nav-open .side { transform: none; visibility: visible; }
  body.nav-open { overflow: hidden; }
  body.nav-open .backdrop { display: block; }
  .page { padding: 22px var(--s-4) 70px; }
}

/* narrow page variant for account forms and short notices */
.page.uzka { max-width: 560px; }
/* server messages (Django messages) above the page content */
.spravy { margin-bottom: var(--s-4); }
.spravy .box p { margin: 0; }
/* home page has no .page column, so its messages get their own wrapper */
.spravy-obal { max-width: 1060px; margin: 0 auto; padding: 0 var(--s-5); }
.spravy-obal .spravy { margin: var(--s-4) 0 0; } /* top gap only when there are messages, so the first screen keeps its height */
/* footer links to the legal pages */
.paticka-odkazy { display: flex; gap: var(--s-4); justify-content: center; flex-wrap: wrap; margin-bottom: 0; }
.paticka-odkazy a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
footer p { margin: 0; }
