/* Shared MESH BUDDY site footer and hit counter. */
.npn-site-footer,
.npn-site-footer * {
  box-sizing: border-box;
}

.npn-site-footer {
  --npn-footer-bg: #0c0e0d;
  --npn-footer-surface: #111513;
  --npn-footer-surface-2: #161b18;
  --npn-footer-line: #2a322c;
  --npn-footer-line-strong: #3c4a40;
  --npn-footer-green: #46e06b;
  --npn-footer-green-dim: #2ea043;
  --npn-footer-blue: #6cb2ff;
  --npn-footer-text: #d7e0d9;
  --npn-footer-bright: #eff5f0;
  --npn-footer-muted: #8ca394;
  position: relative;
  z-index: 70;
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--npn-footer-line-strong);
  background: linear-gradient(180deg, var(--npn-footer-surface), var(--npn-footer-bg));
  color: var(--npn-footer-text);
  font: 11px/1.45 "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  letter-spacing: 0;
  box-shadow: 0 -12px 28px rgba(0, 0, 0, .28);
}

.page > .npn-site-footer {
  flex: 0 0 auto;
  margin-top: auto;
}

.npn-site-footer-primary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.npn-site-footer-brand {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--npn-footer-green-dim);
  background: #07100a;
  color: var(--npn-footer-green);
  font: 700 11px "Saira Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.npn-site-footer-note {
  min-width: 180px;
  max-width: 720px;
  color: var(--npn-footer-muted);
}

.npn-site-footer-note > * {
  margin: 0;
}

.npn-site-footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.npn-site-footer a,
.npn-site-footer-link {
  color: var(--npn-footer-text);
  text-decoration: none;
}

.npn-site-footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--npn-footer-line);
  background: var(--npn-footer-surface-2);
  font: 600 10px "Saira Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .10em;
  text-transform: uppercase;
  white-space: nowrap;
}

.npn-site-footer-link:hover,
.npn-site-footer-link[aria-current="page"] {
  border-color: var(--npn-footer-green-dim);
  color: var(--npn-footer-bright);
}

.npn-site-footer-link[aria-current="page"] {
  color: var(--npn-footer-green);
  box-shadow: inset 0 -2px 0 var(--npn-footer-green);
}

.npn-site-hit-counter {
  display: grid;
  grid-template-columns: repeat(3, auto);
  align-items: center;
  gap: 6px;
  justify-content: end;
}

.npn-site-hit-item {
  display: grid;
  min-width: 78px;
  gap: 1px;
  padding: 5px 8px;
  border: 1px solid var(--npn-footer-line);
  background: #080d0a;
}

.npn-site-hit-value {
  color: var(--npn-footer-blue);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.npn-site-hit-label {
  color: var(--npn-footer-muted);
  font: 600 9px "Saira Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .10em;
  text-transform: uppercase;
  white-space: nowrap;
}

.npn-site-hit-counter.is-volatile .npn-site-hit-value {
  color: var(--npn-footer-muted);
}

@media (max-width: 900px), (pointer: coarse) and (max-width: 1180px) {
  body.npn-site-footer-map .npn-site-footer {
    display: none;
  }
}

@media (max-width: 760px) {
  .npn-site-footer {
    grid-template-columns: 1fr;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .npn-site-footer-links {
    width: 100%;
    margin-left: 0;
  }

  .npn-site-hit-counter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    justify-content: stretch;
  }

  .npn-site-hit-item {
    min-width: 0;
  }
}

@media (max-width: 430px) {
  .npn-site-footer-primary {
    align-items: flex-start;
    flex-direction: column;
  }

  .npn-site-footer-note {
    min-width: 0;
  }

  .npn-site-hit-counter {
    grid-template-columns: 1fr;
  }
}

/* Map page: the map app is a fixed 100vh layout, so an in-flow footer can be
   pushed off the true bottom when the grid overflows. Pin it to the viewport
   bottom and reserve its height so the map/sidebars never hide under it. */
body.npn-site-footer-map .npn-site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
}

body.npn-site-footer-map .map-layout {
  margin-bottom: 60px;
}
