/* Border Delays embed widget, release 3: Direction 1, "calm premium app".
   Pages on other sites load this file, so it is immutable once shipped: to change
   the look, copy it to embed-v4.css and change EMBED_STYLESHEET in worker/embed.js.
   Written for /embed/<crossing> (worker/embed.js); it styles nothing else.

   A white card with a hairline edge, the mark and name in ink, Mona Sans. The
   figures are ink; colour belongs to the status dot beside the word, as on the
   site. The card stays light whatever the page around it does, so it sets no
   prefers-color-scheme rules. It fills the frame it is given, from 280 to 600 px,
   and no part of it is taller than release 2 drew it, so the heights the
   generator suggests still fit. */

@font-face { font-family: "Mona Sans"; font-style: normal; font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; src: url(fonts/mona-sans-latin-v4.woff2) format("woff2"); }
@font-face { font-family: "Mona Sans fallback"; font-weight: 200 500; src: local("Arial"), local("ArialMT"); size-adjust: 104.6%; ascent-override: 104.2%; descent-override: 30.6%; line-gap-override: 0%; }
@font-face { font-family: "Mona Sans fallback"; font-weight: 501 900; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 100.5%; ascent-override: 108.5%; descent-override: 31.8%; line-gap-override: 0%; }

:root {
  color-scheme: light;
  --card: #ffffff;
  --rim: #e3e8e5;
  --ink: #112019;
  --ink-2: #45524b;
  --muted: #5f6b65;
  --sign: #166346;
  --short: #1d966d;
  --short-ink: #007e56;
  --mod: #e59d23;
  --mod-ink: #a25e00;
  --long: #da4d3b;
  --long-ink: #bf4535;
  --old-ink: #5f6a64;
  --focus: #166346;
  --text: "Mona Sans", "Mona Sans fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { background: transparent; }
body {
  margin: 0;
  font: 450 15px/1.35 var(--text);
  color: var(--ink);
  background: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* The card fills the frame, so a taller iframe than the content needs simply
   gives the footer more room to sit at the bottom. */
.board {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--rim);
  border-radius: 16px;
  overflow: hidden;
}

/* The mark and name, in ink: a link to the homepage. Its row and the
   pseudo-element below it make a 44 px target; the row plus the crossing
   name's top padding is the 42 px release 1 measured, so no panel grows. */
.sign {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px 0;
  color: var(--ink);
  font: 650 14px/1 var(--text);
  letter-spacing: -.012em;
  text-decoration: none;
  white-space: nowrap;
}
.sign::after { content: ""; position: absolute; inset: 0 0 -6px; }
.sign:hover { text-decoration: underline; }
.sign svg { width: 20px; height: 20px; flex: none; }
.sign .mark-panel { fill: var(--sign); stroke: none; }
.sign .mark-lane { fill: none; stroke: #fff; stroke-width: 5.6; stroke-linecap: round; stroke-linejoin: round; }

.name {
  margin: 0;
  padding: 4px 14px 8px;
  font: 640 20px/1.2 var(--text);
  font-stretch: 92%;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

/* One block per direction the crossing reports, side by side once there is room. */
.dirs { display: grid; }
.dir { padding: 8px 14px 10px; border-top: 1px solid var(--rim); }
@media (min-width: 480px) {
  .dirs { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .dir + .dir { border-left: 1px solid var(--rim); }
}
.dir-name { margin: 0 0 2px; font: 600 13px/1.3 var(--text); font-stretch: 92%; color: var(--ink-2); }
.lanes { margin: 0; }

/* A lane: its name on the left, its figure on the right. A long name or a long
   state ("Not reported by CBP") wraps the figure under the name instead of
   overflowing. The figure is ink; its status is a dot and a word beside it,
   coloured by data-level, the word the site grades every wait with. An old or
   missing report is grey and says so in words. */
.lane {
  --st: transparent;
  --st-ink: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;
  padding: 2px 0;
}
.lane[data-level="good"] { --st: var(--short); --st-ink: var(--short-ink); }
.lane[data-level="moderate"] { --st: var(--mod); --st-ink: var(--mod-ink); }
.lane[data-level="heavy"] { --st: var(--long); --st-ink: var(--long-ink); }
.lane[data-level="stale"] { --st-ink: var(--old-ink); }
.lane-name { flex: 1 1 5rem; margin: 0; font-size: 15px; font-weight: 520; font-stretch: 92%; color: var(--ink); }
.lane-wait { margin: 0 0 0 auto; text-align: right; }
.wait-value {
  font: 450 28px/1 var(--text);
  font-stretch: 90%;
  letter-spacing: -.025em;
  color: var(--ink);
}
.lane[data-numeric="false"] .wait-value { font-size: 16px; line-height: 1.2; font-weight: 520; letter-spacing: -.01em; font-stretch: 88%; }
.lane[data-numeric="false"][data-level="good"] .wait-value::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--short); vertical-align: .18em; }
.lane[data-level="stale"] .wait-value, .lane[data-level="unknown"] .wait-value, .lane[data-level="neutral"] .wait-value, .lane[data-level="closed"] .wait-value { color: var(--muted); }
.wait-unit { font: 540 13px/1 var(--text); color: var(--ink-2); }
.wait-severity { font: 600 12.5px/1 var(--text); color: var(--st-ink); white-space: nowrap; }
.wait-severity::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--st); vertical-align: .1em; }
.lane[data-level="stale"] .wait-severity::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--old-ink); }

.fresh { margin: 2px 0 0; font: 450 12.5px/1.35 var(--text); font-stretch: 92%; color: var(--muted); }
dd.fresh { flex: 0 0 100%; margin: 0; }

.foot { margin-top: auto; padding: 0 14px 8px; border-top: 1px solid var(--rim); }
.more {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--sign);
  font: 600 14.5px/1.2 var(--text);
  text-decoration: none;
}
.more::before { content: ""; position: absolute; inset: -4px 0; }
.more:hover { text-decoration: underline; }
.legal { margin: 0; font: 450 11px/1.4 var(--text); font-stretch: 92%; color: var(--muted); }
.legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sign:focus-visible { outline-offset: -3px; }

@media (forced-colors: active) {
  .board { border-color: CanvasText; }
  .wait-value, .wait-unit, .wait-severity::before { color: CanvasText; forced-color-adjust: none; }
}
