/* Rules (#302): the rules as numbered articles, each paragraph a clause numbered in the margin;
   the spirit of the game is written on a page of the Guild's book (the home page's ledger, repeated here until it moves into style.css). */
.rules main { padding-block: 0; counter-reset: article; }

.page-head { padding: 3.5rem 0 2.5rem; }
.page-head h1 { font-size: clamp(2.6rem, 6.5vw, 4.4rem); line-height: 1; margin: 0 0 1.75rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 -1px 0 rgba(255, 235, 200, 0.08); }
.articles ol { list-style: none; counter-reset: toc; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.75rem; }
.articles li { counter-increment: toc; }
.articles li::before { content: counter(toc, upper-roman); font: 700 1rem var(--font-heading); color: var(--accent-dark); margin-right: 0.5rem; }
.articles a { color: var(--text-muted); text-decoration-color: rgba(154, 163, 157, 0.35); }
.articles a:hover { color: var(--accent-hover); }

/* One article: its number and title hang in the left column, the clauses read in a 62ch measure */
.article { counter-increment: article; display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 2.5rem;
  padding: 3rem 0; border-top: var(--border-subtle); scroll-margin-top: 1rem; }
.article h2 { font-size: 1.75rem; margin: 0.1rem 0 0; }
.article h2 .no { display: block; font: italic 400 0.95rem/1.4 var(--font-body); color: var(--text-muted); margin-bottom: 0.35rem; }

.clauses { counter-reset: clause; max-width: 62ch; }
.clauses p { counter-increment: clause; position: relative; padding-left: 2.75rem; margin: 0 0 1.1rem; }
.clauses p:last-child { margin-bottom: 0; }
.clauses p::before { content: counter(article) "." counter(clause); position: absolute; left: 0; top: 0.12em;
  font-size: 0.85rem; font-style: italic; color: var(--accent-dark); }
.clauses strong { color: var(--accent); font-weight: 400; font-style: italic; }

/* A page of the Guild's book: ink on parchment, ruled lines, the clause numbers in the red margin */
.ledger { --ink: #2a1f14; --rubric: #7a3a22; --faded: #5c4a33;
  background:
    repeating-linear-gradient(180deg, transparent 0 1.9rem, rgba(42, 31, 20, 0.13) 1.9rem calc(1.9rem + 1px)),
    linear-gradient(90deg, transparent 2.6rem, rgba(122, 58, 34, 0.45) 2.6rem calc(2.6rem + 1px), transparent calc(2.6rem + 1px)),
    #d9ccab;
  color: var(--ink); padding: 1.9rem 1.8rem 1.9rem 0; transform: rotate(-0.5deg); line-height: 1.9rem;
  box-shadow: 0 1.2rem 2.5rem rgba(0, 0, 0, 0.45);
  clip-path: polygon(0 1%, 3% 0, 30% 0.6%, 55% 0, 78% 0.8%, 100% 0, 99.4% 40%, 100% 72%, 99.2% 100%, 70% 99.3%, 41% 100%, 12% 99.2%, 0 100%, 0.6% 60%); }
.ledger p { padding-left: 3.4rem; margin: 0 0 1.9rem; }
.ledger p:last-child { margin-bottom: 0; }
.ledger p::before { left: 0; width: 2.3rem; text-align: right; top: 0; color: var(--rubric); }

@media (max-width: 760px) {
  .page-head { padding: 2rem 0 1.75rem; }
  .page-head h1 { margin-bottom: 1.25rem; }
  .articles ol { flex-direction: column; }
  .article { grid-template-columns: 1fr; gap: 1rem; padding: 2.25rem 0; }
  .clauses p { padding-left: 2.35rem; }
  .ledger { transform: none; padding-right: 1.1rem; }
  .ledger p { padding-left: 2.8rem; }
  .ledger p::before { width: 1.8rem; }
  .ledger { background:
    repeating-linear-gradient(180deg, transparent 0 1.9rem, rgba(42, 31, 20, 0.13) 1.9rem calc(1.9rem + 1px)),
    linear-gradient(90deg, transparent 2.2rem, rgba(122, 58, 34, 0.45) 2.2rem calc(2.2rem + 1px), transparent calc(2.2rem + 1px)), #d9ccab; }
}
