/**
 * @file
 * WCAG 2.1 AA styles for the [jury_duty] shortcode output.
 * Replaces inline styles stripped from the API HTML during accessibility
 * transformation and provides proper table styling.
 */

/* ---- Centered text (replaces style="text-align:center") -------------- */
.jury-duty-centered {
  text-align: center;
}

/* ---- Section wrapper ------------------------------------------------- */
.jury-duty-section {
  margin: 1.5rem 0;
}

/* ---- Table ----------------------------------------------------------- */
.jury-duty-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #dfe1e2;
  margin-top: 1.5rem;
}

/* Caption: visible but styled as a proper heading (1.3.1) */
.jury-duty-caption {
  caption-side: top;
  text-align: left;
  font-weight: bold;
  font-size: 1rem;
  color: #1b2b85;
  padding: 0.75rem 1rem;
  background-color: #f0f4f9;
  border: 1px solid #dfe1e2;
  border-bottom: none;
}

/* Column headers */
.jury-duty-table thead th {
  background-color: #1b2b85;
  color: #ffffff;           /* 11.16:1 contrast — AAA */
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: bold;
  border: 1px solid #1b2b85;
}

/* Row headers (group numbers) — promoted from td to th[scope="row"] */
.jury-duty-table .jury-duty-group-header {
  background-color: #f0f4f9;
  color: #1b1b1b;           /* 16.1:1 contrast — AAA */
  font-weight: bold;
  padding: 0.75rem 1rem;
  border: 1px solid #dfe1e2;
  white-space: nowrap;
  vertical-align: top;
  width: 30%;
}

/* Standard data cells */
.jury-duty-table tbody td {
  padding: 0.75rem 1rem;
  border: 1px solid #dfe1e2;
  vertical-align: top;
  color: #1b1b1b;           /* 16.1:1 contrast — AAA */
}

/* Note / full-width rows (collapsed single-cell rows) */
.jury-duty-table .jury-duty-note-row {
  background-color: #fff2c4;
  color: #1b1b1b;           /* 16.1:1 contrast — AAA */
  font-style: italic;
  padding: 0.75rem 1rem;
  border: 1px solid #dfe1e2;
  text-align: left;
  font-weight: normal;
}

/* Alternating row shading */
.jury-duty-table tbody tr:nth-child(even) td,
.jury-duty-table tbody tr:nth-child(even) .jury-duty-group-header {
  background-color: #f9f9f9;
}

/* ---- Responsive: horizontal scroll on small screens ----------------- */
@media screen and (max-width: 640px) {
  .jury-duty-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .jury-duty-table thead th,
  .jury-duty-table tbody td,
  .jury-duty-table .jury-duty-group-header,
  .jury-duty-table .jury-duty-note-row {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .jury-duty-table .jury-duty-group-header {
    width: auto;
    white-space: normal;
  }
}

/* ---- High contrast mode --------------------------------------------- */
@media (prefers-contrast: high) {
  .jury-duty-table,
  .jury-duty-table thead th,
  .jury-duty-table tbody td,
  .jury-duty-table .jury-duty-group-header,
  .jury-duty-table .jury-duty-note-row {
    border-width: 2px;
  }
}

/* ---- Print ----------------------------------------------------------- */
@media print {
  .jury-duty-table {
    border: 1px solid #000;
  }

  .jury-duty-table thead th {
    background-color: #fff;
    color: #000;
    border: 1px solid #000;
  }

  .jury-duty-table .jury-duty-note-row {
    background-color: #eee;
  }
}
