/* =========================================================
   TESTMASTERPREP ACADEMY — TABLE WIDTH FIX
   Restores native table layout inside Course/Lesson/Quiz content.
   The scroll container is the wrapper, NOT the <table> itself.
========================================================= */

/* The earlier Academy rule set table { display:block }, which causes
   columns to shrink to their intrinsic content width. Restore table semantics. */
.tma .zcm-template-content table,
.tma .zcm-template-content table.wp-block-table,
.tma .zcm-template-content .tmp-exam-table{
  display:table!important;
  width:100%!important;
  min-width:100%!important;
  max-width:none!important;
  table-layout:auto!important;
  box-sizing:border-box!important;
  margin-left:0!important;
  margin-right:0!important;
}

/* Gutenberg puts tables inside figure.wp-block-table.
   Scrolling belongs on the wrapper while the table remains a real table. */
.tma .zcm-template-content .wp-block-table,
.tma .wp-block-table{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  box-sizing:border-box!important;
}

/* Ensure the table inside a Gutenberg wrapper fills the available reading width. */
.tma .zcm-template-content .wp-block-table > table,
.tma .wp-block-table > table{
  display:table!important;
  width:100%!important;
  min-width:100%!important;
  max-width:none!important;
  table-layout:auto!important;
}

/* Zartom/TMP rich-content table wrapper follows the same rule. */
.tma .zcm-template-content .tmp-table-wrap,
.tma .tmp-table-wrap{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  box-sizing:border-box!important;
}

.tma .zcm-template-content .tmp-table-wrap > table,
.tma .tmp-table-wrap > table,
.tma .tmp-table-wrap .tmp-exam-table{
  display:table!important;
  width:100%!important;
  min-width:100%!important;
  max-width:none!important;
  table-layout:auto!important;
}

/* Cells remain normal table cells; do not let theme/Divi turn them into blocks. */
.tma .zcm-template-content table tr{
  display:table-row!important;
}

.tma .zcm-template-content table thead{
  display:table-header-group!important;
}

.tma .zcm-template-content table tbody{
  display:table-row-group!important;
}

.tma .zcm-template-content table th,
.tma .zcm-template-content table td{
  display:table-cell!important;
  box-sizing:border-box!important;
}

/* On narrow screens, retain the wrapper scroll behavior rather than clipping. */
@media(max-width:766px){
  .tma .zcm-template-content .wp-block-table,
  .tma .zcm-template-content .tmp-table-wrap{
    -webkit-overflow-scrolling:touch;
  }
}
