/* Low-vision preferences are applied only while the mode is enabled. */
html[data-spk-size="125"] { font-size: 125%; }
html[data-spk-size="150"] { font-size: 150%; }
html[data-spk-size="175"] { font-size: 175%; }
html[data-spk-size="200"] { font-size: 200%; }

html[data-spk-palette="light"] {
  color-scheme: light;
  --spk-background: #fff;
  --spk-surface: #f1f4f7;
  --spk-text: #111;
  --spk-link: #003d8f;
  --spk-border: #586474;
  --spk-action: #003d8f;
  --spk-action-text: #fff;
  --spk-focus: #7133a1;
  --spk-error: #8d1e1a;
}

html[data-spk-palette="dark"], html[data-spk-palette="yellow"] {
  color-scheme: dark;
  --spk-background: #101010;
  --spk-surface: #242424;
  --spk-text: #fff;
  --spk-link: #ffe680;
  --spk-border: #b8b8b8;
  --spk-action: #fff;
  --spk-action-text: #101010;
  --spk-focus: #8bdbff;
  --spk-error: #ffb0a6;
}

html[data-spk-palette="yellow"] {
  --spk-background: #000;
  --spk-surface: #1a1a1a;
  --spk-text: #ffe34d;
  --spk-link: #fff6b8;
  --spk-border: #ffe34d;
  --spk-action: #ffe34d;
  --spk-action-text: #000;
}

.theme-editorial .skip-link {
  position: fixed;
  z-index: 120;
  top: .5rem;
  left: .5rem;
  max-inline-size: calc(100% - 1rem);
  transform: translateY(calc(-100% - 1rem));
}

.theme-editorial .skip-link:focus {
  transform: none;
  outline: 3px solid var(--spk-focus, #145898);
  outline-offset: 2px;
}

.theme-editorial :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--spk-focus, #145898);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--spk-background, #fff);
}

.theme-editorial #main:focus { outline-offset: -3px; }
.theme-editorial #main { scroll-margin-block-start: 6rem; }

.cms-access-button {
  min-block-size: 32px;
  max-inline-size: 100%;
  color: #17343d;
  background: #fff;
  border: 1px solid #71818c;
  border-radius: .55rem;
  padding: .25em .55em;
  font: 600 .875rem/1.35 Onest, Arial, sans-serif;
  cursor: pointer;
}

.cms-access-button[data-spk-active] { font-weight: 700; }

.spk-a11y-dialog {
  inline-size: min(43rem, calc(100% - 1rem));
  max-inline-size: calc(100% - 1rem);
  max-block-size: calc(100% - 1rem);
  margin: auto;
  padding: clamp(14px, 4vw, 30px);
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--spk-text, #17343d);
  background: var(--spk-background, #fff);
  border: 2px solid var(--spk-border, #657681);
  border-radius: 14px;
  box-shadow: 0 15px 55px #0005;
  font: 400 clamp(16px, .85rem, 22px)/1.5 Onest, Arial, sans-serif;
  overflow-wrap: anywhere;
}

.spk-a11y-dialog::backdrop { background: #0b1826b5; }
.spk-a11y-dialog .spk-a11y-title {
  margin: 0;
  color: inherit;
  font: 700 clamp(23px, 1.42rem, 38px)/1.25 Onest, Arial, sans-serif;
}

.spk-a11y-title:focus { outline: none; box-shadow: none; }
.spk-a11y-hint { margin: .45em 0 1.15em; }
.spk-a11y-controls { display: grid; gap: 1em; }
.spk-a11y-group { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.spk-a11y-group legend { margin-block-end: .4em; padding: 0; font-weight: 700; }

.spk-a11y-choices, .spk-a11y-actions { display: flex; flex-wrap: wrap; gap: .5em; }
.spk-a11y-extras { display: grid; gap: .5em; }
.spk-a11y-choice, .spk-a11y-check, .spk-a11y-actions button {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  min-block-size: 44px;
  min-inline-size: 0;
  max-inline-size: 100%;
  padding: .3em .6em;
  border: 1px solid var(--spk-border, #657681);
  border-radius: 7px;
  color: inherit;
  background: var(--spk-surface, #f2f6f7);
  font: inherit;
  cursor: pointer;
}

.spk-a11y-choice:has(input:checked), .spk-a11y-check:has(input:checked) {
  border-color: var(--spk-action, #155f68);
  box-shadow: inset 0 0 0 1px var(--spk-action, #155f68);
  font-weight: 700;
}

.spk-a11y-dialog :is(label:focus-within, button:focus-visible) {
  outline: 3px solid var(--spk-focus, #145898);
  outline-offset: 2px;
}

.spk-a11y-dialog input {
  flex: none;
  inline-size: 1em;
  block-size: 1em;
  margin: 0;
  accent-color: var(--spk-action, #155f68);
}

.spk-a11y-swatch {
  flex: none;
  padding: 0 .3em;
  border: 1px solid;
  border-radius: 4px;
  font-weight: 700;
  line-height: 1.25;
}

.spk-a11y-swatch[data-swatch="site"] { color: #183452; background: #f7f8f3; }
.spk-a11y-swatch[data-swatch="light"] { color: #111; background: #fff; }
.spk-a11y-swatch[data-swatch="dark"] { color: #fff; background: #101010; }
.spk-a11y-swatch[data-swatch="yellow"] { color: #ffe34d; background: #000; }

.spk-a11y-actions button { justify-content: center; text-align: center; }
.spk-a11y-actions .spk-a11y-done {
  color: var(--spk-action-text, #fff);
  background: var(--spk-action, #155f68);
  border-color: var(--spk-action, #155f68);
  font-weight: 700;
}

.spk-a11y-status:empty { margin: 0; }
.spk-a11y-image-description { display: none; }

html[data-spk-mode] body { overflow-wrap: anywhere; }
html[data-spk-mode] body .site-header { position: relative; }
html[data-spk-mode] body #main { scroll-margin-block-start: .5rem; }

html[data-spk-mode] .site-header .header-inner,
html[data-spk-mode] .site-header .header-actions,
html[data-spk-mode] .site-header .languages {
  flex-wrap: wrap;
  min-inline-size: 0;
  max-inline-size: 100%;
}

html[data-spk-mode] .site-header .header-inner { padding-block: .4rem; }
html[data-spk-mode] .site-header .brand {
  flex-shrink: 1;
  min-inline-size: 0;
  max-inline-size: 100%;
}

html[data-spk-mode] .site-header .brand > span { min-inline-size: 0; }
html[data-spk-mode] .site-header .brand img { flex: none; }
html[data-spk-mode] .site-header .cms-access-button {
  flex-shrink: 1;
  min-block-size: 44px;
  min-inline-size: 0;
  max-inline-size: 100%;
  white-space: normal;
  font-size: 1rem;
  border-width: 2px;
}

html[data-spk-mode] .site-header .main-nav {
  flex: 1 0 100%;
  flex-wrap: wrap;
  order: 1;
  min-inline-size: 0;
}

html[data-spk-mode] .section-sidebar { position: static; }
html[data-spk-mode] .assist-dock,
html[data-spk-mode] .back-to-top,
html[data-spk-mode] .cms-cookie {
  position: static;
  max-inline-size: calc(100% - 1rem);
  margin: .5rem auto;
}

html[data-spk-mode] .assist-dock { flex-wrap: wrap; width: fit-content; }
html[data-spk-mode] .assist-dock a { white-space: normal; }
html[data-spk-mode] .assist-phone span { display: inline; }
html[data-spk-mode] .panorama-caption {
  position: static;
  max-inline-size: 100%;
  border-radius: 0;
}

/* Many text sizes in the editorial theme use pixels. Give those controls and
   content blocks relative sizes while enlarged so they follow the selected size. */
html[data-spk-size]:not([data-spk-size="100"]) body { font-size: 1rem; }
html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial :is(
  main p, main label, main select, main textarea, main input, main summary,
  .brand-name, .main-nav a, .nav-subtitle, .languages, .button, .full-pill, .nav-main-link,
  .rich-content, .full-lead, .document-title, .doc-copy, .faq-answer, .contact-lines strong,
  .contact-band p, .site-footer, .footer-links, .footer-heading, .footer-legal,
  .section-sidebar nav a, .sidebar-help, .assist-dock a, .form-field input, .form-field textarea,
  .full-search-form input, .catalog-select select, .journey-tab, select[data-journey-programme]
) { font-size: 1rem; line-height: 1.5; }

html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial :is(
  .brand-caption, .presentation-bar .container, .eyebrow, .item-eyebrow, .edition,
  .news-meta, .announcement-date, .article-meta, .breadcrumbs, .panorama-caption, .sidebar-label,
  .file-meta, .file-open, .card-more, .catalog-status, .reset-filter, .catalog-pages a,
  .catalog-pages button, .page-gap, .catalog-select, .journey-status, .step-number,
  .source-note, .file-language-note, .contact-lines span, .document-details > div, .field-error,
  .character-count, .demo-check, .full-search-result .search-category, .image-dialog p, table
) { font-size: .875rem; line-height: 1.5; }

html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial :is(main h1) {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.2;
}

html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial .editorial-intro h1 {
  font-size: clamp(2.2rem, 6.6vw, 4rem);
  line-height: 1.15;
}

html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial :is(
  main h2, .contact-band h2, .editorial-intro .hero-statement
) { font-size: clamp(1.5rem, 3vw, 2.15rem); line-height: 1.25; }

html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial :is(main h3, main h4) {
  font-size: 1.3rem;
  line-height: 1.35;
}

html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial :is(
  .button, .full-pill, .nav-main-link, .nav-sub-link, .doc-copy a, .catalog-select, .assist-dock a, .journey-status
) { max-inline-size: 100%; white-space: normal; }

html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial :is(
  .news-copy, .program-copy, .doc-copy, .full-pill > span, .section-heading > *,
  .contact-band .container > *, .form-field, .catalog-select, .catalog-query, .header-actions,
  .full-search-form input, .footer-grid > *, .content-layout > *
) { min-inline-size: 0; }

html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial :is(
  .section-heading, .contact-band .container, .catalog-toolbar, .full-search-form, .full-doc-row, .journey-controls,
  .presentation-bar .container, .presentation-links, .hero-overline, .intro-top
) { flex-wrap: wrap; }

html[data-spk-size]:not([data-spk-size="100"]) .theme-editorial .doc-copy { flex: 1 1 min(12rem, 100%); }
html[data-spk-mode] .table-scroll,
html[data-spk-mode] .table-wrap { max-inline-size: 100%; overflow-x: auto; }

html[data-spk-spacing] .theme-editorial :where(header, main, footer, .contact-band, .cms-cookie) :where(
  h1, h2, h3, h4, h5, h6, p, a, button, label, input, textarea, select, summary, li, dt, dd, td, th, span, time
):not(.ph, .sr-only) {
  line-height: 1.6 !important;
  letter-spacing: .12em !important;
  word-spacing: .16em !important;
  white-space: normal;
}

html[data-spk-spacing] .theme-editorial :where(main, footer) p:not(.sr-only) {
  margin-block-end: 2em;
}

html[data-spk-descriptions] #main :is(img, picture) { display: none !important; }
html[data-spk-descriptions] #main .spk-a11y-image-description {
  display: block;
  block-size: auto;
  padding: .35em .5em;
  border-inline-start: 3px solid currentColor;
  line-height: 1.5;
}

html[data-spk-descriptions] #main :is(.news-image, .person-photo, .panorama-frame, .card-image) {
  display: block;
  block-size: auto;
  min-block-size: 0;
  overflow: visible;
}

html[data-spk-palette]:not([data-spk-palette="site"]) body {
  color: var(--spk-text);
  background: var(--spk-background);
  --ink: var(--spk-text);
  --link: var(--spk-link);
  --line: var(--spk-border);
  --surface: var(--spk-surface);
  --soft: var(--spk-surface);
}

html[data-spk-palette]:not([data-spk-palette="site"]) body :where(*):not(:where(.spk-a11y-dialog, .spk-a11y-dialog *)) {
  color: inherit !important;
  background-color: transparent !important;
  border-color: var(--spk-border) !important;
  text-shadow: none;
}

html[data-spk-palette]:not([data-spk-palette="site"]) body :is(
  .site-header, .main-nav, .full-megamenu, .presentation-bar, .contact-band, .site-footer,
  .cms-cookie, .assist-dock, .back-to-top, .full-program-card, .full-news-card, .address-card,
  .section-card, .person-card, .journey-help, .journey-main, .document-cover, .panorama-caption,
  .form-error-summary, .cms-alert, .cms-receipt, .image-dialog, .skip-link, .document-symbol,
  .full-intro, .address-visual, .editorial-intro, .hero, .sidebar-help, .announcement-row:hover
) { background: var(--spk-surface) !important; backdrop-filter: none; }

html[data-spk-palette]:not([data-spk-palette="site"]) body :is(a[href], .skip-link) {
  color: var(--spk-link) !important;
  text-decoration: underline;
  text-decoration-thickness: max(1px, .08em);
  text-underline-offset: .18em;
}

html[data-spk-palette]:not([data-spk-palette="site"]) body :is(
  button:not(.spk-a11y-dialog button), input:not(.spk-a11y-dialog input),
  select, textarea, .button, .full-pill, .assist-apply
) { background-color: var(--spk-surface) !important; }

html[data-spk-palette]:not([data-spk-palette="site"]) body :is(
  .cms-access-button[data-spk-active], [aria-pressed="true"], .catalog-pages [aria-current="page"]
) { color: var(--spk-action-text) !important; background-color: var(--spk-action) !important; }

html[data-spk-palette]:not([data-spk-palette="site"]) body :is(input, textarea)::placeholder {
  color: var(--spk-text);
  opacity: .85;
}

html[data-spk-palette]:not([data-spk-palette="site"]) body :is(.field-error, .form-error-summary, [aria-invalid="true"]) {
  color: var(--spk-error) !important;
}

@media (max-width: 1279px) {
  html[data-spk-mode] .site-header .main-nav.is-open {
    position: static;
    width: 100%;
    max-block-size: none;
    padding-inline: 0;
  }

  html[data-spk-mode] .site-header .mega-grid { grid-template-columns: minmax(0, 1fr); }

  html[data-spk-mode] .section-sidebar nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    margin: 0;
    padding: 0;
  }

  html[data-spk-mode] .section-sidebar nav a { white-space: normal; }
  html[data-spk-mode] .section-sidebar nav a span { min-inline-size: 0; }

  html[data-spk-mode] .theme-editorial :is(
    .content-layout, .article-layout, .section-grid, .journey-body, .editorial-about, .home-quick
  ) { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  html[data-spk-mode] .site-header .header-inner { justify-content: flex-start; }
  html[data-spk-mode] .site-header .header-actions {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
  html[data-spk-mode] .theme-editorial :is(
    .two-grid, .footer-grid, .mega-grid, .contact-hub-grid, .appeal-fields,
    .coverage-strip, .cms-bulletin-cards, .appeal-preview dl > div, .journey-tabs
  ) { grid-template-columns: minmax(0, 1fr); }

  html[data-spk-mode] .theme-editorial :is(.journey-main, .journey-help, .news-copy, .document-cover) {
    padding-inline: min(1rem, 6vw);
  }

  html[data-spk-mode] .theme-editorial :is(.catalog-query, .catalog-select) { min-inline-size: 0; }
}

@media (forced-colors: active) {
  .theme-editorial :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible,
  .spk-a11y-dialog :is(label:focus-within, button:focus-visible) {
    outline-color: Highlight;
    box-shadow: none;
  }

  .spk-a11y-choice:has(input:checked), .spk-a11y-check:has(input:checked) { border: 2px solid Highlight; }
}
