/* =============================================================================
   Matches — the 2026 Terrace boards 3 and 13 (#58): the shared page header,
   the scoreboard strip in its live states, the next tournament on gold,
   "Coming up." and "How it went.". Measured at 1440 (the 1280 column), 768
   and 390. The ladder rules at the end belong to the dormant [ntc_standings].
   ========================================================================== */

/* --- Page header (every route; shortcodes.php [ntc_page_header]) ---------- */
.ntc-sec--phead .ntc-sec__inner { padding-block: 120px 96px; }
.ntc-phead { display: flex; flex-direction: column; gap: 32px; }
.ntc-phead__row {
  display: grid;
  grid-template-columns: minmax(0, 820px) minmax(0, 380px);
  justify-content: space-between;
  align-items: end;
  gap: 80px;
}
html .ntc-phead__title {
  margin: 0 0 0 -0.015em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 160px;
  line-height: 0.88;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--color-white);
}
.ntc-phead__lede { margin: 0; font-size: 20px; line-height: 1.55; color: var(--color-text); }
.ntc-phead__chips { margin: 0; }

/* A strip on its own (under a page header) keeps the 1280 column too. */
.ntc-scoreboard {
  grid-template-columns: repeat(var(--ntc-cells, 4), minmax(0, 1fr));
  gap: 32px;
  padding-inline: var(--ntc-edge, max(var(--grid-margin), calc((100% - 1280px) / 2)));
  min-height: 128px;
}
@media (min-width: 1024px) { .ntc-lhero .ntc-scoreboard { min-height: 80px; gap: 0; } }
.ntc-scoreboard__live {
  display: inline-block;
  margin-right: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--color-ink);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  vertical-align: middle;
}
.ntc-scoreboard__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
.ntc-scoreboard__link:focus-visible { outline-color: var(--color-ink); }

/* --- Shared Terrace section head --------------------------------------- */
.ntc-lhead {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(0, 480px);
  justify-content: space-between;
  align-items: end;
  gap: 80px;
}
.ntc-lhead__title { display: flex; flex-direction: column; gap: 16px; }
html .ntc-ltitle--h { font-size: 96px; line-height: 0.92; }
.ntc-lhead__intro { margin: 0; font-size: 20px; line-height: 1.55; color: var(--color-text); }

/* --- Next tournament, on gold -------------------------------------------- */
.ntc-sec--next .ntc-sec__inner { padding-block: 120px; }
html .ntc-next__title {
  margin: 64px 0 0 -0.015em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 200px;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--color-text-on-light);
}
.ntc-next__details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 48px;
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
  font-size: 24px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-on-light);
}
.ntc-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
}
.ntc-countdown__unit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 32px;
  background: var(--color-ink);
}
.ntc-countdown__value {
  display: block;
  font-family: var(--font-display);
  font-size: 96px;
  line-height: 1;
  color: var(--color-accent-base);
  font-variant-numeric: tabular-nums;
}
.ntc-countdown__label {
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-white);
}

/* --- Coming up ----------------------------------------------------------- */
.ntc-sec--fixtures .ntc-sec__inner,
.ntc-sec--results .ntc-sec__inner { padding-block: 120px; }
.ntc-fixtures,
.ntc-results {
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--color-line);
}
.ntc-fixtures__row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto 150px;
  align-items: center;
  gap: 40px;
  padding-block: 32px;
  border-bottom: 1px solid var(--color-line);
}
.ntc-fixtures__date { display: flex; flex-direction: column; gap: 4px; }
.ntc-fixtures__day {
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  color: var(--color-accent-base);
}
.ntc-fixtures__month,
.ntc-results__detail { font-size: 16px; }
.ntc-fixtures__month {
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-white);
}
.ntc-fixtures__match,
.ntc-results__match { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ntc-fixtures__title,
.ntc-results__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--color-white);
}
.ntc-fixtures__detail,
.ntc-results__detail { margin: 0; font-size: 20px; color: var(--color-text); }
.ntc-fixtures__tag {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--color-accent-base);
  color: var(--color-text-on-light);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ntc-fixtures__time {
  font-family: var(--font-display);
  font-size: 40px;
  text-align: right;
  text-transform: uppercase;
  color: var(--color-white);
}
.ntc-fixtures__time--phone { display: none; }

/* --- How it went --------------------------------------------------------- */
.ntc-results__row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  padding-block: 24px;
  border-bottom: 1px solid var(--color-line);
}
.ntc-results__detail { font-size: 16px; }
.ntc-results__mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 2px solid var(--color-text);
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--color-white);
}
.ntc-results__row.is-cup .ntc-results__mark {
  border-color: var(--color-accent-base);
  background: var(--color-accent-base);
  color: var(--color-text-on-light);
}
.ntc-results__outcome {
  margin: 0;
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1.5;
  text-align: right;
  color: var(--color-white);
}
.ntc-results__row.is-cup .ntc-results__outcome { color: var(--color-accent-base); }

/* --- 1024 to 1199 -------------------------------------------------------- */
@media (max-width: 1199px) {
  html .ntc-phead__title { font-size: 120px; }
  html .ntc-next__title { font-size: 150px; }
  html .ntc-ltitle--h { font-size: 80px; }
}

/* --- Below 1024: one centred column -------------------------------------- */
@media (max-width: 1023px) {
  .ntc-sec--phead .ntc-sec__inner { padding-block: 48px 40px; }
  .ntc-phead { gap: 16px; align-items: center; text-align: center; }
  .ntc-phead__row { display: flex; flex-direction: column; align-items: center; gap: 20px; }
  html .ntc-phead__title { margin: 0; font-size: 76px; }
  .ntc-phead__lede { max-width: 560px; font-size: 17px; }
  .ntc-phead__chips { justify-content: center; }

  .ntc-scoreboard { min-height: 112px; gap: 12px; }
  .ntc-scoreboard__live { font-size: 13px; margin-right: 8px; }

  .ntc-lhead { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
  .ntc-lhead__title { gap: 12px; }
  html .ntc-ltitle--h { font-size: 40px; }
  .ntc-lhead__intro { max-width: 560px; font-size: 17px; }

  .ntc-sec--next .ntc-sec__inner,
  .ntc-sec--fixtures .ntc-sec__inner,
  .ntc-sec--results .ntc-sec__inner { padding-block: 64px; }
  html .ntc-next__title { margin: 32px 0 0; font-size: clamp(48px, 13vw, 96px); overflow-wrap: break-word; hyphens: manual; }
  .ntc-next__details { flex-direction: column; align-items: center; gap: 8px; margin-top: 32px; font-size: 17px; }
  .ntc-countdown { gap: 8px; margin-top: 32px; }
  .ntc-countdown__unit { gap: 4px; padding: 12px; text-align: left; }
  .ntc-countdown__value { font-size: 40px; }
  .ntc-countdown__label { font-size: 13px; letter-spacing: 0.04em; }

  .ntc-fixtures,
  .ntc-results { margin-top: 32px; text-align: left; }
  .ntc-fixtures__row { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding-block: 20px; }
  .ntc-fixtures__day { font-size: 40px; }
  .ntc-fixtures__month { font-size: 13px; }
  .ntc-fixtures__title,
  .ntc-results__title { font-size: 24px; }
  .ntc-fixtures__detail { font-size: 15px; }
  .ntc-fixtures__tag,
  .ntc-fixtures__time { display: none; }
  .ntc-fixtures__time--phone {
    display: block;
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    text-align: left;
    text-transform: none;
    color: var(--color-accent-base);
  }

  .ntc-results__row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; padding-block: 16px; }
  .ntc-results__mark { width: 40px; height: 40px; font-size: 24px; }
  .ntc-results__title { font-size: 20px; }
  .ntc-results__detail { font-size: 13px; }
  .ntc-results__outcome { font-size: 28px; }
}

@media (max-width: 767px) {
  .ntc-scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ntc-scoreboard__cell { overflow-wrap: anywhere; }
}

/* Buffer rows for the cache-correctness fix (ADR 0002 §1b). The server
   renders two fixtures beyond the limit so the client has something real to
   promote when it drops a match that has already kicked off. Hidden here
   rather than in JS so that WITHOUT JavaScript the list is exactly the
   length it was before the change — the extra rows never appear. */
.ntc-fixtures__row.is-buffer { display: none; }

/* --- Ladder ---------------------------------------------------------------
   # 52 / Club flexible / P W D L 56 each / BP 74 accent / +- 74 / Form 180 /
   PTS 66 right. Below 1024px the wrapper scrolls horizontally and the table
   keeps its 1100px min-width: a ladder row that wraps stops being a row. */
.ntc-sec--ladder .ntc-sec__inner {
  display: flex;
  flex-direction: column;
  gap: 44px;
  padding-block: 120px;
}

.ntc-ladder__scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ntc-ladder {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  table-layout: fixed;
}

.ntc-ladder th,
.ntc-ladder td {
  padding: 0;
  text-align: left;
  vertical-align: middle;
}

.ntc-ladder thead th {
  padding-block: 14px;
  border-bottom: 1px solid var(--color-line);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--font-weight-normal);
  line-height: 12px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.ntc-ladder thead .ntc-ladder__bp { color: var(--color-accent); }

.ntc-ladder abbr { text-decoration: none; border: 0; }

.ntc-ladder tbody th,
.ntc-ladder tbody td {
  padding-block: 20px;
  border-bottom: 1px solid var(--color-line);
}

/* The club's own row is raised out of the ink and turned to accent — the one
   row a supporter is actually looking for. */
.ntc-ladder__row.is-club th,
.ntc-ladder__row.is-club td { background: var(--color-ink-raised); }
.ntc-ladder__row.is-club .ntc-ladder__rank,
.ntc-ladder__row.is-club .ntc-ladder__club { color: var(--color-accent); }

.ntc-ladder__rank {
  width: 52px;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: 20px;
  color: var(--color-text-muted);
}

.ntc-ladder__club {
  width: auto;
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--text-lg);
  letter-spacing: -0.03em;
  color: var(--color-white);
}

.ntc-ladder__num,
.ntc-ladder__bp,
.ntc-ladder__diff {
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.ntc-ladder__num  { width: 56px; color: var(--color-text); }
.ntc-ladder__bp   { width: 74px; color: var(--color-accent); }
.ntc-ladder__diff { width: 74px; color: var(--color-text-muted); }

.ntc-ladder__form { width: 180px; }

.ntc-ladder__pts {
  width: 66px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  line-height: var(--text-lg);
  font-variant-numeric: tabular-nums;
  color: var(--color-white);
}

/* Five 22px chips, oldest first. Each carries screen-reader text of its own;
   the visible legend below the table is the sighted reader's key. Colour never
   carries the meaning on its own in either channel.
   NAMED .ntc-formguide, not .ntc-form: the contact form owns .ntc-form, its
   stylesheet loads after this one, and the collision turned the guide into a
   32px-gap COLUMN — five chips stacked vertically, blowing every ladder row out
   to 279px tall. */
.ntc-formguide { display: flex; gap: 5px; }

.ntc-formguide__mark {
  position: relative;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: var(--radius-none);
}

.ntc-formguide__mark--w { background: var(--color-accent); }
.ntc-formguide__mark--d { background: var(--color-gray-600); }
.ntc-formguide__mark--l { background: var(--color-gray-800); }

.ntc-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 16px;
  color: var(--color-text-muted);
}

.ntc-legend__item { display: inline-flex; align-items: center; gap: var(--spacing-sm); }

.ntc-legend__swatch { width: 16px; height: 16px; flex-shrink: 0; }
.ntc-legend__swatch--w { background: var(--color-accent); }
.ntc-legend__swatch--d { background: var(--color-gray-600); }
.ntc-legend__swatch--l { background: var(--color-gray-800); }

.ntc-legend__note { padding-left: 12px; }

/* --- Responsive -----------------------------------------------------------
   The fixture and result rows carry a 420px opponent slot that cannot survive a
   narrow viewport, so below 1024px they become two-line blocks with the lanes
   preserved inside each line. The ladder does not: it scrolls. */
