/* Responsive listicle tables for blog.tchop.io (wavy-child).
   Generated by scripts/make-tables-responsive.py. Do not hand-edit.
   Layer 1: wide tables scroll instead of compressing (all widths).
   Layer 2: at 700px and below each row collapses into a stacked card. */

/* Layer 1: horizontal scroll container. figure.wp-block-table covers block
   tables even with JS off; .table-scroll is added by the JS for classic tables. */
.table-scroll,
figure.wp-block-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
}
table.rtable {
  width: 100%;
  border-collapse: collapse;
}

/* Layer 2: stacked cards on phones */
@media (max-width: 700px) {
  .table-scroll,
  figure.wp-block-table { overflow-x: visible; }

  table.rtable {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
    font-size: 1rem;
  }
  /* hide the header row visually, keep it for assistive tech */
  table.rtable thead {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
  }
  table.rtable tbody { display: block; }

  /* each row becomes a card */
  table.rtable tbody tr {
    display: block;
    margin: 0 0 14px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    overflow: hidden;
  }
  /* first cell (th scope=row, or the JS-marked first column) is the card title */
  table.rtable tbody tr th[scope="row"],
  table.rtable tbody tr [data-rowhead] {
    display: block;
    padding: 12px 14px 10px;
    font-weight: 700;
    color: #16181d;
    background: #f6f7f9;
    border-bottom: 1px solid #e6e6e6;
    text-align: left;
  }
  /* every other cell is a label / value line */
  table.rtable tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    text-align: right;
  }
  table.rtable tbody td[data-rowhead] { text-align: left; }
  table.rtable tbody td:last-child { border-bottom: 0; }
  table.rtable tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 1 45%;
    padding-right: 10px;
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
  }
}
