/* Teacher app entrypoint. Shared design system styles are loaded from Classroom.Web.DesignSystem. */

:root {
  --app-sidebar-gradient-start: var(--ds-color-brand-secondary);
  --app-sidebar-gradient-end: var(--ds-color-brand-primary);
}

#blazor-error-ui:not([style*="display:block"]):not([style*="display: block"]) {
  display: none;
}

.notes-editor {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.notes-preview-shell {
  border: 1px solid var(--ds-color-border-muted);
  border-radius: 0.75rem;
  background: var(--ds-color-surface);
  min-height: 23.25rem;
  max-height: 28rem;
  overflow: auto;
}

.notes-preview-content {
  padding: 1rem;
  line-height: 1.6;
}

.notes-preview-content > :first-child {
  margin-top: 0;
}

.notes-preview-content > :last-child {
  margin-bottom: 0;
}

.notes-rendered-content {
  line-height: 1.7;
}

.notes-rendered-content > :first-child {
  margin-top: 0;
}

.notes-rendered-content > :last-child {
  margin-bottom: 0;
}

.app-rich-math-preview-shell {
  border: 1px solid var(--ds-color-border-muted);
  border-radius: 0.75rem;
  background: var(--ds-color-surface);
  min-height: 16rem;
}

.app-rich-math-content {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.app-rich-math-content--compact {
  font-size: var(--ds-font-size-body);
  line-height: 1.6;
}

.app-rich-math-content--button {
  display: inline-block;
  flex: 1 1 auto;
  min-width: 0;
}

.app-rich-math-content--button .katex-display,
.app-rich-math-content--button p {
  margin: 0;
}

.app-rich-math-content > :first-child {
  margin-top: 0;
}

.app-rich-math-content > :last-child {
  margin-bottom: 0;
}

.app-rich-math-content pre,
.app-rich-math-content code {
  white-space: pre-wrap;
  word-break: break-word;
}

.app-rich-math-content .katex-display {
  margin: 1rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}

@media (min-width: 992px) {
  .app-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .app-shell__main {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
}

#classroom-notes-print-root {
  display: none;
}

@media print {
  @page {
    margin: 0;
  }

  body.notes-print-active {
    background: var(--ds-color-surface-raised) !important;
  }

  body.notes-print-active .app-shell,
  body.notes-print-active #blazor-error-ui,
  body.notes-print-active #components-reconnect-modal {
    display: none !important;
  }

  body.notes-print-active #classroom-notes-print-root {
    display: block !important;
    margin: 0;
    padding: 12mm 14mm;
    color: var(--ds-color-text-primary);
    background: var(--ds-color-surface-raised);
    font-family: "Times New Roman", Times, serif;
    line-height: var(--ds-line-height-body);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  body.notes-print-active .classroom-notes-print-header {
    border-bottom: 1px solid var(--ds-color-border-subtle);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
  }

  body.notes-print-active .classroom-notes-print-header h1 {
    font-size: var(--ds-font-size-h2);
    margin: 0;
  }

  body.notes-print-active .classroom-notes-print-meta {
    color: var(--ds-color-text-secondary);
    font-size: var(--ds-font-size-label);
    margin-top: 0.25rem;
  }

  body.notes-print-active .classroom-notes-print-content > :first-child {
    margin-top: 0;
  }

  body.notes-print-active .classroom-notes-print-content > :last-child {
    margin-bottom: 0;
  }

  body.notes-print-active .classroom-notes-page-break {
    break-before: page;
    page-break-before: always;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  body.notes-print-active .classroom-notes-print-content h1,
  body.notes-print-active .classroom-notes-print-content h2,
  body.notes-print-active .classroom-notes-print-content h3,
  body.notes-print-active .classroom-notes-print-content h4 {
    break-after: avoid-page;
    page-break-after: avoid;
  }

  body.notes-print-active .classroom-notes-print-content .katex-display,
  body.notes-print-active .classroom-notes-print-content ul,
  body.notes-print-active .classroom-notes-print-content ol,
  body.notes-print-active .classroom-notes-print-content pre,
  body.notes-print-active .classroom-notes-print-content blockquote,
  body.notes-print-active .classroom-notes-print-content table {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  body.notes-print-active .classroom-notes-print-content p {
    orphans: 3;
    widows: 3;
  }

  .app-rich-math-content .katex-display,
  .app-rich-math-content ul,
  .app-rich-math-content ol,
  .app-rich-math-content pre,
  .app-rich-math-content blockquote,
  .app-rich-math-content table {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .app-rich-math-content p,
  .app-rich-math-content li {
    orphans: 3;
    widows: 3;
  }
}
