/* Terralogiq C — Gutenberg table style
   Figma: Website-Terralogiq node 7719:10401

   Gutenberg often omits <thead>. In that case the first <tbody> row
   is the header (all <td>), so it must get the gray header treatment. */

.wp-block-table.is-style-terralogiqc table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

/* WP core adds a 3px thead/tfoot rule — Figma uses a uniform 1px cell border */
.wp-block-table.is-style-terralogiqc thead,
.wp-block-table.is-style-terralogiqc tfoot {
  border: none;
}

.wp-block-table.is-style-terralogiqc th,
.wp-block-table.is-style-terralogiqc td {
  border: 1px solid #ebebeb;
  padding: 10px;
  text-align: center;
  vertical-align: middle;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #202124;
  background-color: #fff;
  font-weight: 400;
}

/* Header: thead when the Header section is on */
.wp-block-table.is-style-terralogiqc thead th,
.wp-block-table.is-style-terralogiqc thead td {
  background-color: #d0d6dd;
  font-weight: 600;
}

/* Header: first body row when there is no thead (typical editor output) */
.wp-block-table.is-style-terralogiqc table:not(:has(thead)) tbody tr:first-child th,
.wp-block-table.is-style-terralogiqc table:not(:has(thead)) tbody tr:first-child td {
  background-color: #d0d6dd;
  font-weight: 600;
}

/* First column of body rows is Medium — skip the header row when it lives in tbody */
.wp-block-table.is-style-terralogiqc table:has(thead) tbody td:first-child,
.wp-block-table.is-style-terralogiqc table:has(thead) tbody th:first-child,
.wp-block-table.is-style-terralogiqc table:not(:has(thead)) tbody tr:not(:first-child) td:first-child,
.wp-block-table.is-style-terralogiqc table:not(:has(thead)) tbody tr:not(:first-child) th:first-child {
  font-weight: 500;
}
