/* The offence page in the night shift order (scripts/generate-offence-pages.py, night_page();
   the pages are listed in seo/offence-page-template.json). Every other offence page keeps
   section-offence.css. Colours and sizes come from section-tokens.css.

   Desktop: a main column and a right-hand rail (Key facts beside Points to prove, the
   contents box beside the law). Phone: one column, the contents as one row of chips that
   scrolls sideways, then Points to prove, the app strip and Key facts. No script needed. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--s-bg); }
body {
  margin: 0;
  font-family: var(--s-f);
  color: var(--s-ink);
  background: var(--s-bg);
  line-height: var(--s-t-wbody-lh);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.ox a:focus-visible,
.ox summary:focus-visible {
  outline: var(--s-focus-w) solid var(--s-accent-t);
  outline-offset: 2px;
}

/* The title band */
.sx-ref .ox-hero {
  padding: 40px 0 44px;
  background: var(--s-w-hero);
  border-bottom: var(--s-w-head-b);
  color: var(--s-w-hero-ink);
}
.ox-crumb {
  margin: 0 0 18px;
  color: var(--s-w-hero-ink2);
  font-size: var(--s-t-sub-size);
  line-height: var(--s-t-sub-lh);
}
.ox-crumb a { color: var(--s-link); }
.sx-ref .ox .eyebrow {
  color: var(--s-accent-t);
  font-family: var(--s-f);
  font-size: var(--s-t-lab-size);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: anywhere;
}
.sx-ref .ox h1 {
  margin: 10px 0 16px;
  max-width: 900px;
  font-size: var(--s-t-wh1-size);
  line-height: var(--s-t-wh1-lh);
  letter-spacing: var(--s-tr-h1);
  overflow-wrap: break-word;
}
.ox .lead {
  max-width: 770px;
  margin: 0;
  color: var(--s-w-hero-ink2);
  font-size: var(--s-t-wlead-size);
  line-height: var(--s-t-wlead-lh);
}

/* On this page: chips on a phone, a box in the rail on a desktop */
.ox-label {
  margin: 0 0 10px;
  color: var(--s-ink3);
  font-size: var(--s-t-lab-size);
  line-height: var(--s-t-lab-lh);
  font-weight: 600;
}
.ox-chips ul,
.ox-toc ul { list-style: none; margin: 0; padding: 0; }
.ox-chips { display: none; }
.ox-toc {
  grid-area: toc;
  align-self: start;
  position: sticky;
  top: 92px;
  padding: 20px 22px;
  background: var(--s-card);
  border: var(--s-card-b);
  border-radius: var(--s-r);
}
.ox-toc .ox-label { color: var(--s-ink); font-size: var(--s-t-h3-size); line-height: var(--s-t-h3-lh); font-weight: 700; }
.ox-toc a {
  display: inline-block;
  padding: 5px 0;
  color: var(--s-link);
  font-size: var(--s-t-sub-size);
  line-height: var(--s-t-sub-lh);
}

/* The grid */
.ox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas:
    "ptp facts"
    "strip strip"
    "main toc";
  gap: 28px 48px;
  padding-top: 36px;
  padding-bottom: 72px;
}
.ox-ptp { grid-area: ptp; }
.ox-strip { grid-area: strip; }
.ox-facts { grid-area: facts; align-self: start; }
.ox-main { grid-area: main; min-width: 0; }

.ox h2 {
  margin: 40px 0 16px;
  font-size: var(--s-t-wh2-size);
  line-height: var(--s-t-wh2-lh);
  letter-spacing: var(--s-tr-h2);
}
.ox-ptp h2,
.ox-main > section:first-child h2,
.ox-facts h2 { margin-top: 0; }
.ox h3 {
  margin: 22px 0 6px;
  font-size: var(--s-t-h3-size);
  line-height: var(--s-t-h3-lh);
}
.ox-main p,
.ox-main li { color: var(--s-ink2); font-size: var(--s-t-wbody-size); line-height: var(--s-t-wbody-lh); }
.ox-main strong { color: var(--s-ink); }
.ox-main ul { padding-left: 22px; }

/* Points to prove: numbered */
.ox .ptp-list { list-style: none; margin: 0; padding: 0; }
.ox .ptp-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 12px;
  color: var(--s-ink);
  font-size: var(--s-t-wbody-size);
  line-height: var(--s-t-wbody-lh);
}
.sx-ref .ox .ptp-list strong {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  margin-top: 2px;
  border-radius: var(--s-r-bars);
  background: var(--s-n-bg);
  color: var(--s-n-ink);
  font-family: var(--s-fm);
  font-size: var(--s-t-code-size);
  line-height: var(--s-t-btn-lh);
}

/* Key facts */
.ox-facts {
  padding: 20px 22px;
  background: var(--s-card);
  border: var(--s-card-b);
  border-radius: var(--s-r);
}
.ox-facts h2 { font-size: var(--s-t-h3-size); line-height: var(--s-t-h3-lh); letter-spacing: 0; }
.ox-facts dl { margin: 0; }
.ox-facts dl > div { padding: 10px 0; border-top: var(--s-rule); }
.ox-facts dl > div:first-child { border-top: 0; padding-top: 0; }
.ox-facts dt { color: var(--s-ink3); font-size: var(--s-t-lab-size); line-height: var(--s-t-lab-lh); font-weight: 600; }
.ox-facts dd { margin: 4px 0 0; color: var(--s-ink); font-size: var(--s-t-sub-size); line-height: var(--s-t-sub-lh); }

/* The app strip: today's inline sentence and the two store buttons, small */
.ox-strip .section-dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0;
  padding: 10px 12px 10px 18px;
}
.ox-strip .section-dl .section-dl-line {
  margin: 0;
  font-size: var(--s-t-sub-size);
  line-height: var(--s-t-sub-lh);
  font-weight: 600;
}
.ox-strip .section-dl-stores { gap: 8px; }
.ox-strip a.section-dl-btn {
  min-height: 44px;
  padding: 8px 14px;
  font-size: var(--s-t-lab-size);
  font-weight: 700;
}

/* What the law says: the card's quote, one thin outline all the way round */
.ox-law {
  margin: 0 0 14px;
  padding: 16px 18px;
  background: var(--s-card);
  border: var(--s-hl-w) solid var(--s-hl);
  border-radius: var(--s-r);
}
.ox-law p { margin: 0 0 8px; color: var(--s-ink); font-size: var(--s-t-read-size); line-height: var(--s-t-read-lh); }
.ox-law p:last-child { margin-bottom: 0; }
.ox-main .ox-law .ox-law-head { color: var(--s-accent-t); font-weight: 600; }
.ox-law .ox-in1 { padding-left: 16px; }
.ox-law .ox-in2 { padding-left: 32px; }
.ox-law .ox-in3 { padding-left: 48px; }

/* Target offence (attempt cards): the card's stored wording, not a quote, so no outline */
.ox-target { margin: 0 0 14px; }
.ox-target p { margin: 0 0 8px; color: var(--s-ink2); font-size: var(--s-t-read-size); line-height: var(--s-t-read-lh); }
.ox-main .ox-target .ox-law-head { color: var(--s-ink); font-weight: 600; }
.ox-target .ox-in1 { padding-left: 16px; }
.ox-target .ox-in2 { padding-left: 32px; }
.ox-target .ox-in3 { padding-left: 48px; }

/* The card's quoted sentence above the penalty line */
.ox-law[data-ox="sentence"] + .ox-law[data-ox="sentence"] { margin-top: 0; }

/* How the law applies */
.ox-note { margin: 0 0 18px; }
.ox-note h3 { margin-top: 0; }
.ox-note p { margin: 0; }
.ox-main .ox-note .ox-auth { margin-top: 6px; color: var(--s-ink3); font-size: var(--s-t-sub-size); line-height: var(--s-t-sub-lh); }

/* CJS codes: six, then the rest behind "Show all" */
.ox-main .ox-sub { margin: -8px 0 12px; color: var(--s-ink3); font-size: var(--s-t-sub-size); line-height: var(--s-t-sub-lh); }
.ox .letters,
.ox .ox-more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ox .letters { border: var(--s-card-b); border-radius: var(--s-r); background: var(--s-card); overflow: hidden; }
.ox .ox-more { grid-column: 1 / -1; }
.ox .letter { padding: 12px 16px; border-top: var(--s-rule); }
.ox .letters > .letter:nth-child(-n+2) { border-top: 0; }
.ox .letters > .letter:only-child { grid-column: 1 / -1; }
.sx-ref .ox .letter b {
  display: block;
  margin-bottom: 2px;
  color: var(--s-accent-t);
  font-family: var(--s-fm);
  font-size: var(--s-t-code-size);
  letter-spacing: 0.06em;
}
.ox .letter span { color: var(--s-ink2); font-size: var(--s-t-sub-size); line-height: var(--s-t-sub-lh); }
.ox .ox-more summary {
  grid-column: 1 / -1;
  min-height: 44px;
  padding: 12px 16px;
  border-top: var(--s-rule);
  color: var(--s-link);
  font-size: var(--s-t-sub-size);
  line-height: var(--s-t-sub-lh);
  font-weight: 600;
  cursor: pointer;
}
.ox .ox-more[open] summary { display: none; }

/* Sources, the date, related offences */
.ox .source-list a { color: var(--s-link); overflow-wrap: anywhere; }
.ox-main .ox-checked { margin-top: 8px; color: var(--s-ink3); font-size: var(--s-t-sub-size); line-height: var(--s-t-sub-lh); }
.ox-main .ox-related { list-style: none; padding: 0; margin: 0; }
.ox-related li { padding: 10px 0; border-top: var(--s-rule); }
.ox-related li:first-child { border-top: 0; }
.ox-related a { color: var(--s-link); }
.ox-role {
  display: block;
  color: var(--s-ink3);
  font-size: var(--s-t-lab-size);
  line-height: var(--s-t-lab-lh);
  font-weight: 600;
}
.ox-main .ox-code { margin-left: 8px; color: var(--s-ink3); font-family: var(--s-fm); font-size: var(--s-t-code-size); }
.ox-main .section-dl[data-cta="end"] { margin-top: 0; }

@media (max-width: 900px) {
  .ox-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "ptp" "strip" "facts" "main";
    gap: 24px;
    padding-top: 20px;
  }
  .ox-toc { display: none; }
  .ox-chips { display: block; padding-top: 18px; }
  .ox-chips ul {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }
  .ox-chips li { flex: 0 0 auto; }
  .ox-chips a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: var(--s-btn2-b);
    border-radius: var(--s-r-pill);
    color: var(--s-ink);
    font-size: var(--s-t-sub-size);
    line-height: var(--s-t-sub-lh);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }
  .ox-facts dl > div { display: grid; grid-template-columns: 40% minmax(0, 1fr); gap: 12px; }
  .ox-facts dd { margin: 0; }
}

@media (max-width: 640px) {
  .sx-ref .ox-hero { padding: 22px 0 26px; }
  .ox-crumb { margin-bottom: 10px; }
  .ox .letters,
  .ox .ox-more { grid-template-columns: minmax(0, 1fr); }
  .ox .letters > .letter:nth-child(2) { border-top: var(--s-rule); }
  .ox-strip .section-dl { padding: 12px 14px; }
}
