/* Trueread portal: the tab bar along the bottom of a phone screen. Trueread Noir.
   Shown only below 861px, the width where the menu stops being a column at the left and becomes the panel that
   opens over the page (app.css and app.js use the same breakpoint). Four places in one tap, within reach of a thumb:
   on a venue's pages Forecast, Roster, Prep and Menu; elsewhere Venues, Account and Menu.
   Menu is the menu's own toggle (app.js); without JavaScript it is a link to the venues list.

   A solid Void bar across the foot of the screen with a hairline on top, like the top bar's under it: no glass,
   no blur, no shadow. The tab you are on has White words and a short White rule on the bar's top edge; the
   others are Smoke (7.9:1 on Void). Never Sodium or Mercury: those mean busier and quieter only. */

.tabbar { display: none; }

@media screen and (max-width: 860px) {
  :root {
    --tabbar-height: 64px;                                       /* a 63px tab and the 1px hairline over it */
    --tabbar-gap: max(0px, env(safe-area-inset-bottom));         /* clear of the home indicator on phones that have one */
    --tabbar-room: calc(var(--tabbar-height) + var(--tabbar-gap) + 16px);
  }
  /* Room under the page, so the last panel stops 16px above the bar, and so focus and jump links never land under it. */
  body.app { padding-bottom: var(--tabbar-room); }
  .content { padding-bottom: 0; }
  html { scroll-padding-bottom: var(--tabbar-room); }

  .tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;   /* under the menu's scrim (30) */
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
    height: calc(var(--tabbar-height) + var(--tabbar-gap)); padding: 0 8px var(--tabbar-gap);
    background: var(--tr-bg); border-top: 1px solid var(--tr-line); }

  /* A tab: icon over a short label; the whole cell is the target. */
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-width: 0; min-height: 63px; padding: 6px 4px; border: 0; border-radius: 0; background: none; color: var(--tr-text-2);
    font: inherit; font-size: 12px; line-height: 16px; font-weight: 400; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: color var(--tr-dur-1) linear, background-color var(--tr-dur-1) linear; }
  .tab[hidden] { display: none; }
  .tab svg.i { width: 24px; height: 24px; }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* The page you are on: White words and a 24px White rule lying on the bar's hairline. */
  .tab.on { color: var(--tr-text); font-weight: 500; }
  .tab.on::before { content: ""; position: absolute; top: -1px; left: 50%; width: 24px; height: 2px; margin-left: -12px; background: var(--tr-text); }
  .tab:active { background: var(--tr-well); }
  .tab:focus-visible { outline-offset: -2px; }
  .tab:hover { text-decoration: none; }
  @media (hover: hover) { .tab:hover { color: var(--tr-text); } }
}

/* A phone on its side: little height to spare, so the label goes beside the icon and the bar is 10px lower. */
@media screen and (max-width: 860px) and (max-height: 480px) {
  :root { --tabbar-height: 54px; }
  .tab { flex-direction: row; gap: 8px; min-height: 44px; padding: 4px 8px; }
  .tab svg.i { width: 20px; height: 20px; }
}

/* Windows high-contrast: the rule is dropped with the other fills, so the tab you are on gets a rim instead. */
@media (forced-colors: active) {
  .tab.on { outline: 2px solid CanvasText; outline-offset: -2px; }
}
