/* styles/layout.css
   App shell layout: sidebar + main pane structure shared by dashboard,
   subject and chapter screens, plus the two-column setup screen layout. */

/* ---- Shared app layout (sidebar + main) ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--color-text);
  padding: 0 8px 22px;
}

.sidebar__brand svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.sidebar__nav-item:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.sidebar__nav-item--active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.sidebar__nav-item svg {
  flex-shrink: 0;
}

.sidebar__footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}

.sidebar__nav-item--muted {
  color: var(--color-text-faint);
}

.main-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar--with-back {
  justify-content: flex-start;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 0;
}

.back-link:hover {
  color: var(--color-primary);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.page-content {
  padding: 32px;
  max-width: 1080px;
  width: 100%;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.page-subtitle {
  color: var(--color-text-muted);
  font-size: 14.5px;
  margin-top: 4px;
}

.section-heading {
  font-size: 17px;
  font-weight: 700;
  margin: 28px 0 16px;
}

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 16px 24px;
}

.site-footer__content {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}

.site-footer__logo {
  width: 2rem;
  height: auto;
}

.site-footer__text {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
}

@media (max-width: 640px) {
  .site-footer {
    padding: 14px 18px;
  }

  .site-footer__logo {
    width: 1.75rem;
  }
}

/* ---- Setup screen two-column layout ---- */
.setup-layout {
  display: flex;
  min-height: 100vh;
}

.setup-aside {
  width: 300px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.setup-main {
  flex: 1;
  padding: 48px 56px;
  max-width: 760px;
}

@media (max-width: 920px) {
  .setup-layout, .app-layout {
    flex-direction: column;
  }
  .sidebar, .setup-aside {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .setup-main {
    padding: 32px 24px;
  }
  .page-content {
    padding: 20px;
  }
}
