/* --------------------------------------------------------------------------
   CWN Scorecard

   Rectangular option marks, hairline edges, no shadows — same dialect as the
   rest of the site. The two direction variants differ only in the accent used
   for the meter and the band rule; both keep white-on-primary for the selected
   option, because #0E7C8A carries white at 4.92:1 and #C77BA0 does not (3.1:1).
   -------------------------------------------------------------------------- */

.cwnscorecard-block {
  background: var(--surface-soft);
  padding-top: var(--section-padding-top);
  padding-bottom: var(--section-padding-bottom);
}

/* `hidden` lives in the user-agent sheet, so any author class beats it. */
.cwnscorecard-block [hidden] {
  display: none !important;
}

.cwnscorecard-header {
  max-width: 760px;
  margin-bottom: 40px;
}

.cwnscorecard-heading {
  font-size: 38px;
  line-height: 1.12;
  margin: 0 0 16px;
}

.cwnscorecard-intro {
  font-size: 17px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--body-text);
  margin: 0;
  max-width: 60ch;
}

.cwnscorecard-tool {
  background: #fff;
  border: 1px solid var(--hairline);
  padding: 40px;
}

/* The scale words repeat on every row for screen readers, but sighted users only
   need them once at the top of the list. */
/* Sized to the options row — five 44px marks plus four 8px gaps — so the two
   words sit over the ends of the scale rather than near them.

   fit-content with a min-width rather than a flat width: at a flat 252px the
   two labels exactly filled the box and `space-between` had nothing left to
   distribute, so they rendered touching as "NOT TRUE YETCONSISTENTLY TRUE".
   Now the box holds the scale's width as a floor and grows leftward when the
   labels need more room, which also means an editor can write longer ones
   without the pair colliding again. */
.cwnscorecard-scale-key {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: fit-content;
  min-width: 252px;
  margin-left: auto;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 4px;
}

.cwnscorecard-scale-key-end {
  font-family: var(--font1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.cwnscorecard-statement {
  border-bottom: 1px solid var(--hairline);
  margin: 0;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cwnscorecard-statement-text {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--body-text);
  max-width: 52ch;
}

.cwnscorecard-scale {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

/* Present only for assistive tech and for the wrapped mobile layout — the key at
   the top of the card carries it visually on desktop. */
.cwnscorecard-scale-end {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.cwnscorecard-options {
  display: flex;
  gap: 8px;
}

.cwnscorecard-option {
  position: relative;
  display: block;
  cursor: pointer;
}

/* The input stays in the layout at full size so it keeps its hit area, its focus
   ring, and its place in the tab order — it is only made invisible. */
.cwnscorecard-radio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cwnscorecard-option-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hairline-strong);
  border-radius: 0;
  font-family: var(--font1);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  font-variant-numeric: tabular-nums;
}

.cwnscorecard-option:hover .cwnscorecard-option-mark {
  border-color: var(--primary);
}

.cwnscorecard-radio:checked + .cwnscorecard-option-mark {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cwnscorecard-radio:focus-visible + .cwnscorecard-option-mark {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.cwnscorecard-progress {
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  margin: 22px 0 0;
}

.cwnscorecard-result {
  margin-top: 32px;
  border-top: 1px solid var(--hairline);
  padding-top: 32px;
}

.cwnscorecard-score {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.cwnscorecard-score-label {
  font-family: var(--font1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.cwnscorecard-score-value {
  font-family: var(--font1);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cwnscorecard-score-max {
  font-size: 22px;
  color: var(--muted);
}

.cwnscorecard-meter {
  margin-top: 18px;
  height: 6px;
  background: var(--hairline);
  overflow: hidden;
}

.cwnscorecard-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cwnscorecard-block--alert .cwnscorecard-meter-fill {
  background: var(--tertiary);
}

.cwnscorecard-band {
  margin-top: 26px;
  border-left: 3px solid var(--primary);
  background: var(--surface-card);
  padding: 24px 28px;
}

.cwnscorecard-block--alert .cwnscorecard-band {
  border-left-color: var(--tertiary);
  background: var(--surface-soft);
}

.cwnscorecard-band-label {
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 10px;
}

.cwnscorecard-band-guidance {
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--body-text);
  margin: 0;
  max-width: 66ch;
  white-space: pre-line;
}

.cwnscorecard-result-actions {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cwnscorecard-copy,
.cwnscorecard-reset {
  font-family: var(--font1);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 0;
  box-shadow: none;
  padding: 13px 24px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cwnscorecard-copy {
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
}

.cwnscorecard-copy:hover {
  background: var(--primary-active);
  border-color: var(--primary-active);
}

.cwnscorecard-reset {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hairline-strong);
}

.cwnscorecard-reset:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.cwnscorecard-noscript,
.cwnscorecard-note {
  font-size: 13px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--muted);
  margin: 20px 0 0;
  max-width: 74ch;
}

@media (max-width: 1199px) {
  .cwnscorecard-heading { font-size: 32px; }
  .cwnscorecard-tool { padding: 32px; }
  .cwnscorecard-scale-key { display: none; }

  /* Below the desktop width the statement and its scale stop fitting on one
     line, so the row stacks and each scale carries its own end labels again. */
  .cwnscorecard-statement {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .cwnscorecard-statement-text { max-width: none; }

  .cwnscorecard-scale {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .cwnscorecard-scale-end {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
    flex: 0 1 auto;
    max-width: 96px;
    font-family: var(--font1);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.35;
  }
}

@media (max-width: 767px) {
  .cwnscorecard-heading { font-size: 26px; }
  .cwnscorecard-intro { font-size: 16px; }
  .cwnscorecard-tool { padding: 24px 20px; }
  .cwnscorecard-statement-text { font-size: 16px; }

  /* At phone width the two end labels plus five marks cannot share a line, so
     the labels sit above the marks and the marks stretch edge to edge. */
  .cwnscorecard-scale {
    flex-wrap: wrap;
    gap: 8px;
  }

  .cwnscorecard-scale-end { max-width: none; flex: 1 1 40%; }
  .cwnscorecard-scale-end:last-child { text-align: right; }

  .cwnscorecard-options {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .cwnscorecard-option { flex: 1 1 0; }
  .cwnscorecard-option-mark { width: 100%; height: 48px; }

  .cwnscorecard-score-value { font-size: 34px; }
  .cwnscorecard-band { padding: 20px; }
  .cwnscorecard-band-label { font-size: 19px; }
  .cwnscorecard-copy,
  .cwnscorecard-reset { width: 100%; text-align: center; }
}
