/* Shared theme for the py-nycmta docs site — MTA signage inspired. */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #555555;
  --card: #f5f5f5;
  --border: #dddddd;
  --link: #0039a6;
  --code-bg: #1a1a1a;
  --code-fg: #f5f5f5;
  --accent: #fccc0a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #ececec;
    --muted: #a0a0a0;
    --card: #1c1c1e;
    --border: #333333;
    --link: #8ab4f8;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
}

a {
  color: var(--link);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---- Header: black station-sign bar ---- */

.site-header {
  background: #000;
  color: #fff;
  padding: 1rem 0 1.1rem;
}

.site-header .container {
  border-top: 3px solid #fff; /* the white rule along the top of MTA signs */
  padding-top: 0.9rem;
}

.site-header h1 {
  margin: 0 0 0.2rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.site-header .badges {
  display: inline-flex;
  gap: 0.25rem;
}

.site-header nav {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.site-header nav a {
  color: #fff;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

.tag-unofficial {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  vertical-align: middle;
}

/* ---- Line badges (subway bullets) ---- */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  flex: none;
}

.ln-123 { background: #ee352e; }
.ln-456 { background: #00933c; }
.ln-7   { background: #b933ad; }
.ln-ace { background: #0039a6; }
.ln-bdfm { background: #ff6319; }
.ln-g   { background: #6cbe45; }
.ln-jz  { background: #996633; }
.ln-l   { background: #a7a9ac; }
.ln-nqrw { background: #fccc0a; color: #000; }
.ln-s   { background: #808183; }
.ln-sir {
  background: #0039a6;
  width: auto;
  border-radius: 0.8em;
  padding: 0 0.5em;
  font-size: 0.75rem;
}

.badge.not-queryable {
  opacity: 0.45;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

/* ---- Sections ---- */

main.container {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

section {
  margin-bottom: 2.5rem;
}

h2 {
  font-size: 1.35rem;
  border-bottom: 4px solid var(--fg);
  padding-bottom: 0.3rem;
  margin: 2rem 0 1rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

.lede {
  font-size: 1.1rem;
  max-width: 44rem;
}

.fact-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.fact-chip {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
}

.base-url {
  font-size: 0.95rem;
  color: var(--muted);
}

.base-url code {
  color: var(--fg);
  font-size: 1.05rem;
}

/* ---- Code ---- */

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.5;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

:not(pre) > code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.08em 0.35em;
}

/* ---- Tables ---- */

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: var(--muted);
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.75rem 0.55rem 0;
  vertical-align: top;
}

tbody tr:hover {
  background: var(--card);
}

tr.highlight td {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg));
}

.method {
  display: inline-block;
  background: #00933c;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.endpoint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 1rem;
}

/* ---- Try-it widget ---- */

.try-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.try-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}

.try-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.try-form label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.try-form select,
.try-form input {
  font: inherit;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  min-width: 5.5rem;
}

.try-form input {
  width: 6.5rem;
  text-transform: uppercase;
}

.try-form button[type="submit"] {
  font: inherit;
  font-weight: 700;
  background: #000;
  color: #fff;
  border: 2px solid #000;
  border-radius: 4px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .try-form button[type="submit"] {
    background: #fff;
    color: #000;
    border-color: #fff;
  }
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 0.3rem;
}

.preset {
  font: inherit;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}

.preset:hover {
  border-color: var(--fg);
}

/* ---- Notices ---- */

.notice {
  border-left: 5px solid var(--accent);
  background: var(--card);
  padding: 0.7rem 0.9rem;
  border-radius: 0 6px 6px 0;
  margin: 0.8rem 0;
}

.notice.error {
  border-left-color: #ee352e;
}

/* ---- Stations page controls ---- */

.sticky-controls {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
  padding: 0.8rem 0 0.6rem;
  border-bottom: 1px solid var(--border);
}

#station-search {
  font: inherit;
  width: 100%;
  max-width: 26rem;
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--fg);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
  align-items: center;
}

.chip {
  font: inherit;
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.3rem;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  border-color: var(--fg);
  box-shadow: 0 0 0 2px var(--fg);
}

.chip-clear {
  font: inherit;
  font-size: 0.85rem;
  background: none;
  border: none;
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
  padding: 0.15rem 0.4rem;
}

#match-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: auto;
}

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 0 2.5rem;
}

.site-footer p {
  margin: 0.35rem 0;
}

/* ---- Small screens ---- */

@media (max-width: 640px) {
  th, td {
    padding: 0.4rem 0.5rem 0.4rem 0;
    font-size: 0.88rem;
  }

  .site-header h1 {
    font-size: 1.3rem;
  }

  pre {
    font-size: 0.8rem;
  }
}
