/* =========================
   DataTable + Case Studies
   ========================= */

/* Full-width layout */
.page-layout-full .page-columns { grid-template-columns: 1fr !important; }
.page-layout-full main.content { max-width: 100%; }
.page-layout-full #quarto-document-content { max-width: none; }

#quarto-document-content .dataTables_wrapper { width: 100%; }

/* -------------------------
   Table layout + typography
   ------------------------- */

table.dataTable {
  width: 100% !important;
  table-layout: fixed;           /* key: respect column widths */
}

/* Header labels: keep on one line */
table.dataTable thead th {
  white-space: nowrap;
}

/* Body cells: wrap cleanly */
table.dataTable tbody td {
  vertical-align: top;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.3;
}

/* Tighten padding so rows aren’t overly tall */
table.dataTable thead th,
table.dataTable tbody td {
  padding: 8px 10px;
}

/* -------------------------
   Column widths 
   1 Details | 2 Title | 3 Lead org | 4 Purpose | 5 AI type | 6 Years | 7 Maturity
   ------------------------- */

/* Details control column */
table.dataTable th:nth-child(1),
table.dataTable td:nth-child(1) {
  width: 44px;
}

/* Title */
table.dataTable th:nth-child(2),
table.dataTable td:nth-child(2) {
  width: 25%;
  min-width: 220px;
}

/* Lead organisation */
table.dataTable th:nth-child(3),
table.dataTable td:nth-child(3) {
  width: 18%;
  min-width: 170px;
}

/* Purpose of AI (give it room) */
table.dataTable th:nth-child(4),
table.dataTable td:nth-child(4) {
  white-space: pre-line;
  width: 25%;
  min-width: 240px;
}

/* AI type(s) */
table.dataTable th:nth-child(5),
table.dataTable td:nth-child(5) {
  white-space: pre-line;
  width: 14%;
  min-width: 150px;
}

/* Years active */
table.dataTable th:nth-child(6),
table.dataTable td:nth-child(6) {
  width: 10%;
  min-width: 130px;
  white-space: normal; 
  overflow-wrap: anywhere;
}

/* Maturity */
table.dataTable th:nth-child(7),
table.dataTable td:nth-child(7) {
  width: 12%;
  min-width: 160px;
}

/* -------------------------
   Expand/collapse control
   ------------------------- */

td.details-control {
  text-align: center;
  font-weight: 600;
  cursor: pointer;
}

tr.shown td.details-control {
  font-weight: 700;
}

/* -------------------------
   Details panel styling
   ------------------------- */

.cs-details {
  padding: 0.75rem 0.75rem;
  line-height: 1.35;
}

.cs-details p {
  margin: 0 0 0.6rem 0;
}

.cs-details ul {
  margin: 0.25rem 0 0.6rem 1.2rem;
}

/* -------------------------
   Filter controls above the table
   ------------------------- */

.dt-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px 20px;
  margin: 0.75rem 0 1.25rem 0;
}

.dt-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dt-filter label {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

.dt-filter-select {
  width: 100%;
  padding: 6px 8px;
  box-sizing: border-box;
}