/* Custom ordered list numbering styles for nested lists */

/* Hide the default list numbers */
.trix-content ol,
.action-text-content ol,
trix-editor ol {
  list-style-type: none;
  counter-reset: item;
  padding-left: 0;
}

/* Main list items */
.trix-content ol > li,
.action-text-content ol > li,
trix-editor ol > li {
  counter-increment: item;
  position: relative;
  padding-left: 2em;
}

.trix-content ol > li::before,
.action-text-content ol > li::before,
trix-editor ol > li::before {
  content: counter(item) ". ";
  position: absolute;
  left: 0;
  color: var(--tw-prose-counters, #6b7280);
  font-weight: 400;
}

/* First level nested lists */
.trix-content ol ol,
.action-text-content ol ol,
trix-editor ol ol {
  counter-reset: subitem;
  padding-left: 1.5em;
}

.trix-content ol ol > li,
.action-text-content ol ol > li,
trix-editor ol ol > li {
  counter-increment: subitem;
  padding-left: 2.5em;
}

.trix-content ol ol > li::before,
.action-text-content ol ol > li::before,
trix-editor ol ol > li::before {
  content: counter(item) "." counter(subitem) " ";
  left: 0;
}

/* Second level nested lists */
.trix-content ol ol ol,
.action-text-content ol ol ol,
trix-editor ol ol ol {
  counter-reset: subsubitem;
  padding-left: 1.5em;
}

.trix-content ol ol ol > li,
.action-text-content ol ol ol > li,
trix-editor ol ol ol > li {
  counter-increment: subsubitem;
  padding-left: 3.5em;
}

.trix-content ol ol ol > li::before,
.action-text-content ol ol ol > li::before,
trix-editor ol ol ol > li::before {
  content: counter(item) "." counter(subitem) "." counter(subsubitem) " ";
  left: 0;
}

/* Third level nested lists */
.trix-content ol ol ol ol,
.action-text-content ol ol ol ol,
trix-editor ol ol ol ol {
  counter-reset: subsubsubitem;
  padding-left: 1.5em;
}

.trix-content ol ol ol ol > li,
.action-text-content ol ol ol ol > li,
trix-editor ol ol ol ol > li {
  counter-increment: subsubsubitem;
  padding-left: 4.5em;
}

.trix-content ol ol ol ol > li::before,
.action-text-content ol ol ol ol > li::before,
trix-editor ol ol ol ol > li::before {
  content: counter(item) "." counter(subitem) "." counter(subsubitem) "." counter(subsubsubitem) " ";
  left: 0;
}

/* Apply to prose classes */
.prose ol,
[class*="prose"] ol,
.content ol {
  list-style-type: none;
  counter-reset: item;
  padding-left: 0;
}

.prose ol > li,
[class*="prose"] ol > li,
.content ol > li {
  counter-increment: item;
  position: relative;
  padding-left: 2em;
}

.prose ol > li::before,
[class*="prose"] ol > li::before,
.content ol > li::before {
  content: counter(item) ". ";
  position: absolute;
  left: 0;
  color: var(--tw-prose-counters, #6b7280);
  font-weight: 400;
}

/* Nested lists for prose */
.prose ol ol,
[class*="prose"] ol ol,
.content ol ol {
  counter-reset: subitem;
  padding-left: 1.5em;
}

.prose ol ol > li,
[class*="prose"] ol ol > li,
.content ol ol > li {
  counter-increment: subitem;
  padding-left: 2.5em;
}

.prose ol ol > li::before,
[class*="prose"] ol ol > li::before,
.content ol ol > li::before {
  content: counter(item) "." counter(subitem) " ";
  left: 0;
}

/* Second level for prose */
.prose ol ol ol,
[class*="prose"] ol ol ol,
.content ol ol ol {
  counter-reset: subsubitem;
  padding-left: 1.5em;
}

.prose ol ol ol > li,
[class*="prose"] ol ol ol > li,
.content ol ol ol > li {
  counter-increment: subsubitem;
  padding-left: 3.5em;
}

.prose ol ol ol > li::before,
[class*="prose"] ol ol ol > li::before,
.content ol ol ol > li::before {
  content: counter(item) "." counter(subitem) "." counter(subsubitem) " ";
  left: 0;
}