/* ==============================
   NextMetro — Brand Guidelines v1.0
   Typography: Rajdhani | Theme: Neutral Brutalist
   Core shared styles loaded on every page.
   Page-specific styles are in separate CSS files.
   ============================== */

/* Self-hosted Rajdhani (Latin subset) */
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/rajdhani-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/rajdhani-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/rajdhani-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/rajdhani-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/rajdhani-700.woff2') format('woff2');
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global reset for sharp edges — applied to all elements except dots */
*:not([class*="dot"]):not([class*="peak-indicator-dot"]) {
  border-radius: 0;
}

:root {
  /* Surfaces */
  --nm-bg: #0A0A0A;
  --nm-surface: #141414;
  --nm-surface-elevated: #1E1E1E;
  --nm-surface-overlay: #282828;

  /* Borders */
  --nm-border: #333333;
  --nm-border-subtle: #222222;
  --nm-border-strong: #444444;

  /* Text */
  --nm-text-primary: #FAFAFA;
  --nm-text-secondary: #A0A0A0;
  --nm-text-muted: #949494;
  --nm-text-disabled: #767676;

  /* Accent */
  --nm-amber: #D4A03C;
  --nm-amber-dim: #C8A244;
  --nm-amber-bright: #E8B854;
  --nm-amber-glow: rgba(212, 160, 60, 0.4);

  /* Status */
  --nm-status-ok: #00E676;
  --nm-status-ok-glow: rgba(0, 230, 118, 0.5);
  --nm-status-warn: #FFB300;
  --nm-status-warn-glow: rgba(255, 179, 0, 0.4);
  --nm-status-error: #FF5252;
  --nm-status-info: #40C4FF;

  /* WMATA Lines */
  --nm-line-red: #D41140;
  --nm-line-orange: #F09500;
  --nm-line-blue: #00A8E8;
  --nm-line-green: #00BD45;
  --nm-line-yellow: #FFD400;
  --nm-line-silver: #9BA5A5;

  /* Line Page Background Tints (line color at ~7% over #0A0A0A) */
  --nm-line-bg-red: #190B0E;
  --nm-line-bg-orange: #1B130A;
  --nm-line-bg-blue: #0A141A;
  --nm-line-bg-green: #09160E;
  --nm-line-bg-yellow: #1B1809;
  --nm-line-bg-silver: #111213;

  /* Line Page Elevated Surfaces (line color at ~5% over #141414) */
  --nm-line-surface-red: #1E1217;
  --nm-line-surface-orange: #201A12;
  --nm-line-surface-blue: #131B21;
  --nm-line-surface-green: #131D16;
  --nm-line-surface-yellow: #211F11;
  --nm-line-surface-silver: #191A1B;

  /* Nav/Footer Design Tokens */
  --nm-black:    #0A0A0A;
  --nm-dark:     #111111;
  --nm-surface2: #222222;
  --nm-border2:  #3A3A3A;
  --nm-white:    #F0EDEA;
  --nm-gray:     #9A9A9A;
  --nm-muted:    #767676;
  /* Line colors — aliases for nav/footer (canonical values above as --nm-line-*) */
  --line-red:    var(--nm-line-red);
  --line-orange: var(--nm-line-orange);
  --line-silver: var(--nm-line-silver);
  --line-blue:   var(--nm-line-blue);
  --line-yellow: var(--nm-line-yellow);
  --line-green:  var(--nm-line-green);

  /* Fare Machine */
  --nm-fare-blue: #0076A8;
  --nm-fare-orange: #E85D04;
  --nm-fare-yellow: #FFB703;

  /* Typography */
  --nm-font: 'Rajdhani', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --nm-space-2xs: 0.125rem;
  --nm-space-xs: 0.25rem;
  --nm-space-sm: 0.5rem;
  --nm-space-md: 1rem;
  --nm-space-lg: 1.5rem;
  --nm-space-xl: 2rem;
  --nm-space-2xl: 3rem;
  --nm-space-3xl: 4rem;

  /* Transitions */
  --nm-transition-fast: 100ms ease;
  --nm-transition-normal: 200ms ease;
  --nm-transition-slow: 300ms ease;

  color-scheme: dark;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--nm-font);
  background-color: var(--nm-bg);
  color: var(--nm-text-primary);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  min-width: 320px;
}

a {
  color: var(--nm-text-secondary);
  text-decoration: none;
  transition: color var(--nm-transition-normal);
}

a:hover {
  color: var(--nm-amber);
}

/* ==============================
   Animations
   ============================== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeSlideUp 0.45s ease-out both; }
.d1 { animation-delay: 0.06s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.18s; }
.d4 { animation-delay: 0.24s; }
.d5 { animation-delay: 0.30s; }

@keyframes shimmer {
  0%   { opacity: 0.3; }
  50%  { opacity: 0.6; }
  100% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse,
  .alert-indicator,
  .animate-in,
  .pids-skeleton-block {
    animation: none;
  }
  .animate-in {
    opacity: 1;
    transform: none;
  }
}

/* Old navbar styles removed — see /css/nav.css */

/* ==============================
   System Status Bar
   ============================== */
.ticker-bar {
  background-color: var(--nm-surface);
  border-bottom: 1px solid var(--nm-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
}

.ticker-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 720px;
  font-family: var(--nm-font);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--nm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ticker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1 1 0;
  padding: 4px 0;
  position: relative;
}

/* Subtle dividers between items */
.ticker-item + .ticker-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--nm-border-subtle);
}

.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50% !important;
  display: inline-block;
  flex-shrink: 0;
}

.ticker-line-name {
  color: var(--nm-text-secondary);
}

.ticker-status-ok {
  color: var(--nm-status-ok);
}

.ticker-status-alert {
  color: var(--nm-status-error);
}

.ticker-status-caution {
  color: var(--nm-status-warn);
}

/* Pulse the dot when there's an alert */
.ticker-item--alert .ticker-dot {
  animation: pulse 2s ease-in-out infinite;
}

@media (max-width: 480px) {
  .ticker-track {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    gap: 0;
  }
  .ticker-item {
    gap: 3px;
  }
  /* Hide status text on very small screens, keep dot as indicator */
  .ticker-status-text {
    display: none;
  }
}

/* ==============================
   Hero / Station Selector
   ============================== */
.hero {
  background-color: var(--nm-surface);
  padding: var(--nm-space-3xl) var(--nm-space-lg) var(--nm-space-2xl);
  position: relative;
  border-bottom: 1px solid var(--nm-border-subtle);
  overflow: hidden;
}

/* Hero background image layer */
.hero--has-image {
  min-height: 280px;
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 1;
  transition: opacity 0.3s;
}

.hero__image img[data-error] {
  opacity: 0;
}

.hero__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.55) 0%,
    rgba(10, 10, 10, 0.7) 50%,
    rgba(20, 20, 20, 0.92) 100%
  );
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Breadcrumb */
.hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--nm-space-xs);
  font-family: var(--nm-font);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: var(--nm-space-md);
}

.hero-breadcrumb a {
  color: var(--nm-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.hero-breadcrumb a:hover {
  color: var(--nm-amber);
}

.hero-breadcrumb__sep {
  color: var(--nm-text-disabled);
  font-size: 0.7rem;
}

.hero-breadcrumb__current {
  color: var(--nm-text-secondary);
}

.hero-label {
  display: block;
  font-family: var(--nm-font);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--nm-amber-dim);
  letter-spacing: 0.12em;
  margin-bottom: var(--nm-space-xs);
}

.hero-station-name {
  font-family: var(--nm-font);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.5rem);
  color: var(--nm-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: var(--nm-space-xs);
}

.hero-station-address {
  font-family: var(--nm-font);
  font-weight: 400;
  font-size: 1rem;
  color: var(--nm-text-secondary);
  margin-bottom: var(--nm-space-lg);
  min-height: 1.2em;
}

.hero-station-desc {
  font-family: var(--nm-font);
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--nm-text-secondary);
  margin-bottom: var(--nm-space-lg);
  max-width: 520px;
  line-height: 1.5;
}

/* ==============================
   Accessibility Utilities
   ============================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: 8px 16px;
  background: var(--nm-amber);
  color: var(--nm-bg);
  font-weight: 600;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==============================
   Unified Breadcrumb
   Positioned as first element inside #main, above hero.
   Large tap targets, underlined links, visible on all backgrounds.
   ============================== */
.nm-breadcrumb {
  background-color: var(--nm-bg);
  padding: var(--nm-space-sm) var(--nm-space-lg);
  border-bottom: 1px solid var(--nm-border-subtle);
}

.nm-breadcrumb-list {
  display: flex;
  align-items: center;
  gap: var(--nm-space-xs);
  list-style: none;
  max-width: 900px;
  margin: 0 auto;
  font-family: var(--nm-font);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nm-breadcrumb-item a {
  color: var(--nm-text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--nm-border-strong);
  transition: color var(--nm-transition-normal), text-decoration-color var(--nm-transition-normal);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 4px;
}

.nm-breadcrumb-item a:hover {
  color: var(--nm-amber);
  text-decoration-color: var(--nm-amber);
}

.nm-breadcrumb-sep {
  color: var(--nm-text-disabled);
  font-size: 0.75rem;
  user-select: none;
}

.nm-breadcrumb-current {
  color: var(--nm-text-muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 4px;
}

@media (max-width: 768px) {
  .nm-breadcrumb {
    padding: var(--nm-space-sm) var(--nm-space-md);
  }
}

/* ==============================
   WMATA Data Disclaimer
   Required by WMATA API Developer Agreement.
   Must appear in legible bold print on the same
   page as transit data, in close proximity.
   ============================== */
.wmata-data-disclaimer {
  margin: 0;
  padding: var(--nm-space-sm) var(--nm-space-md);
  border: 1px solid var(--nm-border);
  border-top: none;
  background: var(--nm-surface);
  font-family: var(--nm-font);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--nm-text-secondary);
  flex-shrink: 0;
}

.wmata-data-disclaimer strong {
  color: var(--nm-text-primary);
  font-weight: 700;
}

/* ==============================
   Inline Alert Links (global)
   ============================== */
.alerts-inline-link {
  color: var(--nm-amber);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.alerts-inline-link:hover {
  color: var(--nm-amber-bright);
}
