/* Responsive table system
   Use {% include table-start.html variant="balanced" %} before a markdown table
   and {% include table-end.html %} after it. The wrapper preserves readable
   column widths on small screens by scrolling horizontally when needed. */

.content .table-scroll {
  --table-min-width: 42rem;
  --table-cell-padding: 12px 14px;
  --table-head-bg: var(--bg-alt);
  width: 100%;
  max-width: 100%;
  margin: 1.5em 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid #ddd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.content .table-scroll table,
.content .table-scroll .examples-table,
.content .table-scroll .timestamp-table {
  display: table;
  width: 100%;
  min-width: var(--table-min-width);
  margin: 0;
  border: 0;
  border-collapse: collapse;
  border-radius: 0;
  box-shadow: none;
  table-layout: fixed;
}

.content .table-scroll th,
.content .table-scroll td {
  padding: var(--table-cell-padding);
  border: 1px solid #ddd;
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
}

.content .table-scroll th {
  background: var(--table-head-bg);
  color: var(--text);
  font-weight: 750;
}

.content .table-scroll tr:nth-child(even) td {
  background: #fafafa;
}

.content .table-scroll a {
  overflow-wrap: normal;
}

.content .table-scroll td:last-child a {
  white-space: nowrap;
}

.content .table-scroll mjx-container {
  max-width: 100%;
}

.content .table-scroll td mjx-container {
  display: inline-block;
  vertical-align: middle;
  font-size: .96em;
}

.content .table-scroll mjx-container[display="true"] {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  padding: .25rem 0 .2rem;
}

.content .table-scroll-compact {
  --table-min-width: 34rem;
  --table-cell-padding: 10px 12px;
}

.content .table-scroll-wide {
  --table-min-width: 54rem;
}

.content .table-scroll-timestamps {
  --table-min-width: 44rem;
}

.content .table-scroll-examples {
  --table-min-width: 38rem;
}

.content .table-scroll table.timestamp-table th:first-child,
.content .table-scroll table.timestamp-table td:first-child,
.content .table-scroll .timestamp-table th:first-child,
.content .table-scroll .timestamp-table td:first-child {
  width: 48%;
}

.content .table-scroll table.timestamp-table th:nth-child(2),
.content .table-scroll table.timestamp-table td:nth-child(2),
.content .table-scroll .timestamp-table th:nth-child(2),
.content .table-scroll .timestamp-table td:nth-child(2) {
  width: 34%;
}

.content .table-scroll table.timestamp-table th:last-child,
.content .table-scroll table.timestamp-table td:last-child,
.content .table-scroll .timestamp-table th:last-child,
.content .table-scroll .timestamp-table td:last-child {
  width: 18%;
  min-width: 7rem;
  text-align: center;
  white-space: nowrap;
}

.content .table-scroll table.examples-table td:first-child,
.content .table-scroll table.examples-table th:first-child,
.content .table-scroll .examples-table td:first-child,
.content .table-scroll .examples-table th:first-child {
  width: 64%;
}

.content .table-scroll table.examples-table td:last-child,
.content .table-scroll table.examples-table th:last-child,
.content .table-scroll .examples-table td:last-child,
.content .table-scroll .examples-table th:last-child {
  width: 36%;
  min-width: 8rem;
  text-align: center;
}

.content .table-scroll table.examples-table a,
.content .table-scroll .examples-table a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media (max-width: 700px) {
  .content .table-scroll {
    border-radius: 12px;
  }

  .content .table-scroll table,
  .content .table-scroll .examples-table,
  .content .table-scroll .timestamp-table {
    display: table;
    width: 100%;
    min-width: var(--table-min-width);
    table-layout: fixed;
  }

  .content .table-scroll th,
  .content .table-scroll td {
    padding: 11px 12px;
  }
}
