/* mevebu docs
   Reuses the site tokens from ../assets/css/site.css. Only what the docs
   layout adds lives here: the sidebar frame, the content column, and prose. */

.docs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- sidebar ---------- */

.docs-aside {
  display: none;
}

.docs-nav {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100dvh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-bottom: 32px;
  scrollbar-width: thin;
}

.docs-group + .docs-group {
  margin-top: 26px;
}

.docs-group > p {
  font-size: 0.72rem;
  font-weight: 660;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
  padding-left: 10px;
}

.docs-nav ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1px;
}

.docs-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.88rem;
  color: var(--ink-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 140ms var(--ease), background-color 140ms var(--ease),
    border-color 140ms var(--ease);
}

.docs-nav a:hover {
  color: var(--ink);
  background: var(--deck-2);
}

.docs-nav a[aria-current="page"] {
  color: var(--jade);
  background: var(--jade-tint);
  border-left-color: var(--jade);
  font-weight: 600;
}

/* ---------- content ---------- */

.docs-main {
  min-width: 0;
  padding-block: 32px 72px;
}

.docs-crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-bottom: 18px;
  list-style: none;
  padding: 0;
}

.docs-crumbs a {
  color: var(--ink-3);
  text-decoration: none;
}

.docs-crumbs a:hover {
  color: var(--ink);
}

.docs-crumbs li + li::before {
  content: "/";
  margin-right: 7px;
  color: var(--orbit-hard);
}

.docs-article {
  max-width: 74ch;
}

.docs-article h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.4rem);
  margin-bottom: 10px;
}

.docs-article h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.55rem);
  margin-top: 2.4em;
  margin-bottom: 0.6em;
  padding-top: 0.2em;
}

.docs-article h3 {
  font-size: 1.05rem;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
}

.docs-article p,
.docs-article li {
  color: var(--ink-2);
}

.docs-article p {
  margin-bottom: 1em;
}

.docs-article > p:first-of-type {
  color: var(--ink);
  font-size: 1.05rem;
}

.docs-article ul,
.docs-article ol {
  padding-left: 1.3em;
  margin-bottom: 1em;
  display: grid;
  gap: 0.45em;
}

.docs-article li::marker {
  color: var(--ink-3);
}

.docs-article a {
  color: var(--jade);
  text-decoration-color: color-mix(in srgb, var(--jade) 40%, transparent);
}

.docs-article a:hover {
  text-decoration-color: var(--jade);
}

.docs-article strong {
  color: var(--ink);
  font-weight: 640;
}

.docs-article hr {
  border: 0;
  border-top: 1px solid var(--orbit);
  margin: 2.4em 0;
}

.docs-article img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--orbit);
  box-shadow: var(--shadow-md);
  margin: 1.4em 0;
}

.docs-article blockquote {
  margin: 1.4em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--jade);
  background: var(--jade-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.docs-article blockquote p {
  margin: 0;
  color: var(--ink);
}

.docs-article code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--jade-tint);
  border: 1px solid var(--orbit);
  color: var(--ink);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.docs-article pre {
  margin: 1.2em 0;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--orbit);
  background: var(--code-bg);
  color: var(--code-ink);
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.7;
  scrollbar-width: thin;
}

.docs-article pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
}

.docs-article table {
  margin: 1.2em 0;
  display: block;
  overflow-x: auto;
  border: 1px solid var(--orbit);
  border-radius: var(--radius);
  background: var(--deck);
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.docs-article th,
.docs-article td {
  padding: 9px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--orbit);
}

.docs-article th {
  background: var(--deck-2);
  text-align: left;
  white-space: nowrap;
}

.docs-article tr:last-child td {
  border-bottom: 0;
}

/* page footer: previous and next */
.docs-pager {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--orbit);
}

.docs-pager a {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--orbit);
  border-radius: var(--radius);
  background: var(--deck);
  text-decoration: none;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease);
}

.docs-pager a:hover {
  border-color: var(--orbit-hard);
  transform: translateY(-1px);
}

.docs-pager small {
  font-size: 0.74rem;
  color: var(--ink-3);
}

.docs-pager span {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
}

.docs-pager .next {
  text-align: right;
}

/* mobile contents, a disclosure above the article */
.docs-mobile-nav {
  margin-bottom: 24px;
  border: 1px solid var(--orbit);
  border-radius: var(--radius);
  background: var(--deck);
}

.docs-mobile-nav summary {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
}

.docs-mobile-nav summary::-webkit-details-marker {
  display: none;
}

.docs-mobile-nav .docs-nav {
  position: static;
  max-height: none;
  padding: 0 12px 16px;
}

/* docs landing cards */
.docs-index-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin: 1.6em 0;
}

.docs-index-grid a {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--orbit);
  border-radius: var(--radius);
  background: var(--deck);
  text-decoration: none;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease);
}

.docs-index-grid a:hover {
  border-color: var(--orbit-hard);
  transform: translateY(-1px);
}

.docs-index-grid strong {
  font-size: 0.95rem;
}

.docs-index-grid span {
  font-size: 0.86rem;
  color: var(--ink-2);
}

/* loading and error states for the markdown fetch */
.docs-status {
  padding: 40px 0;
  color: var(--ink-3);
  font-size: 0.92rem;
}

@media (min-width: 560px) {
  .docs-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-pager {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .docs {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 48px;
  }

  .docs-aside {
    display: block;
    padding-top: 40px;
  }

  .docs-mobile-nav {
    display: none;
  }

  .docs-main {
    padding-block: 40px 96px;
  }
}

/* The article takes focus after a route change for screen readers, but it is
   not a control: no visible ring unless the user is navigating by keyboard. */
.docs-article:focus,
.docs-article:focus-visible {
  outline: none;
}
