/**
 * Shared JKPTG table presentation and reusable Table content type.
 */

/* Style only tables that opt into the reusable Table content presentation. */
.jkptg-table-content__table {
  width: 100%;
  margin-block: 24px;
  color: var(--jkptg-text-secondary, #3d3d3d);
  border-collapse: collapse;
  font-family: var(--jkptg-font-family-body, 'Inter', sans-serif);
}

.jkptg-table-content__table th,
.jkptg-table-content__table td {
  padding: 14px 16px;
  border: 1px solid var(--jkptg-border-neutral-on-light-15, rgb(0 0 0 / 15%));
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.jkptg-table-content__table thead th {
  color: var(--jkptg-color-navy-900, #00122a);
  background: var(--jkptg-color-teal-100, #e6fffc);
  border-bottom: 2px solid var(--jkptg-border-action-default, #2d9bd3);
  font-weight: var(--jkptg-font-weight-semibold, 600);
  white-space: nowrap;
}

.jkptg-table-content__table tbody th {
  color: var(--jkptg-color-navy-900, #00122a);
  font-weight: var(--jkptg-font-weight-semibold, 600);
}

.jkptg-table-content__table tbody th,
.jkptg-table-content__table tbody td {
  background: var(--jkptg-surface-primary, #fcfcfc);
}

.jkptg-table-content__table tbody tr:nth-child(even) th,
.jkptg-table-content__table tbody tr:nth-child(even) td {
  background: var(--jkptg-surface-secondary, #f6f6f6);
}

.jkptg-table-content {
  box-sizing: border-box;
  width: min(
    calc(100% - (2 * var(--jkptg-layout-content-gutter, 24px))),
    var(--jkptg-layout-container-max-width, 1200px)
  );
  margin: 48px auto 120px;
  color: var(--jkptg-text-primary, #090909);
  font-family: var(--jkptg-font-family-body, 'Inter', sans-serif);
}

.jkptg-table-content *,
.jkptg-table-content *::before,
.jkptg-table-content *::after {
  box-sizing: border-box;
}

.jkptg-table-content__title {
  margin: 0 0 16px;
  color: var(--jkptg-color-navy-900, #00122a);
  font-family: var(--jkptg-font-family-title, 'Inter', sans-serif);
  font-size: var(--jkptg-font-size-2xl, 32px);
  font-weight: var(--jkptg-font-weight-bold, 700);
  line-height: 1.25;
}

.jkptg-table-content__body {
  max-width: 900px;
  color: var(--jkptg-text-secondary, #3d3d3d);
  font-size: var(--jkptg-font-size-md, 16px);
  line-height: 1.5;
}

.jkptg-table-content__category {
  display: inline-flex;
  margin: 16px 0 24px;
  padding: 6px 12px;
  color: var(--jkptg-text-action-press, #026ca3);
  background: var(--jkptg-color-cyan-100, #e4f3fa);
  border-radius: var(--jkptg-radius-full, 999px);
  font-size: var(--jkptg-font-size-sm, 14px);
  font-weight: var(--jkptg-font-weight-semibold, 600);
}

.jkptg-table-content__expandable {
  overflow: hidden;
  background: var(--jkptg-surface-primary, #fcfcfc);
  border: 1px solid var(--jkptg-border-default, #d3d7dc);
  border-radius: var(--jkptg-radius-xl, 12px);
}

.jkptg-table-content__expandable > summary {
  position: relative;
  padding: 14px 48px 14px 16px;
  color: var(--jkptg-color-navy-900, #00122a);
  background: var(--jkptg-surface-secondary, #f6f6f6);
  font-size: var(--jkptg-font-size-md, 16px);
  font-weight: var(--jkptg-font-weight-semibold, 600);
  cursor: pointer;
  list-style: none;
}

.jkptg-table-content__expandable > summary::-webkit-details-marker {
  display: none;
}

.jkptg-table-content__expandable > summary::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 9px;
  height: 9px;
  content: '';
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
}

.jkptg-table-content__expandable:not([open]) > summary::after {
  transform: translateY(-35%) rotate(-45deg);
}

.jkptg-table-content__scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.jkptg-table-content__table {
  min-width: 640px;
  margin-block: 24px;
}

/* Keep the monthly statistics headers and values on a single line. */
main table.jkptg-online-services-table {
  min-width: 1120px;
}

.jkptg-online-services-table thead th:not(:first-child),
.jkptg-online-services-table tbody td {
  white-space: nowrap;
}

main table.jkptg-online-services-table th,
main table.jkptg-online-services-table td {
  padding: 6px 4px;
  font-size: var(--jkptg-font-size-md, 16px);
}

main table.jkptg-online-services-table thead th:first-child,
main table.jkptg-online-services-table tbody th {
  width: 240px;
  min-width: 240px;
  white-space: normal;
}

main table.jkptg-online-services-table thead th:not(:first-child) {
  text-align: center;
}

main table.jkptg-online-services-table thead .jkptg-online-services-table__year {
  text-align: center;
}

.jkptg-online-services-table tbody td {
  text-align: right;
}

@media (max-width: 767.98px) {
  .jkptg-table-content {
    margin-block: 32px 80px;
  }

  .jkptg-table-content__title {
    font-size: 26px;
  }

  .jkptg-table-content__table th,
  .jkptg-table-content__table td {
    padding: 10px 12px;
    font-size: var(--jkptg-font-size-sm, 14px);
  }

  .ckeditor-accordion-container > dl .jkptg-table-content__table {
    min-width: 0;
  }
}
