/* /rules: the league rulebook. Left column = search + section list (sticky), right = the rules. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rules-wrap { max-width: 1240px; margin: 0 auto; }
.rules-head { margin-bottom: 22px; }
.rules-head .kicker-tag { display: table; margin: 12px 0 6px; }
.rules-head h1 { font-size: clamp(34px, 5.4vw, 62px); line-height: 1; margin: 10px 0 8px; }
.rules-summary { font-size: 18px; font-weight: 600; margin: 0 0 10px; color: var(--muted); }
.rules-head .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rules-print { font: inherit; text-transform: none; letter-spacing: 0; font-weight: 800; font-size: 13px; color: var(--red, #c33533); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.rules-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.rules-side { position: sticky; top: calc(84px + var(--safe-t, 0px)); max-height: calc(100vh - 100px - var(--safe-t, 0px)); display: flex; flex-direction: column; gap: 12px; background: var(--card); color: var(--text); border: var(--border); border-radius: 20px; box-shadow: var(--pop); padding: 14px; }
.rules-search input { width: 100%; box-sizing: border-box; font: inherit; font-weight: 600; font-size: 16px; padding: 11px 13px; border: 2.5px solid var(--text, #141414); border-radius: 12px; background: #fff; color: #141414; }
.rules-search input:focus { outline: 3px solid var(--red, #c33533); outline-offset: 1px; }
.rules-hits { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 800; font-size: 14px; }
.rules-hits[hidden] { display: none; }
.rules-hits span { flex: 1; }
.rules-hits button { width: 34px; height: 30px; border-radius: 9px; border: 2px solid var(--text, #141414); background: var(--card-2, #eee); color: var(--text); font-weight: 900; cursor: pointer; }
.rules-hits button:disabled { opacity: .4; cursor: default; }
.rules-toc { min-height: 0; display: flex; flex-direction: column; }
.rules-toc summary { font-weight: 900; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--muted); cursor: pointer; padding: 2px 2px 6px; list-style: none; }
.rules-toc summary::-webkit-details-marker { display: none; }
.rules-toc nav { overflow-y: auto; min-height: 0; max-height: calc(100vh - 250px); margin: 0 -6px; padding: 0 6px; }
.rules-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rules-toc a { display: flex; gap: 8px; align-items: baseline; padding: 7px 9px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.25; }
.rules-toc a:hover { background: var(--card-2, #eee); }
.rules-toc a.active { background: var(--yellow, #ffd400); color: #141414; }
.rules-toc a.dim { opacity: .35; }
.toc-num { flex: none; min-width: 22px; font-weight: 900; color: var(--red, #c33533); }
.rules-toc a.active .toc-num { color: #141414; }
.toc-t { flex: 1; }
.toc-n { flex: none; font-size: 12px; background: var(--red, #c33533); color: #fff; border-radius: 999px; padding: 1px 7px; }

.rules-body { font-size: 17px; line-height: 1.65; font-weight: 500; overflow-wrap: anywhere; padding: clamp(18px, 4vw, 44px); }
.rule-sec { scroll-margin-top: calc(90px + var(--safe-t, 0px)); padding-bottom: 8px; }
.rule-sec + .rule-sec { border-top: 2px dashed var(--line, #ddd); padding-top: 18px; }
.rule-sec[hidden] { display: none; }
.rule-sec h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.15; margin: 4px 0 12px; display: flex; gap: 12px; align-items: baseline; }
.rule-num { flex: none; display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px; box-sizing: border-box; border-radius: 12px; background: var(--red, #c33533); color: #fff; font-size: 22px; }
.rules-body p { margin: 0 0 1em; }
.rule-clause { scroll-margin-top: calc(100px + var(--safe-t, 0px)); padding-left: 52px; text-indent: -52px; }
.clause-num { display: inline-block; width: 46px; text-indent: 0; font-weight: 900; color: var(--red, #c33533); text-decoration: none; }
.rules-table { overflow-x: auto; margin: 4px 0 18px; border: var(--border); border-radius: 14px; }
.rules-table table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.4; }
.rules-table th { text-align: left; background: var(--text, #141414); color: var(--card, #fff); font-weight: 800; padding: 9px 12px; }
.rules-table td { padding: 8px 12px; border-top: 1px solid var(--line, #ddd); vertical-align: top; }
.rules-table tr:nth-child(even) td { background: var(--card-2, #f3f3f3); }
.rules-body mark { background: #ffe14d; color: #141414; border-radius: 3px; padding: 0 1px; scroll-margin-top: 140px; }
.rules-body mark.current { background: #ff8a3d; outline: 2px solid #141414; }
.rules-none { font-weight: 700; color: var(--muted); }

@media (max-width: 900px) {
  .rules-layout { grid-template-columns: 1fr; gap: 14px; }
  .rules-side { top: calc(64px + var(--safe-t, 0px)); z-index: 5; max-height: none; padding: 10px; }
  .rules-toc nav { max-height: 46vh; }
  .rules-toc summary { padding-bottom: 0; }
  .rules-toc[open] summary { padding-bottom: 6px; }
  .rules-toc summary::after { content: " ▾"; }
  .rule-clause { padding-left: 0; text-indent: 0; }
  .clause-num { width: auto; margin-right: 4px; }
}

@media print {
  .site-nav, .site-foot, .rules-side, .rules-print, .back-link { display: none !important; }
  .page-main { padding-top: 0; }
  .rules-layout { display: block; }
  .rules-head, .rules-body { box-shadow: none; border: 0; padding: 0; }
  .rule-sec[hidden] { display: block; }
  .rule-sec { break-inside: auto; }
  .rules-table { break-inside: avoid; }
}
