/* ==========================================================================
   Dark background (the switch in the header, assets/js/dark.js).
   The page's lightness is inverted with its hues kept, so white grounds turn
   dark and navy text turns light; photographs, the logo and the solid brand
   blocks are inverted back so they keep their exact colours.
   ========================================================================== */
:root[data-theme="dark"] { filter: invert(1) hue-rotate(180deg); background: #fff; }
:root[data-theme="dark"] body { background: #edf0f5; }
:root[data-theme="dark"] :is(
  img, video, svg.mark, .ar-book__img, .button, .nav-feature, .ct-submit, .review-bar, .photo-hero, footer,
  .eq-hero, .eq-band, .eq-split__text:not(:nth-of-type(2)), .eq-sponsors li:first-child,
  .lg-board__head, .publication.journal, .publication.gazette, .rise__bar, .rise__arrow, .podium__bar, .podium-tabs [aria-selected="true"],
  .pod-tabs [aria-selected="true"], .record__sleeve, .record__disc, .flap, .sx__frame figcaption,
  .ar-band, .ar-editors .is-chief, .event-image
) { filter: invert(1) hue-rotate(180deg); }
/* Inside a block that is already inverted back, nothing is inverted again. */
:root[data-theme="dark"] :is(
  img, video, svg.mark, .ar-book__img, .button, .nav-feature, .ct-submit, .review-bar, .photo-hero, footer,
  .eq-hero, .eq-band, .eq-split__text:not(:nth-of-type(2)), .eq-sponsors li:first-child,
  .lg-board__head, .publication.journal, .publication.gazette, .rise__bar, .rise__arrow, .podium__bar, .podium-tabs [aria-selected="true"],
  .pod-tabs [aria-selected="true"], .record__sleeve, .record__disc, .flap, .sx__frame figcaption,
  .ar-band, .ar-editors .is-chief, .event-image
) :is(
  img, video, svg.mark, .ar-book__img, .button, .nav-feature, .ct-submit, .review-bar, .photo-hero, footer,
  .eq-hero, .eq-band, .eq-split__text:not(:nth-of-type(2)), .eq-sponsors li:first-child,
  .lg-board__head, .publication.journal, .publication.gazette, .rise__bar, .rise__arrow, .podium__bar, .podium-tabs [aria-selected="true"],
  .pod-tabs [aria-selected="true"], .record__sleeve, .record__disc, .flap, .sx__frame figcaption,
  .ar-band, .ar-editors .is-chief, .event-image
) { filter: none; }

/* The switch */
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--navy); cursor: pointer; transition: transform 200ms, border-color 200ms; }
.theme-toggle:hover { border-color: var(--navy); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-reduced-motion: no-preference) { .theme-toggle svg { transition: transform 400ms cubic-bezier(.16, 1, .3, 1); } .theme-toggle:hover svg { transform: rotate(-20deg); } }
