/* ===== GitHub-style light theme ===== */

:root {
  /* GitHub color tokens */
  --gh-fg: #1f2328;
  --gh-fg-muted: #656d76;
  --gh-fg-accent: #0969da;
  --gh-bg: #ffffff;
  --gh-bg-subtle: #f6f8fa;
  --gh-border: #d0d7de;
  --gh-border-muted: #d8dee4;
  --gh-danger: #cf222e;
  --gh-success: #1a7f37;
  --gh-attention: #9a6700;

  /* Override Material theme colors */
  --md-primary-fg-color: #ffffff;
  --md-primary-fg-color--light: #f6f8fa;
  --md-primary-fg-color--dark: #1f2328;
  --md-primary-bg-color: #1f2328;
  --md-accent-fg-color: #0969da;
  --md-default-fg-color: #1f2328;
  --md-default-fg-color--light: #656d76;
  --md-default-fg-color--lighter: #848d97;
  --md-default-bg-color: #ffffff;
  --md-default-bg-color--light: #f6f8fa;
  --md-code-bg-color: #f6f8fa;
  --md-code-fg-color: #1f2328;
  --md-typeset-color: #1f2328;
  --md-typeset-a-color: #0969da;
}

/* ===== Hide logo/brand icon ===== */
.md-header__button.md-logo {
  display: none;
}

/* ===== Header — white with subtle bottom border ===== */
.md-header {
  background-color: #f6f8fa;
  border-bottom: 1px solid var(--gh-border);
  box-shadow: none;
  color: var(--gh-fg);
}

.md-header__topic,
.md-header__title {
  color: var(--gh-fg);
}

.md-header .md-icon,
.md-header [data-md-component="logo"] {
  color: var(--gh-fg);
}

.md-search__input {
  background-color: var(--gh-bg);
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  color: var(--gh-fg);
}

.md-search__input::placeholder {
  color: var(--gh-fg-muted);
}

/* ===== Sidebar — clean GitHub nav ===== */
.md-sidebar {
  border-right: none;
}

.md-sidebar--primary,
.md-sidebar--secondary {
  border: none;
}

.md-nav__link {
  color: var(--gh-fg);
  font-size: 0.85rem;
}

.md-nav__link:hover {
  color: var(--gh-fg-accent);
}

.md-nav__link--active,
.md-nav__item--active > .md-nav__link {
  color: var(--gh-fg-accent);
  font-weight: 600;
}

.md-nav__item--nested > .md-nav__link {
  font-weight: 600;
  color: var(--gh-fg);
}

/* ===== Reduce top gap on main content ===== */
.md-main__inner {
  margin-top: 0;
}

/* ===== Content — GitHub README typesetting ===== */
.md-grid {
  max-width: 2024px;
}

.md-typeset {
  font-size: 16px;
  line-height: 1.5;
  color: var(--gh-fg);
}

/* Headings — GitHub style */
.md-typeset h1 {
  font-size: 2em;
  font-weight: 600;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--gh-border-muted);
  margin-bottom: 16px;
  color: var(--gh-fg);
}

.md-typeset h2 {
  font-size: 1.5em;
  font-weight: 600;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--gh-border-muted);
  margin-top: 24px;
  margin-bottom: 16px;
  color: var(--gh-fg);
}

.md-typeset h3 {
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 16px;
  color: var(--gh-fg);
}

.md-typeset h4 {
  font-size: 1em;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 16px;
  color: var(--gh-fg);
}

/* Paragraphs */
.md-typeset p {
  margin-top: 0;
  margin-bottom: 16px;
}

/* Links — GitHub blue */
.md-typeset a {
  color: var(--gh-fg-accent);
  text-decoration: none;
}

.md-typeset a:hover {
  text-decoration: underline;
}

/* Inline code — GitHub gray pill */
.md-typeset code {
  background-color: rgba(175, 184, 193, 0.2);
  border-radius: 6px;
  font-size: 85%;
  padding: 0.2em 0.4em;
  color: var(--gh-fg);
  font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
}

/* Code blocks — GitHub style */
.md-typeset pre {
  background-color: var(--gh-bg-subtle);
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  margin-bottom: 16px;
}

.md-typeset pre > code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
  line-height: 1.45;
}

.highlight code {
  font-size: inherit;
}

/* Tables — GitHub style with borders */
.md-typeset table:not([class]) {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin-bottom: 16px;
  margin-left: 0;
  margin-right: 0;
}

/* Kill wrapper border/margin that shifts table left */
.md-typeset__table {
  border: none !important;
  padding: 0;
  margin: 0 !important;
  box-shadow: none;
  display: block;
  width: 100%;
}

.md-typeset__scrollwrap {
  margin: 0 !important;
}

.md-typeset table:not([class]) th {
  font-weight: 600;
  background-color: var(--gh-bg-subtle);
  border: 1px solid var(--gh-border-muted);
  padding: 6px 13px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--gh-fg);
  min-width: 0;
}

.md-typeset table:not([class]) td {
  border: 1px solid var(--gh-border-muted);
  padding: 6px 13px;
}

.md-typeset table:not([class]) tr {
  background-color: var(--gh-bg);
  border: none;
}

.md-typeset table:not([class]) tr:nth-child(2n) {
  background-color: var(--gh-bg-subtle);
}

/* Prevent any outer border on the table element itself */
.md-typeset table:not([class]),
.md-typeset table {
  border: none !important;
  outline: none;
}

/* Blockquotes — GitHub left border */
.md-typeset blockquote {
  border-left: 0.25em solid var(--gh-border);
  color: var(--gh-fg-muted);
  padding: 0 1em;
  margin: 0 0 16px;
}

/* Horizontal rules */
.md-typeset hr {
  border: none;
  border-bottom: 1px solid var(--gh-border-muted);
  margin: 24px 0;
}

/* Lists — GitHub spacing */
.md-typeset ul,
.md-typeset ol {
  margin-bottom: 16px;
  padding-left: 2em;
}

.md-typeset li {
  margin-top: 0.25em;
}

.md-typeset li + li {
  margin-top: 0.25em;
}

/* ===== Admonitions — GitHub alert style ===== */
.md-typeset .admonition,
.md-typeset details {
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  border-left: 4px solid;
  box-shadow: none;
  margin-bottom: 16px;
  font-size: 0.9rem;
  background: var(--gh-bg);
}

.md-typeset .admonition-title,
.md-typeset summary {
  background-color: var(--gh-bg-subtle);
  border-bottom: 1px solid var(--gh-border);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Info / Note — blue */
.md-typeset .admonition.note,
.md-typeset .admonition.info {
  border-left-color: var(--gh-fg-accent);
}

.md-typeset .admonition.note .admonition-title,
.md-typeset .admonition.info .admonition-title {
  color: var(--gh-fg-accent);
}

/* Warning / Attention — yellow */
.md-typeset .admonition.warning,
.md-typeset .admonition.attention,
.md-typeset .admonition.important {
  border-left-color: var(--gh-attention);
}

.md-typeset .admonition.warning .admonition-title,
.md-typeset .admonition.attention .admonition-title,
.md-typeset .admonition.important .admonition-title {
  color: var(--gh-attention);
}

/* Danger — red */
.md-typeset .admonition.danger {
  border-left-color: var(--gh-danger);
}

.md-typeset .admonition.danger .admonition-title {
  color: var(--gh-danger);
}

/* Success / Tip — green */
.md-typeset .admonition.tip,
.md-typeset .admonition.success {
  border-left-color: var(--gh-success);
}

.md-typeset .admonition.tip .admonition-title,
.md-typeset .admonition.success .admonition-title {
  color: var(--gh-success);
}

/* Example — purple */
.md-typeset .admonition.example {
  border-left-color: #8250df;
}

.md-typeset .admonition.example .admonition-title {
  color: #8250df;
}

/* ===== Footer ===== */
.md-footer {
  background-color: var(--gh-bg-subtle);
  border-top: 1px solid var(--gh-border);
  color: var(--gh-fg-muted);
}

.md-footer-meta {
  background-color: var(--gh-bg-subtle);
}

/* ===== Table of Contents ===== */
.md-sidebar--secondary .md-nav__link {
  font-size: 0.8rem;
  color: var(--gh-fg-muted);
}

.md-sidebar--secondary .md-nav__link:hover,
.md-sidebar--secondary .md-nav__link--active {
  color: var(--gh-fg-accent);
}

/* Hide scrollbars on both sidebars */
.md-sidebar__scrollwrap,
.md-sidebar__inner {
  scrollbar-width: none;           /* Firefox */
  -ms-overflow-style: none;        /* IE/Edge */
}

.md-sidebar__scrollwrap::-webkit-scrollbar,
.md-sidebar__inner::-webkit-scrollbar {
  display: none;                   /* Chrome/Safari */
}

/* Remove the grey scroll indicator line from TOC */
.md-sidebar__inner {
  border-left: none;
}

/* Hide the scroll/progress indicator on the TOC sidebar */
.md-sidebar--secondary .md-nav {
  border-left: none;
}

.md-sidebar--secondary {
  border-left: none;
}

/* Remove the right sidebar border too */
.md-sidebar--secondary .md-sidebar__scrollwrap {
  border-left: none;
}

/* ===== Tabs ===== */
.md-typeset .tabbed-labels > label {
  color: var(--gh-fg-muted);
  border-bottom: 2px solid transparent;
  font-size: 0.85rem;
}

.md-typeset .tabbed-labels > label:hover {
  color: var(--gh-fg);
}

.md-typeset .tabbed-labels > .tabbed-input:checked + label {
  color: var(--gh-fg-accent);
  border-bottom-color: var(--gh-fg-accent);
}

/* ===== Search ===== */
.md-search-result__meta {
  color: var(--gh-fg-muted);
}

.md-search-result .md-typeset mark {
  background-color: #fff8c5;
  color: var(--gh-fg);
}

/* ===== Permalink anchors ===== */
.md-typeset .headerlink {
  color: var(--gh-fg-muted);
  opacity: 0;
}

.md-typeset h1:hover .headerlink,
.md-typeset h2:hover .headerlink,
.md-typeset h3:hover .headerlink,
.md-typeset h4:hover .headerlink {
  opacity: 1;
}

/* ===== Strong text ===== */
.md-typeset strong {
  font-weight: 600;
}

/* ===== Back to top button ===== */
.md-top {
  background-color: var(--gh-fg-accent);
  color: white;
}
