/* ─── shared.css — styles common to every TrackMyBus page ── */

/* ─── RESET & VARIABLES ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1b5e6e;
  --primary-dark:  #134655;
  --primary-light: #e8f3f6;
  --headline:      #1a3a42;
  --body:          #444;
  --muted:         #888;
  --surface:       #f5f5f5;
  --border:        #e2e2e2;
  --alert:         #f97316;
  --alert-light:   #fff7ed;
  --white:         #ffffff;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  color: var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── TIME BAR ───────────────────────────────────────────── */
.time-bar {
  height: 28px;
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 101;
}

.time-bar-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.95);
}

/* ─── NAV ────────────────────────────────────────────────── */
nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6%;
  flex-shrink: 0;
  position: sticky;
  top: 28px;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border: 1px solid #aaa;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--headline);
  letter-spacing: -0.025em;
}

.logo-text span { color: var(--primary); }

/* ─── NAV ICONS ──────────────────────────────────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Icons hidden by default; shown immediately on first paint for returning logged-in users */
#nav-icons { display: none; }
.is-authed #nav-icons { display: flex; }

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #262626;
  transition: opacity 0.15s;
}

.nav-icon:hover { opacity: 0.6; }

/* Track page icon is always orange — primary CTA */
.nav-icon--track { color: var(--alert); }

/* ─── HAMBURGER ──────────────────────────────────────────── */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  margin-left: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--headline);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── NAV DROPDOWN ───────────────────────────────────────── */
.nav-menu {
  position: fixed;
  top: 84px;
  left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 150;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-menu.open { transform: translateY(0); opacity: 1; pointer-events: auto; }

.nav-menu a {
  display: block;
  padding: 1rem 6%;
  font-size: 1rem;
  font-weight: 500;
  color: var(--headline);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.nav-menu a:last-child { border-bottom: none; }
.nav-menu a:hover     { background: var(--surface); }
.nav-signout          { color: #c0392b !important; border-top: 1px solid var(--border); }

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  padding: 1.25rem 6%;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--white);
}

footer a       { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--headline); }

/* ─── SKELETON SHIMMER ───────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skel {
  border-radius: 6px;
  background: linear-gradient(90deg, #e8e8e8 25%, #f4f4f4 50%, #e8e8e8 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

/* ─── SKIP LINK ──────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}

.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  overflow: visible;
}

/* ─── FOCUS STYLES ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 480px) {
  nav, footer { padding-left: 5%; padding-right: 5%; }
}
