/* ==========================================================================
   Divider — a line between things, with optional text or an icon in it.

   <div class="divider"></div>                     a plain line (like <hr>, with spacing)
   <div class="divider">or</div>                   text in the middle
   <div class="divider divider-start">Today</div>  text at the start (.divider-end at the end)
   <span class="divider-vertical"></span>          a vertical line in a row of things (toolbars, meta text)

   .divider-sm · .divider-lg   less / more space around it
   .divider-dashed             dashed line
   theme-*                     colored line and text
   ========================================================================== */

.divider {
  --mo-divider-color: var(--mo-border-color);
  --mo-divider-space: 1rem;
  --mo-divider-style: solid;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-block: var(--mo-divider-space);
  font-size: .8125rem;
  font-weight: var(--mo-font-weight-medium);
  color: var(--mo-fg-3);
  white-space: nowrap;
}
.divider::before,
.divider::after {
  flex: 1 1 0;
  min-width: 1rem;
  content: "";
  border-top: var(--mo-border-width) var(--mo-divider-style) var(--mo-divider-color);
}
/* No text: one continuous line */
.divider:empty { gap: 0; }
.divider:empty::after { display: none; }

/* Text at the start or end: the line only runs on the other side */
.divider-start:not(:empty)::before, .divider-end:not(:empty)::after { display: none; }

.divider-sm { --mo-divider-space: .5rem; }
.divider-lg { --mo-divider-space: 2rem; }
.divider-dashed { --mo-divider-style: dashed; }
.divider[class*="theme-"] { --mo-divider-color: var(--mo-theme-border); color: var(--mo-theme-fg); }
.divider > .mi { font-size: 1rem; }

/* Vertical: stretches to the height of the row it's in */
.divider-vertical {
  display: inline-block;
  align-self: stretch;
  flex-shrink: 0;
  width: 0;
  min-height: 1em;
  margin-inline: .5rem;
  vertical-align: middle;
  border-inline-start: var(--mo-border-width) var(--mo-divider-style, solid) var(--mo-divider-color, var(--mo-border-color));
}
.divider-vertical[class*="theme-"] { --mo-divider-color: var(--mo-theme-border); }
