/* === Arduino Language Reference — стиль под docs.arduino.cc === */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Roboto+Mono:wght@400;500&display=swap');

body.arduino-ref-theme {
  --arduino-teal: #008184;
  --arduino-teal-light: #00979C;
  --arduino-bg: #ffffff;
  --arduino-text: #000000;
  --arduino-text-secondary: #4D4D4D;
  --arduino-text-muted: #95A5A6;
  --arduino-sidebar-bg: #F8F9FA;
  --arduino-border: #DAE3E3;
  --arduino-code-bg: #ECF1F1;
  --arduino-code-color: #1A1A1A;
  --arduino-code-block-bg: #1A1A1A;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 16px;
  line-height: 1.6;
  color: var(--arduino-text);
}

body.arduino-ref-theme,
body.arduino-ref-theme .wy-body-for-nav,
body.arduino-ref-theme .wy-grid-for-nav {
  background-color: var(--arduino-bg) !important;
}

/* === Левый сайдбар === */
body.arduino-ref-theme .wy-nav-side {
  background-color: var(--arduino-sidebar-bg) !important;
  border-right: 1px solid var(--arduino-border) !important;
  width: 300px;
  padding-top: 0;
}

body.arduino-ref-theme .wy-side-scroll {
  background: var(--arduino-sidebar-bg) !important;
}

body.arduino-ref-theme .wy-side-nav-search {
  background: white !important;
  border-bottom: 1px solid var(--arduino-border);
  padding: 1.4em 1.2em;
}

body.arduino-ref-theme .wy-side-nav-search > a,
body.arduino-ref-theme .wy-side-nav-search .wy-dropdown > a {
  color: var(--arduino-teal) !important;
  font-weight: 700;
  font-size: 1.1em;
}

body.arduino-ref-theme .wy-side-nav-search > div.version {
  color: #777;
}

body.arduino-ref-theme .wy-side-nav-search input[type="text"] {
  border: 1px solid var(--arduino-border);
  border-radius: 4px;
  background: white;
  color: var(--arduino-text);
  box-shadow: none;
  padding: 8px 12px;
}

body.arduino-ref-theme .wy-menu-vertical {
  background: var(--arduino-sidebar-bg) !important;
  padding-top: 0.5em;
}

body.arduino-ref-theme .wy-menu-vertical a {
  color: var(--arduino-text-secondary) !important;
  padding: 0.5em 1.2em !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  background: transparent !important;
  border: none !important;
}

body.arduino-ref-theme .wy-menu-vertical a:hover {
  background: #ECF1F1 !important;
  color: var(--arduino-teal) !important;
}

body.arduino-ref-theme .wy-menu-vertical li.current {
  background: transparent !important;
}

body.arduino-ref-theme .wy-menu-vertical li.current > a {
  background: white !important;
  color: var(--arduino-teal) !important;
  font-weight: 600;
  border-left: 3px solid var(--arduino-teal) !important;
}

body.arduino-ref-theme .wy-menu-vertical li.toctree-l2,
body.arduino-ref-theme .wy-menu-vertical li.toctree-l3,
body.arduino-ref-theme .wy-menu-vertical li.toctree-l4 {
  background: var(--arduino-sidebar-bg) !important;
}

body.arduino-ref-theme .wy-menu-vertical li.toctree-l2 a {
  padding-left: 2.5em !important;
}
body.arduino-ref-theme .wy-menu-vertical li.toctree-l3 a {
  padding-left: 3.5em !important;
}
body.arduino-ref-theme .wy-menu-vertical li.toctree-l4 a {
  padding-left: 4.5em !important;
}

body.arduino-ref-theme .wy-menu-vertical p.caption,
body.arduino-ref-theme .wy-menu-vertical .caption-text {
  color: var(--arduino-teal) !important;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 1.5em 1.2em 0.8em !important;
  margin-bottom: 0.4em !important;
  line-height: 1.4;
}

/* === Основной контент === */
body.arduino-ref-theme .wy-nav-content-wrap {
  background: white !important;
  margin-left: 300px;
}

body.arduino-ref-theme .wy-nav-content {
  background: white !important;
  color: var(--arduino-text);
  max-width: 850px;
  padding: 3em 4em 4em;
  margin: 0 auto;
}

body.arduino-ref-theme .wy-nav-top {
  background: white !important;
  color: var(--arduino-teal) !important;
  border-bottom: 1px solid var(--arduino-border);
}

body.arduino-ref-theme .wy-nav-top a {
  color: var(--arduino-teal) !important;
  font-weight: 700;
}

/* === Хлебные крошки === */
body.arduino-ref-theme .wy-breadcrumbs {
  border-bottom: 1px solid var(--arduino-border);
  padding-bottom: 1em;
  margin-bottom: 2em;
  font-size: 13px;
}

body.arduino-ref-theme .wy-breadcrumbs li {
  color: var(--arduino-text-muted);
}

body.arduino-ref-theme .wy-breadcrumbs li a {
  color: var(--arduino-text-secondary) !important;
  text-decoration: none;
  font-weight: 400;
}

body.arduino-ref-theme .wy-breadcrumbs li a:hover {
  color: var(--arduino-teal) !important;
}

body.arduino-ref-theme .wy-breadcrumbs li:last-child {
  color: var(--arduino-text);
  font-weight: 600;
}

body.arduino-ref-theme .wy-breadcrumbs-aside {
  display: none;
}

/* === Заголовки === */
body.arduino-ref-theme .rst-content h1,
body.arduino-ref-theme h1 {
  color: var(--arduino-text) !important;
  font-weight: 700 !important;
  font-size: 3em !important;
  border-bottom: none !important;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0.8em;
  font-family: "Open Sans", sans-serif !important;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

body.arduino-ref-theme .rst-content h2,
body.arduino-ref-theme h2 {
  color: var(--arduino-text) !important;
  font-weight: 700 !important;
  font-size: 2em !important;
  border-bottom: none !important;
  padding-bottom: 0;
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-family: "Open Sans", sans-serif !important;
  line-height: 1.3;
}

body.arduino-ref-theme .rst-content h3,
body.arduino-ref-theme h3 {
  color: var(--arduino-text) !important;
  font-weight: 700 !important;
  font-size: 1.4em !important;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
  font-family: "Open Sans", sans-serif !important;
}

body.arduino-ref-theme .rst-content h4,
body.arduino-ref-theme h4 {
  color: var(--arduino-text) !important;
  font-weight: 600 !important;
  font-size: 1.15em !important;
  margin-top: 1.5em;
  margin-bottom: 0.4em;
}

body.arduino-ref-theme .rst-content p,
body.arduino-ref-theme p {
  color: var(--arduino-text) !important;
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 1em;
}

/* === Inline код (бирюзовый стиль как у Arduino) === */
body.arduino-ref-theme code,
body.arduino-ref-theme .rst-content code,
body.arduino-ref-theme .rst-content code.literal,
body.arduino-ref-theme code.docutils.literal,
body.arduino-ref-theme code.docutils.literal.notranslate,
body.arduino-ref-theme tt {
  background: #ECF1F1 !important;
  color: #00979C !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  border: 1px solid #C8D2D2 !important;
  font-size: 0.9em;
  font-family: "Roboto Mono", "Consolas", monospace !important;
  font-weight: 500;
}

/* Принудительно цвет на span.pre внутри code */
body.arduino-ref-theme code .pre,
body.arduino-ref-theme .rst-content code .pre,
body.arduino-ref-theme code.literal .pre,
body.arduino-ref-theme code.docutils.literal .pre,
body.arduino-ref-theme code.docutils.literal.notranslate .pre {
  color: #00979C !important;
  background: transparent !important;
  border: none !important;
}

/* === Блоки кода === */
body.arduino-ref-theme .highlight {
  background: var(--arduino-code-block-bg) !important;
  border-radius: 6px;
  border: none !important;
  margin: 1.5em 0;
  overflow: hidden;
}

body.arduino-ref-theme .highlight pre {
  background: var(--arduino-code-block-bg) !important;
  color: #E0E0E0 !important;
  padding: 1.2em 1.4em !important;
  border-radius: 6px;
  font-family: "Roboto Mono", "Consolas", monospace !important;
  font-size: 14px;
  line-height: 1.6;
  border: none !important;
}

body.arduino-ref-theme .highlight .k,
body.arduino-ref-theme .highlight .kt,
body.arduino-ref-theme .highlight .kd {
  color: #569CD6 !important;
}

body.arduino-ref-theme .highlight .nf,
body.arduino-ref-theme .highlight .nx {
  color: #DCDCAA !important;
}

body.arduino-ref-theme .highlight .n {
  color: #9CDCFE !important;
}

body.arduino-ref-theme .highlight .s,
body.arduino-ref-theme .highlight .s1,
body.arduino-ref-theme .highlight .s2 {
  color: #CE9178 !important;
}

body.arduino-ref-theme .highlight .c,
body.arduino-ref-theme .highlight .c1,
body.arduino-ref-theme .highlight .cm,
body.arduino-ref-theme .highlight .cp {
  color: #6A9955 !important;
  font-style: italic;
}

body.arduino-ref-theme .highlight .mi,
body.arduino-ref-theme .highlight .mf,
body.arduino-ref-theme .highlight .il {
  color: #B5CEA8 !important;
}

body.arduino-ref-theme .highlight .o,
body.arduino-ref-theme .highlight .p {
  color: #D4D4D4 !important;
}

/* === Admonitions === */
body.arduino-ref-theme .admonition {
  border-radius: 8px;
  border: none;
  padding: 1.2em 1.4em;
  margin: 1.5em 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

body.arduino-ref-theme .admonition-title {
  margin: 0 0 0.5em 0 !important;
  padding: 0 !important;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.arduino-ref-theme .admonition.note {
  background: #EBF5FF !important;
  border-left: 4px solid #2196F3;
}
body.arduino-ref-theme .admonition.note .admonition-title {
  background: transparent !important;
  color: #1565C0 !important;
  font-weight: 700;
}

body.arduino-ref-theme .admonition.warning {
  background: #FFF8E1 !important;
  border-left: 4px solid #FFA726;
}
body.arduino-ref-theme .admonition.warning .admonition-title {
  background: transparent !important;
  color: #E65100 !important;
  font-weight: 700;
}

body.arduino-ref-theme .admonition.tip,
body.arduino-ref-theme .admonition.hint {
  background: #E8F5E9 !important;
  border-left: 4px solid #4CAF50;
}
body.arduino-ref-theme .admonition.tip .admonition-title,
body.arduino-ref-theme .admonition.hint .admonition-title {
  background: transparent !important;
  color: #2E7D32 !important;
  font-weight: 700;
}

body.arduino-ref-theme .admonition.important {
  background: #FFEBEE !important;
  border-left: 4px solid #F44336;
}
body.arduino-ref-theme .admonition.important .admonition-title {
  background: transparent !important;
  color: #C62828 !important;
  font-weight: 700;
}

body.arduino-ref-theme .admonition p {
  color: var(--arduino-text) !important;
  margin-bottom: 0;
}

/* === Ссылки === */
body.arduino-ref-theme a,
body.arduino-ref-theme .rst-content a {
  color: var(--arduino-teal) !important;
  text-decoration: none;
  font-weight: 600;
}

body.arduino-ref-theme a:hover,
body.arduino-ref-theme .rst-content a:hover {
  color: var(--arduino-teal-light) !important;
  text-decoration: underline;
}

body.arduino-ref-theme a:visited {
  color: var(--arduino-teal) !important;
}

body.arduino-ref-theme a code,
body.arduino-ref-theme a .literal {
  color: var(--arduino-teal) !important;
}

/* === Списки === */
body.arduino-ref-theme li,
body.arduino-ref-theme .rst-content li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--arduino-text) !important;
  margin-bottom: 0.4em;
}

body.arduino-ref-theme ul,
body.arduino-ref-theme ol {
  padding-left: 1.5em;
}

/* === Кнопки prev/next внизу === */
body.arduino-ref-theme .rst-footer-buttons {
  margin-top: 4em;
  padding-top: 2em;
  border-top: 1px solid var(--arduino-border);
}

body.arduino-ref-theme .btn-neutral,
body.arduino-ref-theme .btn {
  background: white !important;
  color: var(--arduino-teal) !important;
  border: 1px solid var(--arduino-border) !important;
  border-radius: 4px !important;
  padding: 8px 16px !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

body.arduino-ref-theme .btn-neutral:hover {
  background: var(--arduino-sidebar-bg) !important;
  color: var(--arduino-teal) !important;
}

body.arduino-ref-theme .btn-neutral .fa,
body.arduino-ref-theme .btn-neutral .icon {
  color: var(--arduino-teal) !important;
}

/* === Footer === */
body.arduino-ref-theme footer {
  color: #95A5A6;
  font-size: 13px;
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px solid var(--arduino-border);
}

body.arduino-ref-theme hr {
  border: none;
  border-top: 1px solid var(--arduino-border);
  margin: 2em 0;
}

/* === Таблицы === */
body.arduino-ref-theme table.docutils {
  border: 1px solid var(--arduino-border) !important;
  box-shadow: none !important;
}

body.arduino-ref-theme table.docutils thead {
  background: var(--arduino-sidebar-bg) !important;
}

body.arduino-ref-theme table.docutils th {
  background: var(--arduino-sidebar-bg) !important;
  color: var(--arduino-text) !important;
  font-weight: 700;
  border: 1px solid var(--arduino-border) !important;
}

body.arduino-ref-theme table.docutils td {
  background: white !important;
  color: var(--arduino-text) !important;
  border: 1px solid var(--arduino-border) !important;
}

@media (max-width: 768px) {
  body.arduino-ref-theme .wy-nav-content-wrap {
    margin-left: 0;
  }
  body.arduino-ref-theme .wy-nav-content {
    padding: 1.5em;
  }
  body.arduino-ref-theme .rst-content h1,
  body.arduino-ref-theme h1 {
    font-size: 2em !important;
  }
  body.arduino-ref-theme .rst-content h2,
  body.arduino-ref-theme h2 {
    font-size: 1.5em !important;
  }
}


/* === Fallback: html.arduino-ref-theme — если JS поставил класс на html === */
html.arduino-ref-theme .rst-content code,
html.arduino-ref-theme .rst-content code.literal,
html.arduino-ref-theme .rst-content code.docutils.literal,
html.arduino-ref-theme .rst-content code.docutils.literal.notranslate,
html.arduino-ref-theme code,
html.arduino-ref-theme tt {
  background: #ECF1F1 !important;
  color: #00979C !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  border: 1px solid #C8D2D2 !important;
  font-family: "Roboto Mono", monospace !important;
}
html.arduino-ref-theme code .pre,
html.arduino-ref-theme .rst-content code .pre,
html.arduino-ref-theme code.docutils.literal .pre,
html.arduino-ref-theme code.docutils.literal.notranslate .pre {
  color: #00979C !important;
  background: transparent !important;
  border: none !important;
}
