/* Site-wide tweaks. Loaded on every page (see zensical.toml extra_css).
 * Page-specific landing styles live in landing.css. */

/* Keep the landing header quiet while leaving full docs search intact.
 *
 * Material's instant navigation does not re-render the header partial
 * or re-run inline scripts when swapping pages, so we cannot rely on
 * either to toggle a state class. Detect the landing page directly
 * from the swapped-in content, which Material does replace per page. */
body:has(.md-content--landing) .md-header label[for="__search"],
body:has(.md-content--landing) .md-header [data-md-component="search"],
body:has(.md-content--landing) .md-header .md-search {
  display: none;
}

/* Mirror image: when navigating away from the landing page via instant
 * navigation, the landing-only "Docs" link in the header DOM is not
 * replaced. Hide it whenever the swapped-in content is no longer the
 * landing page. */
body:not(:has(.md-content--landing)) .md-header .st-header-docs {
  display: none;
}

/* Keep the header title solid without forcing Material's alternate
 * page-title layer to sit on top of the site title. */
.md-header__title {
  opacity: 1 !important;
  transform: none !important;
}

.md-header__ellipsis,
.md-header__topic,
.md-header__title .md-ellipsis,
.md-header__topic .md-ellipsis {
  opacity: 1 !important;
  transform: none !important;
}

.md-header__title .md-ellipsis,
.md-header__topic .md-ellipsis {
  font-weight: 600;
}

.st-header-title-link,
.st-header-title-link:visited {
  color: inherit;
  text-decoration: none;
}

.st-header-docs,
.st-header-docs:visited {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  margin: 0 0.55rem 0 0.35rem;
  padding: 0 0.58rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  color: var(--md-default-fg-color);
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
}

.st-header-docs:hover {
  color: var(--md-accent-fg-color);
  border-color: currentColor;
}

.st-site-footer {
  background: var(--md-default-bg-color);
  border-top: 1px solid var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color--light);
}

.st-site-footer__inner {
  min-height: 3.8rem;
  padding: 0.85rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
}

.st-site-footer__brand,
.st-site-footer__brand:visited {
  min-width: 0;
  color: var(--md-default-fg-color);
  text-decoration: none;
}

.st-site-footer__name {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

.st-site-footer__tagline {
  display: block;
  margin-top: 0.12rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.6rem;
  line-height: 1.35;
}

.st-site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.st-site-footer__nav a,
.st-site-footer__nav a:visited,
.st-site-footer__credit a,
.st-site-footer__credit a:visited {
  color: var(--md-default-fg-color);
  text-decoration: none;
}

.st-site-footer__nav a {
  font-size: 0.62rem;
  font-weight: 700;
}

.st-site-footer__nav a:hover,
.st-site-footer__credit a:hover {
  color: var(--md-accent-fg-color);
}

.st-site-footer__credit {
  color: var(--md-default-fg-color--light);
  font-size: 0.58rem;
  white-space: nowrap;
}

@media screen and (max-width: 44.984375em) {
  .st-site-footer__inner {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    text-align: center;
  }
}
