/* SPDX-FileCopyrightText: 2026 ff-fab
 * SPDX-License-Identifier: MIT
 */

/* click-zoom — Overlay and cursor styles ---------------------------------- */

/* Mermaid diagrams: opt-out — cursor shown by default, JS adds
   .click-zoom-excluded when zoom would not enlarge the diagram. */
.mermaid:not(.click-zoom-excluded),
.mermaid:not(.click-zoom-excluded) svg {
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

.mermaid:not(.click-zoom-excluded):hover {
  opacity: 0.85;
}

/* Images and inline SVGs: opt-in via [data-click-zoom] attribute. */
[data-click-zoom] {
  cursor: zoom-in;
}

[data-click-zoom]:hover {
  filter: brightness(1.02);
}

.click-zoom-overlay {
  align-items: center;
  backdrop-filter: blur(4px);
  background: rgba(10, 12, 16, 0.85);
  inset: 0;
  display: flex;
  justify-content: center;
  opacity: 0;
  padding: 2rem;
  position: fixed;
  transition: opacity 0.2s ease;
  z-index: 9999;
}

.click-zoom-overlay.active {
  opacity: 1;
}

.click-zoom-content {
  max-height: calc(100vh - 6rem);
  max-width: calc(100vw - 6rem);
  overflow: auto;
}

.click-zoom-content svg {
  background: var(--md-default-bg-color);
  border-radius: 0.5rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25);
  display: block;
}

.click-zoom-content img {
  display: block;
  max-height: calc(100vh - 6rem);
  max-width: calc(100vw - 6rem);
}

.click-zoom-close {
  background: transparent;
  border: 0;
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.2;
  padding: 0.25rem 0.5rem;
  position: fixed;
  right: 1.25rem;
  text-align: left;
  top: 1rem;
}

.click-zoom-close:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

@media (max-width: 48rem) {
  .click-zoom-overlay {
    padding: 1rem;
  }

  .click-zoom-content {
    max-height: calc(100vh - 4rem);
    max-width: calc(100vw - 2rem);
  }

  .click-zoom-close {
    right: 1rem;
    top: 0.75rem;
  }
}
