/*
 * AIMET color palette
 */
:root {
    --aimet-blue: #3253dc;
    --aimet-dark-blue: #0000ff;
    --aimet-white: #ffffff;
    --aimet-border-grey: #e0e0e0;
    --aimet-menu-hover: #e3efff;
    --aimet-menu-font-active: #0058ff;
    --aimet-code-grey: #fafafa;
    --aimet-code-grey-dark: #535353;
    --aimet-light-blue: #e7f2fa;
  }
  
 aside.toc-drawer ul ul ul ul {
   display: none;
}

/* Hide level 3 entries */
.toctree-l3 {
    display: none;
}

/* Hide collapse arrow on level 2 entries */
li.toctree-l2 [for^="toctree-checkbox-"] {
    visibility: hidden;
}

/*
 * Configure the appearance of code output box.
 * Values are based on sphinx-gallery configuration
*/
.script-output {
    color: black;
    display: flex;
    gap: 0.5em;
}

.script-output::before {
    content: "Out:";
    line-height: 1.4;
    padding-top: 10px;
}

body[data-theme="dark"] .script-output::before {
    color: var(--aimet-white);
}

.script-output .highlight {
    background: transparent;
    flex-grow: 1;
    overflow: auto;
    /* Allow output block to take up maximum 25 lines */
    max-height: 25em;
}

/* Change the code backgorund in light and default mode */ 
body[data-theme="light"] *.highlight pre,
body[data-theme="light"] pre.literal-block {
    background-color: var(--aimet-code-grey);
}

/* Change the code backgorund in dark mode */ 
body[data-theme="dark"] *.highlight pre, body[data-theme="dark"] pre.literal-block { 
    background-color: var(--aimet-code-grey-dark);
}


/*
 * Glossary formatting
*/
[id^="term-"] {
    font-weight: bold;
}

/*
 * Heading formatting
 */

h1 {
    font-size:2.5em;
    margin-top:1.75rem;
    margin-bottom:1rem;
}

h2 {
    font-size:2em;
    margin-top:1.75rem;
    margin-bottom:1.25rem;
    font-weight: normal;
}
    
h3 {
    font-size:1.5em;
    margin-top:1.25rem;
    margin-bottom:1.25rem;
    font-weight: normal;
}
    
h4 {
    font-size:1.25em;
    margin-top:1.25rem;
    margin-bottom:1.25rem;
    font-weight: normal;
}

h5 {
    font-size:1.125em;
    margin-top:1.25rem;
    margin-bottom:1.25rem;
    font-weight: normal;
}

/*
 * Performance summary table
 */
table.perf-table {
    border-collapse: collapse;
    width: 100%;
    border: 1px solid var(--aimet-border-grey);
    font-size: 0.78em;
}

table.perf-table thead th {
    background-color: var(--aimet-blue);
    color: var(--aimet-white);
    font-weight: 600;
    text-align: left;
    border: none;
    border-bottom: 2px solid var(--aimet-dark-blue);
}

/* Zebra striping by model group: each model is its own <tbody>, so banding
 * is independent of how many recipe rows a model has. */
table.perf-table tbody:nth-of-type(odd) {
    background-color: var(--aimet-white);
}

table.perf-table tbody:nth-of-type(even) {
    background-color: var(--aimet-light-blue);
}

/* Highlight the model group being hovered for readability */
table.perf-table tbody:hover {
    background-color: var(--aimet-menu-hover);
}

table.perf-table th,
table.perf-table td {
    padding: 6px 10px;
    border: none;
    vertical-align: middle;
}

/* Emphasize the model name (the rowspan cell at the start of each group) */
table.perf-table tbody tr:first-child td:first-child {
    font-weight: 600;
}

/* Center the four numeric columns (PPL, MMLU, Time, CUDA). Use nth-last-child
 * so the rule holds in rowspan rows that omit the leading model-name cell. */
table.perf-table th:nth-last-child(1),
table.perf-table th:nth-last-child(2),
table.perf-table th:nth-last-child(3),
table.perf-table th:nth-last-child(4),
table.perf-table td:nth-last-child(1),
table.perf-table td:nth-last-child(2),
table.perf-table td:nth-last-child(3),
table.perf-table td:nth-last-child(4) {
    text-align: center;
}

/* Dark mode */
body[data-theme="dark"] table.perf-table {
    border-color: var(--aimet-code-grey-dark);
}

body[data-theme="dark"] table.perf-table tbody:nth-of-type(odd) {
    background-color: transparent;
}

body[data-theme="dark"] table.perf-table tbody:nth-of-type(even) {
    background-color: rgba(50, 83, 220, 0.15);
}

body[data-theme="dark"] table.perf-table tbody:hover {
    background-color: rgba(50, 83, 220, 0.30);
}