/*
 * Sample and sample-prep sections: native <details> laid out like the former
 * jQuery UI accordion, in the UO palette from the theme's --uowdf-color-*
 * variables (hex fallbacks match the theme's values). Text contrast, WCAG
 * 1.4.3: closed header #104735 on #e6ecea is 8.9:1; open header white on UO
 * green #007030 is 6.2:1. The accordion's white on #007fff was 3.8:1 and
 * failed (axe color-contrast).
 */
.group-sample-group > details,
.group-sample-prep > details {
  border: 0;
  margin: 2px 0 0;
  padding: 0;
}

.group-sample-group > details > summary,
.group-sample-prep > details > summary {
  display: block;
  position: relative;
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 0.5em 0.5em 0.5em 1.86em;
  font-family: "Source Sans Variable", Arial, Helvetica, Verdana, sans-serif;
  font-size: 1em;
  font-weight: 500;
  line-height: 1.6667;
  color: var(--uowdf-color-uo-legacy-green, #104735);
  background: var(--uowdf-color-uo-legacy-green-t1, #e6ecea);
  border: 1px solid var(--uowdf-color-uo-legacy-green-t3, #b6c7c2);
  border-radius: 3px;
  transition: none;
}

.group-sample-group > details > summary:hover,
.group-sample-prep > details > summary:hover {
  color: var(--uowdf-color-uo-legacy-green, #104735);
  background: var(--uowdf-color-uo-legacy-green-t2, #cfdad6);
}

/* A clear keyboard focus ring (WCAG 2.4.7), offset so it shows on green too. */
.group-sample-group > details > summary:focus-visible,
.group-sample-prep > details > summary:focus-visible {
  outline: 3px solid var(--uowdf-color-uo-legacy-green, #104735);
  outline-offset: 2px;
}

/* Hide the browser marker and the site-wide +/- in favour of the triangle. */
.group-sample-group > details > summary::-webkit-details-marker,
.group-sample-prep > details > summary::-webkit-details-marker {
  display: none;
}

.group-sample-group > details > summary::after,
.group-sample-prep > details > summary::after {
  content: none;
}

/* Triangle icon: points right when closed, down when open. */
.group-sample-group > details > summary::before,
.group-sample-prep > details > summary::before {
  content: "";
  position: absolute;
  left: 0.95em;
  top: 50%;
  transform: translateY(-50%);
  border-style: solid;
  border-width: 0.28em 0 0.28em 0.36em;
  border-color: transparent transparent transparent currentColor;
}

.group-sample-group > details[open] > summary,
.group-sample-prep > details[open] > summary {
  color: #fff;
  background: var(--uowdf-color-uo-green, #007030);
  border-color: var(--uowdf-color-uo-green, #007030);
  border-radius: 3px 3px 0 0;
}

.group-sample-group > details[open] > summary:hover,
.group-sample-prep > details[open] > summary:hover {
  color: #fff;
  background: var(--uowdf-color-uo-legacy-green, #104735);
}

.group-sample-group > details[open] > summary::before,
.group-sample-prep > details[open] > summary::before {
  border-width: 0.36em 0.28em 0 0.28em;
  border-color: currentColor transparent transparent transparent;
}

/*
 * Windows High Contrast and other forced-colours modes repaint borders,
 * which would turn the transparent sides of the triangle solid. Keep the
 * shape and draw it in the system text colour.
 */
@media (forced-colors: active) {
  .group-sample-group > details > summary::before,
  .group-sample-prep > details > summary::before {
    forced-color-adjust: none;
    border-color: transparent transparent transparent CanvasText;
  }

  .group-sample-group > details[open] > summary::before,
  .group-sample-prep > details[open] > summary::before {
    border-color: CanvasText transparent transparent transparent;
  }
}

.group-sample-group > details > .details-wrapper,
.group-sample-prep > details > .details-wrapper {
  padding: 1em 2.2em;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 300;
  line-height: 1.3;
  color: #333;
  background: #fff;
  border: 1px solid #ddd;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.group-sample-group > details > .details-wrapper .field__label,
.group-sample-prep > details > .details-wrapper .field__label {
  font-weight: 700;
}