/*
 * For reference: https://pydata-sphinx-theme.readthedocs.io/en/v0.9.0/user_guide/customizing.html
 * For colors: https://clrs.cc/
 */

/* anything related to the light theme */
html[data-theme="light"] {
    --pst-color-primary: #76B900;
    --pst-color-secondary: #5b8e03;
    --pst-color-secondary-highlight: #5b8e03;
    --pst-color-inline-code-links: #76B900;
    --pst-color-info: var(--pst-color-primary);
    --pst-color-info-highlight: var(--pst-color-primary);
    --pst-color-info-bg: #daedb9;
    --pst-color-attention: #ffc107;
    --pst-color-text-base: #323232;
    --pst-color-text-muted: #646464;
    --pst-color-shadow: #d8d8d8;
    --pst-color-border: #c9c9c9;
    --pst-color-inline-code: #76B900;
    --pst-color-target: #fbe54e;
    --pst-color-background: #fff;
    --pst-color-on-background: #fff;
    --pst-color-surface: #f5f5f5;
    --pst-color-on-surface: #e1e1e1;
    --pst-color-link: var(--pst-color-primary);
    --pst-color-link-hover: #789841;
    --pst-color-table-row-hover-bg: #daedb9;
    --pst-color-accent: var(--pst-color-primary);
}

/* anything related to the dark theme */
html[data-theme="dark"] {
    --pst-color-primary: #76B900;
    --pst-color-secondary: #c2f26f;
    --pst-color-secondary-highlight: #c2f26f;
    --pst-color-inline-code-links: #b6e664;
    --pst-color-info: var(--pst-color-primary);
    --pst-color-info-highlight: var(--pst-color-primary);
    --pst-color-info-bg: #3a550b;
    --pst-color-attention: #dca90f;
    --pst-color-text-base: #cecece;
    --pst-color-text-muted: #a6a6a6;
    --pst-color-shadow: #212121;
    --pst-color-border: silver;
    --pst-color-inline-code: #76B900;
    --pst-color-target: #472700;
    --pst-color-background: #121212;
    --pst-color-on-background: #1e1e1e;
    --pst-color-surface: #212121;
    --pst-color-on-surface: #373737;
    --pst-color-link: var(--pst-color-primary);
    --pst-color-link-hover: #aee354;
    --pst-color-table-row-hover-bg: #3a550b;
    --pst-color-accent: var(--pst-color-primary);
}

/* for the announcement link */
.bd-header-announcement a,
.bd-header-version-warning a {
    color: #7FDBFF;
}

/* Sidebar search box: one unified bar; green highlight wraps icon + input + shortcut */
.sidebar-primary-item .bd-search {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
    border: 1px solid var(--pst-color-border);
    border-radius: 6px;
    background: var(--pst-color-background);
}
.sidebar-primary-item .bd-search:focus-within {
    border-color: var(--pst-color-primary);
    box-shadow: 0 0 0 2px rgba(118, 185, 0, 0.2);
}
.sidebar-primary-item .bd-search .form-control {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border: none;
    border-radius: 0;
    outline: none;
    font-size: 0.9em;
    background: transparent;
}
.sidebar-primary-item .bd-search .form-control:focus {
    box-shadow: none;
}
.sidebar-primary-item .bd-search .fa-magnifying-glass {
    color: var(--pst-color-text-muted);
    flex-shrink: 0;
}
.sidebar-primary-item .bd-search .search-button__kbd-shortcut {
    flex-shrink: 0;
}

/* Reduce top padding in left sidebar */
.bd-sidebar-primary {
    padding: 1rem;
}

/* Hide "Table of Contents" label in sidebar nav */
.bd-sidebar-primary .bd-links__title {
    display: none;
}

/* reduce padding for logo */
.navbar-brand {
    padding-top: 0.0rem !important;
    padding-bottom: 0.0rem !important;
}

.navbar-icon-links {
    padding-top: 0.0rem !important;
    padding-bottom: 0.0rem !important;
}

/* Icon links in left sidebar: compact single row (like Isaac Lab reference) */
.sidebar-primary-item .navbar-icon-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.1rem;
    align-items: center;
    padding-left: 0;
    margin-bottom: 0.25rem;
}
.sidebar-primary-item .navbar-icon-links .nav-item {
    list-style: none;
    margin: 0;
}
.sidebar-primary-item .navbar-icon-links .nav-link {
    display: flex;
    align-items: center;
    padding: 0.1rem 0.2rem;
    font-size: 1.1em;
    color: var(--pst-color-text-base);
    text-decoration: none;
    border-radius: 2px;
}
.sidebar-primary-item .navbar-icon-links .nav-link:hover {
    color: var(--pst-color-link);
}
.sidebar-primary-item .navbar-icon-links .nav-link i,
.sidebar-primary-item .navbar-icon-links .nav-link svg {
    width: 1.1em;
    height: 1.1em;
    opacity: 0.9;
    flex-shrink: 0;
}
.sidebar-primary-item .navbar-icon-links .nav-link img.icon-link-image {
    max-height: 1.25em;
    width: auto;
    vertical-align: middle;
}

/* showcase task tables */

.showcase-table {
    min-width: 75%;
}

.showcase-table td {
    border-color: gray;
    border-style: solid;
    border-width: 1px;
}

.showcase-table p {
    margin: 0;
    padding: 0;
}

.showcase-table .rot90 {
    transform: rotate(-90deg);
    margin: 0;
    padding: 0;
}

.showcase-table .center {
    text-align: center;
    vertical-align: middle;
}

/* Code block: smaller font to fit 100 column width on one line */
.code-100col {
    font-size: 0.9em;
}
.code-100col pre {
    white-space: pre;
}

/* Extra space after license badge on index */
img.license-badge {
    margin-bottom: 1rem;
}
