/* Additional custom styles for Armory Bot documentation */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar - light mode */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--salamander-green);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--forge-orange);
}

/* Custom scrollbar - dark mode */
[data-md-color-scheme="slate"] ::-webkit-scrollbar-track {
  background: var(--forge-gray);
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb {
  background: var(--forge-orange);
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb:hover {
  background: var(--auric-gold);
}

/* Content fade-in */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.md-content {
  animation: fadeIn 0.3s ease-out;
}

/* TOC active link highlight */
.md-nav__link--active {
  transition: color 0.2s ease;
}

/* Sticky TOC on wide screens */
@media screen and (min-width: 60em) {
  .md-sidebar--secondary {
    position: sticky;
    top: 3.6rem;
  }
}

/* Better focus visibility for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--salamander-green);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Make the theme toggle a slider-style switch */
.md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"][hidden] {
  display: none !important;
}

.md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"]:not([hidden]) {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  min-width: 3.4rem;
  height: 1.9rem;
  border-radius: 999px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"]:not([hidden]) svg {
  display: none;
}

.md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"]:not([hidden])::before {
  content: "";
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #f6f7f8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.md-header__option[data-md-component="palette"] .md-header__button[for="__palette_0"]:not([hidden])::before {
  transform: translateX(1.58rem);
}

.md-header__option[data-md-component="palette"] .md-header__button[for="__palette_1"]:not([hidden])::before {
  transform: translateX(0);
}

.md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"]:not([hidden]):hover {
  border-color: rgba(255, 255, 255, 0.58);
}

.md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"]:not([hidden]):focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

[data-md-color-scheme="slate"] .md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"]:not([hidden]) {
  border-color: rgba(224, 90, 43, 0.65);
  background: rgba(224, 90, 43, 0.2);
}

[data-md-color-scheme="mechanicum"] .md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"]:not([hidden]) {
  border-color: rgba(205, 127, 50, 0.7);
  background: rgba(205, 127, 50, 0.22);
}

@media screen and (max-width: 760px) {
  .md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"]:not([hidden]) {
    width: 3rem;
    min-width: 3rem;
    height: 1.7rem;
  }

  .md-header__option[data-md-component="palette"] .md-header__button[for^="__palette"]:not([hidden])::before {
    width: 1.32rem;
    height: 1.32rem;
  }

  .md-header__option[data-md-component="palette"] .md-header__button[for="__palette_0"]:not([hidden])::before {
    transform: translateX(1.34rem);
  }
}

/* Small-window and tiled layout safeguards */
@media screen and (max-width: 1100px) {
  .md-main__inner {
    margin-top: 0.6rem;
  }

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

  .md-typeset {
    font-size: 0.84rem;
  }

  .md-typeset h1 {
    font-size: 1.6rem;
  }

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

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

  .md-typeset table:not([class]) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .md-typeset .tabbed-set {
    overflow-x: auto;
  }

  .md-typeset .tabbed-labels {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media screen and (max-width: 760px) {
  .md-content__inner {
    padding: 0 0.45rem 0.8rem;
  }

  .md-typeset {
    font-size: 0.8rem;
  }

  .md-typeset h1 {
    font-size: 1.35rem;
  }

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

  .hero-section {
    margin: 1rem 0;
    padding: 1.2rem 0.85rem;
  }
}

/* ── Subscribe CTA ─────────────────────────────────────────────────────── */
.subscribe-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--md-code-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.5rem;
  flex-wrap: wrap;
}

.subscribe-cta-text {
  font-size: 0.9rem;
  color: var(--md-default-fg-color--light);
}
