/* sidebar-mobile.css — hamburger menu + ToolNav depth + UX fixes */

/* Missing CSS variable definitions used by copy-tooltip.css */
:root {
  --muted: #888;
  --border: #111;
}

/* ToolNav depth: sub-items indented with accent left border */
.nav-list a.sub {
  padding-left: 20px;
  font-size: 0.66rem;
  border-left-width: 5px;
  border-left-color: var(--accent);
}

/* Screen-reader only: visually hidden but accessible to search engines */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hero h1: same style as .hero h2 in brutalist.css (h2→h1 for SEO) */
.hero h1 {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.15rem;
  letter-spacing: 1px;
}

/* Brand title: replaces h1 for SEO (h1 moved to page content) */
.brand-title {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.1rem;
  letter-spacing: 1px;
  line-height: 0.95;
}

/* Brand row layout */
.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* Focus-visible styles for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: #fff1f1;
}

/* Tooltip accessible on focus (not just hover) */
[data-tip]:focus::after,
[data-tip]:focus-within::after {
  opacity: 1;
}

/* Disabled button state (loading) */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Table scroll hint: right-edge fade */
.table-wrap {
  position: relative;
}
.table-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.85));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s;
}

/* Legal text (Privacy, Terms) */
.legal-text {
  font-size: 0.76rem;
  text-transform: none;
  line-height: 1.7;
}
.legal-text h3 {
  margin-top: 20px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.legal-text p {
  margin: 0 0 12px;
}

/* Global Footer */
.site-footer {
  border-top: 2px solid var(--border);
  padding: 18px 20px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Space Mono', monospace;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy {
  opacity: 0.6;
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.footer-links a:hover {
  opacity: 1;
}

/* Mobile: ≤1120px */
@media (max-width: 1120px) {
  /* Increase touch targets for nav links (WCAG 44px min) */
  .nav-list a {
    padding: 12px 10px;
    font-size: 0.76rem;
  }
  .nav-list a.sub {
    padding: 12px 10px 12px 24px;
    font-size: 0.72rem;
  }

  /* Improve small font readability on mobile */
  .kpi h4 { font-size: 0.68rem; }
  .kpi p { font-size: 0.96rem; }
  .block-title { font-size: 0.7rem; }
  .footer-note { font-size: 0.72rem; }
  .checklist li { font-size: 0.76rem; }
  .field h5 { font-size: 0.7rem; }
  .notice { font-size: 0.7rem; }

  .hamburger {
    display: block;
  }

  /* Sidebar toggle: slide down with max-height animation */
  .sidebar > *:not(.brand):not(.search-block) {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  .sidebar.open > *:not(.brand):not(.search-block) {
    max-height: 500px;
    opacity: 1;
  }
  .sidebar.open > .nav-block,
  .sidebar.open > .note-block {
    padding: 10px;
    margin: 10px;
  }

  /* KPI grid: 2 columns instead of 1 on small screens */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
