/* TEMPORARY — Wagtail admin fixes while the Concord UI kit is installed but NOT adopted.

   PlayActive installs zyrous_wagtail_core.concord_ui for its markup and leaves
   CONCORD_UI_ADOPT_CORE_ADMIN unset, so Wagtail's own admin chrome, listings and
   forms stay in place. The kit stylesheet (concord_ui/css/concord-ui.css) still
   loads on every admin page, and a handful of its rules restyle Wagtail's plain
   elements for a layout that only exists once the kit is adopted. Each rule
   below undoes exactly one of those, back to Wagtail 6.3's own value, and
   names the Concord rule it answers.

   HOW TO REMOVE: adopting the kit turns this off by itself —
   playactive.wagtail_hooks.admin_concord_unadopted_css emits nothing once
   CONCORD_UI_ADOPT_CORE_ADMIN is truthy. Once adoption is settled, delete this
   file, that hook and tests/test_admin_concord_unadopted.py. Nothing else
   references them.

   Loaded with order=1001, after admin_palette_restore.css (1000) and so after
   the kit's link: Wagtail writes the global admin stylesheets into the <body>
   in hook order, so a later link wins at equal specificity. Every selector
   here matches the Concord rule it overrides, specificity for specificity,
   without raising any priority flag.

   Found by crawling the 397 no-argument admin list/create screens on
   2026-09-28 with the kit on and off; each fix cleared its check on every one.
*/

/* 1. Search boxes (every listing header): the magnifier icon sat on top of the
      placeholder. Concord's
        .w-field__input > input:not([type=checkbox], …) { padding: sm md }
      out-specifies Wagtail's `.w-field__icon + input`, which leaves room for
      the icon; the text then started 12px in, under a 29px icon. */
.w-field__input > .w-field__icon + input {
  padding-inline-start: 2.625rem;
}

/* 2. Form checkboxes (every boolean field): a squashed teal blob. Concord's
        .w-field input[type=checkbox]:not([class])          { 16px, filled }
        .w-field input[type=checkbox]:not([class]):checked  { background: teal }
      shrink Wagtail's 24px box and fill it teal, but Wagtail still draws its
      own 16px teal tick (::before) inside — teal on teal, overhanging a box
      that is now the tick's own size. Back to Wagtail's box; its tick is
      untouched. List-view and permission checkboxes carry a class or sit
      outside .w-field and were never affected. */
.w-field input[type=checkbox]:not([class]) {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.1875rem;
  background-color: var(--w-color-surface-field);
  border-color: var(--w-color-border-field-default);
}

.w-field input[type=checkbox]:not([class]):checked {
  background-color: var(--w-color-surface-field);
  border-color: var(--w-color-border-field-default);
}

/* 3. Label touching its input (user, site, collection, redirect, image,
      document, programme and organisation create forms; maintenance mode).
      Wagtail spaces them with a 0.625rem top margin on .w-field__input;
      Concord zeroes that and uses a flex gap inside .w-field instead — but on
      these forms the label is .w-field's previous sibling, outside the flex
      box, so nothing separates them. */
.w-field__label + .w-field {
  margin-top: 0.625rem;
}

/* 4. No space between one field and the next on the same forms. Wagtail gives
      .w-field__wrapper a 1.875rem bottom margin; Concord's
        .w-field__wrapper:last-child { margin-block-end: 0 }
      is meant for the last field of a panel, but Wagtail's plain forms wrap
      every field in its own <li> of ul.fields, so every field is a last child
      and each input ran straight into the next label. */
ul.fields > li > .w-field__wrapper:last-child {
  margin-block-end: 1.875rem;
}
