/* ==========================================================================
   cx-srcs - "Data sources and methods" disclosure panel. Standalone
   component (not part of .cx-explorer's own CSS/JS) - included into that
   component's twig, but styled/behaving independently. Colour, font-size
   and spacing are custom properties on .cx-srcs; defaults fall back to
   the shared tokens in base/color/color.css, base/fonts/fonts.css where
   the value matches.
   ========================================================================== */

.cx-srcs {
  --cxds-navy: var(--clr-blue, #21568C);
  --cxds-accent: var(--clr-yellow-orange, #F8B323);
  --cxds-ink: var(--clr-gray-dark, #4D4D4D);
  --cxds-line: var(--clr-gray-light, #DBDBDB);
  --cxds-white: #FFFFFF;
  --cxds-head-bg: #EFEFEF;

  --cxds-fs-title: var(--fs-24, 24px);
  --cxds-fs-subtitle: var(--fs-15, 15px);
  --cxds-fs-lead: var(--fs-14, 14px);
  --cxds-fs-table: var(--fs-14, 14px);

  --cxds-radius: 0 28px 0 28px;
  --cxds-px: clamp(14px, 4.9vw, 70px);

  margin: 0 auto;
  background: var(--cxds-white);
  border: 1px solid var(--cxds-line);
  border-radius: var(--cxds-radius);
  overflow: hidden;
  font-family: var(--primary-ff, 'Poppins', sans-serif);
}

/* `source` can hold multiple items (see the twig's doc comment) - each
   renders its own sibling <details>, so stacked panels need their own gap */
.cx-srcs + .cx-srcs {
  margin-top: 16px;
}

.cx-srcs summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--cxds-px);
  background: var(--cxds-navy);
  color: var(--cxds-white);
}

.cx-srcs summary::-webkit-details-marker {
  display: none;
}

.cx-srcs__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cx-srcs__head b {
  font-size: var(--cxds-fs-title);
  line-height: 1.25;
  font-weight: 700;
}

.cx-srcs__head small {
  font-size: var(--cxds-fs-subtitle);
  color: rgba(255, 255, 255, 0.92);
}

.cx-srcs__icon {
  font-style: normal;
  font-size: var(--fs-24, 24px);
  font-weight: 600;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--cxds-white);
  display: grid;
  place-items: center;
  flex: none;
  box-sizing: border-box;
}

.cx-srcs[open] .cx-srcs__icon {
  background: var(--cxds-accent);
  border-color: var(--cxds-accent);
  color: #000000;
}

.cx-srcs__body {
  padding: 28px var(--cxds-px) 36px;
}

.cx-srcs__lead {
  margin: 0 0 16px;
  font-size: var(--cxds-fs-lead);
  line-height: 1.6;
  color: var(--cxds-ink);
}

/* `description` is rich text and arrives pre-wrapped in its own <p> (see
   the twig's doc comment) - neutralise that <p>'s default margin so it
   doesn't add to this wrapper's own margin-bottom */
.cx-srcs__lead p {
  margin: 0;
}

.cx-tblwrap {
  overflow: auto;
  /* overrides .tbl-theme-default's own default (--fs-12) - same element,
     this file just loads after sub-modules/tables/table.css */
  --th-fs: 14px;
}

/* `content` is a Drupal rich-text field - CKEditor output has wrapped its
   own <table> in a <dl><dd> before; neutralise the browser's default
   margins on those so an editor adding/removing that wrapper later
   doesn't change the table's spacing either way. */
.cx-tblwrap dl,
.cx-tblwrap dd {
  margin: 0;
}

.cx-srcs table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--cxds-fs-table);
  color: var(--cxds-ink);
}

.cx-srcs th {
  text-align: left;
  background: var(--cxds-head-bg);
  padding: 12px;
  font-weight: 700;
}

.cx-srcs td {
  padding: 10px 12px;
  border-top: 1px solid var(--cxds-line);
  vertical-align: top;
  line-height: 1.5;
}

.cx-srcs td:first-child {
  font-weight: 600;
  width: 32%;
}

.cx-srcs td a {
  font-weight: 600;
  white-space: nowrap;
}
