/* table-v4.css- reusable department table designs (6 types) */

.table-v4 {
  padding: 60px 0;
}

.table-v4 .section-heading {
  margin-bottom: 2rem;
}

/* Filter pills */
.table-v4__filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 64, 141, 0.25) transparent;
}

.table-v4__filter {
  flex: 0 0 auto;
  border: 1px solid #ffb606;
  background: #fff;
  color: var(--dept-v3-navy, #002147);
  border-radius: 999px;
  padding: 0.5rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.table-v4__filter:hover {
  background: rgba(255, 182, 6, 0.12);
}

.table-v4__filter.is-active {
  background: #ffb606;
  border-color: #ffb606;
  color: #002147;
  font-weight: 700;
}

.table-v4__filter-full {
  display: none;
}

@media (min-width: 992px) {
  .table-v4__filter {
    padding: 0.625rem 1.35rem;
    font-size: 0.875rem;
  }

  .table-v4__filter-short {
    display: none;
  }

  .table-v4__filter-full {
    display: inline;
  }
}

/* Design-switcher mode: each tab panel carries its own layout modifier */
.table-v4--tabbed .table-v4__panel.table-v4--activity-log .table-v4__table {
  min-width: 1100px;
}

.table-v4__filters--panel {
  margin-top: 0;
}

/* Panels */
.table-v4__panel {
  display: none;
}

.table-v4__panel.is-active {
  display: block;
}

.table-v4__panel[hidden] {
  display: none !important;
}

/* Table shell */
.table-v4__table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(37, 64, 141, 0.12);
  border-radius: 14px;
  background: #fff;
}

.table-v4__table-wrap--scroll {
  overflow-x: auto;
}

.table-v4__table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.table-v4--activity-log .table-v4__table {
  min-width: 1200px;
}

.table-v4__table thead th {
  background: #1a3470;
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 0.9rem 1rem;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.table-v4__table thead th:last-child {
  border-right: 0;
}

.table-v4__table thead th.is-center,
.table-v4__table tbody td.is-center {
  text-align: center;
}

.table-v4__table tbody td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(37, 64, 141, 0.1);
  border-right: 1px solid rgba(37, 64, 141, 0.08);
  color: var(--text-dark, #1a1a1a);
  vertical-align: top;
  line-height: 1.5;
}

.table-v4__table tbody td:last-child {
  border-right: 0;
}

.table-v4__table tbody tr:last-child td {
  border-bottom: 0;
}

.table-v4--basic .table-v4__table tbody tr:nth-child(odd) td,
.table-v4--pdf-links .table-v4__table tbody tr:nth-child(odd) td,
.table-v4--media-preview .table-v4__table tbody tr:nth-child(odd) td {
  background: #fff;
}

.table-v4--pdf-links .table-v4__table tbody tr:nth-child(even) td,
.table-v4--activity-log .table-v4__table tbody tr:nth-child(even) td,
.table-v4--media-preview .table-v4__table tbody tr:nth-child(even) td,
.table-v4--table-gallery .table-v4__table tbody tr:nth-child(even) td {
  background: rgba(235, 245, 255, 0.45);
}

/* Links */
.table-v4__link {
  color: var(--dept-v3-blue, #25408d);
  font-weight: 600;
  text-decoration: none;
}

.table-v4__link:hover {
  text-decoration: underline;
}

.table-v4__link-sep {
  margin: 0 0.4rem;
  color: rgba(37, 64, 141, 0.35);
}

/* Media preview cell */
.table-v4__media-link {
  display: inline-block;
}

.table-v4__media-thumb {
  width: 88px;
  height: 62px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(37, 64, 141, 0.18);
  display: block;
}

.table-v4__badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e6f1fb;
  color: #0c447c;
}

/* Footer + pagination */
.table-v4__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.table-v4__count {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-light, #5d5d5d);
}

.table-v4__pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.table-v4__page-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid rgba(37, 64, 141, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--dept-v3-blue, #25408d);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.table-v4__page-btn:hover:not(:disabled) {
  background: var(--dept-v3-light, #ebf5ff);
}

.table-v4__page-btn.is-active {
  background: #ffb606;
  border-color: #ffb606;
  color: #002147;
}

.table-v4__page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Gallery block (type 5) */
.table-v4__gallery-block {
  margin-top: 2rem;
}

.table-v4__gallery-heading {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dept-v3-navy, #002147);
  position: relative;
  padding-bottom: 0.5rem;
}

.table-v4__gallery-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3rem;
  height: 3px;
  border-radius: 999px;
  background: #ffb606;
}

.table-v4__gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .table-v4__gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .table-v4__gallery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .table-v4--gallery-only .table-v4__gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.table-v4__gallery-card {
  text-align: center;
}

.table-v4__gallery-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.table-v4__gallery-media {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(37, 64, 141, 0.12);
  box-shadow: 0 8px 24px rgba(0, 33, 71, 0.06);
}

.table-v4__gallery-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.table-v4--gallery-only .table-v4__gallery-media img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.table-v4__gallery-caption {
  margin-top: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dept-v3-blue, #25408d);
  line-height: 1.4;
}

.table-v4__placeholder {
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--dept-v3-light, #ebf5ff);
  border: 1px dashed rgba(37, 64, 141, 0.2);
  color: var(--dept-v3-blue, #25408d);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Mobile stacked rows */
@media (max-width: 767.98px) {
  .table-v4--activity-log .table-v4__table thead {
    display: none;
  }

  .table-v4--activity-log .table-v4__table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid rgba(37, 64, 141, 0.12);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
  }

  .table-v4--activity-log .table-v4__table tbody td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-right: 0;
  }

  .table-v4--activity-log .table-v4__table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--dept-v3-blue, #25408d);
    flex: 0 0 42%;
  }

  .table-v4--activity-log .table-v4__table tbody tr:nth-child(even) td {
    background: transparent;
  }
}
