/* Modern Tables – Smart Column Widths */
.mt-scroll {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
.mt-enhanced {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}
.mt-enhanced th, .mt-enhanced td {
  word-wrap: break-word !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
}

/* Optional: keep header sticky hint (disabled by default) */
/*
.mt-scroll .mt-enhanced thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  background: inherit !important;
}
*/
/* v1.1.0: Stabilize 4+ column tables */
table.info-table, table.mtable, table[data-modern-table="1"] {
  table-layout: fixed;
  width: 100%;
}
table.info-table th, table.info-table td,
table.mtable th, table.mtable td,
table[data-modern-table="1"] th, table[data-modern-table="1"] td {
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* v1.1.1: Hide captions for targeted tables */
table.info-table > caption,
table.mtable > caption,
table[data-modern-table="1"] > caption { display: none !important; }

/* v1.1.1: Font-size for 4+ columns when class is set by JS */
table.mt-4plus th, table.mt-4plus td { font-size: 9px !important; }


/* v1.1.2 – Spacing & desktop font bump helpers */
/* Always keep vertical space above/below targeted tables and wrappers */
:is(table.info-table, table.mtable, table[data-modern-table="1"]), .mt-scroll {
  margin-top: 20px !important;
  margin-bottom: 20px !important;
}

/* Ensure adjacent paragraphs/images don't touch tables */
:where(p, img, figure) + :is(table.info-table, table.mtable, table[data-modern-table="1"]),
:is(table.info-table, table.mtable, table[data-modern-table="1"]) + :where(p, img, figure),
:where(p, img, figure) + .mt-scroll,
.mt-scroll + :where(p, img, figure) {
  margin-top: 20px !important;
}

/* Note: Font-size on desktop is applied inline via JS to override previous !important rules. */



/* v1.1.4 – Minimal header fallback if theme misses tbody-headers */
table.mtable thead th {
  font-weight: 700 !important;
  background: rgba(0,0,0,0.04) !important;
}



/* v1.1.5 – Mobile center alignment */
@media (max-width: 768px) {
  /* Center the table block horizontally (for narrower-than-container tables) */
  :is(table.info-table, table.mtable, table[data-modern-table="1"]), .mt-scroll {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  /* Center text inside header and body cells */
  :is(table.info-table, table.mtable, table[data-modern-table="1"]) th,
  :is(table.info-table, table.mtable, table[data-modern-table="1"]) td {
    text-align: center !important;
    vertical-align: middle !important;
  }
}

