/* Main view; LED basics live in led.css */

:root {
  --fs: clamp(22px, 2.6vw + 6px, 34px);
}

body { min-height: 100vh; }

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.6em max(0.6em, env(safe-area-inset-right)) 1.5em max(0.6em, env(safe-area-inset-left));
}

/* Header line on the display: station and clock */

.top { padding: 0.15em 0; border-bottom: 2px solid var(--led-faint); }
.top-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
h1 { font-size: 1.5em; font-weight: 400; line-height: 1.1; }
.clock { font-size: 1.5em; line-height: 1.1; }

.status {
  display: flex;
  align-items: center;
  gap: 0.35em;
  margin-top: 0.35em;
  font-size: 0.7em;
}
.dot { width: 0.4em; height: 0.4em; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px var(--led-glow); }
.status[hidden] { display: none; }
.status .dot { animation: blink 1.4s steps(2, jump-none) infinite; }

/* Station search */

.search { position: relative; margin-top: 0.5em; font-size: 0.8em; }
.search-input {
  width: 100%;
  padding: 0.3em 0.5em 0.25em;
  border: 2px solid var(--led-faint);
  border-radius: 0.2em;
  background: none;
  color: var(--led);
  font: inherit;
  line-height: 1;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search-input::placeholder { color: var(--led-dim); opacity: 1; }
.search-input:focus { border-color: var(--led); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.2em);
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  list-style: none;
  background: var(--bg);
  border: 2px solid var(--led);
  border-radius: 0.2em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}
.search-heading { padding: 0.4em 0.5em 0.2em; color: var(--led-dim); font-size: 0.85em; }
.search-option { cursor: pointer; padding: 0.35em 0.5em; line-height: 1.1; }
.search-option:hover, .search-option[aria-selected="true"] { background: var(--led); color: var(--bg); }
.search-option.is-current::after { content: " ●"; font-size: 0.7em; vertical-align: middle; }

/* Disruption notices: scrolling line plus an expandable list */

.notices { margin: 0.5em 0 0.7em; }
.notices .ticker { height: 1.1em; padding-top: 0.05em; }
.notice-list { margin-top: 0.3em; font-size: 0.75em; }
.notice-list > summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: 0.15em 0;
  color: var(--led-dim);
}
.notice-list > summary::-webkit-details-marker { display: none; }
.notice-list > summary:hover { color: var(--led); }
.notice-list > summary::after { content: " ▾"; }
.notice-list[open] > summary::after { content: " ▴"; }
.notice-list ul { list-style: none; margin-top: 0.3em; border-top: 1px solid var(--led-faint); }
.notice-list li { border-bottom: 1px solid var(--led-faint); }
.notice-list li summary { cursor: pointer; padding: 0.35em 0; line-height: 1.15; list-style: none; }
.notice-list li summary::-webkit-details-marker { display: none; }
.notice-lines { color: var(--led-dim); }
.notice-text { white-space: pre-line; line-height: 1.2; color: var(--led-dim); padding-bottom: 0.6em; }

/* Line filter: summary button plus a grid with all lines */

.filter { margin: 0.6em 0 0.7em; font-size: 0.8em; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em 0.8em; }
.filter-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.25em 0.6em 0.2em;
  border: 2px solid var(--led-dim);
  border-radius: 0.2em;
  background: none;
  line-height: 1;
}
.filter-toggle::before { content: "Filter:"; color: var(--led-dim); }
.filter-toggle::after { content: "▾"; color: var(--led-dim); }
.filter-toggle[aria-expanded="true"]::after { content: "▴"; }
.filter-toggle:hover { border-color: var(--led); }
.filter-clear {
  cursor: pointer;
  background: none;
  border: 0;
  color: var(--led-dim);
  text-decoration: underline;
  text-decoration-color: var(--led-faint);
  text-underline-offset: 3px;
}
.filter-clear:hover { color: var(--led); }

.filter-panel {
  margin-top: 0.5em;
  padding: 0.5em;
  border: 2px solid var(--led-faint);
  border-radius: 0.2em;
}
.filter-hint { color: var(--led-dim); font-size: 0.85em; margin-bottom: 0.45em; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3em, 1fr));
  gap: 0.35em;
}
.chip {
  cursor: pointer;
  padding: 0.3em 0 0.25em;
  border: 2px solid var(--led-faint);
  border-radius: 0.2em;
  background: none;
  color: var(--led-dim);
  line-height: 1;
}
.chip:hover { color: var(--led); border-color: var(--led-dim); }
.chip[aria-pressed="true"] { background: var(--led); border-color: var(--led); color: var(--bg); }

/* Departure board */

.board { padding: 0.3em 0.4em; border: 2px solid #141414; border-radius: 0.25em; }
.rows { list-style: none; min-height: 6em; }
.placeholder { padding: 1.5em 0; text-align: center; list-style: none; }
.placeholder button, .placeholder a {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
  border-bottom: 2px solid var(--led);
  margin-top: 0.4em;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3em 1em;
  margin-top: 0.8em;
  font-size: 0.7em;
  color: var(--led-dim);
}
.foot a { text-decoration-color: var(--led-faint); text-underline-offset: 3px; }
.foot a:hover { color: var(--led); }

/* Phones: narrower columns, a little more room for destinations */
@media (max-width: 560px) {
  :root { --fs: clamp(19px, 5.6vw, 26px); }
  .page { padding-inline: max(0.4em, env(safe-area-inset-left)) max(0.4em, env(safe-area-inset-right)); }
  .board { padding: 0.25em; border-width: 1px; }
  .dep { grid-template-columns: 1.8em 1fr auto 2.6em; column-gap: 0.25em; }
  h1, .clock { font-size: 1.3em; }
}
