/* Navigation rail and bottom tab bar. Every #tabs / .desktop-brand rule lives
   here, in cascade order, so the nav has one source of truth. Loaded after
   app.module.css and friendly.css. */

.desktop-brand {display: none; }
#tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  justify-items: center;
  background: var(--paper);
  border-top: 2px solid var(--line-1);
  box-shadow: 0 -5px 12px rgb(0 0 0 / 3%);
  padding: 10px 8px calc(10px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}
#tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 52px;
  height: 52px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.2;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-2);
  transition:
    background 0.15s var(--ease),
    border-color 0.15s var(--ease);
}
/* 720-959px: a 540px bar centred over full-bleed content. Sitting flush to the
   bottom edge with square corners, it read as a full-width bar that had failed
   to size itself — scrolling rows were visible on both sides of it at the same
   height ("Governme" to the left, "0/5 le" to the right). Lifting it off the
   edge and rounding it makes it plainly a floating bar that content passes
   behind, which is what it always was. */
@media (min-width: 720px) {
  #tabs {
    left: 50%;
    right: auto;
    width: 540px;
    transform: translateX(-50%);
    bottom: 14px;
    border: 1px solid var(--line-2);
    border-radius: 20px;
    box-shadow: 0 6px 22px rgb(21 37 54 / 12%);
    padding-bottom: 10px;
  }
}
@media (min-width: 960px) {
  #tabs {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: var(--desktop-rail);
    padding: 24px 18px;
    border-top: 0;
    border-right: 2px solid rgb(255 255 255 / 12%);
    background: #071827;
    box-shadow: 8px 0 0 rgb(0 0 0 / 12%);
    border-radius: 0;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .desktop-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 2px;
    padding: 4px 0 0;
    border-bottom: 1px solid rgb(255 255 255 / 16%);
    color: #fff;
    text-decoration: none;
  }
  /* The rail wordmark is live text in the bundled Fredoka Bold, the face of the
     brand artwork, so it stays crisp at any size. The anchor carries the accessible name. */
  .desktop-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
  }
  .desktop-wordmark {
    font: 700 31px/1 Fredoka, Nunito, system-ui, sans-serif;
    letter-spacing: -0.4px;
    color: #1cb0f6;
    white-space: nowrap;
  }
  #tabs button {
    min-height: 52px;
    width: 100%;
    max-width: none;
    height: auto;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    border: 2px solid transparent;
    border-radius: var(--r);
    color: rgb(255 255 255 / 62%);
    font-size: 0.95rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
  }
  .desktop-brand-logo {
    height: 48px;
  }
}
#tabs {min-height: 76px; background: var(--paper); border-top: 1px solid var(--line-2); box-shadow: 0 -2px 10px #15253608; }
#tabs button {color: var(--ink-2); font-weight: 800; font-size: 12px; gap: 3px; }
@media (max-width: 959px) {
  #tabs button {width: 100%; min-width: 0; white-space: nowrap; }
}
body.onquiz #journeyHeader, body.onquiz #tabs {display: none; }
@media (min-width: 960px) {
  #tabs {background: var(--paper); border-right: 1px solid var(--line-2); box-shadow: none; padding-top: 30px; }
  #tabs button {font-size: 16px; gap: 14px; color: var(--ink-2); }
  body.onquiz #tabs {display: flex; }
}
#tabs {box-shadow: none; }
#tabs button {border-radius: 13px; }
#tabs button.on {color: var(--brand-ink); background: transparent; border-color: transparent; }
#tabs .tab-icon {display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border: 2px solid transparent; border-radius: 13px; transform: none; transition: background .16s ease, border-color .16s ease; }
#tabs button.on .tab-icon {border-color: var(--brand-line); background: var(--brand-soft); }
#tabs .tab-art {display: block; width: 46px; height: 46px; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; transform-origin: center; transition: transform .13s ease-out; }
#tabs [data-tab="today"] .tab-art {width: 44px; height: 44px; }
#tabs [data-tab="q"] .tab-art, #tabs [data-tab="h"] .tab-art {width: 42px; height: 42px; }
#tabs button:active .tab-icon {transform: none; }
/* Phone press: the icon squashes under the finger (class set in app.js) and springs back on release. */
@media (max-width: 959px) { #tabs button.is-pressed .tab-art { transform: scale(.95); transition: transform .08s ease; } }
@media (max-width: 959px) {
  #tabs {min-height: 72px; padding: 8px 12px calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); border-top: 1px solid var(--line-2); }
  /* Icons only in the bottom bar; each button retains its accessible name. */
  #tabs button {width: 100%; min-width: 0; height: 54px; padding: 0; gap: 0; border: 0; font-size: 0; line-height: 0; }
  #tabs .tab-icon {width: 46px; height: 46px; }
  #tabs .tab-art {width: 40px; height: 40px; }
  #tabs [data-tab="today"] .tab-art {width: 39px; height: 39px; }
  #tabs [data-tab="q"] .tab-art, #tabs [data-tab="h"] .tab-art, #tabs [data-tab="unlock"] .tab-art {width: 38px; height: 38px; }
}
@media (min-width: 960px) {
  #tabs button {min-height: 58px; padding: 3px 14px 3px 8px; gap: 9px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; border: 2px solid transparent; border-radius: 16px; transition: background .16s ease, border-color .16s ease; }
  #tabs button.on {background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
  #tabs button:not(.on):hover, #tabs button:not(.on):focus-visible {background: var(--panel-2); border-color: transparent; }
  #tabs button.on .tab-icon {border-color: transparent; background: transparent; }
  #tabs .tab-icon {width: 46px; height: 46px; }
  #tabs .tab-art {width: 40px; height: 40px; }
  #tabs [data-tab="today"] .tab-art {width: 38px; height: 38px; }
  #tabs [data-tab="q"] .tab-art, #tabs [data-tab="h"] .tab-art {width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  #tabs .tab-icon, #tabs .tab-art {transition: none; }
}
