/* ── Tables ────────────────────────────────────────────────────
   Dense, scannable rows for management screens (Website Studio,
   Build2Teach Studio, Central Portal). Not used on public pages.
*/
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table th, .table td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--type-small-size);
    vertical-align: middle;
}

.table th {
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-weight: var(--type-label-weight);
}

.table tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .table {
        display: block;
        overflow-x: auto;
    }
}

/* ── Markdown-rendered tables ──────────────────────────────────
   Distinct from `.table` above (dense Studio management screens):
   this is what a GFM pipe table in authored Markdown becomes - see
   apps.core.markdown's table_open/table_close render rule, which
   wraps every rendered table in `.table-responsive`. Appears
   wherever rendered Markdown appears (the Content Editor's live
   preview and every public Article/Project/Offering/Profile page)
   via the shared `.markdown-content` wrapper - there is nothing
   page-specific here. White canvas and reading-mode padding, not
   the Studio's denser look. */
.markdown-content .table-responsive {
    margin: var(--space-5) 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    /* Setting only overflow-x makes the UA compute overflow-y as
       `auto` too (per the CSS Overflow spec), which is exactly what's
       wanted here: the rounded corners above stay clipped, and a
       wide table scrolls horizontally only when it doesn't fit -
       no separate small-screen media query needed. */
    overflow-x: auto;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-background);
    font-size: var(--type-small-size);
}

.markdown-content th,
.markdown-content td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.markdown-content thead th {
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-weight: var(--type-label-weight);
}

.markdown-content tbody tr:last-child td {
    border-bottom: none;
}
