/*
 * Table column sizing — no generic rules. Every table gets explicit control
 * via a <div class="..." markdown> wrapper.
 *
 * Classes:
 *   expand-col2  — column 2 gets remaining space, all others shrink to fit
 *   expand-last  — last column gets remaining space, all others shrink to fit
 *   expand-col2-wrap-col4 — like expand-col2, but column 4 also wraps
 *
 * Usage:
 *   <div class="expand-col2" markdown>
 *   | ID | Title | Published |
 *   ...
 *   </div>
 *
 * All selectors prefixed with .md-typeset for specificity over Material theme.
 */

/* ── Shared: all non-expanding cells shrink to content ── */

.md-typeset .expand-col2 td,
.md-typeset .expand-col2 th,
.md-typeset .expand-last td,
.md-typeset .expand-last th,
.md-typeset .expand-col2-wrap-col4 td,
.md-typeset .expand-col2-wrap-col4 th {
  white-space: nowrap;
  width: 1%;
}

/* ── expand-col2: column 2 absorbs remaining space ── */

.md-typeset .expand-col2 td:nth-child(2),
.md-typeset .expand-col2 th:nth-child(2) {
  white-space: normal;
  width: 99%;
}

/* ── expand-last: last column absorbs remaining space ── */

.md-typeset .expand-last td:last-child,
.md-typeset .expand-last th:last-child {
  white-space: normal;
  width: 99%;
}

/* ── expand-col2-wrap-col4: col 2 expands, col 4 also wraps ── */

.md-typeset .expand-col2-wrap-col4 td:nth-child(2),
.md-typeset .expand-col2-wrap-col4 th:nth-child(2) {
  white-space: normal;
  width: 99%;
}

.md-typeset .expand-col2-wrap-col4 td:nth-child(4),
.md-typeset .expand-col2-wrap-col4 th:nth-child(4) {
  white-space: normal;
  width: auto;
}

/* ── nowrap-ids: columns 1 and 2 don't wrap (for # + ID columns) ── */

.md-typeset .nowrap-ids td:nth-child(1),
.md-typeset .nowrap-ids th:nth-child(1),
.md-typeset .nowrap-ids td:nth-child(2),
.md-typeset .nowrap-ids th:nth-child(2) {
  white-space: nowrap;
  width: 1%;
}

.md-typeset .nowrap-ids td:last-child,
.md-typeset .nowrap-ids th:last-child {
  white-space: normal;
  width: 99%;
}

/* ── meta: headerless key-value metadata table ── */

.md-typeset .meta thead {
  display: none;
}

.md-typeset .meta table {
  margin-top: 0;
  margin-bottom: 0;
}

.md-typeset .meta td {
  padding: 0.2em 0.5em;
  border: none;
}

.md-typeset .meta td:first-child {
  white-space: nowrap;
  width: 1%;
}

.md-typeset .meta td:last-child {
  width: 99%;
}

/* ── split-text: all columns wrap, col 1 gets ~33%, rest share ~67% ── */

.md-typeset .split-text td,
.md-typeset .split-text th {
  white-space: normal;
  vertical-align: top;
}

.md-typeset .split-text td:first-child,
.md-typeset .split-text th:first-child {
  width: 33%;
}
