/*
Purpose: Presentation and theme overrides for HybridOps documentation.
Usage: Load via mkdocs.yml `extra_css` after Material theme styles.
*/

/* Hide only the primary sidebar site title label */
.md-sidebar .md-nav--primary>.md-nav__title {
  display: none !important;
}

.md-sidebar .md-nav--primary>.md-nav__list {
  margin-top: 0.25rem;
}

.mermaid {
  display: block;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

pre.mermaid,
.superfences-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.adr-index-scroll {
  max-height: 400px;
  overflow-y: auto;
}

.md-typeset table,
.md-typeset .md-typeset__table table {
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(0.78rem, 0.73rem + 0.18vw, 0.9rem) !important;
}

.md-typeset table:not([class]) {
  overflow: hidden;
  border-radius: 12px;
}

:root {
  --ho-black: #050607;
  --ho-black-2: #090b0f;
  --ho-black-3: #0e1117;
  --ho-border-dark: rgba(255, 255, 255, 0.08);
  --ho-border-light: rgba(15, 23, 42, 0.08);
  --ho-accent: #42f5d7;
  --ho-link: #7be8ff;
  --ho-radius: 14px;
  --ho-header-line: rgba(123, 232, 255, 0.24);
}

body,
.md-header,
.md-nav,
.md-typeset,
.md-search__input,
button,
input {
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

code,
pre,
kbd,
.md-typeset code,
.md-typeset pre code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
}

.md-nav__link {
  border-radius: 10px;
  transition: background-color 140ms ease, color 140ms ease;
}

.md-nav__link:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-md-color-scheme="default"] .md-nav__link:hover {
  background: rgba(15, 23, 42, 0.04);
}

.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.06;
}

.md-typeset h2,
.md-typeset h3 {
  letter-spacing: -0.01em;
}

.md-typeset a {
  text-underline-offset: 0.14em;
  text-decoration-thickness: 0.08em;
}

.md-typeset pre>code,
.md-typeset .admonition,
.md-typeset details {
  border-radius: var(--ho-radius);
  box-shadow: none;
}

.md-typeset .admonition-title,
.md-typeset summary {
  border-radius: calc(var(--ho-radius) - 1px) calc(var(--ho-radius) - 1px) 0 0;
}

[data-md-color-scheme="slate"] {
  color-scheme: dark;
  --md-default-bg-color: var(--ho-black) !important;
  --md-default-bg-color--light: var(--ho-black-2) !important;
  --md-default-bg-color--lighter: var(--ho-black-3) !important;
  --md-default-fg-color: rgba(255, 255, 255, 0.94) !important;
  --md-default-fg-color--light: rgba(255, 255, 255, 0.76) !important;
  --md-default-fg-color--lighter: rgba(255, 255, 255, 0.52) !important;
  --md-primary-fg-color: #0b0f17 !important;
  --md-primary-fg-color--light: #121723 !important;
  --md-primary-fg-color--dark: #080b11 !important;
  --md-primary-bg-color: #ffffff !important;
  --md-accent-fg-color: var(--ho-accent) !important;
  --md-typeset-a-color: var(--ho-link) !important;
  --md-code-bg-color: #0d121c !important;
  --md-code-fg-color: #f0f6ff !important;
  --md-footer-bg-color: #07090d !important;
  --md-footer-bg-color--dark: #040507 !important;
}

/* Material paints multiple surfaces separately in slate mode. */
html[data-md-color-scheme="slate"],
body[data-md-color-scheme="slate"],
body[data-md-color-scheme="slate"] .md-container,
body[data-md-color-scheme="slate"] .md-main,
body[data-md-color-scheme="slate"] .md-main__inner,
body[data-md-color-scheme="slate"] .md-content,
body[data-md-color-scheme="slate"] .md-content__inner,
body[data-md-color-scheme="slate"] .md-sidebar,
body[data-md-color-scheme="slate"] .md-sidebar__inner,
body[data-md-color-scheme="slate"] .md-sidebar__scrollwrap,
body[data-md-color-scheme="slate"] .md-nav,
body[data-md-color-scheme="slate"] .md-nav__list {
  background: var(--ho-black) !important;
  background-image: none !important;
}

body[data-md-color-scheme="slate"] .md-header,
body[data-md-color-scheme="slate"] .md-tabs {
  background: rgba(7, 9, 13, 0.94) !important;
  border-bottom: 1px solid var(--ho-border-dark);
  backdrop-filter: blur(10px);
}

body[data-md-color-scheme="slate"] .md-header,
body[data-md-color-scheme="slate"] .md-tabs {
  background: rgba(7, 9, 13, 0.94) !important;
  border-bottom: 1px solid var(--ho-border-dark);
  backdrop-filter: blur(10px);
}

body[data-md-color-scheme="slate"] .md-header {
  box-shadow: inset 0 -1px 0 var(--ho-header-line);
}

body[data-md-color-scheme="slate"] .md-search__form {
  border: 1px solid var(--ho-border-dark) !important;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03) !important;
  box-shadow: none;
}

body[data-md-color-scheme="slate"] .md-typeset {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 500;
}

body[data-md-color-scheme="slate"] .md-typeset h1,
body[data-md-color-scheme="slate"] .md-typeset h2,
body[data-md-color-scheme="slate"] .md-typeset h3 {
  color: #fff;
}

body[data-md-color-scheme="slate"] .md-typeset h1 {
  font-size: clamp(2rem, 1.7rem + 1.2vw, 2.8rem);
}

body[data-md-color-scheme="slate"] .md-typeset p,
body[data-md-color-scheme="slate"] .md-typeset li {
  color: rgba(255, 255, 255, 0.82);
}

body[data-md-color-scheme="slate"] .md-typeset a {
  color: var(--ho-link);
}

body[data-md-color-scheme="slate"] .md-nav__link--active {
  color: var(--ho-accent) !important;
  font-weight: 600;
}

body[data-md-color-scheme="slate"] .md-typeset pre>code,
body[data-md-color-scheme="slate"] .md-typeset .admonition,
body[data-md-color-scheme="slate"] .md-typeset details {
  border: 1px solid var(--ho-border-dark);
  background: rgba(255, 255, 255, 0.02);
}

body[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
  border: 1px solid var(--ho-border-dark);
}

[data-md-color-scheme="default"] .md-header,
[data-md-color-scheme="default"] .md-tabs {
  border-bottom: 1px solid var(--ho-border-light);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

[data-md-color-scheme="default"] .md-search__form {
  border: 1px solid var(--ho-border-light);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.03);
  box-shadow: none;
}

[data-md-color-scheme="default"] .md-typeset pre>code,
[data-md-color-scheme="default"] .md-typeset .admonition,
[data-md-color-scheme="default"] .md-typeset details {
  border: 1px solid var(--ho-border-light);
  background: rgba(255, 255, 255, 0.88);
}

[data-md-color-scheme="default"] .md-typeset table:not([class]) {
  border: 1px solid var(--ho-border-light);
}

.ho-install-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-inline-start: 0.5rem;
  padding: 0.22rem 0.7rem;
  border: 1px solid rgba(123, 232, 255, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(123, 232, 255, 0.1), rgba(66, 245, 215, 0.07)),
    rgba(255, 255, 255, 0.03);
  color: rgba(238, 252, 255, 0.96);
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.72rem;
  line-height: 1.25;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.ho-install-button:hover {
  border-color: rgba(123, 232, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(123, 232, 255, 0.14), rgba(66, 245, 215, 0.1)),
    rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.ho-install-button:active {
  transform: translateY(0);
  background-color: rgba(255, 255, 255, 0.08);
}

.ho-install-button:focus-visible {
  outline: 2px solid rgba(123, 232, 255, 0.55);
  outline-offset: 2px;
}

.ho-install-button--installed {
  cursor: default;
  opacity: 0.7;
}

[data-md-color-scheme="default"] .ho-install-button {
  border-color: rgba(2, 132, 199, 0.22);
  background:
    linear-gradient(180deg, rgba(2, 132, 199, 0.08), rgba(14, 165, 233, 0.06)),
    rgba(255, 255, 255, 0.7);
  color: #0b1724;
}

[data-md-color-scheme="default"] .ho-install-button:hover {
  border-color: rgba(2, 132, 199, 0.32);
  background:
    linear-gradient(180deg, rgba(2, 132, 199, 0.12), rgba(14, 165, 233, 0.08)),
    rgba(255, 255, 255, 0.92);
}

@media (max-width: 256px) {
  .ho-install-button {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .md-nav__link,
  .ho-install-button {
    transition: none;
  }
}

/* Keep Material search preview typography compact. */
.md-search-result__title {
  font-size: 0.95rem;
  line-height: 1.35;
}

.md-search-result__teaser :is(h1, h2, h3, h4, h5, h6) {
  margin: 0.2rem 0 !important;
  font-size: 0.95rem !important;
  line-height: 1.35 !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
}

.md-search-result__teaser p,
.md-search-result__teaser li {
  margin: 0.2rem 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.md-search-result__teaser code {
  font-size: 0.75rem;
}

/* Explicit theme selector dropdown (Dark / Light / Auto). */
.ho-theme-dropdown__source {
  display: none !important;
}

.ho-theme-dropdown {
  position: relative;
  margin-inline-end: 0.1rem;
}

.ho-theme-dropdown__trigger {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 2.12rem;
  height: 2.12rem;
  padding: 0;
  border: 0;
  border-radius: 9px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.ho-theme-dropdown__icon {
  display: inline-flex;
  width: 1.05rem;
  height: 1.05rem;
}

.ho-theme-dropdown__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.ho-theme-dropdown__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ho-theme-dropdown__trigger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ho-theme-dropdown__trigger:focus-visible {
  outline: 2px solid rgba(123, 232, 255, 0.55);
  outline-offset: 2px;
}

[data-md-color-scheme="default"] .ho-theme-dropdown__trigger:hover {
  background: rgba(15, 23, 42, 0.06);
}

.ho-theme-dropdown__menu {
  position: absolute;
  top: calc(100% + 0.38rem);
  right: 0;
  z-index: 30;
  min-width: 11.25rem;
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--ho-border-dark);
  background: #0f121a;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
  display: none;
}

.ho-theme-dropdown.is-open .ho-theme-dropdown__menu {
  display: block;
}

.ho-theme-dropdown__item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.ho-theme-dropdown__item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.ho-theme-dropdown__item.is-selected {
  background: rgba(123, 232, 255, 0.15);
}

.ho-theme-dropdown__item-check {
  opacity: 0;
}

.ho-theme-dropdown__item.is-selected .ho-theme-dropdown__item-check {
  opacity: 1;
}

[data-md-color-scheme="default"] .ho-theme-dropdown__menu {
  border-color: var(--ho-border-light);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

[data-md-color-scheme="default"] .ho-theme-dropdown__item:hover {
  background: rgba(15, 23, 42, 0.06);
}

[data-md-color-scheme="default"] .ho-theme-dropdown__item.is-selected {
  background: rgba(2, 132, 199, 0.14);
}
