/* ══════════════════════════════════════════════════
   FRONTEND  <ol> / <ul>
══════════════════════════════════════════════════ */

ol.gaia-list,
ul.gaia-list {
  padding-left: 1em !important;
  margin-left: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: 1.8;
}

ul.gaia-list--none {
  list-style: none !important;
  padding-left: 0 !important;
}

ul.gaia-list--dot {
  list-style-type: disc !important;
}
ul.gaia-list--circle {
  list-style-type: circle !important;
}

ol.gaia-list--decimal {
  list-style-type: decimal !important;
}
ol.gaia-list--lower-alpha {
  list-style-type: lower-alpha !important;
}
ol.gaia-list--upper-alpha {
  list-style-type: upper-alpha !important;
}

/* circle-number */
ol.gaia-list--circle-number {
  list-style: none !important;
  padding-left: 0 !important;
  counter-reset: list-c var(--list-start, 0);
}

ol.gaia-list--circle-number > li {
  margin-bottom: 0.4em;
  padding-left: 0.3em;
}

ol.gaia-list--circle-number > li::before {
  counter-increment: list-c;
  content: counter(list-c);
  float: left;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  margin-right: 0.6em;
  margin-top: calc((2.2em - 1em) / 2);
}

ol.gaia-list--circle-number > li > .gaia-list-item__label {
  display: block;
  overflow: hidden;
}

/* nested list spacing */
ol.gaia-list ol.gaia-list,
ol.gaia-list ul.gaia-list,
ul.gaia-list ol.gaia-list,
ul.gaia-list ul.gaia-list {
  margin-top: 0.4em !important;
  margin-bottom: 0.2em !important;
  margin-left: 0 !important;
}

/* ══════════════════════════════════════════════════
   EDITOR  div-based layout
══════════════════════════════════════════════════ */

div.gaia-list {
  padding-left: 1em !important;
  line-height: 1.8;
}

/* counter resets — outer level */
div.gaia-list--decimal {
  counter-reset: ec-list;
}
div.gaia-list--lower-alpha {
  counter-reset: ec-list;
}
div.gaia-list--upper-alpha {
  counter-reset: ec-list;
}
div.gaia-list--circle-number {
  counter-reset: ec-circle;
}

/* flex row: marker + text */
div.gaia-list .gaia-list-item__content {
  display: flex;
  align-items: baseline;
  gap: 0.4em;
}

div.gaia-list .gaia-list-item__content::before {
  flex-shrink: 0;
  font-weight: 700;
  color: #333;
}

/* — decimal */
div.gaia-list--decimal .gaia-list-item__content::before {
  counter-increment: ec-list;
  content: counter(ec-list) ".";
}

/* — lower-alpha */
div.gaia-list--lower-alpha .gaia-list-item__content::before {
  counter-increment: ec-list;
  content: counter(ec-list, lower-alpha) ".";
}

/* — upper-alpha */
div.gaia-list--upper-alpha .gaia-list-item__content::before {
  counter-increment: ec-list;
  content: counter(ec-list, upper-alpha) ".";
}

/* — circle-number */
div.gaia-list--circle-number .gaia-list-item__content {
  align-items: flex-start;
}
div.gaia-list--circle-number .gaia-list-item__content::before {
  counter-increment: ec-circle;
  content: counter(ec-circle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  border: 1.5px solid #333;
  font-size: 0.75em;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.55em;
}

/* — dot */
div.gaia-list--dot .gaia-list-item__content::before {
  content: "●";
  font-weight: 400;
}

/* — circle */
div.gaia-list--circle .gaia-list-item__content::before {
  content: "○";
  font-weight: 400;
}

/* — none */
div.gaia-list--none .gaia-list-item__content::before {
  content: none;
}

/* ── NESTED LIST LEAK FIX ───────────────────────────
   Reset ALL inherited counter/marker styles when
   a gaia-list appears inside another gaia-list.
   Rules below this block re-apply the correct style.
─────────────────────────────────────────────────── */

div.gaia-list div.gaia-list .gaia-list-item__content::before {
  counter-increment: none !important;
  content: none !important;
  display: none !important;
  width: auto !important;
  height: auto !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: inherit !important;
}

/* Re-apply for each type in nested context
   (must come AFTER the reset block above)       */

div.gaia-list div.gaia-list--decimal {
  counter-reset: ec-list;
}
div.gaia-list div.gaia-list--lower-alpha {
  counter-reset: ec-list;
}
div.gaia-list div.gaia-list--upper-alpha {
  counter-reset: ec-list;
}
div.gaia-list div.gaia-list--circle-number {
  counter-reset: ec-circle;
}

div.gaia-list div.gaia-list--decimal .gaia-list-item__content::before {
  counter-increment: ec-list !important;
  content: counter(ec-list) "." !important;
  display: inline-block !important;
  font-weight: 700 !important;
}

div.gaia-list div.gaia-list--lower-alpha .gaia-list-item__content::before {
  counter-increment: ec-list !important;
  content: counter(ec-list, lower-alpha) "." !important;
  display: inline-block !important;
  font-weight: 700 !important;
}

div.gaia-list div.gaia-list--upper-alpha .gaia-list-item__content::before {
  counter-increment: ec-list !important;
  content: counter(ec-list, upper-alpha) "." !important;
  display: inline-block !important;
  font-weight: 700 !important;
}

div.gaia-list div.gaia-list--circle-number .gaia-list-item__content {
  align-items: flex-start;
}
div.gaia-list div.gaia-list--circle-number .gaia-list-item__content::before {
  counter-increment: ec-circle !important;
  content: counter(ec-circle) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 1.4em !important;
  height: 1.4em !important;
  border-radius: 50% !important;
  border: 1.5px solid #333 !important;
  font-size: 0.82em !important;
  font-weight: 700 !important;
  margin-top: 0.1em !important;
}

div.gaia-list div.gaia-list--dot .gaia-list-item__content::before {
  content: "●" !important;
  display: inline-block !important;
  font-weight: 400 !important;
}

div.gaia-list div.gaia-list--circle .gaia-list-item__content::before {
  content: "○" !important;
  display: inline-block !important;
  font-weight: 400 !important;
}

div.gaia-list div.gaia-list--none .gaia-list-item__content::before {
  content: none !important;
  display: none !important;
}

/* ══════════════════════════════════════════════════
   EDITOR  InnerBlocks wrapper fixes
══════════════════════════════════════════════════ */

div.gaia-list .block-editor-block-list__layout {
  padding: 0 !important;
  margin: 0 !important;
}

div.gaia-list .block-editor-block-list__block {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* ══════════════════════════════════════════════════
   ADD BUTTON
══════════════════════════════════════════════════ */

.gaia-list__add-wrap {
  display: block;
  margin-top: 8px;
}

.gaia-list__add-btn {
  display: inline-block;
  width: auto !important;
  border: 1px dashed #ccc !important;
  background: transparent !important;
  color: #888 !important;
  padding: 4px 16px !important;
  font-size: 0.85em;
  cursor: pointer;
}

.gaia-list__add-btn:hover {
  border-color: #999 !important;
  color: #333 !important;
}
