/* ---------- rules page ---------- */
.rules-layout {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px;
  max-width: 1200px; margin: 0 auto; padding: 22px 20px 80px;
}

/* contents */
.rules-toc {
  position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto;
  font-size: 14px; padding-right: 6px;
}
.toc-ch { margin: 0 0 16px; }
.toc-ch > a {
  display: block; font: 400 22px/1.1 var(--display); letter-spacing: .04em; color: var(--ink);
  text-decoration: none; margin-bottom: 6px;
}
.toc-ch > a small { color: var(--red-ink); margin-right: 6px; }
.toc-ch ul { list-style: none; margin: 0; padding: 0; }
.toc-ch li a {
  display: block; padding: 4px 10px; border-left: 2px solid var(--line); color: var(--ink-2); text-decoration: none;
}
.toc-ch li a:hover { color: var(--ink); border-left-color: var(--ink-3); }
.toc-ch li a.on { color: var(--red-ink); border-left-color: var(--red); font-weight: 600; }
.toc-ch li ul { display: none; }
.toc-ch li.open ul { display: block; }
.toc-ch li li a { padding-left: 22px; font-size: 13px; }

.toc-mobile { display: none; }

/* body */
.rules-body { max-width: 72ch; }
.ch-head { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 3px solid var(--red); }
.ch-head + * { margin-top: 0; }
.rules-chapter + .rules-chapter { margin-top: 56px; }
.ch-num {
  display: inline-grid; place-items: center; width: 38px; height: 38px; margin-right: 10px; vertical-align: 6px;
  background: var(--red); color: #fff; font: 400 26px/1 var(--display);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
.ch-title { margin: 0; font: 400 46px/1 var(--display); letter-spacing: .03em; }
.ch-src { margin: 6px 0 0; color: var(--ink-3); font-size: 13px; }

.rules-body h2 {
  font: 400 30px/1.1 var(--display); letter-spacing: .04em; margin: 34px 0 10px;
  padding-bottom: 4px; border-bottom: 2px solid var(--red); scroll-margin-top: 90px;
}
.rules-body h3 { font: 700 18px/1.3 var(--text); color: var(--red-ink); margin: 22px 0 6px; scroll-margin-top: 90px; }
.rules-body h2 .pg, .rules-body h3 .pg { font: 500 12px/1 var(--text); color: var(--ink-3); letter-spacing: 0; margin-left: 8px; }
.rules-body p, .rules-body li { font-family: "Source Serif 4", Georgia, serif; font-size: 16.5px; line-height: 1.6; }
.rules-body p { margin: 0 0 10px; }
.rules-body ul, .rules-body ol { margin: 0 0 12px; padding-left: 24px; }
.rules-body ul li::marker { color: var(--red); }
.rules-body ol li::marker { color: var(--red-ink); font-weight: 700; font-family: var(--text); }
.rules-body li { margin: 3px 0; }

.rx {
  margin: 12px 0 14px; padding: 10px 14px 4px; background: var(--chip); border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
}
.rx p { font-style: italic; font-size: 15.5px; }
.rx-tag {
  display: block; font: 700 11px/1 var(--text); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px; font-style: normal;
}
figure.rfig, figure.rtab { margin: 12px 0 16px; }
figure.rfig img { display: block; max-width: min(100%, 360px); height: auto; border-radius: 6px; background: #fff; }
figure.rtab img { display: block; max-width: 100%; height: auto; border-radius: 6px; background: #fff; box-shadow: var(--shadow); }
figure.rtab figcaption, .rtable caption {
  font: 700 12px/1 var(--text); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 8px; text-align: left;
}
.rtable { border-collapse: collapse; margin: 12px 0 6px; font-size: 14px; min-width: 60%; }
.rtable th { background: var(--red); color: #fff; text-align: left; padding: 6px 10px; font-weight: 600; }
.rtable td { padding: 6px 10px; border-bottom: 1px solid var(--line); }
.rtable-note { font-size: 13px; color: var(--ink-3); margin: 0 0 14px !important; font-family: var(--text) !important; }
.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 30% { background: var(--sel); box-shadow: 0 0 0 6px var(--sel); } 100% { background: transparent; box-shadow: none; } }

/* search results */
.rules-results { max-width: 72ch; }
.rr-meta { color: var(--ink-3); font-size: 13px; margin: 0 0 10px; }
.rr { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rr button {
  display: block; width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; cursor: pointer;
}
.rr button:hover, .rr button:focus-visible { border-color: var(--red); outline: none; }
.rr-path { font-size: 12px; font-weight: 700; color: var(--red-ink); text-transform: uppercase; letter-spacing: .05em; }
.rr-snip { margin-top: 3px; font-family: "Source Serif 4", Georgia, serif; font-size: 15px; color: var(--ink-2); }
.rr mark { background: var(--gold); color: #000; border-radius: 2px; padding: 0 1px; }
.rr-empty { color: var(--ink-2); padding: 12px 0; }

@media (max-width: 860px) {
  .rules-layout { grid-template-columns: 1fr; padding: 14px 16px 60px; gap: 0; }
  .rules-toc { display: none; }
  .toc-mobile {
    display: block; margin: 0 0 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 14px;
  }
  .toc-mobile summary { font-weight: 700; cursor: pointer; }
  .toc-mobile .toc-ch { margin-top: 12px; }
  .toc-mobile .toc-ch li ul { display: block; }
  .ch-title { font-size: 38px; }
  .rules-body p, .rules-body li { font-size: 16px; }
}
