/* CCDSS publications catalogue — left filter rail + Infobase DataTables pagination */

.ccdss-pub-search-term {
  display: inline-block;
  padding: 0.1em 0.4em;
  margin: 0 0.05em;
  font-family: inherit;
  font-size: 0.92em;
  font-weight: 600;
  line-height: 1.3;
  color: #26374a;
  background: #f5f5f5;
  border: 1px solid #dcdee1;
  border-radius: 3px;
  white-space: nowrap;
}

.ccdss-pub-layout {
  margin-top: 10px;
}

.ccdss-pub-toolbar {
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 16px;
  margin: 0 0 15px;
}

.ccdss-pub-toolbar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.ccdss-pub-search-group {
  grid-column: 1 / -1;
}

.ccdss-pub-toolbar .form-group {
  margin-bottom: 0;
  min-width: 0;
}

.ccdss-pub-search-group > label {
  display: block;
  margin-bottom: 8px;
}

.ccdss-pub-search-group .form-control {
  width: 100%;
  max-width: none;
}

.pub-filter-label {
  display: block;
  margin-bottom: 8px;
}

.pub-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-filter-buttons .btn {
  max-width: 100%;
  margin: 0;
  white-space: normal;
  text-align: left;
}

/*
 * Phone: default GCWeb/WET details chrome (same as Data Tool / Case definitions).
 * sm+: strip the shell so filter chips sit in the toolbar without a disclosure box.
 */
.ccdss-pub-filters {
  margin: 0;
  min-width: 0;
}

.ccdss-pub-filters-body {
  display: grid;
  gap: 16px;
  margin-top: 12px;
  min-width: 0;
}

@media (min-width: 768px) {
  .ccdss-pub-filters,
  .ccdss-pub-filters[open] {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  .ccdss-pub-filters > summary {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: none !important;
  }

  .ccdss-pub-filters::details-content {
    content-visibility: visible;
    block-size: auto;
  }

  .ccdss-pub-filters-body {
    display: grid !important;
    margin-top: 0;
  }
}

@media (min-width: 992px) {
  .ccdss-pub-toolbar {
    position: sticky;
    top: 1rem;
    margin-bottom: 0;
  }

  .ccdss-pub-count {
    margin-top: 0;
  }
}

.ccdss-pub-toolbar .btn.active-filter,
.ccdss-pub-toolbar .btn.active-filter:hover,
.ccdss-pub-toolbar .btn.active-filter:focus,
.ccdss-pub-toolbar .btn.is-active {
  background: #26374a;
  border-color: #26374a;
  color: #fff;
}

.ccdss-pub-count {
  margin: 0 0 15px;
  font-weight: 600;
}

.compact-pub-table {
  margin-bottom: 30px;
}

.compact-pub-table table {
  margin-bottom: 0;
}

.ccdss-pub-table {
  border: 0;
  background-color: transparent;
}

.ccdss-pub-table > thead > tr > th,
.ccdss-pub-table > tbody > tr > td {
  border: 0;
  padding-left: 8px;
  padding-right: 8px;
  background-color: transparent;
  text-align: left;
  vertical-align: top;
}

.ccdss-pub-table > thead > tr > th {
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
  vertical-align: middle;
}

.ccdss-pub-table > tbody > tr > td {
  border-top: 1px solid #ddd;
  padding-top: 12px;
  padding-bottom: 12px;
}

.ccdss-pub-td-cover {
  width: 96px;
}

.ccdss-pub-thumb-link {
  display: block;
  width: 72px;
  height: 96px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
}

.ccdss-pub-cover {
  /* Synthetic gradient + opaque type-chip fill (white text for contrast). */
  --pub-cover-from: #26374a;
  --pub-cover-to: #4a6b82;
  --pub-cover-badge: #1b2b3a;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(160deg, var(--pub-cover-from) 0%, var(--pub-cover-to) 100%);
  overflow: hidden;
}

.ccdss-pub-cover--data-blog {
  --pub-cover-from: #1f4d3a;
  --pub-cover-to: #3d7a5f;
  --pub-cover-badge: #0f3d2c;
}

.ccdss-pub-cover--fact-sheet {
  --pub-cover-from: #2b4c7e;
  --pub-cover-to: #5b7fb5;
  --pub-cover-badge: #1a3a66;
}

.ccdss-pub-cover--infographic {
  --pub-cover-from: #6b3a1f;
  --pub-cover-to: #b06a3c;
  --pub-cover-badge: #5a2a0e;
}

.ccdss-pub-cover--peer-reviewed,
.ccdss-pub-cover--scientific-article {
  --pub-cover-from: #3b2f63;
  --pub-cover-to: #6a5a9a;
  --pub-cover-badge: #2a1f4d;
}

.ccdss-pub-cover--report {
  --pub-cover-from: #5c1f2c;
  --pub-cover-to: #9a4a5c;
  --pub-cover-badge: #4a1520;
}

.ccdss-pub-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.ccdss-pub-cover--has-image {
  /* Cover art is un-tinted; type colour lives only on the chip. */
  background: #e8e8e8;
}

.ccdss-pub-cover-type {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  max-width: calc(100% - 0.15rem);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.16rem 0.34rem;
  border: 0;
  border-radius: 2px;
  line-height: 1.2;
  color: #fff;
  background: var(--pub-cover-badge);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.ccdss-pub-cover-mark {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.4;
  line-height: 1;
}

.ccdss-pub-title {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.ccdss-pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ccdss-pub-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  background: #edf2f7;
  color: #26374a;
}

.ccdss-pub-chip--condition {
  background: #e8f2e8;
  color: #1f4d3a;
}

.ccdss-pub-td-category {
  box-sizing: border-box;
  padding-right: 1.25rem;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.ccdss-pub-table > tbody > tr > td.ccdss-pub-td-category {
  font-size: 16px;
  line-height: 1.4375;
}

/* Column width follows the header on one line (EN + longer FR). */
.ccdss-pub-table > thead > tr > th.ccdss-pub-td-category {
  width: 1%;
  white-space: nowrap;
  font-size: inherit;
  line-height: inherit;
  padding-right: 1.25rem;
}

.ccdss-pub-td-resource {
  padding-left: 0.75rem;
}

.ccdss-pub-table > thead > tr > th.ccdss-pub-td-resource {
  padding-left: 0.75rem;
}

.ccdss-pub-empty {
  margin: 1rem 0 2rem;
  padding: 1rem;
  background: #f5f5f5;
  border-left: 4px solid #26374a;
}

/* Infobase DataTables pagination look (scoped; pages without theme DataTables still match) */
#ccdss-pub-pagination {
  margin: 0 0 2rem;
}

#ccdss-pub-pagination .dataTables_wrapper {
  clear: both;
  position: relative;
}

#ccdss-pub-pagination .dataTables_paginate {
  padding-top: 1.25em;
  text-align: center;
}

#ccdss-pub-pagination .paginate_button {
  background-color: #eaebed;
  border: 1px solid #dcdee1;
  color: #335075;
  cursor: pointer;
  display: inline-block;
  line-height: 1.4375;
  margin-bottom: 0.5em;
  margin-left: -1px;
  padding: 10px 16px;
  position: relative;
  text-decoration: none;
}

#ccdss-pub-pagination .paginate_button.previous,
#ccdss-pub-pagination .paginate_button.current:first-child {
  border-bottom-left-radius: 4px;
  border-top-left-radius: 4px;
  margin-left: 0;
}

#ccdss-pub-pagination .paginate_button.next,
#ccdss-pub-pagination .paginate_button.current:last-child {
  border-bottom-right-radius: 4px;
  border-top-right-radius: 4px;
}

#ccdss-pub-pagination .paginate_button.current {
  background-color: #2572b4;
  border-color: #2572b4;
  color: #fff;
  cursor: default;
  z-index: 2;
}

#ccdss-pub-pagination .paginate_button:hover,
#ccdss-pub-pagination .paginate_button:focus,
#ccdss-pub-pagination .paginate_button:active {
  background-color: #d4d6da;
  border-color: #bbbfc5;
  color: #335075;
}

#ccdss-pub-pagination .paginate_button.current:hover,
#ccdss-pub-pagination .paginate_button.current:focus,
#ccdss-pub-pagination .paginate_button.current:active {
  background-color: #2572b4;
  border-color: #2572b4;
  color: #fff;
}

#ccdss-pub-pagination .paginate_button.disabled {
  display: none;
}

@media (max-width: 767px) {
  .ccdss-pub-toolbar-grid {
    grid-template-columns: 1fr;
  }

  .ccdss-pub-td-cover {
    width: auto;
  }

  /* Card layout: undo Bootstrap .table-responsive nowrap that widens the page. */
  .compact-pub-table.table-responsive {
    border: 0;
    margin-bottom: 0;
    overflow-x: visible;
  }

  .ccdss-pub-table > thead {
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
  }

  .ccdss-pub-table,
  .ccdss-pub-table > tbody,
  .ccdss-pub-table > tbody > tr,
  .ccdss-pub-table > tbody > tr > td {
    display: block;
    width: 100%;
  }

  .ccdss-pub-table > tbody > tr {
    margin-bottom: 1rem;
    border: 1px solid #dcdee1;
    padding: 0.75rem;
  }

  .compact-pub-table.table-responsive > .ccdss-pub-table > tbody > tr > td,
  .ccdss-pub-title,
  .ccdss-pub-title a,
  .ccdss-pub-meta,
  .ccdss-pub-chip,
  .ccdss-pub-td-category,
  .ccdss-pub-td-resource {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .ccdss-pub-table > tbody > tr > td {
    border: 0;
    border-top: 0;
    padding: 0.35rem 0;
    max-width: 100%;
  }
}
