/* ==========================================================================
   WATL — Document posts (.watl-doc)
   --------------------------------------------------------------------------
   Reusable vocabulary for "reference document" posts: WATL procedure /
   rule-change / testing-notice articles pasted into a post as Gutenberg
   blocks. Enqueued by inc/post-doc.php only when the singular content
   actually contains `watl-doc`, and injected into the block editor by the
   same file so the editor preview matches.

   Paste-in starter: gutenberg-templates/opponent-scoring-process.html

   SPECIFICITY NOTE
   These posts render inside `.watl-news .article-body` (single.php →
   template-parts/news-styles.php), whose rules — `.watl-news .article-body h2`,
   `… ul, … ol`, `… li`, `… table th/td` — all score (0,2,1). news-styles.php
   prints inline in the BODY, i.e. after this enqueued file, so a specificity
   tie would lose. Every selector below is therefore rooted at the doubled
   class `.watl-doc.watl-doc` (0,2,0) to clear those rules outright. Keep that
   prefix when adding rules here.

   Design tokens are redeclared locally as hex, matching the .watl-rules /
   .watl-news / .watl-committees convention. Do not switch to main.css vars.
   ========================================================================== */

.watl-doc {
  --wd-red: #C0392B;
  --wd-dark: #111A27;
  --wd-ink: #1A1A1A;
  --wd-body-ink: #33383F;
  --wd-mid: #5A6370;
  --wd-line: #E0DCD5;
  --wd-cream: #F1EEE8;
  --wd-chip: #E5E3DE;
  --wd-gold: #C8A24A;
  --wd-flag: #B08000;
  --wd-blue: #1A56C4;
  --wd-head: 'Barlow Condensed', Arial, Helvetica, sans-serif;
  --wd-text: 'Barlow', Arial, Helvetica, sans-serif;
  font-family: var(--wd-text);
  color: var(--wd-ink);
  counter-reset: wd-sec;
}

.watl-doc * { box-sizing: border-box; }

/* --------------------------------------------------------------------------
   Hero panel — dark slab with a red left edge.
   .wd-hero > .wd-hero__kicker / .wd-hero__title / .wd-hero__sub
   Kept as paragraphs, not headings, so it stays out of single.php's
   auto-generated "In This Article" sidebar TOC.
   -------------------------------------------------------------------------- */
.watl-doc.watl-doc .wd-hero {
  background: var(--wd-dark);
  border-left: 6px solid var(--wd-red);
  padding: 22px 24px 24px;
  margin: 0 0 18px;
}
.watl-doc.watl-doc .wd-hero p { margin: 0; }
.watl-doc.watl-doc .wd-hero__kicker {
  font-family: var(--wd-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--wd-red);
  margin-bottom: 6px;
}
.watl-doc.watl-doc .wd-hero__title {
  font-family: var(--wd-head);
  font-size: clamp(26px, 4.6vw, 34px);
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 1.05;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 7px;
}
.watl-doc.watl-doc .wd-hero__sub {
  font-size: 13.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, .72);
}

/* --------------------------------------------------------------------------
   Notice bar — e.g. "CURRENTLY IN TESTING: …". Leading <strong> is the label.
   .wd-note--red swaps the gold rule for the WATL red.
   -------------------------------------------------------------------------- */
.watl-doc.watl-doc .wd-note {
  background: var(--wd-cream);
  border-left: 4px solid var(--wd-gold);
  padding: 11px 16px;
  margin: 0 0 30px;
}
.watl-doc.watl-doc .wd-note--red { border-left-color: var(--wd-red); }
.watl-doc.watl-doc .wd-note p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--wd-body-ink);
}
.watl-doc.watl-doc .wd-note strong {
  font-family: var(--wd-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--wd-ink);
  margin-right: 6px;
}

/* Inline marker for an unresolved / under-review item. Renders blue,
   bold and underlined — the "text shown in BLUE" convention. */
.watl-doc.watl-doc .wd-open {
  color: var(--wd-blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Sections. The red A. / B. / C. prefix is a CSS counter, so the heading
   text stays clean for single.php's sidebar TOC. Add .wd-sec__h--plain to
   suppress the letter on a given heading.
   -------------------------------------------------------------------------- */
.watl-doc.watl-doc .wd-sec { margin: 0 0 34px; }
.watl-doc.watl-doc .wd-sec:last-child { margin-bottom: 0; }

.watl-doc.watl-doc h2.wd-sec__h {
  font-family: var(--wd-head);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--wd-ink);
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0 0 11px;
  border-top: 0;
  border-bottom: 1px solid var(--wd-line);
}
.watl-doc.watl-doc h2.wd-sec__h::before {
  counter-increment: wd-sec;
  content: counter(wd-sec, upper-alpha) ".";
  color: var(--wd-red);
  font-weight: 700;
}
.watl-doc.watl-doc h2.wd-sec__h--plain::before { content: none; }

.watl-doc.watl-doc .wd-lede {
  font-size: 15px;
  line-height: 1.7;
  color: var(--wd-body-ink);
  margin: 0 0 16px;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Nested lists — red numerals, red circle sub-bullets, red dash sub-sub.
   Plain nested Gutenberg list blocks; markers are pure CSS so renumbering
   and drag-reordering in the editor keep working.
   -------------------------------------------------------------------------- */
.watl-doc.watl-doc .wd-list {
  margin: 0 0 18px;
  padding: 0 0 0 28px;
  list-style: decimal;
}
.watl-doc.watl-doc .wd-list li {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--wd-ink);
}
.watl-doc.watl-doc .wd-list > li::marker {
  color: var(--wd-red);
  font-weight: 700;
}

.watl-doc.watl-doc .wd-list ul {
  list-style: none;
  margin: 9px 0 6px;
  padding: 0 0 0 22px;
}
.watl-doc.watl-doc .wd-list ul > li {
  position: relative;
  margin: 0 0 7px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--wd-body-ink);
}
.watl-doc.watl-doc .wd-list ul > li::before {
  content: '\25CB';
  position: absolute;
  left: -18px;
  top: 1px;
  color: var(--wd-red);
  font-size: 10px;
  line-height: 2;
}

.watl-doc.watl-doc .wd-list ul ul {
  margin: 7px 0 4px;
  padding: 0 0 0 22px;
}
.watl-doc.watl-doc .wd-list ul ul > li::before {
  content: '\2013';
  font-size: 14px;
  line-height: 1.35;
  top: 0;
}

/* A leading <strong> on a third-level item reads as a consequence label
   ("FIRST OFFENSE (In a match):"). */
.watl-doc.watl-doc .wd-list ul ul > li > strong:first-child {
  color: var(--wd-flag);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Tables. <strong> in a cell renders as a neutral chip.
   .wd-table--versions is the "current vs. testing" comparison shape: the
   LAST body row's chip goes red. Row order matters — testing goes last.
   -------------------------------------------------------------------------- */
.watl-doc.watl-doc .wd-table {
  margin: 6px 0 20px;
  overflow-x: auto;
}
.watl-doc.watl-doc .wd-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  table-layout: auto;
}
.watl-doc.watl-doc .wd-table th {
  font-family: var(--wd-head);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--wd-mid);
  text-align: left;
  padding: 8px 14px;
  background: var(--wd-cream);
  border: 0;
  border-bottom: 2px solid var(--wd-ink);
}
.watl-doc.watl-doc .wd-table td {
  padding: 14px;
  vertical-align: middle;
  color: var(--wd-body-ink);
  line-height: 1.55;
  border: 0;
  border-bottom: 1px solid var(--wd-line);
}
.watl-doc.watl-doc .wd-table td strong {
  display: inline-block;
  min-width: 96px;
  text-align: center;
  padding: 4px 12px;
  background: var(--wd-chip);
  color: var(--wd-ink);
  font-family: var(--wd-head);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  line-height: 1.4;
}
.watl-doc.watl-doc .wd-table td em { font-style: italic; }

.watl-doc.watl-doc .wd-table--versions td:first-child {
  width: 150px;
  white-space: nowrap;
}
.watl-doc.watl-doc .wd-table--versions tbody tr:last-child td strong {
  background: var(--wd-red);
  color: #fff;
}

/* -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .watl-doc.watl-doc .wd-hero { padding: 18px 16px 20px; }
  .watl-doc.watl-doc .wd-note { padding: 10px 12px; }
  .watl-doc.watl-doc .wd-list { padding-left: 22px; }
  .watl-doc.watl-doc .wd-table--versions td:first-child { width: auto; }
}
