/* Apache Cassandra course consistency and overflow fixes — 2026-09-08 */

html,
body {
  max-width: 100%;
}

body.lesson-page {
  overflow-x: clip;
}

.lesson-shell,
.lesson-shell > *,
.lesson-content,
.lesson-content > *,
.lesson-header,
.lesson-support,
.section-shell,
.course-sidebar,
.lesson-nav,
.lesson-nav > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.lesson-header h1,
.lesson-content h2,
.lesson-content h3,
.lesson-content h4,
.lesson-content p,
.lesson-content li,
.lesson-content dd,
.lesson-content dt,
.lesson-content blockquote,
.lesson-meta span,
.sidebar-chapter summary,
.sidebar-lesson,
.lesson-nav strong,
.reference-list a,
.donation-card code {
  overflow-wrap: anywhere;
  word-break: normal;
}

.lesson-content :not(pre) > code,
.lesson-content td code,
.lesson-content th code {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.code-window,
.code-window pre,
.lesson-content pre {
  max-width: 100%;
  min-width: 0;
}

.code-window pre,
.lesson-content pre {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.code-window code,
.code-window .code-line,
.lesson-content pre code {
  overflow-wrap: normal;
  word-break: normal;
  white-space: pre;
}

.cassandra-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.cassandra-table-scroll > table.data-table {
  width: 100%;
  min-width: max-content;
  max-width: none;
  margin-inline: 0;
}

.cassandra-table-scroll:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Make the explicit current-lesson state resilient even if older shared CSS is cached. */
.sidebar-lesson.is-current,
.sidebar-lesson[aria-current="page"] {
  font-weight: 700;
}

.sidebar-lesson.is-current i,
.sidebar-lesson[aria-current="page"] i {
  display: inline-flex;
}

/* Prism/CQL token styling, scoped to this course and aligned with the academy theme variables. */
.cassandra-syntax-highlighted .token.comment,
.cassandra-syntax-highlighted .token.prolog,
.cassandra-syntax-highlighted .token.doctype,
.cassandra-syntax-highlighted .token.cdata {
  color: var(--syntax-comment, #718096);
}

.cassandra-syntax-highlighted .token.punctuation {
  color: var(--muted, currentColor);
}

.cassandra-syntax-highlighted .token.property,
.cassandra-syntax-highlighted .token.tag,
.cassandra-syntax-highlighted .token.constant,
.cassandra-syntax-highlighted .token.symbol,
.cassandra-syntax-highlighted .token.variable {
  color: var(--syntax-name, #93c5fd);
}

.cassandra-syntax-highlighted .token.boolean,
.cassandra-syntax-highlighted .token.number {
  color: var(--syntax-number, #fbbf24);
}

.cassandra-syntax-highlighted .token.selector,
.cassandra-syntax-highlighted .token.attr-name,
.cassandra-syntax-highlighted .token.string,
.cassandra-syntax-highlighted .token.char,
.cassandra-syntax-highlighted .token.builtin,
.cassandra-syntax-highlighted .token.inserted {
  color: var(--syntax-string, #86efac);
}

.cassandra-syntax-highlighted .token.operator,
.cassandra-syntax-highlighted .token.entity,
.cassandra-syntax-highlighted .token.url {
  color: var(--syntax-operator, #fda4af);
}

.cassandra-syntax-highlighted .token.atrule,
.cassandra-syntax-highlighted .token.attr-value,
.cassandra-syntax-highlighted .token.function,
.cassandra-syntax-highlighted .token.class-name,
.cassandra-syntax-highlighted .token.cql-command {
  color: var(--syntax-function, #67e8f9);
}

.cassandra-syntax-highlighted .token.keyword,
.cassandra-syntax-highlighted .token.cql-keyword {
  color: var(--syntax-keyword, #c084fc);
  font-weight: 650;
}

.cassandra-syntax-highlighted .token.regex,
.cassandra-syntax-highlighted .token.important {
  color: var(--warning, #fbbf24);
}

.cassandra-syntax-highlighted .token.important,
.cassandra-syntax-highlighted .token.bold {
  font-weight: 700;
}

.cassandra-syntax-highlighted .token.italic {
  font-style: italic;
}

@supports not (overflow-x: clip) {
  body.lesson-page {
    overflow-x: hidden;
  }
}
