#mainnav {
    transition: box-shadow 0.2s ease-in-out;
    height: 50px;
}

.rmprint {

}

body {
    position: relative;
}

:root {
    --bittersweet: #ee5a58ff;
    --bittersweet50: #ee5a5888;
    --eerie-black: #1e1b18ff;
    --antiflash-white: #e8e9ebff;
    --slate-gray: #6b717eff;
    --orange-peel: #ffa630ff;

    .btn-primary {
        background-color: var(--bittersweet);
        border-color: transparent;
    }

    .btn-primary:active {
        background-color: var(--bittersweet50);
        border-color: var(--antiflash-white);
    }

    .accordion-button {
        background-color: var(--eerie-black);
        color: var(--antiflash-white);
    }

    .accordion-button.collapsed {
        background-color: var(--bs-accordion-btn-bg);
    }

    .accordion-button:focus {
        box-shadow: inset 0 calc(-1 * var(--bs-accordion-border-width)) 0 var(--eerie-black) !important;
    }

    .accordion-button::after {
        --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ee5a58'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e");
        --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ee5a58'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e");
    }


    .accordion-button:not(.collapsed)::after {
      /*--bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23ff5722' class='bi bi-chevron-up' viewBox='0 0 16 16'%3e%3cpath fill-rule='evenodd' d='M1.646 11.354a.5.5 0 0 0 .708 0L8 5.707l5.646 5.647a.5.5 0 0 0 .708-.708l-6-6a.5.5 0 0 0-.708 0l-6 6a.5.5 0 0 0 0 .708z'/%3e%3c/svg%3e");*/
    }
}

section, .apiitem {
    scroll-margin-top: 50px;
}

.search-result {
    user-select: none;
    cursor: pointer;
}

#searchbox {
    width: 100%;
}

.search-container {
    flex-grow: 0.2;
    position: relative;
    display: flex;
    flex-direction: column;
}

#search-results {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    max-height: 50vh;
    overflow-y: scroll;
    width: calc();
}

.page-break {
    min-height: 500px;
}

.revision-planned {
    background-color: var(--eerie-black);    
    opacity: 0.4;
}

.libcardlogo {
    width: 100px;
    height: auto;
    object-fit: contain;
}

#toc {
    position: fixed;
    flex-direction: row;
    top: 80px;
    right: 8px;
    width: 20vw;
    z-index: 100;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-gutter: stable both-edges;
}

.flexijustify {
    justify-content: start;
}

.flexijustify-midpoint {

}

.midpoint-flex {
}
@media (min-width: 800px) {
    .flexijustify {
        justify-content: start !important;
    }

    .midpoint-flex {
        display: flex !important;
    }

}

@media (min-width: 800px) and (max-width: 1199px) {
    .flexijustify-midpoint {
        flex-grow: 1 !important;
        padding-right: 200px;
    }
}

@media (min-width: 1200px) {
    .flexijustify {
        justify-content: center !important;
    }
}

@media (min-width: 800px) {
    #toc {
        right: 2px;
        width: 25vw;
    }
}

@media (min-width: 1200px) {
    #toc {
        right: 16px;
        width: 20vw;
    }    
}

@media (min-width: 1600px) {
    #toc {
        right: 64px;
        width: 20vw;
    }    
}

@media (min-width: 2400px) {
    #toc {
        right: 32px;
        width: 32vw;
    }
}

/*@media (min-width: 2400px) {
    #toc {
        width: 40vw;
    }
}
*/
.nav-item.dropdown:hover .dropdown-menu {
    display: block;
}

.libcard {
    transition: background-color 0.2s ease-in-out;
    /*width: 564px;*/
    /*height: 120px;*/
}

.libcard:hover {
    background-color: var(--eerie-black);
}

.center {
    align-self: center;
}

@media print {
    .navbar {
        display: none !important;
    }
    .toc {
        display: none !important;
    }
    .btn {
        display: none !important;
    }
    .carousel-control-prev {
        display: none !important;
    }
    .carousel-control-next {
        display: none !important;
    }
    footer {
        break-inside: avoid !important;
    }
    .toc-outline {
        display: none !important;
    }
    section {
        break-inside: avoid !important;
    }
    #main-content {
        width: 100% !important;
    }
    .rmprint {
        display: none !important;
    }
}    

.hidden {
    display:none;
}

pre {
    background-color: rgb(63, 63, 63);
}

/* Container for each function entry */
.apiitem.function {
    padding-bottom: 4px;
    margin: 16px 0px;
    color: var(--antiflash-white);
    /*background-color: var(--eerie-black);*/
    border-radius: 16px;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 0px 12px rgba(0, 0, 0, 0.7);
    /*margin-bottom: min(100vh, 50%);*/
}

.span-image {
    display: block;
    margin: auto;
    max-width: 100%;
    height: auto;
}

.apiitem.function:hover {
    box-shadow: 0 0px 24px rgba(0, 0, 0, 0.9);
}

.apidetails {
    padding-left:  8px;
    padding-top:   8px;
    padding-right: 8px;
}

.item-decl {
    border-top-left-radius:  8px;
    border-top-right-radius: 8px;
    /*font-weight: bold;*/
    display: block;
    padding-top:    4px;
    padding-left:   8px;
    padding-bottom: 8px;
    background-color: #55555555;
    /*background-color: var(--antiflash-white);*/
    background: #EE5A58FF;
    background: linear-gradient(90deg,rgba(238, 90, 88, 0.7) 20%, rgba(238, 90, 88, 0.23) 100%);
    transition: background-image 0.2s ease-in-out;
}

.item-desc {
    margin-bottom: 12px;
    line-height: 1.5;
}


/* Optional: subtle anchor link for quick access */
.apiitem.function .item-decl::before {
    content: "§ ";
    font-size: 0.9rem;
    visibility: hidden;
}

.apiitem.function:hover .item-decl::before {
    visibility: visible;
}

/* Table inside API item */
.apiitem.function table {
    /*width: 100%;*/
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.8em;
    table-layout: fixed; /* key: ensures column widths are consistent */
}

.apiitem.function table td {
    /*border: 1px solid #555;*/
    padding: 8px 12px;
    font-size: 0.95rem;
}

.apiitem.function table td:first-child {
    /*font-weight: bold;*/
    color: var(--orange-peel);
}

.apiitem.function table tr:nth-child(even) {
    background-color: var(--eerie-black); /* slightly lighter than container */
}

/* Set a fixed min-width for the first column */
.apiitem.function table td:first-child {
    width: 300px;
    text-align: left;
}

.dropdown-item:active {
    background-color: var(--slate-gray);
}

.dropdown-item.active {
    background-color: var(--bittersweet);
}

.outline-section .nav-link {
    color: #ffffff55;
    font-size: 0.9em;
    padding-top: 2px;
    padding-bottom: 2px;
    transform: translate(0px);
    transition: transform 0.2s ease-in-out,
                color     0.2s ease-in-out;
}

.outline-section .nav-link.active {
    color: #ffffffff;
    transform: translate(-10px);
}


.hljs {
  display: block;
  overflow-x: auto;
  padding: 0.5em;
}

.hljs {
  color: #ddd;
  background: #303030;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
  color: white;
}


.hljs-subst {
  /* default */
}

.hljs-string,
.hljs-title,
.hljs-name,
.hljs-type,
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
  color: #d88;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
  color: #979797;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-title,
.hljs-section,
.hljs-doctag,
.hljs-type,
.hljs-name,
.hljs-strong {
  font-weight: bold;
}

.hljs-emphasis {
  font-style: italic;
}