.md-typeset .admonition.islandora,
.md-typeset details.islandora {
  border-color: rgb(194, 19, 19);
}
.md-typeset .islandora > .admonition-title,
.md-typeset .islandora > summary {
  background-color: rgba(194, 19, 19, 0.1);
}
.md-typeset .islandora > .admonition-title::before,
.md-typeset .islandora > summary::before {
  content: "🦞";
  background-color: rgba(194, 19, 19, 0);
  -webkit-mask-image: none;
  mask-image: none;
  mask-size: unset;
}

.markdown-body .callout[theme="islandora"] {
  --background: #c54245;
  --border: #ffffff6b;
  --text: #f5fffa;
}

/** Mermaid animation helpers for stepped flow diagrams. */
@keyframes dash {
  to {
    stroke-dashoffset: -100;
  }
}

/**
 * Sequential flow animation for Mermaid diagrams.
 *
 * Author diagrams by assigning flow step classes to edges:
 *
 *   class e1 flow0;
 *   class e2 flow1;
 *   class e3 flow2;
 *
 * The JavaScript runtime finds flow0..flow10-style classes, applies the dash
 * styling, and animates those steps in sequence. Edges sharing the same flowN
 * value animate in parallel. By default each step lasts 3 s, followed by a 2 s
 * pause before the full sequence repeats.
 */
@keyframes dashFlash {
  0%    { stroke-dashoffset: 900; }
  12.5% { stroke-dashoffset: -100; }
  12.6% { stroke-dashoffset: 900; }
  100%  { stroke-dashoffset: 900; }
}

.mermaid-expandable {
  cursor: zoom-in;
}

.mermaid-expandable:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 0.3rem;
}

.mermaid-lightbox {
  background: transparent;
  border: 0;
  max-width: min(96vw, 1400px);
  padding: 0;
  width: 96vw;
}

.mermaid-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.mermaid-lightbox__frame {
  background: var(--md-default-bg-color);
  border-radius: 0.6rem;
  box-shadow: var(--md-shadow-z3);
  max-height: 90vh;
  overflow: hidden;
}

.mermaid-lightbox__close {
  appearance: none;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  cursor: pointer;
  display: block;
  margin: 1rem 1rem 0 auto;
  padding: 0.35rem 0.75rem;
}

.mermaid-lightbox__body {
  overflow: auto;
  padding: 1rem;
}

.mermaid-lightbox__body svg {
  display: block;
  margin: 0 auto;
}

/** Play / Pause / Restart controls injected below animated diagrams **/
.mermaid-controls {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.mermaid-controls .mermaid-btn {
  appearance: none;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0.35;
  padding: 0.25rem 0.5rem;
  transition: opacity 0.15s;
}

.mermaid-controls .mermaid-btn:hover,
.mermaid-controls .mermaid-btn:focus-visible {
  opacity: 0.85;
}

.mermaid-controls .mermaid-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .mermaid * {
    animation: none !important;
    transition: none !important;
  }
}
