/* wg-utilities-lists.css */
/* =========================================================
   UVU Lists — opt-in, inheritance friendly
   Classes:
   .list-standard .list-circle .list-dash .list-check
   .list-arrow .list-box .list-none

   - Apply to a parent or directly to a <ul>
   - A <ul> with its own list-* class overrides the parent
   - A <li> with its own list-* class overrides the ul
   - .icon--* can override the default icon on a parent, ul, or li
   - .li-* changes marker color only
   ========================================================= */

/* default marker color
   Uses the active theme accent when inside .thm-* and falls back to the global accent.
   Explicit .li-* classes override this variable without duplicating every text/bg/border utility. */
:where(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) {
  --list-marker-color: var(--theme-accent, var(--accent));
}

/* Let existing .text-* utilities drive marker color when applied directly to a list or li.
   This avoids rebuilding the full color system inside lists.css. */
:where(ul[class*="text-"], ol[class*="text-"], li[class*="text-"]) {
  --list-marker-color: currentColor;
}

/* default variant tokens */
.list-standard {
  --list-style-type: disc;
  --list-padding-left: 1.5em;
}

.list-circle {
  --list-style-type: disc;
  --list-padding-left: 1.5em;
  --fa: "\e122";
  --fa-family: "Font Awesome 7 Pro";
  --fa-weight: 900;
}

.list-check {
  --list-style-type: disc;
  --list-padding-left: 1.5em;
  --fa: "\f058";
  --fa-family: "Font Awesome 7 Pro";
  --fa-weight: 900;
}

.list-arrow {
  --list-style-type: disc;
  --list-padding-left: 1.5em;
  --fa: "\f061";
  --fa-family: "Font Awesome 7 Pro";
  --fa-weight: 900;
}

.list-dash {
  --list-style-type: disc;
  --list-padding-left: 1.5em;
  --fa: "\e404";
  --fa-family: "Font Awesome 7 Pro";
  --fa-weight: 900;
}

.list-box {
  --list-style-type: none;
  --list-padding-left: 0;
}

.list-none {
  --list-style-type: none;
  --list-padding-left: 0;
}

/* marker-only color utilities */
.li-uvu { --list-marker-color: var(--uvu); }
.li-wolverine { --list-marker-color: var(--wolverine); }
.li-valley { --list-marker-color: var(--valley); }
.li-meadow { --list-marker-color: var(--meadow); }
.li-seahaze { --list-marker-color: var(--seahaze); }
.li-sage { --list-marker-color: var(--sage); }
.li-super { --list-marker-color: var(--super); }
.li-dark-green { --list-marker-color: var(--dark-green); }
.li-black { --list-marker-color: var(--black); }
.li-dark-grey { --list-marker-color: var(--dark-grey); }
.li-grey { --list-marker-color: var(--grey); }
.li-light-grey { --list-marker-color: var(--light-grey); }
.li-warm { --list-marker-color: var(--warm); }
.li-off-white { --list-marker-color: var(--off-white); }
.li-white { --list-marker-color: var(--white); }

/* element-level marker color overrides
   Allows <li class="li-wolverine"> inside a normal ul/ol to override the marker after a theme is applied. */
li:is(.li-uvu, .li-wolverine, .li-valley, .li-meadow, .li-seahaze, .li-sage, .li-super, .li-dark-green, .li-black, .li-dark-grey, .li-grey, .li-light-grey, .li-warm, .li-off-white, .li-white)::marker {
  color: var(--list-marker-color);
}

/* Let existing text utilities force normal ul/ol markers without re-declaring color values here. */
:where(ul[class*="text-"], ol[class*="text-"]) > li::marker,
li[class*="text-"]::marker {
  color: currentColor;
}

/* base ul activation */
:where(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none),
:where(ul.list-standard, ul.list-circle, ul.list-dash, ul.list-check, ul.list-arrow, ul.list-box, ul.list-none) {
  margin: var(--space-sm) 0;
  padding-left: var(--list-padding-left, 1.5em);
  list-style-position: outside;
  list-style-type: var(--list-style-type, disc);
}

/* vertical rhythm */
:where(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li + li,
:where(ul.list-standard, ul.list-circle, ul.list-dash, ul.list-check, ul.list-arrow, ul.list-box, ul.list-none) > li + li {
  margin-top: var(--space-xs);
}

/* restore li spacing when fs-h* is applied directly to the li */
:where(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li:is(.fs-h1, .fs-h2, .fs-h3, .fs-h4, .fs-h5, .fs-h6),
:where(ul.list-standard, ul.list-circle, ul.list-dash, ul.list-check, ul.list-arrow, ul.list-box, ul.list-none) > li:is(.fs-h1, .fs-h2, .fs-h3, .fs-h4, .fs-h5, .fs-h6),
li:is(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none):is(.fs-h1, .fs-h2, .fs-h3, .fs-h4, .fs-h5, .fs-h6) {
  margin-bottom: 0.5em;
}

/* =========================================================
   .list-standard
   ========================================================= */
:where(.list-standard)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li::marker,
:where(ul.list-standard) > li::marker,
li.list-standard::marker {
  color: var(--list-marker-color);
}

/* =========================================================
   icon-based lists
   .list-circle .list-check .list-arrow .list-dash
   keep native ul/li spacing and replace only the marker
   ========================================================= */
:where(.list-circle, .list-check, .list-arrow, .list-dash)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li::marker,
:where(ul.list-circle, ul.list-check, ul.list-arrow, ul.list-dash) > li::marker,
li.list-circle::marker,
li.list-check::marker,
li.list-arrow::marker,
li.list-dash::marker {
  content: var(--fa) " ";
  font-family: var(--fa-family, "Font Awesome 7 Pro");
  font-weight: var(--fa-weight, 900);
  color: var(--list-marker-color);
  font-size: 1em;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* li overrides for marker-based variants */
li.list-standard,
li.list-circle,
li.list-check,
li.list-arrow,
li.list-dash {
  list-style-position: outside;
  list-style-type: disc;
  padding-left: 0;
  background: none;
}

/* =========================================================
   .list-box
   ========================================================= */
:where(.list-box)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none),
:where(ul.list-box) {
  padding-left: 0;
  list-style: none;
}

:where(.list-box)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li,
:where(ul.list-box) > li,
li.list-box {
  list-style: none;
  padding-left: calc(4px + var(--space-xs));
  background-image: linear-gradient(var(--list-marker-color), var(--list-marker-color));
  background-repeat: no-repeat;
  background-size: 4px calc(100% - (var(--space-xxs) * 2));
  background-position: 0 var(--space-xxs);
}

:where(.list-box)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li::marker,
:where(ul.list-box) > li::marker,
li.list-box::marker {
  content: none;
}

/* =========================================================
   .list-none
   ========================================================= */
:where(.list-none)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none),
:where(ul.list-none) {
  padding-left: 0;
  margin: 0;
  list-style: none;
}

:where(.list-none)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li,
:where(ul.list-none) > li,
li.list-none {
  padding-left: 0;
  list-style: none;
  background: none;
}

:where(.list-none)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li::marker,
:where(ul.list-none) > li::marker,
li.list-none::marker {
  content: none;
}

/* better single-li overrides when parent ul removes native marker space */
:where(.list-box, .list-none)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li:is(.list-standard, .list-circle, .list-check, .list-arrow, .list-dash),
:where(ul.list-box, ul.list-none) > li:is(.list-standard, .list-circle, .list-check, .list-arrow, .list-dash) {
  margin-left: 1.5em;
}

:where(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow)
  :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li:is(.list-box, .list-none),
:where(ul.list-standard, ul.list-circle, ul.list-dash, ul.list-check, ul.list-arrow) > li:is(.list-box, .list-none) {
  margin-left: -1.5em;
}

/* =========================================================
   Safari fallback for icon lists
   Safari can fail on icon fonts in ::marker
   keep Chrome/Firefox on ::marker, use floated pseudo marker in Safari
   ========================================================= */
@supports (font: -apple-system-body) and (-webkit-appearance: none) {
  :where(.list-circle, .list-check, .list-arrow, .list-dash)
    :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none),
  :where(ul.list-circle, ul.list-check, ul.list-arrow, ul.list-dash) {
    list-style: none;
    padding-left: calc(var(--list-padding-left, 1.5em) + 0.25em);
  }

  :where(.list-circle, .list-check, .list-arrow, .list-dash)
    :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li,
  :where(ul.list-circle, ul.list-check, ul.list-arrow, ul.list-dash) > li,
  li.list-circle,
  li.list-check,
  li.list-arrow,
  li.list-dash {
    list-style: none;
  }

  :where(.list-circle, .list-check, .list-arrow, .list-dash)
    :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li::marker,
  :where(ul.list-circle, ul.list-check, ul.list-arrow, ul.list-dash) > li::marker,
  li.list-circle::marker,
  li.list-check::marker,
  li.list-arrow::marker,
  li.list-dash::marker {
    content: "";
  }

  :where(.list-circle, .list-check, .list-arrow, .list-dash)
    :where(ul):not(.list-standard, .list-circle, .list-dash, .list-check, .list-arrow, .list-box, .list-none) > li::before,
  :where(ul.list-circle, ul.list-check, ul.list-arrow, ul.list-dash) > li::before,
  li.list-circle::before,
  li.list-check::before,
  li.list-arrow::before,
  li.list-dash::before {
    content: var(--fa);
    float: left;
    width: calc(var(--list-padding-left, 1.5em) + 0.25em);
    margin-left: calc(-1 * (var(--list-padding-left, 1.5em) + 0.25em));
    font-family: var(--fa-family, "Font Awesome 7 Pro");
    font-weight: var(--fa-weight, 900);
    font-size: 1em;
    line-height: inherit;
    text-align: center;
    color: var(--list-marker-color);
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    pointer-events: none;
  }
}