@import "./theme.css";

/* Site navigation is independent of formula themes and host editor SDK styles. */
.math-site-header {
  display: block;
  height: auto;
  min-height: 80px;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #dce0e5;
  background: #fafaf8;
  color: #20242b;
  color-scheme: light;
  font: 14px/1.5 system-ui, sans-serif;
  position: relative;
  z-index: 50;
}
.math-site-header .math-site-header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  box-sizing: border-box;
  max-width: 1264px;
  min-height: 80px;
  margin: 0 auto;
  padding: 16px 48px;
}
.math-site-header a {
  color: inherit;
  text-decoration: none;
  letter-spacing: 0;
}
.math-site-header .math-site-brand {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -1px;
  white-space: nowrap;
}
.math-site-header .math-site-brand span {
  color: #606975;
  font-weight: 400;
}
.math-site-header .math-site-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
}
.math-site-links > a,
.math-site-samples > summary {
  font: 500 13px/1.5 system-ui, sans-serif;
  white-space: nowrap;
}
.math-site-header a:hover,
.math-site-samples > summary:hover {
  color: #315efb;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.math-site-header [aria-current],
.math-site-samples > summary[data-active] {
  color: #315efb;
  font-weight: 650;
}
.math-site-header :is(a, select, summary):focus-visible {
  outline: 2px solid #315efb;
  outline-offset: 4px;
}
/* Keep the native select's keyboard behavior while matching the site controls.
   Explicit metrics avoid page resets and OS appearance changing its closed box. */
.math-site-header .math-site-language {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  color: #606975;
  margin: 0;
  font: 13px/20px system-ui, sans-serif;
  white-space: nowrap;
}
.math-site-header .math-site-language::after {
  content: "";
  position: absolute;
  right: 13px;
  top: calc(50% - 4px);
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}
.math-site-header [data-site-locale] {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 104px;
  height: 36px;
  margin: 0;
  padding: 7px 32px 7px 12px;
  border: 1px solid #dce0e5;
  border-radius: 6px;
  background: #fff;
  color: #20242b;
  font: 500 13px/20px system-ui, sans-serif;
  letter-spacing: normal;
  text-align: left;
  cursor: pointer;
}
.math-site-header [data-site-locale]:hover {
  border-color: #aeb8c6;
  background: #f3f5fb;
}
.math-site-header [data-site-locale]:focus-visible {
  border-color: #315efb;
  outline: 2px solid #315efb;
  outline-offset: 2px;
}
.math-site-header .math-site-samples {
  position: relative;
  padding: 0;
  margin: 0;
  border: 0;
  color: inherit;
  font: inherit;
}
.math-site-samples > summary {
  cursor: pointer;
  list-style: none;
  padding: 0;
  margin: 0;
}
.math-site-samples > summary::-webkit-details-marker {
  display: none;
}
.math-site-samples > summary::after {
  content: "⌄";
  margin-left: 5px;
}
.math-site-samples > div {
  position: absolute;
  top: calc(100% + 12px);
  left: -12px;
  min-width: 185px;
  padding: 6px;
  background: white;
  border: 1px solid #dce0e5;
  border-radius: 8px;
  box-shadow: 0 8px 24px #20242b14;
}
.math-site-samples a {
  display: block;
  padding: 8px 10px;
  font-size: 13px;
  white-space: nowrap;
  border-radius: 4px;
}
.math-site-samples a:hover {
  background: #edf1ff;
}
@media (max-width: 1050px) {
  .math-site-header .math-site-header-inner {
    flex-wrap: wrap;
    gap: 14px 24px;
    padding: 16px 24px;
  }
  .math-site-header .math-site-language {
    margin-left: auto;
  }
  .math-site-header .math-site-links {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 14px 24px;
  }
}
@media (max-width: 480px) {
  .math-site-header .math-site-header-inner {
    padding-inline: 20px;
    gap: 16px;
  }
  .math-site-header .math-site-links {
    gap: 12px 18px;
  }
  .math-site-language > span {
    display: none;
  }
  .math-site-header .math-site-brand {
    font-size: 21px;
  }
}
