/* ---------- Event Rules as one readable document (rules/list.html, rules/rule.html; decision 2026-10-18) ----------
   Numbered sections with an "In short" lead-in and the full text, a contents list beside them on wide screens and a
   compact "Find a Rule" bar on phones, a print layout, and each rule's own page in the same style. Brand tokens only. */

.rdoc-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; margin: 1.25rem 0 0; color: var(--night-muted); font-size: var(--step--1); }
.rdoc-print { display: inline-flex; align-items: center; min-height: var(--target); color: var(--brand-gold); font-weight: 650; }
.rdoc-print:hover { color: var(--white); }
.rdoc-print-hint { margin-top: 1.5rem; padding: .75rem 1rem; border-radius: var(--radius-md); background: var(--surface-2); }

.rdoc-wrap { display: grid; gap: 1.5rem; padding-top: clamp(1.25rem, 1rem + 1.5vw, 2.5rem); padding-bottom: var(--section); }
.rdoc { min-width: 0; max-width: 46rem; }

/* Contents */
.rdoc-side__label { margin: 0 0 .6rem; font-size: var(--step--2); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.rdoc-toc { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.rdoc-toc li[hidden] { display: none; }
.rdoc-toc a { display: grid; grid-template-columns: 1.9rem 1fr; gap: .35rem; align-items: baseline; min-height: var(--target); padding: .55rem .7rem;
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; line-height: 1.3; font-size: 1rem; border-left: 3px solid transparent; }
.rdoc-toc a:hover { background: var(--surface-2); color: var(--heading); }
.rdoc-toc a[aria-current] { background: var(--surface-2); color: var(--heading); font-weight: 650; border-left-color: var(--brand-orange); }
.rdoc-toc__n { color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 600; }

.rdoc-jump > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.25rem;
  padding: .6rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--heading);
  font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.rdoc-jump > summary::-webkit-details-marker { display: none; }
.rdoc-jump > summary::after { content: ""; flex: none; width: .6rem; height: .6rem; margin: -.25rem .2rem 0 0; border: solid currentColor;
  border-width: 0 2px 2px 0; rotate: 45deg; transition: rotate .2s var(--ease-out); }
.rdoc-jump[open] > summary::after { rotate: 225deg; margin-top: .2rem; }
.rdoc-jump__count { margin-left: auto; font-weight: 500; font-size: var(--step--1); color: var(--text-muted); }
.rdoc-jump__panel { padding: .9rem 0 0; }
.rdoc-search { margin-bottom: 1rem; }
.rdoc-search .search { max-width: none; display: block; }
.rdoc-search input { width: 100%; min-height: 3rem; font-size: 1rem; }
.rdoc-search__status { margin: .5rem 0 0; font-size: var(--step--1); color: var(--text-muted); }
.rdoc-search__status:empty { display: none; }

/* Phones with the script: one compact bar that stays in reach and opens over the page. */
@media (max-width: 61.99rem) {
  .rdoc-wrap.is-enhanced .rdoc-side { position: sticky; top: 4.5rem; z-index: 20; margin-inline: -.25rem; padding: .5rem .25rem;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .rdoc-wrap.is-enhanced .rdoc-jump { position: relative; }
  .rdoc-wrap.is-enhanced .rdoc-jump__panel { position: absolute; left: 0; right: 0; top: calc(100% + .4rem); max-height: calc(100svh - 10rem);
    overflow-y: auto; overscroll-behavior: contain; padding: 1rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
  .rdoc-wrap:not(.is-enhanced) .rdoc-jump__panel { padding: 1rem; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); }
  .rdoc-wrap:not(.is-enhanced) .rdoc-jump[open] > summary { border-radius: var(--radius-md) var(--radius-md) 0 0; }
}

/* Wide screens: the contents sit beside the rules and follow along. */
@media (min-width: 62rem) {
  .rdoc-wrap { grid-template-columns: 18.5rem minmax(0, 1fr); gap: 3.5rem; }
  .rdoc-side > * { position: sticky; top: 6.5rem; max-height: calc(100vh - 8rem); overflow-y: auto; overscroll-behavior: contain; padding-right: .25rem; }
  .rdoc-wrap.is-enhanced .rdoc-jump > summary { display: none; }
  .rdoc-wrap.is-enhanced .rdoc-jump__panel { padding-top: 0; }
  .rdoc-wrap.is-single { grid-template-areas: "side main"; }
  .rdoc-wrap.is-single .rdoc { grid-area: main; }
  .rdoc-wrap.is-single .rdoc-side { grid-area: side; }
}

/* Sections */
.rdoc-sec { scroll-margin-top: 1.5rem; padding: clamp(2rem, 1.6rem + 1.5vw, 3rem) 0; border-top: 1px solid var(--border); }
.rdoc-sec:first-child { padding-top: .5rem; border-top: 0; }
.rdoc-sec[hidden] { display: none; }
@media (min-width: 62rem) { .rdoc-sec { scroll-margin-top: -1.5rem; } }  /* html already has scroll-padding-top: 6rem */
.rdoc-sec__head { display: flex; gap: .9rem; align-items: flex-start; }
.rdoc-num { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin-top: .1rem; border-radius: 50%;
  font: 700 1.1rem/1 var(--font-display); color: var(--heading); font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--brand-gold) 22%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand-gold) 75%, transparent); }
.rdoc-sec__head h2 { margin: 0 0 .3rem; font-size: var(--step-2); line-height: 1.15; letter-spacing: -.015em; }
.rdoc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; margin: 0; font-size: var(--step--1); color: var(--text-muted); }
.rdoc-meta--end { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.rdoc-scope { display: inline-block; padding: .1rem .6rem; border-radius: 999px; background: var(--chip-bg); color: var(--heading); font-weight: 600; }
.rdoc-short { margin: 1.1rem 0 0; padding: .9rem 1.1rem; border-left: 4px solid var(--brand-gold); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--surface-2); font-size: 1.08rem; line-height: 1.55; color: var(--text); }
.rdoc-short b { color: var(--heading); }

/* Rule text: a comfortable measure, larger type, calm lists. */
.rdoc-body { max-width: 68ch; margin-top: 1.25rem; font-size: 1.125rem; line-height: 1.65; overflow-wrap: anywhere; }
.rdoc-body > * + * { margin-top: 1rem; }
.rdoc-body > :first-child { margin-top: 0; }
.rdoc-body p { margin-bottom: 0; }
.rdoc-body :is(h3, h4, h5, h6) { color: var(--heading); line-height: 1.25; margin-top: 1.9rem; margin-bottom: 0; }
.rdoc-body h3 { font-size: var(--step-1); }
.rdoc-body :is(h4, h5, h6) { font-size: 1.125rem; }
.rdoc-body :is(h3, h4, h5, h6) + * { margin-top: .5rem; }
.rdoc-body :is(ul, ol) { padding-left: 1.5rem; margin-bottom: 0; }
.rdoc-body li { padding-left: .2rem; }
.rdoc-body li + li, .rdoc-body li > :is(ul, ol) { margin-top: .5rem; }
.rdoc-body li::marker { color: var(--brand-orange); font-weight: 700; }
.rdoc-body ol ol { list-style-type: lower-alpha; }
.rdoc-body ol ol ol { list-style-type: lower-roman; }
.rdoc-body strong, .rdoc-body b { color: var(--heading); }
.rdoc-body a { color: var(--accent); }
.rdoc-body img { max-width: 100%; height: auto; vertical-align: middle; border-radius: var(--radius-sm); }
.rdoc-body blockquote { margin: 1.25rem 0; padding: .25rem 0 .25rem 1.1rem; border-left: 4px solid var(--brand-orange); color: var(--text-muted); }
.rdoc-body hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
/* The words that make it a requirement (must, never, required…): a quiet underline, not a shout. */
.rdoc-key { font-weight: 650; color: var(--heading); text-decoration: underline; text-decoration-thickness: .14em; text-underline-offset: .2em;
  text-decoration-color: color-mix(in srgb, var(--brand-orange) 55%, transparent); }

.rdoc-sec__foot { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: 1.25rem 0 0; font-size: var(--step--1); }
.rdoc-sec__foot a { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--target); color: var(--text-muted); text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .2em; }
.rdoc-sec__foot a:hover, .rdoc-sec__foot a.is-copied { color: var(--accent); }
.rdoc-sec__foot svg { width: 1.05rem; height: 1.05rem; flex: none; }
.rdoc-empty { padding: 2rem 0; font-size: 1.1rem; }
.rdoc-empty .button { margin-left: .5rem; }
.rdoc-empty[hidden] { display: none; }
.rdoc-end { margin-top: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Each rule's own page */
.rdoc-wrap.is-single .rdoc-sec { padding-top: .5rem; border-top: 0; }
.rdoc-wrap.is-single .rdoc-body { margin-top: 0; }
.rdoc-pager { display: grid; gap: .75rem; margin-top: 1rem; }
@media (min-width: 40rem) { .rdoc-pager { grid-template-columns: 1fr 1fr; } }
.rdoc-pager a { display: grid; gap: .2rem; padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.rdoc-pager a:hover { border-color: var(--brand-orange); box-shadow: var(--shadow); }
.rdoc-pager__next { text-align: right; grid-column: -2; }
.rdoc-pager__dir { font-size: var(--step--1); color: var(--text-muted); font-weight: 600; }
.rdoc-pager__title { font: 700 1.1rem/1.3 var(--font-display); color: var(--heading); }
.rdoc-all .arrow-link { display: inline-flex; align-items: center; min-height: var(--target); margin-top: .5rem; }
@media (max-width: 61.99rem) { .rdoc-wrap.is-single .rdoc-side { padding-top: 2rem; border-top: 1px solid var(--border); } }

/* Print: just the rules, every one of them, in black on white. */
@media print {
  .rdoc-side, .rdoc-hero-meta, .rdoc-pager, .rdoc-search, .rdoc-empty, .rdoc-end, .rdoc-sec__foot, .rdoc-print-hint,
  .page-hero .crumbs, .page-hero nav, .rule-hero__art, .stars { display: none !important; }
  .page-hero { padding: 0 0 .75rem !important; min-height: 0 !important; }
  .page-hero h1 { font-size: 22pt !important; max-width: none; margin: 0 0 .25rem; }
  .page-hero .lede, .page-hero .eyebrow { color: #333 !important; font-size: 10.5pt; }
  .rdoc-wrap { display: block; padding: 0; }
  .rdoc { max-width: none; }
  .rdoc-sec, .rdoc-sec[hidden] { display: block !important; padding: 12pt 0; border-top: 1px solid #999; }
  .rdoc-sec__head { break-after: avoid; }
  .rdoc-sec__head h2 { font-size: 14pt; color: #000; }
  .rdoc-num { background: none; box-shadow: inset 0 0 0 1px #000; color: #000; width: 1.8rem; height: 1.8rem; font-size: 11pt; }
  .rdoc-short { background: none; border-left: 3px solid #000; padding: 4pt 0 4pt 8pt; font-size: 10.5pt; color: #000; }
  .rdoc-body { max-width: none; font-size: 10.5pt; line-height: 1.45; color: #000; }
  .rdoc-body :is(h3, h4, h5, h6) { break-after: avoid; color: #000; }
  .rdoc-body li { break-inside: avoid; }
  .rdoc-body li::marker { color: #000; }
  .rdoc-key, .rdoc-body strong, .rdoc-body b, .rdoc-short b { color: #000; text-decoration: none; }
  .rdoc-meta, .rdoc-scope { color: #333; background: none; padding: 0; }
}
