/* The cookie banner with three kinds (cookies PR 6, Dev1, 30 November 2026; website/docs/cookies-consent-visits-design.md,
   3.1 and 3.3). Loaded after consent.css, and only with SITE_STATS_ON: by the footer partial consent-levels.html
   (scripts/layout.mjs) and by website-next's CookieConsent. Every rule sits under .consent--levels, which only the new
   banner has, so today's banner is never touched. Accept all, Reject all and Choose what to allow share one rule
   (.consent__choice, in consent.css) and no rule targets one of them: identical buttons, as the ICO asks. Colours are
   the tokens of styles.css; tests/consent-levels.test.js. */

.consent--levels .consent__level[hidden] { display: none; }

/* The first level: one under the other on a phone, side by side on a wide screen. */
.consent--levels .consent__actions--three { grid-template-columns: 1fr; }
.consent--levels .consent__actions--save { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .consent--levels .consent__actions--three { grid-template-columns: repeat(3, 1fr); }
  .consent--levels .consent__actions--save { grid-template-columns: minmax(0, 240px); justify-content: end; }
}

/* Bar (privacy notice, terms): the card is no longer the grid, the first level is; the second level reads top to bottom. */
.consent--levels.consent--bar .consent__card { display: block; }
.consent--levels.consent--bar .consent__actions--save { margin-top: 16px; }
@media (min-width: 768px) {
  .consent--levels.consent--bar .consent__level[data-consent-level="1"] { display: grid; grid-template-columns: 1fr minmax(0, 480px); column-gap: 32px; align-items: center; }
  .consent--levels.consent--bar .consent__level[data-consent-level="1"][hidden] { display: none; }
  .consent--levels.consent--bar .consent__level[data-consent-level="1"] > p { grid-column: 1; }
  .consent--levels.consent--bar .consent__level[data-consent-level="1"] > .consent__actions { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
}

/* The second level: each kind with its name and switch on one line, what it does below. */
.consent--levels .consent__kind {
  display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: center; padding: 16px 0;
  border-top: 1px solid var(--line);
}
.consent--levels .consent__label { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--white); }
.consent--levels .consent__about,
.consent--levels .consent__gpc { grid-column: 1 / -1; margin: 8px 0 0; font-size: 14px; line-height: 20px; color: var(--text-2); }
.consent--levels .consent__gpc { color: var(--white); }
.consent--levels .consent__gpc[hidden] { display: none; }

/* The switch: a 44 px target around a 44 x 24 track. On: the track fills with Sky, the knob moves right. */
.consent--levels .consent__switch {
  position: relative; display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 4px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--white); font: inherit; cursor: pointer;
}
.consent--levels .consent__switch[aria-disabled="true"] { cursor: default; }
.consent--levels .consent__switch:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.consent--levels .consent__knob { position: relative; display: block; width: 44px; height: 24px; border: 2px solid var(--white); border-radius: 12px; }
.consent--levels .consent__knob::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--white);
}
.consent--levels .consent__switch[aria-checked="true"] .consent__knob { border-color: var(--sky); background: var(--sky); }
.consent--levels .consent__switch[aria-checked="true"] .consent__knob::after { background: var(--navy); transform: translateX(20px); }
.consent--levels .consent__always { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-2); }

/* Movement only for those who haven't asked for less. */
@media (prefers-reduced-motion: no-preference) {
  .consent--levels .consent__knob,
  .consent--levels .consent__knob::after { transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease; }
}
