/**
 * Shared article / page prose: tables inside rich text.
 * Loaded after theme CSS via template_head.
 *
 * Wrapper: horizontal scroll only (does not change table display — themes may use
 * display:block + thead/tr { display:table } for responsive layout).
 *
 * Cell rules: baseline borders/padding for themes that omit table styles (e.g. geo-insight-hub)
 * and to fix TinyMCE border-width-only inline styles that never render without border-style.
 */
:root {
  --yh-table-pad-y: 0.65rem;
  --yh-table-pad-x: 0.85rem;
  --yh-table-border: color-mix(in srgb, CanvasText 16%, transparent);
  --yh-table-head-bg: color-mix(in srgb, CanvasText 6%, Canvas);
}

:is(
  .post-content,
  .prose,
  .corp-content,
  .studio-content,
  .steady-content,
  .vivid-content,
  .tx-post-content,
  .tx-page-content,
  .tx-prose-block,
  .ts-article-body,
  .ts-page-content,
  .ts-post-body,
  .ts-contact-page-content,
  .ts-hall-prose,
  .ag-article-body,
  .ag-page-content,
  .ag-post-body,
  .ag-contact-page-content,
  .geo-page-content,
  .neon-article.post-content
) .yh-table-scroll {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 1.25rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

:is(
  .post-content,
  .prose,
  .corp-content,
  .studio-content,
  .steady-content,
  .vivid-content,
  .tx-post-content,
  .tx-page-content,
  .tx-prose-block,
  .ts-article-body,
  .ts-page-content,
  .ts-post-body,
  .ts-contact-page-content,
  .ts-hall-prose,
  .ag-article-body,
  .ag-page-content,
  .ag-post-body,
  .ag-contact-page-content,
  .geo-page-content,
  .neon-article.post-content
) .yh-table-scroll > table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.55;
}

:is(
  .post-content,
  .prose,
  .corp-content,
  .studio-content,
  .steady-content,
  .vivid-content,
  .tx-post-content,
  .tx-page-content,
  .tx-prose-block,
  .ts-article-body,
  .ts-page-content,
  .ts-post-body,
  .ts-contact-page-content,
  .ts-hall-prose,
  .ag-article-body,
  .ag-page-content,
  .ag-post-body,
  .ag-contact-page-content,
  .geo-page-content,
  .neon-article.post-content
) .yh-table-scroll :is(th, td) {
  border: 1px solid var(--yh-table-border);
  padding: var(--yh-table-pad-y) var(--yh-table-pad-x);
  vertical-align: top;
  text-align: start;
  word-break: break-word;
  overflow-wrap: anywhere;
}

:is(
  .post-content,
  .prose,
  .corp-content,
  .studio-content,
  .steady-content,
  .vivid-content,
  .tx-post-content,
  .tx-page-content,
  .tx-prose-block,
  .ts-article-body,
  .ts-page-content,
  .ts-post-body,
  .ts-contact-page-content,
  .ts-hall-prose,
  .ag-article-body,
  .ag-page-content,
  .ag-post-body,
  .ag-contact-page-content,
  .geo-page-content,
  .neon-article.post-content
) .yh-table-scroll th {
  font-weight: 600;
  background: var(--yh-table-head-bg);
}
