/* TI Zephyr documentation — branding overrides for sphinx_rtd_theme */

/* Top navigation bar: TI red */
.wy-nav-top {
    background-color: #CC0000;
}

/* Sidebar search area */
.wy-side-nav-search {
    background-color: #FCFCFC;
}
.wy-side-nav-search > .icon    { color: #404040 !important; }
.wy-side-nav-search > .version { color: #404040 !important; }

/* Widen content area beyond RTD default */
.wy-nav-content {
    max-width: 1200px;
}

/* Tables */
table, table.docutils {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
table thead, table.docutils thead {
    white-space: normal;
}
table th, table td {
    padding: 8px 12px;
    border: 1px solid #c8cfd5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}
table th, table.docutils th {
    background-color: #2c3e50;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    border-color: #1a252f;
}

/* Tables marked ``:class: force-wrap``: wrap cell text instead of scrolling
   sideways. The theme sets nowrap on cells inside .wy-table-responsive, and a
   fixed layout keeps the column widths given by ``:widths:``. */
.wy-table-responsive table.force-wrap {
    table-layout: fixed;
    width: 100%;
}
.wy-table-responsive table.force-wrap td,
.wy-table-responsive table.force-wrap th {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Italic line directly under a page title (rst-class:: ti-subtitle) */
.rst-content p.ti-subtitle {
    font-style: italic;
    margin-top: -12px;
}

/* Code blocks */
div.highlight pre {
    font-size: 0.85em;
    line-height: 1.5;
}

/* Admonitions */
div.admonition {
    margin: 1em 0;
}

/* Images: constrained and centered */
.rst-content .section img,
.rst-content section img {
    max-width: 75%;
    height: auto;
    display: block;
    margin: 0.5em auto;
}
img {
    max-width: 100%;
    height: auto;
}

/* Compact simple lists */
.rst-content .section ul.simple,
.rst-content section ul.simple,
.rst-content .toctree-wrapper ul.simple {
    margin-bottom: 0;
    margin-top: 0;
}

/* sphinx_rtd_theme zeros margin-top on all headings; restore it so section
   headings never visually collide with the preceding content. */
.rst-content h2,
.rst-content h3,
.rst-content h4 {
    margin-top: 1.5em;
}

/* Zephyr logo at the top right of every page */
.wy-nav-content {
    position: relative;
}
.wy-nav-content::before {
    content: "";
    position: absolute;
    top: 15px;
    right: 42px;
    width: 100px;
    height: 45px;
    background: url("zephyr_logo.svg") right center / contain no-repeat;
}

/* Sidebar: TI logo first, then the project title */
.wy-side-nav-search > a.icon-home {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 6px;
}
.wy-side-nav-search > a.icon-home img.logo {
    order: -1;
    flex-basis: 100%;
    margin: 12px auto 10px;
}

/* No grey band beside the content on wide screens */
.wy-nav-content-wrap {
    background: #fcfcfc;
}

/* Breathing room around version and search */
.wy-side-nav-search .version {
    margin: 6px 0;
}
.wy-side-nav-search input[type=text] {
    margin-bottom: 12px;
}

/* The mobile top bar already shows the title */
@media (max-width: 768px) {
    .wy-nav-content::before {
        display: none;
    }
}

/* Upstream Zephyr look: navy sidebar, purple accent, every nesting depth.
   !important: the theme sets grey backgrounds per level with higher specificity. */
.wy-nav-side {
    background: #333f67;
}
.wy-menu-vertical li a {
    color: #c3e3ff !important;
    background: #333f67 !important;
    border: none !important;
}
.wy-menu-vertical li.current > a,
.wy-menu-vertical li.current > ul {
    background: #2a3558 !important;
}
.wy-menu-vertical li a:hover {
    background: #29355c !important;
}
.wy-menu-vertical li.current > a.current,
.wy-menu-vertical li.toctree-l1.current > a {
    background: #212d51 !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 #af7fe4;
}
.wy-menu-vertical p.caption {
    color: #af7fe4;
}

/* Keep breadcrumbs clear of the Zephyr logo */
.wy-breadcrumbs {
    padding-right: 110px;
}

/* Consistent links, tinted code blocks */
.rst-content a,
.rst-content a:visited {
    color: #1a5a8a;
}
.rst-content a:hover {
    color: #2563a8;
}
.rst-content div[class^="highlight"] {
    background: #f6f8fa;
    border-radius: 4px;
}
