/* SnapBoost docs — Qian Capital brand, clean RTD layout */

:root {
  --qc-light: #f8f6f2;
  --qc-mid: #eae3d7;
  --qc-dark: #1f271b;
  --qc-green: #344e41;
  --qc-gold: #c0aa81;
  --qc-gold-bright: #d4c09a;
  --qc-gold-dim: rgba(192, 170, 129, 0.18);
  --qc-text: #1f271b;
  --qc-muted: rgba(31, 39, 27, 0.62);
  --qc-border: rgba(31, 39, 27, 0.12);
}

/* Base */
body,
.wy-body-for-nav {
  color: var(--qc-text);
  background: var(--qc-light);
}

.wy-nav-content-wrap {
  background: var(--qc-light);
}

.wy-nav-content {
  max-width: 1100px;
  background: var(--qc-light);
}

/* Sidebar — Qian Capital dark green */
.wy-nav-side {
  background: var(--qc-dark);
}

.wy-side-nav-search,
.wy-nav-top {
  background: var(--qc-dark) !important;
  border-bottom: 1px solid rgba(192, 170, 129, 0.22);
}

.wy-side-nav-search {
  padding: 0.9rem 0.75rem 0.8rem;
  text-align: center;
}

.wy-side-nav-search > a.sb-title {
  display: block;
  margin: 0.15rem 0 0.65rem;
  color: var(--qc-light) !important;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-align: center;
}

.wy-side-nav-search > a.sb-title:hover {
  color: var(--qc-gold-bright) !important;
}

/* Version dropdown directly under SnapBoost title */
.sb-version-switch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
  text-align: left;
}

.sb-version-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--qc-gold);
  margin: 0;
}

.sb-version-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 2px;
  border: 1px solid rgba(192, 170, 129, 0.35);
  background-color: rgba(248, 246, 242, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c0aa81' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  color: var(--qc-light);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 0.4rem 1.8rem 0.4rem 0.65rem;
  box-shadow: none;
  cursor: pointer;
}

.sb-version-select:hover,
.sb-version-select:focus {
  border-color: var(--qc-gold);
  background-color: rgba(248, 246, 242, 0.1);
  outline: none;
}

.sb-version-select option {
  color: var(--qc-dark);
  background: var(--qc-light);
}

.wy-side-nav-search input[type="text"] {
  border-radius: 2px;
  border: 1px solid rgba(192, 170, 129, 0.35);
  background: rgba(248, 246, 242, 0.06);
  color: var(--qc-light);
  box-shadow: none;
  width: 100%;
}

.wy-side-nav-search input[type="text"]:focus {
  border-color: var(--qc-gold);
  background: rgba(248, 246, 242, 0.1);
}

.wy-side-nav-search input[type="text"]::placeholder {
  color: rgba(248, 246, 242, 0.45);
}

.wy-menu-vertical header,
.wy-menu-vertical p.caption {
  color: var(--qc-gold) !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 1rem;
}

.wy-menu-vertical a {
  color: rgba(248, 246, 242, 0.8) !important;
}

.wy-menu-vertical a:hover {
  background: rgba(192, 170, 129, 0.1) !important;
  color: var(--qc-gold-bright) !important;
}

/* Keep expanded section left edge continuous (no RTD top/bottom gap) */
.wy-menu-vertical li.toctree-l1 {
  border-left: 2px solid transparent;
}

.wy-menu-vertical li.toctree-l1.current {
  border-left-color: var(--qc-gold);
  background: transparent;
}

.wy-menu-vertical li.current {
  background: transparent;
}

.wy-menu-vertical li.current a {
  border-right: none !important;
}

.wy-menu-vertical li.current > a,
.wy-menu-vertical li.toctree-l1.current > a {
  background: var(--qc-gold-dim) !important;
  border-top: none !important;
  border-bottom: none !important;
  border-right: none !important;
  border-left: none !important;
  color: var(--qc-gold-bright) !important;
  font-weight: 600;
}

.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a {
  background: rgba(192, 170, 129, 0.08) !important;
}

.wy-nav-top a {
  color: var(--qc-light);
}

.wy-nav-top i {
  color: var(--qc-gold);
}

/* Content typography */
.rst-content {
  font-size: 16px;
  line-height: 1.65;
}

.rst-content h1,
.rst-content h2,
.rst-content h3,
.rst-content h4 {
  color: var(--qc-dark);
  font-weight: 700;
}

.rst-content h1 {
  font-size: 1.85rem;
  margin-bottom: 0.75em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--qc-border);
}

.rst-content h2 {
  font-size: 1.4rem;
  margin-top: 1.75em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--qc-border);
}

.rst-content h3 {
  font-size: 1.15rem;
  color: var(--qc-green);
  margin-top: 1.4em;
}

.rst-content p,
.rst-content li {
  color: var(--qc-text);
}

.rst-content a:not(.btn):not(.headerlink),
.rst-content a:not(.btn):not(.headerlink):visited {
  color: #8a7349;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: rgba(138, 115, 73, 0.45);
}

.rst-content a:not(.btn):not(.headerlink):hover {
  color: #6b5a3a;
  text-decoration-color: #6b5a3a;
}

.rst-content .toctree-wrapper .caption,
.rst-content .caption-text {
  color: var(--qc-green);
  font-size: 1.05rem;
  font-weight: 700;
}

/* Code */
.rst-content code,
.rst-content tt {
  background: var(--qc-mid);
  border: 1px solid var(--qc-border);
  border-radius: 2px;
  color: var(--qc-dark);
  font-size: 0.875em;
  padding: 0.1em 0.35em;
}

.rst-content div[class^="highlight"],
.rst-content pre.literal-block {
  border: 1px solid var(--qc-border);
  border-radius: 2px;
  background: #f3efe6 !important;
  box-shadow: none;
}

.rst-content div[class^="highlight"] pre,
.rst-content pre.literal-block {
  background: transparent !important;
  color: var(--qc-dark);
  font-size: 0.875rem;
  line-height: 1.55;
}

.rst-content .copybtn {
  top: 0.4rem;
  right: 0.4rem;
  opacity: 0.5;
  color: var(--qc-green);
}

.rst-content .copybtn:hover {
  opacity: 1;
}

/* Tables */
.rst-content table.docutils {
  border: 1px solid var(--qc-border);
  box-shadow: none;
  width: 100%;
  table-layout: auto;
  margin: 1.25em 0;
}

.rst-content table.docutils thead th,
.rst-content table.docutils thead th p {
  background: var(--qc-green);
  color: var(--qc-light) !important;
  font-weight: 600;
  border: none;
  white-space: normal;
}

.rst-content table.docutils td,
.rst-content table.docutils th {
  border-color: var(--qc-border);
  padding: 0.65em 1em;
  vertical-align: top;
  word-break: break-word;
}

.rst-content table.docutils tr:nth-child(even) td {
  background: rgba(234, 227, 215, 0.45);
}

/* Admonitions */
.rst-content .admonition,
.rst-content .note,
.rst-content .tip,
.rst-content .warning,
.rst-content .important {
  border-radius: 2px;
  border: 1px solid var(--qc-border);
  background: #fffdf9;
  box-shadow: none;
}

.rst-content .admonition-title,
.rst-content .note .admonition-title,
.rst-content .tip .admonition-title {
  background: var(--qc-green) !important;
}

.rst-content .warning .admonition-title,
.rst-content .important .admonition-title {
  background: #6b5a3a !important;
}

/* Buttons */
.btn-neutral,
.rst-footer-buttons a.btn {
  background: var(--qc-green) !important;
  color: var(--qc-light) !important;
  border-radius: 2px;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  font-weight: 600;
}

.btn-neutral:hover,
.rst-footer-buttons a.btn:hover {
  background: #2a3f34 !important;
  color: var(--qc-gold-bright) !important;
}

/* Breadcrumbs */
.wy-breadcrumbs {
  font-size: 0.85rem;
  color: var(--qc-muted);
}

.wy-breadcrumbs a {
  color: var(--qc-green);
}

.wy-breadcrumbs li.wy-breadcrumbs-aside a {
  color: var(--qc-gold);
}

/* Footer */
footer,
.rst-content footer {
  color: var(--qc-muted);
  border-top: 1px solid var(--qc-border);
  margin-top: 2rem;
  padding-top: 0.85rem;
}

.sb-footer-meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--qc-muted);
}

/* Autodoc signatures */
.rst-content dl.py.class > dt,
.rst-content dl.py.function > dt,
.rst-content dl.py.method > dt {
  background: var(--qc-mid);
  border-left: 3px solid var(--qc-gold);
  border-top: none;
  color: var(--qc-dark);
}

/* Figures */
.rst-content img {
  border: 1px solid var(--qc-border);
  background: #fff;
  padding: 0.25rem;
}

.rst-content img[src*="qian-capital"],
.wy-side-nav-search img.logo,
.sb-sidebar-brand img {
  border: none;
  background: transparent;
  padding: 0;
}

/* Qian Capital logo pinned to bottom of sidebar */
.wy-nav-side {
  position: fixed;
}

.sb-sidebar-brand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem 1.15rem;
  background: linear-gradient(180deg, rgba(31, 39, 27, 0) 0%, var(--qc-dark) 28%);
  border-top: 1px solid rgba(192, 170, 129, 0.18);
}

.sb-sidebar-brand[hidden] {
  display: none;
}

.sb-sidebar-brand a {
  display: block;
  line-height: 0;
  opacity: 0.95;
}

.sb-sidebar-brand a:hover {
  opacity: 1;
}

.sb-sidebar-brand img {
  display: block;
  width: 240px;
  max-width: 92%;
  height: auto;
}

.wy-side-scroll {
  padding-bottom: 8.5rem;
}

@media (max-width: 768px) {
  .wy-nav-content {
    max-width: 100%;
  }
}
