/* Octos Documentation Theme — Finding Nemo Palette
   Nemo Orange:     #E85B26 / #FF5F1F  (primary accent, active links)
   Ocean Blue:      #00B4EF            (main brand, links, headings)
   Yellow Accent:   #F9D53F            (highlights, search marks)
   Dark Water:      #0739B9 / #0D3B7C  (sidebar bg, dark theme)
*/

/* ============ Light Theme (Octos Light) ============ */
.light, html:not(.js) {
  --bg: #F5F9FC;
  --fg: #1A2A3A;
  --sidebar-bg: #0D3B7C;
  --sidebar-fg: #B8D8F0;
  --sidebar-active: #FF5F1F;
  --sidebar-non-existant: #5A8AB5;
  --sidebar-spacer: #0739B9;
  --links: #00B4EF;
  --inline-code-color: #E85B26;
  --theme-popup-bg: #EAF4FB;
  --theme-popup-border: #A8D4F0;
  --theme-hover: #DEEEF8;
  --quote-bg: #EAF4FB;
  --quote-border: #00B4EF;
  --table-border-color: #B0D4EC;
  --table-header-bg: #0D3B7C;
  --table-alternate-bg: #F5F9FC;
  --searchbar-border-color: #A8D4F0;
  --searchbar-bg: #FFFFFF;
  --searchbar-fg: #1A2A3A;
  --searchbar-shadow-color: rgba(0, 180, 239, 0.1);
  --searchresults-border-color: #A8D4F0;
  --searchresults-li-bg: #EAF4FB;
  --search-mark-bg: #F9D53F;
  --color-scheme: light;
}

/* ============ Dark Theme (Octos Dark) — covers ALL dark themes ============ */
html.ayu, html.navy, html.coal, html.rust, .ayu, .navy, .coal, .rust {
  --bg: #081E3F;
  --fg: #D4E6F5;
  --sidebar-bg: #061533;
  --sidebar-fg: #7AAED4;
  --sidebar-active: #FF5F1F;
  --sidebar-non-existant: #3A6A98;
  --sidebar-spacer: #0D3B7C;
  --links: #00B4EF;
  --inline-code-color: #FF8C56;
  --theme-popup-bg: #0A2548;
  --theme-popup-border: #0D3B7C;
  --theme-hover: #0C2D55;
  --quote-bg: #0A2548;
  --quote-border: #00B4EF;
  --table-border-color: #0D3B7C;
  --table-header-bg: #061533;
  --table-alternate-bg: #0A2548;
  --searchbar-border-color: #0D3B7C;
  --searchbar-bg: #0A2548;
  --searchbar-fg: #D4E6F5;
  --searchbar-shadow-color: rgba(0, 0, 0, 0.3);
  --searchresults-border-color: #0D3B7C;
  --searchresults-li-bg: #0A2548;
  --search-mark-bg: #F9D53F;
  --color-scheme: dark;
}

/* ============ Typography ============ */
:root {
  --content-max-width: 860px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

code, pre code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88em;
}

.content main {
  max-width: var(--content-max-width);
}

/* ============ Sidebar ============ */
.sidebar {
  font-size: 0.92em;
}

.sidebar .sidebar-scrollbox {
  padding: 10px 20px;
}

.sidebar ol.chapter li.chapter-item a {
  color: var(--sidebar-fg);
  padding: 5px 0;
  transition: color 0.15s ease;
}

.sidebar ol.chapter li.chapter-item a:hover {
  color: #FFFFFF;
}

.sidebar ol.chapter li.chapter-item a.active {
  color: var(--sidebar-active);
  font-weight: 600;
}

/* Sidebar part titles (User Guide, Operations, Developer Guide) */
.sidebar .chapter li.part-title {
  color: #F9D53F;
  font-weight: 700;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 0 4px;
  border-top: 1px solid var(--sidebar-spacer);
  margin-top: 8px;
}

.sidebar .chapter li.part-title:first-child {
  border-top: none;
  margin-top: 0;
}

/* ============ Content ============ */
.content h1 {
  color: #0D3B7C;
  border-bottom: 3px solid #E85B26;
  padding-bottom: 8px;
}

.content h2 {
  color: #0739B9;
  border-bottom: 1px solid #B0D4EC;
  padding-bottom: 4px;
}

.content h3 {
  color: #00B4EF;
}

html.ayu .content h1,
html.navy .content h1,
html.coal .content h1,
html.rust .content h1 {
  color: #D4E6F5;
  border-bottom-color: #E85B26;
}

html.ayu .content h2,
html.navy .content h2,
html.coal .content h2,
html.rust .content h2 {
  color: #00B4EF;
  border-bottom-color: #0D3B7C;
}

html.ayu .content h3,
html.navy .content h3,
html.coal .content h3,
html.rust .content h3 {
  color: #00B4EF;
}

/* Links */
.content a {
  color: var(--links);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.content a:hover {
  color: #E85B26;
  border-bottom-color: #E85B26;
}

/* ============ Code blocks ============ */
.content pre {
  border-radius: 8px;
  border: 1px solid var(--table-border-color);
  padding: 16px;
}

html.light .content pre, html:not(.js) .content pre {
  background: #0D3B7C;
  color: #D4E6F5;
}

.content code:not(pre code) {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

html.light .content code:not(pre code), html:not(.js) .content code:not(pre code) {
  background: #EAF4FB;
  color: #E85B26;
}

/* ============ Tables ============ */
.content table {
  border-collapse: collapse;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.92em;
}

.content table th {
  background: var(--table-header-bg);
  color: #FFFFFF;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
}

html.light .content table th, html:not(.js) .content table th {
  color: #F5F9FC;
}

.content table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--table-border-color);
}

.content table tr:nth-child(even) {
  background: var(--table-alternate-bg);
}

/* ============ Blockquotes ============ */
.content blockquote {
  border-left: 4px solid #E85B26;
  background: var(--quote-bg);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
}

/* ============ Navigation buttons ============ */
.nav-chapters {
  font-size: 0.9em;
  transition: color 0.15s ease;
}

.nav-chapters:hover {
  color: #E85B26;
}

/* ============ Scrollbar (webkit) ============ */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #0739B9;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #FF5F1F;
}

/* ============ Top menu bar ============ */
.menu-bar {
  border-bottom: 1px solid var(--table-border-color);
}

html.light .menu-bar, html:not(.js) .menu-bar {
  background: #FFFFFF;
}

/* ============ Search ============ */
#searchbar {
  border-radius: 8px;
  padding: 8px 12px;
}

/* ============ Rename theme options ============ */
#mdbook-theme-light {
  font-size: 0 !important;
}
#mdbook-theme-light::after {
  content: "Octos Light";
  font-size: 14px;
}
#mdbook-theme-ayu {
  font-size: 0 !important;
}
#mdbook-theme-ayu::after {
  content: "Octos Dark";
  font-size: 14px;
}
#mdbook-theme-rust {
  font-size: 0 !important;
}
#mdbook-theme-rust::after {
  content: "Rust";
  font-size: 14px;
}
#mdbook-theme-coal {
  font-size: 0 !important;
}
#mdbook-theme-coal::after {
  content: "Coal";
  font-size: 14px;
}
#mdbook-theme-navy {
  font-size: 0 !important;
}
#mdbook-theme-navy::after {
  content: "Navy";
  font-size: 14px;
}

/* ============ Mobile ============ */
@media (max-width: 1080px) {
  .content main {
    padding: 16px;
  }
}
