/* components/check-toggle.css — the +/✓ box standing in for a checkbox: on
   /newsletters/ (partials/newsletter-option.hbs) and in the homepage signup
   box (partials/newsletter-choice.hbs).
   Markup contract: the real <input type="checkbox"> is .sr-only and comes
   immediately before .check-toggle, which holds icons/plus and icons/check.
   Unticked: an outlined box with a plus. Ticked: filled with the ink, check
   in the page colour (so dark mode inverts it too). */

.check-toggle {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  inline-size: var(--space-6);
  aspect-ratio: 1;
  border: var(--border-width) solid var(--color-border-soft);
  border-radius: var(--radius);
  font-size: var(--text-base);
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

:checked + .check-toggle {
  border-color: var(--color-fg);
  background-color: var(--color-fg);
  color: var(--color-bg);
}

:checked + .check-toggle .icon--plus,
:not(:checked) + .check-toggle .icon--check {
  display: none;
}

/* The input is visually hidden, so its focus shows on the box. */
:focus-visible + .check-toggle {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
}
