/* =========================================================
   MOBILE BOTTOM NAVIGATION
   ========================================================= */
.cg-mobile-nav {
  display: none;
}

/* Phone portrait only. Landscape intentionally returns to the normal site
   layout so the fixed bar does not consume scarce vertical space. */
@media (max-width: 900px) and (orientation: portrait) {
  :root {
    --cg-mobile-nav-height: 68px;
    --cg-mobile-nav-red: #ed1c24;
    --cg-mobile-nav-ink: #171a1d;
    --cg-mobile-nav-bg: #f8f5ee;
  }

  /* The footer needs a real scrollable tail equal to the fixed bar height.
     This lets every legal line remain visible after the user releases the
     scroll instead of snapping back underneath the navigation. */
  body {
    padding-bottom: 0;
  }

  .cg-site-footer {
    margin-bottom: calc(var(--cg-mobile-nav-height) + 8px + env(safe-area-inset-bottom, 0px));
  }

  .cg-mobile-nav {
    position: fixed;
    z-index: 9998;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: var(--cg-mobile-nav-height);
    padding: 5px 4px 5px;
    background: var(--cg-mobile-nav-bg);
    border-top: 1px solid rgba(23, 26, 29, .10);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .045);
  }

  .cg-mobile-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 58px;
    padding: 0 1px;
    color: var(--cg-mobile-nav-ink);
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.02;
    text-align: center;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease;
  }

  .cg-mobile-nav__label {
    display: block;
    white-space: nowrap;
  }

  .cg-mobile-nav__label--stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: .95;
  }

  .cg-mobile-nav__item:hover,
  .cg-mobile-nav__item:focus-visible,
  .cg-mobile-nav__item.is-active {
    color: var(--cg-mobile-nav-red);
    text-decoration: none !important;
  }

  .cg-mobile-nav__item.is-active::after {
    content: "";
    position: absolute;
    left: 22%;
    right: 22%;
    bottom: -1px;
    height: 3px;
    border-radius: 999px;
    background: var(--cg-mobile-nav-red);
  }

  .cg-mobile-nav__icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .cg-mobile-nav__item--text .cg-mobile-nav__icon {
    width: 36px;
    height: 36px;
  }
}

/* Explicitly undo the portrait footer clearance when a phone is rotated. */
@media (max-width: 900px) and (orientation: landscape) {
  .cg-mobile-nav {
    display: none !important;
  }

  .cg-site-footer {
    margin-bottom: 0 !important;
  }
}

