/* E-Bike Patrol Quick Reference. One page.
   Nothing here hides content: every section is readable with JavaScript off.
   Light and dark follow the phone (prefers-color-scheme). */

@font-face {
  font-family: "Public Sans";
  font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/PublicSans-100-900.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --surf: #ffffff;
  --tint: #f1f3f8;
  --ink: #142b5c;
  --ink-2: #33415c;
  --line: #cfd6e4;
  --edge: #7a88a6;
  --code: #9c4607;
  --fill: #142b5c;
  --on-fill: #ffffff;
  --amber: #fff0c9;
  --amber-bar: #eb6b0a;
  --c-navy: #142b5c;
  --c-blue: #0d5dc0;
  --c-orange: #a84a07;
  --c-green: #1a7f4d;
  --tile-o: #fdece0;
  --focus: #0f70e6;
  --font: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #081226;
    --surf: #0e1c3b;
    --tint: #14264d;
    --ink: #e6ebf5;
    --ink-2: #dbe4fb;
    --line: #3b5088;
    --edge: #6f86b8;
    --code: #ffb27a;
    --fill: #1b3a7a;
    --on-fill: #e6ebf5;
    --amber: #3a2b08;
    --amber-bar: #ffa968;
    --c-navy: #dbe4fb;
    --c-blue: #7db8ff;
    --c-orange: #ffb27a;
    --c-green: #5fe0a0;
    --tile-o: #3a2210;
    --focus: #ffb27a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@supports (font: -apple-system-body) { html { font: -apple-system-body; } } /* follow the iPhone text size */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 1.125rem; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--c-blue); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; }
b { font-weight: 800; }
.c { color: var(--code); }
a.c { text-decoration: underline; text-underline-offset: 2px; padding: 0 4px; margin: 0 -4px; } /* a cite: opens its pop-up (no JS: leginfo) */
@supports (padding-block: 1lh) { a.c { padding-block: calc((1lh - 1em) / 2); margin-block: calc((1em - 1lh) / 2); } } /* taller tap area, its own line only */

/* cite pop-up: the page script places it under its cite; hidden where the Popover API is missing */
.pop:popover-open { display: block; }
.pop {
  display: none; position: absolute; inset: auto; margin: 0; width: min(100% - 32px, 22rem);
  padding: 12px 16px 14px; border: 2px solid var(--code); border-radius: 12px;
  background: var(--surf); color: var(--ink); box-shadow: 0 8px 28px rgb(0 0 0 / .3); font-size: 1rem;
  max-height: calc(100dvh - 32px); overflow: auto;
}
.pop__t { padding-right: 36px; color: var(--code); font-size: 1.125rem; font-weight: 800; }
.pop__e { list-style: none; margin: 4px 0 8px; }
.pop__e li + li { margin-top: 2px; }
.pop__e li:first-child { font-weight: 700; }
.pop__a { display: inline-block; padding: 6px 0; font-weight: 800; }
.pop__x {
  position: absolute; top: 0; right: 0; width: 48px; height: 48px; border: 0; background: none;
  color: var(--ink); font: inherit; font-size: 1.75rem; line-height: 1; cursor: pointer;
}

/* ----------------------------------------------------------------- page */
.page { width: min(100% - 32px, 760px); margin: 0 auto; padding: 20px 0 40px; }
.top { margin: 0 0 20px; text-align: center; }
.top__logo { display: block; width: min(240px, 72%); margin: 0 auto 16px; border-radius: 6px; }
.top h1 { font-size: clamp(1.375rem, 6.4vw, 1.875rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
.top__more { margin-top: 2px; color: var(--ink-2); }
.top__more a { display: inline-block; padding: 10px 0; font-weight: 800; }
/* the date sits on the rule that closes the header */
.top__date { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 1rem; font-weight: 600; }
.top__date::before, .top__date::after { content: ""; flex: 1; height: 3px; border-radius: 2px; background: var(--c-navy); }

/* section = native details */
.sec {
  --ac: var(--c-navy); --bd: var(--c-navy); --bt: var(--surf);
  border: 3px solid var(--ac); border-radius: 14px; background: var(--surf);
  margin: 0 0 12px;
}
.sec--blue   { --ac: var(--c-blue);   --bd: #0f70e6; --bt: #ffffff; }
.sec--orange { --ac: var(--c-orange); --bd: var(--c-orange); --bt: var(--surf); }
.sec--fill   { --ac: #ff9a4d; --bd: #ff9a4d; --bt: #142b5c; background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
@media (prefers-color-scheme: dark) {
  .sec--blue { --bd: var(--c-blue); --bt: #081226; }
  .sec--navy, .search input { border-color: var(--edge); }
}
.sec > summary {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px;
  cursor: pointer; list-style: none; color: var(--ac);
  font-size: 1.2rem; font-weight: 800; line-height: 1.2; letter-spacing: 0.005em;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after {
  content: ""; flex: none; margin-left: auto; width: 11px; height: 11px;
  border-right: 3px solid currentColor; border-bottom: 3px solid currentColor;
  transform: rotate(45deg) translateY(-3px);
}
.sec[open] > summary::after { transform: rotate(-135deg); }
.n {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bd); color: var(--bt); font-size: 1.15rem; font-weight: 800;
}
.t { flex: 1; min-width: 0; }
.sub { display: block; margin-top: 4px; font-size: 1.125rem; font-weight: 700; color: var(--ink); }
.sec--fill .sub { color: var(--on-fill); }
.sec__body { padding: 4px 16px 16px; }
.note { margin-top: 12px; color: var(--ink); }

/* 1 steps and 7 investigation */
.steps { padding-left: 1.6em; }
.steps li { margin: 0 0 10px; padding-left: 4px; }
.steps li::marker { font-weight: 800; }
.inv { list-style: none; }
.inv li { margin: 0 0 10px; }

/* 2 and 5 tiles */
.tiles { display: grid; gap: 12px; }
@media (min-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile {
  --tc: var(--c-navy); --th: var(--c-navy);
  border: 1px solid var(--line); border-top: 6px solid var(--tc); border-radius: 12px;
  background: var(--tint); padding: 10px 16px 14px;
}
.tile--green  { --tc: #21a161; --th: var(--c-green); }
.tile--orange { --tc: #eb6b0a; --th: var(--c-orange); }
.tile--navy   { --tc: #142b5c; --th: var(--c-navy); }
.tile--blue   { --tc: #0f70e6; --th: var(--c-blue); }
@media (prefers-color-scheme: dark) { .tile--navy { --tc: #8aa3d8; } }
.tile__img { display: block; box-sizing: content-box; width: 111px; height: 66px; max-width: 100%; object-fit: contain; margin: 2px auto 6px; }
@media (prefers-color-scheme: dark) { .tile__img { padding: 6px 14px; border-radius: 10px; background: #aab4c8; filter: brightness(.75); } }
.tile h3 { margin-bottom: 8px; text-align: center; font-size: 1.2rem; font-weight: 800; letter-spacing: 0.02em; color: var(--th); }
.tile ul { list-style: disc; padding-left: 1.2em; }
.tile li { margin: 0 0 6px; }
.tiles--o .tile { border: 0; background: var(--tile-o); padding-top: 12px; }
.tiles--o .tile h3 { text-align: left; color: var(--c-orange); }
.tiles--o .tile p { margin: 0 0 8px; }

/* 3 class cards */
.cls { list-style: none; display: grid; gap: 12px; }
.cls li { border: 1px solid var(--line); border-radius: 12px; background: var(--tint); padding: 10px 14px; }
.cls__n { display: block; margin-bottom: 6px; font-size: 1.25rem; color: var(--c-navy); }
.cls dl > div { display: flex; flex-wrap: wrap; gap: 0 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.cls dt { flex: 0 0 7.2em; color: var(--ink-2); font-weight: 600; }
.cls dd { flex: 1 1 9em; }  /* under its name at large text */

/* 4 and 6 stacked rows: situation first, then the code */
.rows { list-style: none; }
.rows li { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rows li:nth-child(odd) { background: var(--tint); }
.rows li[hidden] { display: none; }
.what { display: block; }
.rows--strong .what { font-weight: 800; }
.res { display: block; margin-top: 2px; font-weight: 800; }
.rows--strong .res { font-weight: 500; }
.rows--strong .res .c { font-weight: 800; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 6px; background: #1a7f4d; color: #ffffff; font-weight: 800; }
@media (prefers-color-scheme: dark) { .badge { background: #1f6b45; color: #e6ebf5; } }
.callout { margin-top: 14px; padding: 10px 14px; border-left: 6px solid var(--amber-bar); border-radius: 6px; background: var(--amber); }

/* violations search (inserted by script, so it never shows as a dead control) */
.search { margin: 4px 0 12px; }
.search label { display: block; margin-bottom: 6px; font-weight: 800; }
.search input {
  width: 100%; min-height: 52px; padding: 8px 14px; border: 3px solid var(--c-navy); border-radius: 10px;
  background: var(--surf); color: var(--ink); font: inherit;
}
.search__msg { margin-top: 10px; font-weight: 700; }

/* closing banner, home-screen tip and footer */
.doubt { margin: 24px 0 12px; padding: 16px; border-radius: 14px; background: var(--fill); color: var(--on-fill); font-size: 1.25rem; line-height: 1.35; }
.doubt b { color: #ff9a4d; }
.tip { margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--tint); }
.tip span { display: block; }
.tip span + span { margin-top: 4px; }
.legal { padding-top: 16px; border-top: 2px solid var(--line); color: var(--ink-2); font-size: 1rem; text-align: center; }
