/* ─── Light mode palette ─── */
:root,
[data-md-color-scheme="default"] {
  --md-default-bg-color: #f5f5f5;
  --md-default-fg-color: #111111;
  --md-default-fg-color--light: #444444;
  --md-default-fg-color--lighter: #888888;
  --md-primary-fg-color: #ffffff;
  --md-primary-bg-color: #000000;
  --md-accent-fg-color: #000000;
}

/* ─── Dark mode palette ─── */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #0a0a0a;
  --md-default-fg-color: #e8e8e8;
  --md-default-fg-color--light: #b0b0b0;
  --md-default-fg-color--lighter: #6e6e6e;
  --md-primary-fg-color: #0a0a0a;
  --md-primary-bg-color: #e8e8e8;
  --md-accent-fg-color: #ffffff;
}

[data-md-color-scheme="slate"] .md-header {
  background-color: #000000;
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #e8e8e8;
}

[data-md-color-scheme="slate"] .md-header__title,
[data-md-color-scheme="slate"] .md-header__title .md-ellipsis {
  color: #e8e8e8;
}

[data-md-color-scheme="slate"] .md-nav {
  background-color: #0a0a0a;
}

[data-md-color-scheme="slate"] .md-nav__link { color: #b0b0b0; }
[data-md-color-scheme="slate"] .md-nav__link:hover,
[data-md-color-scheme="slate"] .md-nav__link--active { color: #ffffff; }

[data-md-color-scheme="slate"] .md-main,
[data-md-color-scheme="slate"] .md-content { background-color: #0a0a0a; }

[data-md-color-scheme="slate"] .highlight pre,
[data-md-color-scheme="slate"] code,
[data-md-color-scheme="slate"] .md-typeset code { background-color: #111111 !important; color: #e8e8e8; border-color: rgba(255,255,255,0.08); }
[data-md-color-scheme="slate"] .md-typeset pre > code,
[data-md-color-scheme="slate"] .highlight { background-color: #111111 !important; }

[data-md-color-scheme="slate"] .md-typeset .md-post { border-bottom-color: rgba(255,255,255,0.1); }
[data-md-color-scheme="slate"] .md-typeset .md-post__title a { color: #e8e8e8; }
[data-md-color-scheme="slate"] .md-typeset .md-post__title a:hover { color: #ffffff; }

[data-md-color-scheme="slate"] .md-typeset .md-tag { background-color: rgba(255,255,255,0.08); color: #b0b0b0; border-color: rgba(255,255,255,0.12); }
[data-md-color-scheme="slate"] .md-typeset .md-tag:hover { background-color: rgba(255,255,255,0.14); color: #ffffff; }

[data-md-color-scheme="slate"] .md-footer,
[data-md-color-scheme="slate"] .md-footer-meta { background-color: #000000; border-top-color: rgba(255,255,255,0.1); }
[data-md-color-scheme="slate"] .md-social__link svg { fill: #6e6e6e; }
[data-md-color-scheme="slate"] .md-social__link:hover svg { fill: #ffffff; }

[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3,
[data-md-color-scheme="slate"] .md-typeset h4 { color: #ffffff; }
[data-md-color-scheme="slate"] .md-typeset h1 { border-bottom-color: rgba(255,255,255,0.1); }

[data-md-color-scheme="slate"] .md-typeset a { color: #c8c8c8; text-decoration-color: rgba(255,255,255,0.25); }
[data-md-color-scheme="slate"] .md-typeset a:hover { color: #ffffff; text-decoration-color: rgba(255,255,255,0.6); }

[data-md-color-scheme="slate"] .md-typeset hr { border-color: rgba(255,255,255,0.1); }

[data-md-color-scheme="slate"] .md-search__input { background-color: rgba(255,255,255,0.06); color: #e8e8e8; }
[data-md-color-scheme="slate"] .md-search__input::placeholder { color: #6e6e6e; }

[data-md-color-scheme="slate"] ::-webkit-scrollbar-track { background: #0a0a0a; }
[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* ─── Header ─── */
.md-header {
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: none;
  color: #111111;
}

.md-header__title {
  font-family: "Roboto Mono", monospace;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111111;
}

.md-header__title .md-ellipsis {
  color: #111111;
}

/* ─── Navigation / sidebar ─── */
.md-nav {
  background-color: #f5f5f5;
}

.md-nav__link {
  color: #444444;
}

.md-nav__link:hover,
.md-nav__link--active {
  color: #000000;
}

/* ─── Main content area ─── */
.md-main {
  background-color: #f5f5f5;
}

.md-content {
  background-color: #f5f5f5;
}

/* ─── Code blocks ─── */
.highlight pre,
code,
.md-typeset code {
  background-color: #ececec !important;
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.md-typeset pre > code {
  background-color: #ececec !important;
}

.highlight {
  background-color: #ececec !important;
}

/* ─── Blog post listing cards ─── */
.md-typeset .md-post {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.md-typeset .md-post:last-child {
  border-bottom: none;
}

.md-typeset .md-post__header {
  margin-bottom: 0.5rem;
}

.md-typeset .md-post__title a {
  color: #111111;
  text-decoration: none;
}

.md-typeset .md-post__title a:hover {
  color: #000000;
  text-decoration: underline;
}

/* ─── Tags ─── */
.md-typeset .md-tag {
  background-color: rgba(0, 0, 0, 0.06);
  color: #444444;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.md-typeset .md-tag:hover {
  background-color: rgba(0, 0, 0, 0.12);
  color: #000000;
}

/* ─── Footer ─── */
.md-footer {
  background-color: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: #444444;
}

.md-footer-meta {
  background-color: #ffffff;
}

.md-social__link svg {
  fill: #888888;
  transition: fill 0.15s ease;
}

.md-social__link:hover svg {
  fill: #000000;
}

/* ─── Headings ─── */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family: "Roboto Mono", monospace;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.01em;
}

.md-typeset h1 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 0.4rem;
}

/* ─── Links ─── */
.md-typeset a {
  color: #222222;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.3);
}

.md-typeset a:hover {
  color: #000000;
  text-decoration-color: rgba(0, 0, 0, 0.7);
}

/* ─── Horizontal rules ─── */
.md-typeset hr {
  border-color: rgba(0, 0, 0, 0.1);
}

/* ─── Search ─── */
.md-search__input {
  background-color: rgba(0, 0, 0, 0.05);
  color: #111111;
}

.md-search__input::placeholder {
  color: #888888;
}

/* ─── Scrollbar (webkit) ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* ─── Mobile: max-width 600px ─── */
@media (max-width: 600px) {
  .md-header__title {
    font-size: 0.75rem;
  }

  .md-typeset h1 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .md-typeset h2 {
    font-size: 1.15rem;
  }

  .md-typeset h3 {
    font-size: 1rem;
  }

  .md-content__inner {
    padding: 0 0.8rem 1.5rem;
  }

  .md-typeset pre {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .md-typeset table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .md-typeset .md-post {
    padding-bottom: 1.2rem;
    margin-bottom: 1.2rem;
  }

  .md-footer {
    padding-bottom: 1rem;
  }

  .md-content *,
  .md-typeset * {
    max-width: 100%;
    word-break: break-word;
  }
}
