/* Click-to-zoom affordance for Mermaid diagrams and content images. */

.content pre.mermaid {
    cursor: zoom-in;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: rgba(127, 127, 127, 0.06);
    border: 1px solid rgba(127, 127, 127, 0.12);
}

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

.content main img {
    cursor: zoom-in;
}

/* Full-screen lightbox */
.cebook-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
    background: rgba(15, 15, 20, 0.88);
    backdrop-filter: blur(2px);
    cursor: zoom-out;
}

.cebook-lightbox-inner {
    position: relative;
    z-index: 1;
    max-width: 96vw;
    max-height: 92vh;
    overflow: auto;
    cursor: default;
    box-sizing: border-box;
    border-radius: 8px;
    padding: 1rem;
    background: var(--cebook-lightbox-bg, #fff);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

html.ayu .cebook-lightbox-inner,
html.coal .cebook-lightbox-inner,
html.navy .cebook-lightbox-inner {
    --cebook-lightbox-bg: #1f1f24;
}

html.light .cebook-lightbox-inner,
html.rust .cebook-lightbox-inner {
    --cebook-lightbox-bg: #fafafa;
}

.cebook-lightbox-inner img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0 auto;
}

/* Mermaid SVGs get the full viewport when zoomed. */
.cebook-lightbox-inner .mermaid {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.cebook-lightbox-inner .mermaid svg {
    width: min(92vw, 1600px) !important;
    max-width: none !important;
    height: auto !important;
}

.cebook-lightbox-hint {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.75rem;
    opacity: 0.65;
    pointer-events: none;
    white-space: nowrap;
}
