/* Start page and operator pages. The map has its own stylesheet, app.css. */
:root {
  --bg: #fbfaf7;
  --card: #ffffff;
  --ink: #1c1b18;
  --text: #34332f;
  --muted: #6e6c63;
  --line: #e6e3da;
  --button: #1c1b18;
  --button-ink: #ffffff;
  --focus: #1f7a6d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151513;
    --card: #1d1c19;
    --ink: #f2f0ea;
    --text: #d6d3ca;
    --muted: #9a978d;
    --line: #2e2d29;
    --button: #f2f0ea;
    --button-ink: #151513;
    --focus: #5cc2b1;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body.site {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sub { color: var(--muted); font-size: 14px; margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 700px) { .wrap { padding: 0 16px; } }

/* ---- Header, footer */
/* Names never break; when space runs out, the nav moves to its own row */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px;
  padding: 40px 0;
}
.brand {
  display: flex; align-items: center; gap: 12px; font-weight: 650; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
}
.site-nav { display: flex; gap: 20px; font-size: 14px; color: var(--muted); white-space: nowrap; }
@media (max-width: 700px) {
  .site-header { padding: 20px 0 8px; }
  .brand { gap: 10px; font-size: 16px; }
  .brand img { width: 32px; height: 32px; }
  .site-nav { gap: 16px; }
}
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 48px 0 40px; color: var(--muted); font-size: 13.6px; line-height: 1.65;
}

/* ---- Start page */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; padding: 88px 0 112px; }
.hero h1 { font-size: clamp(44px, 6vw, 69px); line-height: 0.98; letter-spacing: -0.052em; font-weight: 680; margin: 0; }
.hero-text p { color: var(--text); margin: 0 0 16px; }
.button {
  display: inline-flex; align-items: center; height: 46px; margin-top: 16px; padding: 0 18px;
  border-radius: 7px; background: var(--button); color: var(--button-ink); font-weight: 620; text-decoration: none;
}
.button:hover { opacity: 0.88; }
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 64px; }
}

.operators h2, .page-head .eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px;
}
.operators ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.operator {
  display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px 40px; align-items: baseline;
  padding: 28px 0; border-bottom: 1px solid var(--line);
}
.operator h3 { font-size: 28px; letter-spacing: -0.03em; margin: 0; line-height: 1.2; }
.operator h3 a { text-decoration: none; }
.operator p { margin: 0; color: var(--text); }
.operator-links { display: flex; gap: 20px; font-weight: 600; white-space: nowrap; }
@media (max-width: 800px) {
  .operator { grid-template-columns: 1fr; }
}

/* ---- Operator line cards */
.page-head { max-width: 760px; padding: 40px 0 28px; }
.page-head h1 { font-size: clamp(36px, 5vw, 52px); line-height: 1; letter-spacing: -0.045em; font-weight: 680; margin: 0 0 16px; }
.page-head p { color: var(--text); margin: 0; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.sub-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; font-size: 14px; }
.sub-nav a { padding: 6px 12px; border-radius: 7px; text-decoration: none; color: var(--muted); }
.sub-nav a:hover { color: var(--ink); }
.sub-nav a[aria-current="page"] { background: var(--button); color: var(--button-ink); }
.card-filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.card-filters input, .card-filters select {
  width: 100%; height: 44px; padding: 0 12px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 7px;
}
@media (max-width: 700px) { .card-filters { grid-template-columns: 1fr; } }
.count { color: var(--muted); font-size: 14px; margin: 12px 0; }
.empty { color: var(--muted); }

.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.section-nav a {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font-size: 14px; text-decoration: none;
}
.section-nav a span { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.vehicle-type { padding-top: 32px; scroll-margin-top: 16px; }
.vehicle-type h2 { font-size: 24px; letter-spacing: -0.02em; font-weight: 650; margin: 0 0 16px; }
.vehicle-type h2 .th { color: var(--muted); font-size: 16px; font-weight: 400; letter-spacing: 0; margin-left: 8px; }
.vehicle-type h2 .n { color: var(--muted); font-size: 16px; font-weight: 400; margin-left: 8px; }
.line-cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
@media (max-width: 400px) { .line-cards { grid-template-columns: 1fr; } }
.line-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 14px 16px; height: 100%;
  padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none;
}
.line-card:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.buses { display: flex; align-items: flex-start; }
.buses .bus { width: 48px; height: 56px; flex: none; }
.buses .bus + .bus { margin-left: -26px; }
.line-card-main { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.line-card .tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag {
  padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px;
}
.line-card .name { font-weight: 600; line-height: 1.35; }
.line-card .name-th { color: var(--muted); font-size: 14px; line-height: 1.4; }
.line-card-foot {
  grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--muted); font-size: 13px; line-height: 1.4;
}
.rail-card .rail-bar { width: 6px; border-radius: 3px; }
.line-card .route { color: var(--text); font-size: 14px; line-height: 1.4; }
.line-card-foot .hours { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); }
