/* ==========================================================================
   TAB BAR
   Below 900px: the four tabs along the foot of the screen, edge to edge, on
   frosted paper with a hairline along the top. The current tab is in ink and
   the rest in slate; a short line on the top edge marks it, which the
   browser slides from tab to tab between screens (tab-marker).

   Over the home screen's photographs, until the screen scrolls, the bar is
   clear and its tabs are white (.is-over-photo, .is-scrolled on <html>).
   ========================================================================== */

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-bottom: env(safe-area-inset-bottom);
  background-color: color-mix(in srgb, var(--paper) 86%, transparent);
  box-shadow: 0 -1px 0 color-mix(in srgb, var(--ink) 9%, transparent);
  color: var(--ink);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  transition: background-color 350ms ease, box-shadow 350ms ease, color 350ms ease;
  view-transition-name: tab-bar;
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .tab-bar {
    display: none;
  }
}

.is-scripted:not(.is-scrolled) .tab-bar.is-over-photo {
  background-color: transparent;
  box-shadow: 0 -1px 0 transparent;
  color: var(--white);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.tab-bar__wrapper {
  position: relative;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.tab-bar ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.tab-bar a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  height: 56px;
  color: inherit;
  font-size: 11px;
  font-weight: 620;
  line-height: 1;
  letter-spacing: 0.005em;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity var(--duration-sm) ease, transform var(--duration-sm) var(--ease-out);
}

.tab-bar a:active {
  transform: scale(0.92);
}

.tab-bar a[aria-current="page"] {
  opacity: 1;
}

.tab-bar .icon {
  width: 24px;
  height: 24px;
}

/* MARKER */

/* The short line on the top edge, over the current tab. */
.tab-bar__marker {
  position: absolute;
  top: 0;
  left: calc(12.5% - 12px);
  width: 24px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background-color: currentColor;
  view-transition-name: tab-marker;
}

.tab-bar:has(li:nth-child(2) [aria-current]) .tab-bar__marker {
  left: calc(37.5% - 12px);
}

.tab-bar:has(li:nth-child(3) [aria-current]) .tab-bar__marker {
  left: calc(62.5% - 12px);
}

.tab-bar:has(li:nth-child(4) [aria-current]) .tab-bar__marker {
  left: calc(87.5% - 12px);
}

.tab-bar:not(:has([aria-current])) .tab-bar__marker {
  display: none;
}
