/* layout.css — shell, topbar, layout grid, sidebar contenidor, main */

/* ── Shell ──────────────────────────────────────────────────────────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar {
  flex: 0 0 auto;
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: 54px;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}

/* ── Selector de curs (botons grans, estil segmentat) ─────────────── */
.course-switch {
  display: inline-flex; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 22px; padding: 3px; gap: 2px;
}
.course-btn {
  padding: 7px 16px; border-radius: 18px;
  font-size: 14.5px; font-weight: 700; color: var(--muted);
  white-space: nowrap; transition: .14s var(--ease);
}
.course-btn:hover { color: var(--navy); }
.course-btn.active {
  background: var(--blue); color: #fff;
  box-shadow: 0 1px 3px rgba(46,117,182,.35);
}
.course-btn:disabled,
.course-btn[aria-disabled="true"] {
  color: var(--hint); cursor: not-allowed; opacity: .55;
}
.course-btn:disabled:hover,
.course-btn[aria-disabled="true"]:hover { color: var(--hint); }

.brand {
  font-size: 16px; font-weight: 800; color: var(--navy); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: right;
}
.brand small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }

/* hamburger (només mòbil) */
.menu-toggle { display: none; }

/* ── Layout: sidebar + contingut ───────────────────────────────────── */
.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: start;   /* perquè la sidebar sticky no s'estiri */
}

/* ── Sidebar (contenidor) ───────────────────────────────────────────── */
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  padding: 16px 12px 60px;
  /* Flotant: es manté visible en fer scroll del contingut.
     54px = alçada de la topbar; la barra té el seu propi scroll intern. */
  position: sticky;
  top: 54px;
  align-self: start;
  height: calc(100dvh - 54px);
  overflow-y: auto;
}

/* ── Main / contingut ───────────────────────────────────────────────── */
.main { min-width: 0; }
.doc-wrap { max-width: 880px; margin: 0 auto; padding: 30px 32px 80px; }
