/* Mobile and minimal navigation refinements layered after the main stylesheets. */

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.site-nav-menu {
  display: block;
  justify-self: end;
}

.site-nav-checkbox {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.site-nav-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid rgba(16, 35, 27, 0.14);
  border-radius: 999px;
  padding: 0 14px;
  background: #ffffff;
  color: #10231b;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(16, 35, 27, 0.08);
  -webkit-tap-highlight-color: transparent;
}

.site-nav-toggle:hover,
.site-nav-checkbox:focus-visible + .site-nav-toggle {
  border-color: rgba(16, 35, 27, 0.28);
  box-shadow: 0 12px 28px rgba(16, 35, 27, 0.12);
}

.site-nav-toggle-icon,
.site-nav-toggle-icon::before,
.site-nav-toggle-icon::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.site-nav-toggle-icon {
  position: relative;
}

.site-nav-toggle-icon::before,
.site-nav-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
}

.site-nav-toggle-icon::before {
  top: -5px;
}

.site-nav-toggle-icon::after {
  top: 5px;
}

.site-nav-menu .site-nav {
  display: none !important;
}

.site-nav-checkbox:checked + .site-nav-toggle + .site-nav {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100;
  display: grid !important;
  width: min(235px, calc(100vw - 28px));
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(16, 35, 27, 0.96);
  box-shadow: 0 20px 54px rgba(4, 18, 13, 0.34);
  backdrop-filter: blur(14px);
}

.site-nav-checkbox:checked + .site-nav-toggle + .site-nav::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 28px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 35, 27, 0.96);
}

.site-nav a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 40px;
  border-radius: 12px;
  padding: 0 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 900;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.site-nav a::after {
  display: none;
}

.site-nav a[aria-current='page'] {
  background: rgba(232, 241, 236, 0.14);
  color: #ffffff;
}

.home-shell .hero-compact {
  min-height: 420px;
  padding: clamp(26px, 4vw, 52px);
}

.river-chart-wrap {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@media (max-width: 760px) {
  .brand {
    max-width: min(68vw, 260px);
    line-height: 1.25;
  }

  .site-nav-checkbox:checked + .site-nav-toggle + .site-nav {
    width: min(235px, calc(100vw - 28px));
  }

  .home-shell .hero-compact {
    min-height: 320px;
    padding: 28px;
  }

  .page-hero {
    min-height: 230px;
  }

  .home-shell .hero-compact h1,
  .page-hero h1 {
    line-height: 1;
  }

  .home-shell .hero-compact .actions a,
  .actions a,
  .jump-links a {
    flex: 1 1 180px;
  }

  .chart-panel .chart-summary-grid::after {
    content: 'Swipe sideways to view the full chart ↔';
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-column: 1 / -1;
    margin: 0 0 2px;
    border: 1px solid rgba(16, 35, 27, 0.1);
    border-radius: 999px;
    padding: 9px 12px;
    background: #f4faf6;
    color: #40564a;
    font-size: 0.86rem;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(16, 35, 27, 0.08);
  }

  .river-chart-wrap {
    min-height: 320px;
  }
}
