/* Neo4j course consistency fixes.
   Course-local and additive: keeps the shared Big Data Academy stylesheet authoritative. */

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

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

.lesson-shell,
.lesson-main,
.lesson-container,
.lesson-header,
.lesson-toc,
.lesson-content,
.lesson-content > section,
.lesson-support,
.support-section,
.support-grid,
.lesson-nav,
.objectives,
.checkpoint,
.callout,
.warning,
.table-wrap,
.code-window {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Long technical identifiers, URIs, procedure names, slash-separated terms,
   and generated headings must never force the whole page wider than the viewport. */
.lesson-header h1,
.lesson-content h2,
.lesson-content h3,
.lesson-content h4,
.lesson-content p,
.lesson-content li,
.lesson-content td,
.lesson-content th,
.lesson-content a,
.lesson-content strong,
.lesson-toc,
.lesson-nav,
.sidebar-lesson,
.sidebar-chapter summary {
  overflow-wrap: anywhere;
  word-break: normal;
}

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

/* Tables stay inside the lesson column. Existing .table-wrap containers keep
   their normal internal horizontal scrolling; unwrapped tables can shrink by
   wrapping long cell content instead of creating page-level scroll. */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

table.data-table {
  width: 100%;
  max-width: 100%;
}

table.data-table th,
table.data-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Code may scroll inside its own window, but the window itself may not widen
   the document. */
.code-window {
  width: 100%;
  overflow: hidden;
}

.code-window pre,
.lesson-content pre {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.code-window code {
  max-width: none;
}

/* Flex/grid descendants are a common source of min-content overflow. */
.lesson-header > *,
.lesson-nav > *,
.support-grid > *,
.objectives > * {
  min-width: 0;
}

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

/* -------------------------------------------------------------------------
   Neo4j course consistency pass 2 — code rhythm and table proportions.
   These rules are additive and leave the shared Academy stylesheet in charge
   of colors, typography, borders, and responsive behavior.
   ------------------------------------------------------------------------- */

/* Chapters generated in different batches used the same .code-line spans but
   some serialized newline text nodes between those spans. Because the shared
   code element preserves whitespace, those text nodes can look like an extra
   blank row between every real line. The compatibility script marks only code
   blocks that use direct .code-line children; zeroing typography on the parent
   suppresses serialization whitespace while restoring the Academy's canonical
   code typography on each actual line. Intentional empty .code-line elements
   remain visible as intentional blank code lines. */
.code-window code.neo4j-line-span-code {
  font-size: 0;
  line-height: 0;
}

.code-window code.neo4j-line-span-code > .code-line {
  font: 500 0.82rem/1.75 var(--font-mono);
}

/* Keep key/term columns useful instead of letting them collapse to a few
   characters. Two-column comparison/definition tables receive a stronger
   proportion; wider tables get a smaller minimum so they remain practical. */
table.data-table th:first-child,
table.data-table td:first-child {
  min-width: 8.5rem;
}

table.data-table.neo4j-two-column-table th:first-child,
table.data-table.neo4j-two-column-table td:first-child {
  width: 34%;
  min-width: 12rem;
}

table.data-table.neo4j-two-column-table th:nth-child(2),
table.data-table.neo4j-two-column-table td:nth-child(2) {
  width: 66%;
}

@media (max-width: 720px) {
  table.data-table th:first-child,
  table.data-table td:first-child {
    min-width: 7.5rem;
  }

  table.data-table.neo4j-two-column-table th:first-child,
  table.data-table.neo4j-two-column-table td:first-child {
    width: 38%;
    min-width: 10.5rem;
  }

  table.data-table.neo4j-two-column-table th:nth-child(2),
  table.data-table.neo4j-two-column-table td:nth-child(2) {
    width: 62%;
  }
}

