/* MetroRailRoute.com — Main Stylesheet */
/* CWV targets: LCP <1.5s, CLS <0.05, INP <150ms */

:root {
  --primary:     #003087;
  --primary-dark:#001f5a;
  --accent:      #E32017;
  --accent-2:    #0098D4;
  --bg:          #f5f7fa;
  --surface:     #ffffff;
  --text:        #1a1a1a;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;
  --radius:      8px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,.10);
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --max-w:       1180px;
  --transition:  0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 1rem; line-height: 1.6; color: var(--text); background: var(--bg); }
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5 { line-height: 1.2; font-weight: 700; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

/* ── Skip link ── */
.skip-link {
  position: absolute; top: -100%; left: 0; padding: .5rem 1rem;
  background: var(--primary); color: #fff; z-index: 9999;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { top: 0; }

/* ── Header ── */
.site-header {
  background: var(--primary);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 1rem;
}
.site-logo {
  display: flex; align-items: center; gap: .625rem;
  color: #fff; font-weight: 700; font-size: 1.2rem;
  text-decoration: none;
}
.site-logo svg { flex-shrink: 0; }
.logo-text { white-space: nowrap; }
.primary-nav ul { display: flex; gap: 0; }
.primary-nav a {
  display: block; padding: .5rem .875rem;
  color: rgba(255,255,255,.85); font-size: .95rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: rgba(255,255,255,.15); color: #fff; text-decoration: none;
}
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: .5rem;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: var(--transition); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #0055b3 100%);
  color: #fff; padding: 4rem 0 3.5rem;
  text-align: center;
}
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-bottom: .75rem; }
.hero p  { font-size: 1.1rem; opacity: .9; max-width: 560px; margin: 0 auto 1.75rem; }
.search-form { display: flex; gap: .5rem; max-width: 480px; margin: 0 auto; }
.search-form input {
  flex: 1; padding: .75rem 1rem; font-size: 1rem;
  border: 2px solid transparent; border-radius: var(--radius);
  outline: none;
}
.search-form input:focus { border-color: var(--accent-2); }
.search-form button {
  padding: .75rem 1.25rem; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background var(--transition);
}
.search-form button:hover { background: #c0170f; }

/* ── Sections ── */
.section { padding: 3rem 0; }
.section--alt { background: var(--surface); }
.section-header { text-align: center; margin-bottom: 2rem; }
.section-header h2 { font-size: 1.6rem; color: var(--text); }
.section-header p { color: var(--text-muted); margin-top: .5rem; }

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 1.25rem; flex: 1; }
.card-title { font-size: 1.05rem; margin-bottom: .375rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.card-excerpt { font-size: .9rem; color: var(--text-muted); line-height: 1.5; }
.card-footer { padding: .875rem 1.25rem; border-top: 1px solid var(--border); }
.card-footer a { font-size: .875rem; font-weight: 600; color: var(--primary); }

/* ── Metro city card ── */
.metro-card .card-body { display: flex; flex-direction: column; gap: .5rem; }
.metro-card .city-flag { font-size: 1.5rem; }
.metro-card .city-name { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.metro-card .city-stats { display: flex; gap: 1rem; font-size: .8rem; color: var(--text-muted); }
.metro-card .city-lines { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .25rem; }

/* ── Line badge ── */
.line-badge {
  display: inline-block; padding: .2rem .5rem;
  border-radius: 4px; font-size: .7rem; font-weight: 700;
  color: #fff; white-space: nowrap;
}

/* ── Page layout ── */
.page-hero {
  background: var(--primary); color: #fff;
  padding: 2.5rem 0 2rem;
}
.page-hero h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.page-hero .subtitle { opacity: .85; margin-top: .5rem; font-size: 1.05rem; }

.page-content { padding: 2rem 0 3rem; }
.content-grid { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
.prose { max-width: 100%; }
.prose h2 { font-size: 1.4rem; margin: 2rem 0 .75rem; color: var(--text); }
.prose h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.prose p  { margin-bottom: 1rem; line-height: 1.7; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: .375rem; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: .9rem; }
.prose th { background: var(--primary); color: #fff; padding: .625rem .875rem; text-align: left; }
.prose td { padding: .5rem .875rem; border-bottom: 1px solid var(--border); }
.prose tr:nth-child(even) td { background: var(--bg); }
.prose a { color: var(--primary); text-decoration: underline; }
.prose cite { font-size: .8rem; color: var(--text-muted); display: block; margin-top: .25rem; }

/* ── Sidebar ── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-widget {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem;
}
.sidebar-widget h3 { font-size: 1rem; margin-bottom: .75rem; color: var(--text); }
.sidebar-widget ul li { padding: .375rem 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.sidebar-widget ul li:last-child { border-bottom: none; }

/* ── Quick facts box ── */
.quick-facts {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
}
.quick-facts h3 { font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .875rem; }
.quick-facts dl { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
.quick-facts dt { font-size: .8rem; color: var(--text-muted); }
.quick-facts dd { font-size: .875rem; font-weight: 600; }

/* ── Fare table ── */
.fare-table th { background: var(--primary); }
.fare-zone-badge {
  display: inline-block; padding: .15rem .5rem;
  border-radius: 12px; font-size: .75rem; font-weight: 700;
  background: var(--primary); color: #fff;
}

/* ── Stations list ── */
.stations-list { display: flex; flex-direction: column; gap: .25rem; }
.station-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem .875rem; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border);
  font-size: .9rem;
}
.station-item:hover { border-color: var(--primary); }
.station-item a { color: var(--text); flex: 1; }
.station-item a:hover { color: var(--primary); text-decoration: none; }
.station-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.interchange-icon { font-size: .75rem; color: var(--text-muted); }

/* ── Breadcrumbs ── */
.breadcrumbs { padding: .875rem 0; font-size: .85rem; color: var(--text-muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.breadcrumbs li + li::before { content: '›'; margin-right: .25rem; color: var(--border); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 500; }

/* ── Author byline ── */
.author-byline {
  display: flex; align-items: center; gap: .875rem;
  padding: .875rem 1rem; background: var(--bg);
  border-radius: var(--radius); margin-bottom: 1.5rem;
  font-size: .875rem;
}
.byline-meta { display: flex; flex-direction: column; gap: .25rem; }
.byline-author strong { color: var(--text); }
.author-title { color: var(--text-muted); }
.byline-dates { display: flex; gap: 1rem; color: var(--text-muted); flex-wrap: wrap; }

/* ── Affiliate disclosure ── */
.affiliate-disclosure {
  background: #fffbeb; border: 1px solid #fcd34d;
  border-radius: var(--radius); padding: .75rem 1rem;
  font-size: .85rem; color: #92400e; margin-bottom: 1.5rem;
}

/* ── Lines overview ── */
.lines-list { display: flex; flex-direction: column; gap: .75rem; }
.line-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text);
  border-left: 5px solid var(--primary);
  transition: box-shadow var(--transition);
}
.line-item:hover { box-shadow: var(--shadow-md); text-decoration: none; }
.line-color-bar { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.line-info { flex: 1; }
.line-name { font-weight: 700; }
.line-stats { font-size: .8rem; color: var(--text-muted); }
.line-arrow { color: var(--text-muted); }

/* ── Blog ── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.post-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.post-card-body { padding: 1.25rem; }
.post-tag {
  display: inline-block; padding: .2rem .6rem;
  background: var(--primary); color: #fff;
  border-radius: 4px; font-size: .7rem; font-weight: 600;
  margin-bottom: .75rem;
}
.post-card-title { font-size: 1.1rem; margin-bottom: .5rem; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt { font-size: .875rem; color: var(--text-muted); margin-bottom: .875rem; }
.post-card-meta { font-size: .8rem; color: var(--text-muted); }

/* ── Static pages ── */
.legal-page { max-width: 760px; margin: 0 auto; }
.legal-page h1 { font-size: 1.75rem; margin-bottom: .5rem; }
.legal-page .updated { font-size: .85rem; color: var(--text-muted); margin-bottom: 2rem; }
.legal-page h2 { font-size: 1.15rem; margin: 2rem 0 .625rem; border-bottom: 1px solid var(--border); padding-bottom: .375rem; }
.legal-page p  { margin-bottom: .875rem; font-size: .95rem; line-height: 1.7; }
.legal-page ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-page li { margin-bottom: .375rem; font-size: .95rem; }
.legal-page a  { color: var(--primary); }

/* ── Consent / CMP banner ── */
.consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--primary-dark); color: #fff;
  padding: 1rem; z-index: 9000; font-size: .875rem;
}
.consent-banner p { margin-bottom: .625rem; }
.consent-banner .consent-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn { display: inline-block; padding: .5rem 1.125rem; border-radius: var(--radius); font-weight: 600; font-size: .875rem; cursor: pointer; border: none; transition: background var(--transition); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #c0170f; text-decoration: none; }
.btn--outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.btn--outline:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.btn--sm { padding: .375rem .875rem; font-size: .8rem; }

/* ── Footer ── */
.site-footer { background: #111827; color: rgba(255,255,255,.75); margin-top: 4rem; }
.footer-inner {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem; padding: 3rem 0 2rem;
}
.footer-logo { color: #fff; font-weight: 700; font-size: 1.1rem; }
.footer-tagline { font-size: .85rem; margin-top: .375rem; opacity: .6; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.footer-col h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.5); margin-bottom: .875rem; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col a { color: rgba(255,255,255,.7); font-size: .875rem; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.25rem 0; font-size: .8rem; }
.footer-bottom p { color: rgba(255,255,255,.5); margin-bottom: .25rem; }
.footer-compliance { font-size: .75rem; opacity: .5; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .content-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav   { grid-template-columns: 1fr 1fr; }
  .card-grid    { grid-template-columns: 1fr; }
  .quick-facts dl { grid-template-columns: 1fr; }
  .nav-toggle   { display: flex; }
  .primary-nav  {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--primary-dark); padding: .5rem;
  }
  .primary-nav.open { display: block; }
  .primary-nav ul   { flex-direction: column; }
}
@media (max-width: 480px) {
  .footer-nav   { grid-template-columns: 1fr; }
  .search-form  { flex-direction: column; }
  .hero { padding: 2.5rem 0 2rem; }
}
