/* /rules/ and the rule pages, on the C2 tokens and type in c2.css.
   The breadcrumb sits in the rail (3fr), as the roman numerals do on the
   homepage; everything else reads in the body column (9fr). */

.doc {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  column-gap: 48px;
  align-items: start;
  padding-top: clamp(40px, 6vw, 96px);
  padding-bottom: clamp(72px, 9vw, 140px);
}
.doc > * { grid-column: 2; }
.doc > .crumbs { grid-column: 1; grid-row: 1; }

/* Prose stays at a readable measure inside the wide column. */
.doc p, .doc ul, .doc ol, .doc h3, .doc .answer, .doc .case { max-width: 40em; }

/* ---------- Head of the page ---------- */
.crumbs { font-family: var(--engraved); text-transform: uppercase; letter-spacing: .24em; font-size: 12px; line-height: 1.6; color: var(--ink-3); padding-top: 14px; }
.doc .crumbs a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
.doc .crumbs a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.crumbs span { margin: 0 8px; }
.doc h1 { font-size: clamp(40px, 5vw, 76px); margin: 0 0 20px; max-width: 18ch; }
.meta { font-style: italic; font-size: 17px; line-height: 1.5; color: var(--ink-2); margin: 0 0 44px; }

/* ---------- In short ---------- */
.answer { border: 1px solid var(--rule); background: var(--quiet-card); padding: 26px 30px 12px; margin: 0 0 16px; }
.doc .answer h2 { font-family: var(--engraved); font-weight: 400; text-transform: uppercase; letter-spacing: .28em; font-size: 12px; line-height: 1.6; color: var(--ink-3); border: 0; padding: 0; margin: 0 0 12px; max-width: none; }
.doc .answer p { font-size: 21px; line-height: 1.55; color: var(--ink); }

/* ---------- Sections ---------- */
.doc h2 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.12; margin: 64px 0 22px; padding-top: 30px; border-top: 1px solid var(--rule); max-width: 40em; text-wrap: balance; }
.doc h3 { font-size: clamp(22px, 1.9vw, 26px); line-height: 1.3; margin: 34px 0 10px; }
.doc p { color: var(--ink-2); }
.doc p strong, .doc li strong { color: var(--ink); font-weight: 500; }
:where(.doc) a:not(.eng) { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: var(--ink-3); }
:where(.doc) a:not(.eng):hover { text-decoration-color: var(--ink); }
.doc cite { font-style: italic; }

ul.plain, ol.plain { color: var(--ink-2); padding-left: 1.2em; margin: 0 0 20px; }
ul.plain li, ol.plain li { margin: 0 0 10px; padding-left: 4px; }
ul.plain li::marker, ol.plain li::marker { color: var(--ink-3); }

/* ---------- Tables: they scroll sideways on a phone, and the region takes focus ---------- */
.table-wrap { overflow-x: auto; margin: 8px 0 24px; -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; }
.doc table { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: 17px; line-height: 1.5; }
.doc th { font-family: var(--engraved); font-weight: 400; text-transform: uppercase; letter-spacing: .2em; font-size: 11px; line-height: 1.6; color: var(--ink-3); text-align: left; vertical-align: bottom; padding: 0 20px 12px 0; border-bottom: 1px solid var(--rule); }
.doc td { text-align: left; vertical-align: top; padding: 14px 20px 14px 0; border-bottom: 1px solid var(--rule-2); color: var(--ink-2); }
.doc td:first-child { color: var(--ink); }

/* ---------- Disputed cases ---------- */
.case { border-top: 1px solid var(--rule); padding: 28px 0 12px; }
.case + .case { border-top-color: var(--rule-2); }
.doc .case h3 { font-style: italic; font-weight: var(--display-weight); font-size: clamp(24px, 2.2vw, 30px); margin: 0 0 12px; }

/* ---------- Map plates: engraved silhouettes in --ink, neighbours faint (maps.svg) ---------- */
.emblem { display: block; width: 100%; height: auto; color: var(--ink); }

/* A rule page: its plate sits in the rail under the breadcrumb and stays in view. */
.doc > .rule-plate { grid-column: 1; grid-row: 2 / span 200; align-self: start; position: sticky; top: 32px; margin-top: 40px; }
.rule-plate .mark { padding: 18px; }

/* /rules/: the overview plate runs the full width, and each numeral links to its rule. */
.doc > .world-plate { grid-column: 1 / -1; margin: 48px 0 8px; }
.world-plate .mark { padding: clamp(10px, 2vw, 30px); }
.world { display: block; width: 100%; height: auto; }
.map-grat { fill: none; stroke: var(--rule-2); stroke-width: 1; }
.map-land { fill: var(--ink); fill-opacity: .12; }
.map-hl { fill: var(--ink); fill-opacity: .8; }
.map-lead { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.map-dot { fill: var(--ink); }
.map-seal { fill: var(--mat); stroke: var(--ink); stroke-width: 1; transition: fill .2s ease; }
.world text { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 25px; fill: var(--ink); transition: fill .2s ease; }
.map-mark:hover .map-seal, .map-mark:focus-visible .map-seal { fill: var(--ink); }
.map-mark:hover text, .map-mark:focus-visible text { fill: var(--mat); }
.map-mark:focus-visible { outline: none; }
.map-mark:focus-visible .map-seal { stroke-width: 3; }

/* /rules/: the five rules as plate cards. */
.doc .rule-cards { list-style: none; padding: 0; margin: 8px 0 0; max-width: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.rule-cards li { border: 1px solid var(--rule); background: var(--mat); display: flex; flex-direction: column; padding-bottom: 20px; }
.doc .rule-cards a { display: flex; flex-direction: column; gap: 6px; padding: 0 22px; color: var(--ink); text-decoration: none; }
.card-plate { display: block; margin: 0 -22px 14px; border-bottom: 1px solid var(--rule-2); }
.card-num { font-style: italic; font-weight: var(--display-weight); font-size: 28px; line-height: 1; color: var(--ink-3); }
.card-name { font-size: clamp(21px, 1.8vw, 24px); line-height: 1.3; }
.doc .rule-cards a:hover .card-name, .doc .rule-cards a:focus-visible .card-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.card-note { padding: 6px 22px 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; }

/* ---------- Sources and the closing note ---------- */
.sources { color: var(--ink-2); font-size: 16px; line-height: 1.55; padding-left: 1.2em; }
.sources li { margin: 0 0 10px; }
.sources li::marker { color: var(--ink-3); }
.doc .disclaimer { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--rule); font-style: italic; font-size: 16px; color: var(--ink-3); }

footer ul { flex-wrap: wrap; gap: 12px 28px; }

@media (max-width: 900px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc > *, .doc > .crumbs, .doc > .rule-plate { grid-column: 1; grid-row: auto; }
  .doc > .rule-plate { position: static; max-width: 260px; margin: 0 0 28px; }
  .doc > .world-plate { margin-top: 36px; }
  .crumbs { padding-top: 0; margin-bottom: 18px; }
  .doc h2 { margin-top: 48px; }
}
@media (max-width: 600px) {
  .answer { padding: 20px 20px 6px; }
  .doc .answer p { font-size: 19px; }
}
