/* ==========================================================================
   Meeting minutes tables (revision 2)

   Changed from rev 1:
   - No longer depends on scope="col" / scope="row" (the text format strips them)
   - Broader selector list so it works regardless of body wrapper class
   - Includes a temporary load test at the bottom

   ========================================================================== */

/* Selector list is deliberately broad. If this styles tables you did NOT want
   styled (views listings, webform tables), narrow it to just the body-field
   wrapper once you have confirmed which one your theme uses. */

main table,
.field--name-body table,
.node__content table,
.text-content table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 1rem;
  line-height: 1.4;
  border: 1px solid #d1d5db;
}

main table caption,
.field--name-body table caption,
.node__content table caption,
.text-content table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  padding: 0 0 0.5rem;
  color: inherit;
}

main table th,
main table td,
.field--name-body table th,
.field--name-body table td,
.node__content table th,
.node__content table td,
.text-content table th,
.text-content table td {
  border: 1px solid #d1d5db;
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}

/* Column headers */
main table thead th,
.field--name-body table thead th,
.node__content table thead th,
.text-content table thead th {
  background-color: #f3f4f6;
  font-weight: 700;
}

/* Row headers: first cell of each body row, matched by position rather than
   by scope, since scope is being stripped on save. */
main table tbody tr > th:first-child,
.field--name-body table tbody tr > th:first-child,
.node__content table tbody tr > th:first-child,
.text-content table tbody tr > th:first-child {
  background-color: #f9fafb;
  font-weight: 700;
}

/* Totals row */
main table tfoot th,
main table tfoot td,
.field--name-body table tfoot th,
.field--name-body table tfoot td,
.node__content table tfoot th,
.node__content table tfoot td,
.text-content table tfoot th,
.text-content table tfoot td {
  background-color: #f3f4f6;
  font-weight: 700;
}

@media print {
  main table,
  .field--name-body table,
  .node__content table {
    page-break-inside: avoid;
  }

  main table thead th,
  .field--name-body table thead th,
  .node__content table thead th {
    background-color: transparent;
    border-bottom: 2px solid #000;
  }
}

/* ==========================================================================
   TEMPORARY LOAD TEST
   Uncomment, rebuild cache, reload the page.
   If the table does NOT get a thick red outline, this file is not loading
   at all and the problem is the library attachment, not the CSS.
   Delete this block once confirmed.
   ========================================================================== */

/*
table {
  outline: 3px solid red !important;
}
*/