/* ------------------------------------------------------------ */
/* Docs leaf - palette                                            */
/* ------------------------------------------------------------ */

.docs-leaf {
    --zato-docs-leaf-subtitle: #171b2f;
    --zato-docs-leaf-list-marker: #c1c9d2;
    --zato-docs-leaf-inline-code-background: #eceef1;
    --zato-docs-leaf-inline-code-shadow: #e4e7ea;
    --zato-docs-leaf-panel-background: #f7fafc;
    --zato-docs-leaf-code-background: #fbfbfc;
    --zato-docs-leaf-code-shadow: rgba(26, 31, 54, 0.14);
    --zato-docs-leaf-tooltip-text: #ffffff;

    /* The same background the tippy tooltips use, e.g. on screenshot links. */
    --zato-docs-leaf-tooltip-background: #333333;

    --zato-docs-leaf-chat-user-text: #ffffff;
    --zato-docs-leaf-chat-agent-text: #ffffff;
    --zato-docs-leaf-chat-agent-background: #1d7a3e;
}

/* ------------------------------------------------------------ */
/* Docs leaf - page frame                                         */
/* ------------------------------------------------------------ */

.docs-leaf-container {
    width: 100%;
    max-width: 1175px;
    margin: 0 auto;
    padding: 24px;
}

.docs-leaf-row {
    display: flex;
    flex-direction: row;
}

.docs-leaf-article {
    flex: 1;
    min-width: 200px;
}

/* ------------------------------------------------------------ */
/* Docs leaf - title block                                        */
/* ------------------------------------------------------------ */

.docs-leaf-article .docs-leaf-subtitle {
    margin: 14px 0 4px;
    padding: 0;
    font-size: 22px;
    line-height: 30px;
    font-weight: 400;
    color: var(--zato-docs-leaf-subtitle);
}

/* ------------------------------------------------------------ */
/* Docs leaf - document rhythm                                    */
/* ------------------------------------------------------------ */

.docs-leaf-document p {
    margin: 0;
    padding: 12px 0 0;
    font-size: 16px;
    line-height: 26px;
    color: var(--zato-docs-text);
}

.docs-leaf-document img {
    max-width: 100%;
    margin-top: 12px;
}

/* ------------------------------------------------------------ */
/* Docs leaf - headings                                           */
/* ------------------------------------------------------------ */

.docs-leaf-document h2 {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: fit-content;
    margin: 0;
    /* The host page sets the padding of every h2 with an important flag,
       so this rule has the same weight. */
    padding: 32px 0 0 !important;
    font-size: 21px;
    font-weight: 700;
    color: var(--zato-docs-heading);
}

/* The pointer belongs to the heading's own text and its anchor, both
   injected by the page script - never to the heading's padding box. */
.docs-leaf-heading-text,
.docs-leaf-heading-anchor {
    cursor: pointer;
}

.docs-leaf-heading-anchor {
    /* The anchor for its copied-to-clipboard tooltip. */
    position: relative;
    display: flex;
    margin-left: 8px;
    color: var(--zato-docs-link);
    opacity: 0;
    transition: opacity 0.06s;
}

.docs-leaf-document h2:hover .docs-leaf-heading-anchor,
.docs-leaf-document h3:hover .docs-leaf-heading-anchor {
    opacity: 1;
    transition-delay: 0.05s;
}

.docs-leaf-document h3 {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: fit-content;
    margin: 0;
    padding: 20px 0 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--zato-docs-heading);
}

.docs-leaf-document h3 ~ h3 {
    margin-top: 18px;
    padding-top: 16px;
}

/* ------------------------------------------------------------ */
/* Docs leaf - lists                                              */
/* ------------------------------------------------------------ */

.docs-leaf-document ul,
.docs-leaf-document ol {
    margin: 0;
    padding: 12px 0 0;
    list-style: none;
    font-size: 16px;
    line-height: 26px;
    color: var(--zato-docs-text);
}

.docs-leaf-document li {
    position: relative;
    margin: 4px 0;
    padding: 0 0 0 32px;
}

/* A loose markdown list wraps each item's text in a paragraph - without
   this, the paragraph's own top padding pushes the text below the marker. */
.docs-leaf-document li > p {
    padding-top: 0;
}

.docs-leaf-document ul > li::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--zato-docs-leaf-list-marker);
}

.docs-leaf-document ol {
    counter-reset: docs-leaf-list-item;
}

.docs-leaf-document ol > li::before {
    counter-increment: docs-leaf-list-item;
    content: counter(docs-leaf-list-item);
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    text-align: center;
    color: var(--zato-docs-muted);
    background: var(--zato-docs-divider);
}

/* ------------------------------------------------------------ */
/* Docs leaf - body links                                         */
/* ------------------------------------------------------------ */

.docs-leaf-document a {
    font-weight: 500;
    color: var(--zato-docs-link);
    text-decoration: none;
    transition: color 0.06s;
}

.docs-leaf-document a:visited {
    color: var(--zato-docs-link);
}

.docs-leaf-document a:hover {
    color: var(--zato-dark-accent-color);
    transition-delay: 0.05s;
}

/* ------------------------------------------------------------ */
/* Docs leaf - inline code                                        */
/* ------------------------------------------------------------ */

.docs-leaf-document p code,
.docs-leaf-document li code,
.docs-leaf-document td code {
    padding: 3px 4px 1px;
    font-size: 0.9em;
    color: var(--zato-docs-text);
    background-color: var(--zato-docs-leaf-inline-code-background);
    border-radius: 2px;
    text-shadow: 1px 1px 0 var(--zato-docs-leaf-inline-code-shadow);
}

/* ------------------------------------------------------------ */
/* Docs leaf - tables                                             */
/* ------------------------------------------------------------ */

/* Plain leaf tables - the widget tables draw their own chrome
   in docs-widgets.css, so these rules stay off them. */
.docs-leaf-document table:not(.docs-widget-table) {
    width: 100%;
    max-width: 100%;
    margin-top: 16px;
    border-collapse: collapse;
}

.docs-leaf-document table:not(.docs-widget-table) thead th {
    padding: 8px 16px 8px 8px;
    border-bottom: 1px solid var(--zato-docs-divider);
    font-size: 13px;
    font-weight: 500;
    line-height: 15px;
    text-align: left;
    text-transform: uppercase;
    color: var(--zato-docs-muted);
}

.docs-leaf-document table:not(.docs-widget-table) tbody td {
    padding: 11px 16px 11px 8px;
    border-bottom: 1px solid var(--zato-docs-divider);
    font-size: 14px;
    line-height: 20px;
    vertical-align: top;
    color: var(--zato-docs-text);
}

.docs-leaf-document table:not(.docs-widget-table) tbody tr:last-child td:first-child {
    border-bottom-left-radius: 4px;
}

.docs-leaf-document table:not(.docs-widget-table) tbody tr:last-child td:last-child {
    border-bottom-right-radius: 4px;
}

/* ------------------------------------------------------------ */
/* Docs leaf - tabs                                               */
/* ------------------------------------------------------------ */

.docs-leaf-tab-group {
    margin-top: 8px;
}

.docs-leaf-tabs {
    display: flex;
    flex-direction: row;
    overflow: auto;
    border-bottom: 1px solid var(--zato-docs-divider);
}

.docs-leaf-tab {
    position: relative;
    margin: 0;
    padding: 16px 20px;
    border: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-align: center;
    color: var(--zato-docs-muted);
    background: transparent;
    cursor: pointer;
    transition: color 0.06s;
}

.docs-leaf-tab:hover {
    color: var(--zato-docs-heading);
    transition-delay: 0.05s;
}

.docs-leaf-tab-chip {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--zato-docs-link);
    opacity: 0;
    transition: opacity 300ms ease-in-out;
}

.docs-leaf-tab-active,
.docs-leaf-tab-active:hover {
    color: var(--zato-docs-link);
}

.docs-leaf-tab-active .docs-leaf-tab-chip {
    opacity: 1;
}

.docs-leaf-tab-pane-hidden {
    display: none;
}

/* ------------------------------------------------------------ */
/* Docs leaf - code blocks                                        */
/* ------------------------------------------------------------ */

.docs-leaf-code {
    position: relative;
    margin: 16px 0;
    border: 1px solid var(--zato-docs-divider);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 2px var(--zato-docs-leaf-code-shadow);
}

.docs-leaf-code-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 6px 16px;
    border-bottom: 1px solid var(--zato-docs-divider);
    font-size: 13px;
    font-weight: 500;
    color: var(--zato-docs-muted);
    background: var(--zato-docs-leaf-panel-background);
}

.docs-leaf-code-copy {
    /* The anchor for the copied-to-clipboard tooltip. */
    position: relative;
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--zato-docs-muted);
    background: transparent;
    cursor: pointer;
    transition: color 0.06s;
}

.docs-leaf-code-copy:hover {
    color: var(--zato-docs-heading);
    transition-delay: 0.05s;
}

.docs-leaf-code-tooltip,
.docs-leaf-anchor-tooltip {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 20px;
    color: var(--zato-docs-leaf-tooltip-text);
    background: var(--zato-docs-leaf-tooltip-background);
    /* 0.7s total - 0.525s fully visible, then the 0.175s fade. */
    animation: docs-leaf-tooltip-fade 0.7s forwards;
}

/* Anchored to the control they confirm and centered on it - the code
   tooltip to the left of the copy button, the heading anchor's to the
   right of the anchor icon. */
.docs-leaf-code-tooltip,
.docs-leaf-anchor-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
}

.docs-leaf-code-tooltip {
    right: calc(100% + 8px);
}

.docs-leaf-anchor-tooltip {
    left: calc(100% + 8px);
}

/* The arrow pointing back at the control the tooltip confirms -
   the same triangle the tippy tooltips carry. */
.docs-leaf-code-tooltip::after,
.docs-leaf-anchor-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
}

.docs-leaf-code-tooltip::after {
    left: 100%;
    border-left-color: var(--zato-docs-leaf-tooltip-background);
}

.docs-leaf-anchor-tooltip::after {
    right: 100%;
    border-right-color: var(--zato-docs-leaf-tooltip-background);
}

@keyframes docs-leaf-tooltip-fade {
    0% { opacity: 1; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}

.docs-leaf-code .highlight {
    background: var(--zato-docs-leaf-code-background);
}

.docs-leaf-code .highlight pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
}

/* A block whose long command wraps instead of scrolling sideways. */
.docs-leaf-code .docs-leaf-code-wrap pre code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ */
/* Docs leaf - chat                                               */
/* ------------------------------------------------------------ */

.docs-leaf-document .docs-chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
    padding-bottom: 12px;
}

.docs-leaf-document .docs-chat-bubble {
    max-width: 75%;
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 26px;
}

.docs-leaf-document .docs-chat-user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: var(--zato-docs-leaf-chat-user-text);
    background: var(--zato-default-accent-color);
}

.docs-leaf-document .docs-chat-agent {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: var(--zato-docs-leaf-chat-agent-text);
    background: var(--zato-docs-leaf-chat-agent-background);
}

/* ------------------------------------------------------------ */
/* Docs leaf - panels                                             */
/* ------------------------------------------------------------ */

.docs-leaf-document .hint,
.docs-leaf-document div.try-it,
.docs-leaf-document div.note-aside {
    margin: 16px 0 0;
    padding: 16px;
    border: 0;
    border-radius: 4px;
    background-color: var(--zato-docs-leaf-panel-background);
}

.docs-leaf-document div.try-it strong,
.docs-leaf-document div.note-aside strong {
    color: var(--zato-docs-heading);
}

.docs-leaf-document .hint p:first-child,
.docs-leaf-document div.try-it p:first-child,
.docs-leaf-document div.note-aside p:first-child {
    padding-top: 0;
}

/* ------------------------------------------------------------ */
/* Docs leaf - lightbox                                           */
/* ------------------------------------------------------------ */

.docs-leaf-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.docs-leaf-lightbox-visible {
    display: flex;
}

.docs-leaf-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* ------------------------------------------------------------ */
/* Docs leaf - right pane                                         */
/* ------------------------------------------------------------ */

.docs-leaf-right-pane {
    position: sticky;
    top: calc(var(--zato-docs-header-height) + 1rem);
    /* A stretched flex child is as tall as the whole row and has nowhere
       to stick, staying at its natural height keeps the pane in view. */
    align-self: flex-start;
    flex: none;
    width: 250px;
    padding-left: 48px;
    padding-bottom: 8px;
}

.docs-leaf-toc {
    max-height: calc(100vh - var(--zato-docs-header-height) - 2rem);
    overflow-y: auto;
}

.docs-leaf-toc-fade {
    position: absolute;
    left: 48px;
    right: 0;
    bottom: 0;
    height: 80px;
    pointer-events: none;
    background: linear-gradient(rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, #fff 100%);
    opacity: 0;
    transition: opacity 0.1s ease;
}

.docs-leaf-toc-fade-visible {
    opacity: 1;
}

/* The header's typography is shared with the section nav headers
   and lives in docs-common.css. */
.docs-leaf-toc-header {
    display: block;
    /* Room on the right for the pane's toggle on the same line. */
    padding: 0 28px 12px 0;
}

/* The pane's toggle sits at the top-right corner, level with the
   "On this page" header - its look comes from docs.css. */
.docs-leaf-pane-toggle {
    position: absolute;
    top: 0;
    right: 0;
}

/* Collapsed, the pane is a narrow strip holding only the expand chevron. */
.docs-leaf-right-pane.docs-pane-collapsed {
    width: 28px;
    padding-left: 8px;
}

.docs-leaf-right-pane.docs-pane-collapsed .docs-leaf-toc,
.docs-leaf-right-pane.docs-pane-collapsed .docs-leaf-toc-fade {
    display: none;
}

/* The colors and typography come from the shared docs-nav-link class
   in docs-common.css, this class only adds the list's own rhythm. */
.docs-leaf-toc-link {
    padding: 4px 0;
}

/* The chapter text starts after the toggle slot and the row gap,
   sublinks sit one step deeper than that. */
.docs-leaf-toc-sublink {
    padding: 3px 0 3px 24px;
}

@media (max-width: 1199px) {
    .docs-leaf-right-pane {
        display: none;
    }
}
