/* ==========================================================================
   Breadcrumb — where you are. Just a list; no classes on the items.

   <nav class="breadcrumb" aria-label="Breadcrumb">
     <ol>
       <li><a href="/"><i class="mi mi-house"></i>Home</a></li>
       <li><a href="/orders">Orders</a></li>
       <li aria-current="page">#10421</li>
     </ol>
   </nav>

   Separator: chevron (default) · .breadcrumb-slash · .breadcrumb-dot
   On phones, long trails collapse their middle items into "…".
   ========================================================================== */

.breadcrumb {
  --mo-breadcrumb-gap: .375rem;
  font-size: .875rem;
}
.breadcrumb > ol,
ol.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mo-breadcrumb-gap);
  align-items: center;
  min-width: 0;
  padding: 0;
  margin: 0;
  list-style: none;
}
.breadcrumb li {
  display: inline-flex;
  gap: var(--mo-breadcrumb-gap);
  align-items: center;
  min-width: 0;
  color: var(--mo-fg-3);
}
/* Separator before every item but the first */
.breadcrumb li + li::before {
  flex-shrink: 0;
  width: .875rem;
  height: .875rem;
  content: "";
  background-color: var(--mo-fg-3);
  mask: var(--mo-icon-chevron) center / contain no-repeat;
  opacity: .7;
  rotate: -90deg;
}
.breadcrumb li + li:dir(rtl)::before { rotate: 90deg; }
.breadcrumb-slash li + li::before { width: auto; height: auto; content: "/"; background: none; mask: none; rotate: none; }
.breadcrumb-dot li + li::before { width: .25rem; height: .25rem; background: var(--mo-fg-3); mask: none; border-radius: 50%; rotate: none; }

.breadcrumb a {
  display: inline-flex;
  gap: .375rem;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: var(--mo-radius-1);
  transition: color var(--mo-duration) var(--mo-ease);
}
.breadcrumb a:hover { color: var(--mo-fg-body); }
.breadcrumb a:focus-visible { outline: var(--mo-focus-ring-width) solid var(--mo-theme-focus-ring); outline-offset: 2px; }
.breadcrumb .mi { flex-shrink: 0; font-size: 1rem; }
.breadcrumb [aria-current]:not([aria-current="false"]) { font-weight: var(--mo-font-weight-medium); color: var(--mo-fg-body); }
/* Long names shorten with … (links, or a current item wrapped in an element) */
.breadcrumb li > :is(a, [aria-current]) { display: inline-block; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb li > a:has(> .mi) { display: inline-flex; }

/* Phones: first › … › last two. With 4+ items, the 2nd item turns into the "…" and the rest of the middle hides. */
@media (width < 576px) {
  .breadcrumb li:not(:first-child, :nth-child(2), :nth-last-child(-n + 2)) { display: none; }
  .breadcrumb li:nth-child(2):not(:nth-last-child(-n + 2)) > * { display: none; }
  .breadcrumb li:nth-child(2):not(:nth-last-child(-n + 2))::after { content: "…"; }
}

.breadcrumb-sm { font-size: .8125rem; }
