/**
 * Niagara Transit — terminal platform tables (.nt-terminal-table)
 *
 * Wrap terminal platform guide tables in <div class="nt-terminal-table">.
 * Desktop: semantic table, NT palette. Mobile (≤720px): each row becomes a
 * card; every <td> needs data-label="<column heading>" for the stacked view.
 * Column headers stay available to screen readers via clip-hiding, never
 * display:none.
 */

.nt-terminal-legend {
  font-size: 0.95rem;
  color: #3d3d46;
  max-width: 68ch;
  margin: 0 0 18px;
}

.nt-terminal-table table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #d3d1cb;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 32px;
}

.nt-terminal-table table:last-child {
  margin-bottom: 0;
}

.nt-terminal-table caption {
  text-align: left;
  font-weight: 700;
  font-size: 1.15rem;
  color: #07495f;
  padding: 4px 0 12px;
}

.nt-terminal-table caption .nt-caption-sub {
  display: block;
  font-weight: 400;
  font-size: 0.95rem;
  color: #3d3d46;
  margin-top: 2px;
}

.nt-terminal-table caption .nt-caption-note {
  display: block;
  font-weight: 400;
  font-size: 0.9rem;
  font-style: italic;
  color: #3d3d46;
  margin-top: 4px;
}

.nt-terminal-table th,
.nt-terminal-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #e4e2dc;
  vertical-align: middle;
}

.nt-terminal-table thead th {
  background: #07495f;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nt-terminal-table tbody tr:last-child th,
.nt-terminal-table tbody tr:last-child td {
  border-bottom: none;
}

.nt-terminal-table tbody tr:nth-child(even) {
  background: #f0f0ee;
}

.nt-terminal-table .nt-platform {
  background: transparent;
  font-weight: 700;
  color: #07495f;
  font-size: 1.15rem;
  text-align: center;
  white-space: nowrap;
  width: 110px;
}

.nt-terminal-table .nt-route {
  font-weight: 600;
  white-space: nowrap;
}

.nt-terminal-table .nt-route a {
  color: #07495f;
}

.nt-terminal-table .nt-no-service {
  color: #3d3d46;
  font-style: italic;
}

.nt-terminal-table .nt-time-block {
  margin-bottom: 8px;
}

.nt-terminal-table .nt-time-block:last-child {
  margin-bottom: 0;
}

.nt-terminal-table .nt-time-range {
  font-weight: 600;
  font-size: 0.92rem;
}

.nt-terminal-table .nt-time-freq {
  color: #3d3d46;
  font-size: 0.92rem;
}

/* Mobile: stack each row into a card. Keep thead readable to AT via clip. */
@media (max-width: 720px) {
  .nt-terminal-table table,
  .nt-terminal-table tbody,
  .nt-terminal-table tr,
  .nt-terminal-table th,
  .nt-terminal-table td {
    display: block;
  }

  .nt-terminal-table table {
    border: none;
    background: transparent;
  }

  .nt-terminal-table caption {
    display: block;
  }

  .nt-terminal-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .nt-terminal-table tbody tr {
    border: 1px solid #d3d1cb;
    border-radius: 10px;
    margin-bottom: 16px;
    padding: 14px;
    background: #ffffff;
  }

  .nt-terminal-table tbody tr:nth-child(even) {
    background: #ffffff;
  }

  .nt-terminal-table th,
  .nt-terminal-table td {
    border-bottom: none;
    padding: 6px 0;
  }

  .nt-terminal-table td::before,
  .nt-terminal-table tbody th::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #00677f;
    margin-bottom: 4px;
  }

  .nt-terminal-table .nt-platform {
    font-size: 1.1rem;
    text-align: left;
    width: auto;
  }
}
