/* The bar at the top and the band at the foot — the two things that are the
 * same on every page of the site, the documentation included. One file, loaded
 * by both halves, so the two cannot drift apart.
 *
 * Everything here is in pixels on purpose. Material sets the root font size to
 * 125%, the presentation pages leave it at the browser's default, and a bar
 * built in `rem` would be two different bars. Colour comes from tokens.css.
 */

html { scroll-padding-top: 88px; }

/* ══ the bar ═══════════════════════════════════════════════════════════ */

.dg-bar {
  position: sticky;
  top: 0;
  z-index: 4;                       /* Material's own header sits at 4 */
  background: var(--bg);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  box-shadow: none;
  font-family: var(--sans);
}

.dg-bar__in {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
  min-width: 0;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
}

/* the mark, and the word */
.dg-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  color: var(--ink);
  text-decoration: none;
}
.dg-brand .dg-mark {
  display: block;
  height: 26px; width: 26px;      /* the mark is a square icon */
  flex: none;
}
.dg-brand span {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1;
}

/* the four sections, centre-right */
.dg-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 0 0 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.dg-nav::-webkit-scrollbar { display: none; }
.dg-nav a {
  display: block;
  padding: 21px 0;                  /* the whole height of the bar is the target */
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.dg-nav a:hover { color: var(--ink); }
.dg-nav a[aria-current] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* GitHub, the light/dark toggle, and — in the documentation — search */
.dg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--rule-soft);
}
.dg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}
.dg-icon:hover { color: var(--ink); background: var(--surface); }
.dg-icon svg {
  display: block;
  width: 18px; height: 18px;
  fill: currentColor;
}
.dg-icon[hidden] { display: none; }
.dg-moon, .dg-sun { display: block; line-height: 0; }

/* Which face the toggle wears: the moon when you are in the light, the sun
   when you are in the dark. Decided in CSS, so it is right before any script
   has had a chance to run. */
.dg-sun  { display: none; }
[data-md-color-scheme="slate"] .dg-sun  { display: block; }
[data-md-color-scheme="slate"] .dg-moon { display: none; }
@media (prefers-color-scheme: dark) {
  body:not([data-md-color-scheme="default"]) .dg-sun  { display: block; }
  body:not([data-md-color-scheme="default"]) .dg-moon { display: none; }
}

/* The drawer and search buttons in the documentation keep Material's own
   classes — its stylesheet decides when each of them is on screen. What they
   look like is set alongside .dg-icon, in theme.css. */
.dg-burger { flex: none; }

/* Narrow screens. The sections are the part that has to give: they shrink, and
   past that they scroll inside the bar rather than making the whole page wider
   than the window. */
@media (max-width: 860px) {
  .dg-bar__in { gap: 12px; padding: 0 14px; }
  .dg-nav { gap: 16px; }
  .dg-nav a { font-size: 13px; }
  .dg-actions { padding-left: 8px; margin-left: 0; }
}
@media (max-width: 600px) {
  .dg-brand span { display: none; }
  .dg-nav { gap: 14px; }
}

/* ══ the band ══════════════════════════════════════════════════════════ */

.dg-foot {
  background: var(--band-bg);
  color: var(--band-ink);
  font-family: var(--sans);
  margin-top: auto;
}
/* Previous / next, on the documentation pages only. It sits on the band, above
   the three columns, parted from them by a rule. */
.dg-foot__pager {
  box-sizing: border-box;
  max-width: 1220px;
  margin: 0 auto;
  padding: 8px 20px 0;
  border-bottom: 1px solid var(--band-rule);
}
.dg-foot__pager + .dg-foot__in { padding-top: 34px; }

.dg-foot__in {
  box-sizing: border-box;
  max-width: 1220px;
  margin: 0 auto;
  padding: 46px 20px 30px;
}
.dg-foot__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 40px;
}
.dg-foot h2 {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--band-muted);
}
.dg-foot ul { list-style: none; margin: 0; padding: 0; }
.dg-foot li { margin: 0 0 10px; }
.dg-foot li:last-child { margin-bottom: 0; }
.dg-foot a {
  font-size: 14px;
  line-height: 1.35;
  color: var(--band-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.dg-foot a:hover { border-bottom-color: var(--band-muted); }
.dg-foot__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin: 34px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--band-rule);
  font-size: 13px;
  color: var(--band-muted);
}
.dg-foot__line p { margin: 0; }
.dg-foot__meta { display: flex; gap: 20px; }
.dg-foot__meta a { font-size: 13px; color: var(--band-muted); }
.dg-foot__meta a:hover { color: var(--band-ink); border-bottom-color: var(--band-muted); }
.dg-foot__meta a[aria-current] { color: var(--band-ink); }

@media (max-width: 700px) {
  .dg-foot__cols { grid-template-columns: 1fr; gap: 26px; }
  /* Previous / next, on the documentation pages only. It sits on the band, above
   the three columns, parted from them by a rule. */
.dg-foot__pager {
  box-sizing: border-box;
  max-width: 1220px;
  margin: 0 auto;
  padding: 8px 20px 0;
  border-bottom: 1px solid var(--band-rule);
}
.dg-foot__pager + .dg-foot__in { padding-top: 34px; }

.dg-foot__in { padding: 34px 14px 26px; }
}
