/* "Copy" and "wrap text" code block buttons */
pre:has(.function-btn-container) {
    position: relative;
    display: flex;
    overflow: visible;
}

button.function-btn {
    border: 1px solid #d7dadc;
    border-radius: 5px;
    color: darkgray;
    cursor: pointer;
    display: none;
    height: 30px;
    margin: 0.17rem;
    padding: 0.35rem;
    position: absolute;
    right: 0;
    width: 30px;
    text-align: center;
    white-space: nowrap;
}

pre:has(.hljs.wrap) .wrap-button {
    background-color: rgb(229 229 229);
}

button.function-btn + button.function-btn {
    right: 36px;
}

pre:hover > .function-btn-container > button.function-btn {
    display: block;
}

.function-btn:hover {
    transition: all 0.5s ease;
    color: gray;
}

.function-btn-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.function-btn svg {
    fill: currentcolor;
}

/* Wrap class used for "wrap text" button. */
code.wrap {
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
}

.tooltip-container {
    top: 0;
    right: 0;
}

.tooltiptext {
    visibility: hidden;
    width: fit-content;
    bottom: 120%;
    right: 0;
    background-color: black;
    color: #fff;
    text-align: center;
    padding: 5px;
    border-radius: 6px;
    font-size: 12px;
    cursor: default;
    position: absolute;
}

.function-btn:hover .tooltiptext {
    visibility: visible;
    overflow: visible;
}

.function-btn-container {
    width: 0;
}