/* =========================================================
   TABLES (sitewide base style)
   ========================================================= */

table{
  border-spacing: 0;
  border-collapse: separate;
  border-radius: 22px;
  border: 2px solid #000;
  overflow: hidden;
}

caption {
  caption-side: bottom;
  background-color: #000;
  color: #fff;
  font-weight: 800;
  padding: 10px 8px;
  text-align: left;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

tbody, td{
  padding: 5px;
}

tr:nth-child(even){
  background-color: #f2f2f2;
}

/* Round corners on outermost cells */
tr:last-child td:last-child{
  border-bottom-right-radius: 20px;
}

tr:last-child td:first-child{
  border-bottom-left-radius: 20px;
}

tr:first-child th:first-child{
  border-top-left-radius: 20px;
}

tr:first-child th:last-child{
  border-top-right-radius: 20px;
}

/* Desktop header styling */
@media only screen and (min-width: 801px) {
  thead th{
    font-size: 1.25em;
    font-weight: 800;
    background-color: #000;
    color: #fff;
    padding: 5px;
  }
}


/* =========================================================
   MOBILE RESPONSIVE TABLES (stack into cards)
   ========================================================= */

@media (max-width: 800px) {

  /* Make tables behave like stacked blocks */
  table,
  thead,
  tbody,
  tr,
  th,
  td,
  caption {
    display: block;
  }

  /* Hide header row in mobile view */
  thead {
    display: none;
  }

  /* Divider between "records", but not after the last one */
  tbody tr:not(:last-child) {
    border-bottom: 2px solid #000;
  }

  td {
    border: none;
    white-space: normal;
    text-align: left;
    position: relative;
  }

  /* Label + value layout */
  td::before {
    content: attr(data-title);
    display: block;
    margin: 0 0 4px 0;
    padding: 2px 6px;

    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    background-color: #000;
    width: fit-content;
  }
}