/*
 * Reusable responsive table primitives.
 *
 * Keeps article tables readable on desktop while preventing horizontal page
 * overflow on tablet and mobile.
 */

.panith-rich-text table,
.entry-content table,
.wp-block-table table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.panith-rich-text :where(table),
.entry-content :where(table),
.wp-block-table :where(table) {
  box-sizing: border-box;
}

.panith-rich-text th,
.panith-rich-text td,
.entry-content th,
.entry-content td,
.wp-block-table th,
.wp-block-table td {
  min-width: 140px;
  padding: 12px 14px;
  border: 1px solid rgba(18, 19, 20, 0.14);
  color: #55585A;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

.panith-rich-text th,
.entry-content th,
.wp-block-table th {
  color: #2C2D2D;
  font-weight: 700;
  background: #FFFDF8;
}

.wp-block-table,
.panith-rich-text .wp-block-table,
.entry-content .wp-block-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wp-block-table table {
  width: max-content;
  min-width: 100%;
}

@media (max-width: 760px) {
  .panith-rich-text table,
  .entry-content table,
  .wp-block-table table {
    width: max-content;
    min-width: 100%;
  }

  .panith-rich-text th,
  .panith-rich-text td,
  .entry-content th,
  .entry-content td,
  .wp-block-table th,
  .wp-block-table td {
    min-width: 132px;
    padding: 10px 12px;
    font-size: 14px;
  }
}
