/* Pico overlay: docs chrome only. */
:root {
  --handbook-navy: #1b3a4b;
  --handbook-aside: 17.5rem;
  --handbook-header: 3.6rem;
}

html {
  scroll-padding-top: calc(var(--handbook-header) + 0.75rem);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 100;
  padding: 0.4rem 0.75rem;
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
}
.skip-link:focus {
  top: 0.5rem;
}

.handbook-header {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0;
  padding: 0 1rem;
  height: var(--handbook-header);
  border-bottom: 1px solid var(--pico-muted-border-color);
  background: var(--pico-background-color);
}
.handbook-header nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: 100%;
  margin: 0;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand img {
  width: 1.7rem;
  height: 1.7rem;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text strong {
  font-size: 0.95rem;
}
.brand-text span {
  font-size: 0.72rem;
  color: var(--pico-muted-color);
}
.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-left: auto;
  font-size: 0.875rem;
}
.header-links a {
  text-decoration: none;
}
.nav-toggle {
  display: none;
  width: auto;
  margin: 0;
  padding: 0.3rem 0.65rem;
}

.docs {
  display: grid;
  grid-template-columns: var(--handbook-aside) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  flex: 1 1 auto;
  min-height: 0;
}
.docs > aside {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: sticky;
  top: var(--handbook-header);
  align-self: start;
  max-height: calc(100vh - var(--handbook-header));
  overflow: auto;
  margin: 0;
  padding: 1rem 0.85rem 2rem;
  border-right: 1px solid var(--pico-muted-border-color);
  background: var(--pico-card-background-color);
}
.docs > aside details {
  display: block;
  width: 100%;
  margin: 0 0 0.3rem;
  border: 0;
  padding: 0;
}
.docs > aside summary {
  display: block;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pico-muted-color);
  cursor: pointer;
}
.docs > aside ul {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin: 0.2rem 0 0.45rem;
  padding: 0;
  list-style: none;
}
.docs > aside li {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}
.docs > aside a {
  display: block;
  width: 100%;
  padding: 0.28rem 0.4rem;
  border-radius: 0.3rem;
  text-decoration: none;
  color: var(--pico-color);
  font-size: 0.9rem;
  white-space: normal;
}
.docs > aside a[aria-current="page"] {
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
}
.docs > aside .search {
  margin: 0 0 0.85rem;
  position: relative;
}
.docs > aside .search label {
  font-size: 0.8rem;
}
.docs > aside .search input {
  margin: 0;
}

.article {
  margin: 0;
  padding: 1.35rem 1.5rem 2.5rem;
  max-width: 50rem;
}
.article > header {
  margin: 0 0 1rem;
  padding: 0;
  height: auto;
  background: none;
  border: 0;
  display: block;
}
.crumbs {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  margin: 0 0 0.4rem;
}
.crumbs a {
  text-decoration: none;
}
.ui-where {
  border-left: 3px solid var(--handbook-navy);
  padding: 0.4rem 0.75rem;
  margin: 0 0 1rem;
  background: var(--pico-card-background-color);
}
.page-footer-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
  font-size: 0.9rem;
}
.page-footer-nav a {
  text-decoration: none;
}

.handbook-footer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0.55rem 1rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--pico-muted-color);
  border-top: 1px solid var(--pico-muted-border-color);
  background: var(--pico-background-color);
}
.handbook-footer .copyright {
  margin: 0;
  font-size: inherit;
  color: inherit;
}
.handbook-footer a {
  color: inherit;
  text-decoration: none;
}
.handbook-footer a:hover {
  text-decoration: underline;
}

.search-results {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  max-height: 18rem;
  overflow: auto;
  background: var(--pico-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.35rem;
  padding: 0.3rem;
}
.search-results[hidden] {
  display: none;
}
.search-results a {
  display: block;
  padding: 0.4rem 0.5rem;
  text-decoration: none;
  color: inherit;
}
.search-results a:hover,
.search-results a:focus,
.search-results a[aria-selected="true"] {
  background: var(--pico-primary-focus);
}

.sidenav-product-links {
  display: none;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}
.sidenav-product-links a {
  display: inline;
  padding: 0;
}

.flow-svg {
  width: 100%;
  height: auto;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.4rem;
  background: var(--pico-card-background-color);
}

.lede {
  font-size: 1.05rem;
  color: var(--pico-muted-color);
}

.overflow-auto {
  overflow: auto;
}

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
  }
  .header-links {
    display: none;
  }
  .sidenav-product-links {
    display: flex;
  }
  .docs {
    grid-template-columns: 1fr;
  }
  .docs > aside {
    position: fixed;
    top: var(--handbook-header);
    right: 0;
    bottom: 0;
    height: auto;
    width: min(20rem, 92vw);
    transform: translateX(110%);
    transition: transform 0.18s ease;
    z-index: 30;
    border-left: 1px solid var(--pico-muted-border-color);
    border-right: 0;
  }
  body.nav-open .docs > aside {
    transform: none;
  }
}
