/* Shared, self-hosted display preferences. Font sizes opt in through --a11y-text-scale. */
:root { --a11y-text-scale: 1; }
:root[data-a11y-size="125"] { --a11y-text-scale: 1.25; }
:root[data-a11y-size="150"] { --a11y-text-scale: 1.5; }
:root[data-a11y-size="175"] { --a11y-text-scale: 1.75; }
:root[data-a11y-size="200"] { --a11y-text-scale: 2; }
html.a11y-ready { scroll-padding-block: 1rem calc(5rem * var(--a11y-text-scale)); }
html.a11y-ready body { padding-block-end: calc(4.5rem * var(--a11y-text-scale)); }
.a11y-launch {
  position: fixed; inset-inline-end: max(.75rem, env(safe-area-inset-left));
  inset-block-end: max(.75rem, env(safe-area-inset-bottom)); z-index: 21;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 48px; max-width: calc(100% - 1.5rem); padding: .5rem .85rem;
  border: 2px solid #fff; border-radius: 100px; background: #522455; color: #fff;
  font: 700 calc(1rem * var(--a11y-text-scale))/1.35 Assistant, Arial, sans-serif;
  box-shadow: 0 2px 12px #221d1e40; cursor: pointer;
}
.a11y-launch:hover { background: #38163b; }
.a11y-launch:focus-visible { outline: 3px solid #522455; outline-offset: 3px; }
.a11y-in-dialog {
  display: inline-block; min-block-size: 44px; max-inline-size: 100%; margin-block-end: .75rem;
  padding: .45rem .65rem; border: 1px solid var(--deep); border-radius: 8px;
  color: var(--deep); background: var(--paper); font: inherit; white-space: normal; overflow-wrap: anywhere;
}
/* Reserve a separate row for the launcher while the cookie notice is visible. */
html.a11y-ready .cookie-notice {
  inset-block-end: calc(4.5rem * var(--a11y-text-scale) + env(safe-area-inset-bottom));
  max-block-size: calc(100dvh - 4.5rem * var(--a11y-text-scale) - 1rem);
}
.a11y-dialog {
  box-sizing: border-box; inline-size: min(34rem, calc(100% - 1.5rem)); max-inline-size: calc(100% - 1.5rem);
  max-block-size: calc(100dvh - 1.5rem); margin: auto; overflow: auto;
  padding: clamp(1rem, 3vw, 1.65rem); border: 2px solid #b691c3; border-radius: 18px;
  background: #fdfaf6; color: #221d1e;
  font: 400 calc(1rem * var(--a11y-text-scale))/1.55 Assistant, Arial, sans-serif;
}
.a11y-dialog::backdrop { background: #221d1e99; }
.a11y-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: .6rem; margin-block-end: .5rem; }
.a11y-dialog .a11y-heading h2 { margin: 0; font-size: 1.45em; line-height: 1.25; color: inherit; text-wrap: initial; }
.a11y-heading form { margin: 0; }
.a11y-dialog p { margin: .6rem 0; color: inherit; }
.a11y-dialog button, .a11y-dialog select {
  font: inherit; min-block-size: 44px; max-inline-size: 100%; border: 1px solid #522455;
  border-radius: 8px; padding: .45rem .65rem; background: #fff; color: #522455; cursor: pointer;
}
.a11y-dialog button { white-space: normal; overflow-wrap: anywhere; }
.a11y-dialog button:hover { background: #f0e6f4; }
.a11y-fields { display: grid; gap: .4rem; margin-block: 1rem; }
.a11y-fields > label { font-weight: 700; }
.a11y-fields select { width: 100%; min-width: 0; margin-block-end: .55rem; }
.a11y-check { display: flex; align-items: start; gap: .65rem; padding-block: .35rem; cursor: pointer; }
.a11y-check input { flex: none; inline-size: 1.25em; block-size: 1.25em; margin: .15em 0 0; accent-color: #522455; cursor: pointer; }
.a11y-dialog .a11y-note, .a11y-dialog .a11y-status { font-size: .95em; }
.a11y-dialog .a11y-status:empty { display: none; }
.a11y-statement { display: inline-block; padding-block: .4rem; color: #522455; text-decoration: underline; }
.a11y-dialog :focus-visible { outline: 3px solid #522455; outline-offset: 3px; }
html[data-a11y-links] body a[href] { text-decoration: underline !important; text-decoration-thickness: max(2px, .1em) !important; text-underline-offset: .2em; }
html[data-a11y-motion] *, html[data-a11y-motion] *::before, html[data-a11y-motion] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* High contrast preserves photographs, chart shapes, input controls and system forced-colors. */
@media not print {
  html[data-a11y-contrast="dark"] { --a11y-bg: #121212; --a11y-fg: #fff; --a11y-link: #ffe680; --a11y-border: #e0e0e0; color-scheme: dark; }
  html[data-a11y-contrast="light"] { --a11y-bg: #fff; --a11y-fg: #111; --a11y-link: #003a86; --a11y-border: #333; color-scheme: light; }
  html[data-a11y-contrast]:not([data-a11y-contrast="original"]) body {
    --ink: var(--a11y-fg); --deep: var(--a11y-link); --plum: var(--a11y-link); --muted: var(--a11y-fg);
    --paper: var(--a11y-bg); --white: var(--a11y-bg); --cream: var(--a11y-bg); --lavender: var(--a11y-bg); --line: var(--a11y-border);
  }
  html[data-a11y-contrast]:not([data-a11y-contrast="original"]) body,
  html[data-a11y-contrast]:not([data-a11y-contrast="original"]) body :where(header, nav, main, footer, section, article, aside, div, p, h1, h2, h3, h4, h5, h6, span, strong, em, small, time, label, legend, fieldset, form, details, summary, dl, dt, dd, ul, ol, li, figure, figcaption, blockquote, table, caption, th, td, dialog, button, input, select, textarea) {
    background-color: var(--a11y-bg) !important; background-image: none !important; color: var(--a11y-fg) !important;
    border-color: var(--a11y-border) !important; text-shadow: none !important; box-shadow: none !important;
  }
  html[data-a11y-contrast]:not([data-a11y-contrast="original"]) a[href] { background-color: var(--a11y-bg) !important; background-image: none !important; border-color: var(--a11y-border) !important; }
  html[data-a11y-contrast]:not([data-a11y-contrast="original"]) a[href],
  html[data-a11y-contrast]:not([data-a11y-contrast="original"]) a[href] :where(span, strong, small, em) { color: var(--a11y-link) !important; }
  html[data-a11y-contrast]:not([data-a11y-contrast="original"]) :focus-visible { outline: 3px solid var(--a11y-link) !important; outline-offset: 3px; }
}
/* Enlarged text can wrap without hiding actions or changing the default layout. */
html[data-a11y-enlarged] :where(.header-grid, .hero-copy, .feature > div, .card-copy, .detail-layout > *, .portal-title-row > *, .portal-panel, .library-card, .video-card) { min-width: 0; }
html[data-a11y-enlarged] :where(.button, .action, .members, .menu-button, .site-nav a, .site-nav summary, .portal-header nav a) { white-space: normal; overflow-wrap: anywhere; text-align: center; }
html[data-a11y-enlarged] .program-mark { inline-size: 1.6em; block-size: 1.6em; }
html[data-a11y-enlarged] .review-avatar { inline-size: 2em; block-size: 2em; }
html[data-a11y-enlarged] .reviews-summary { grid-template-columns: minmax(0, 1fr); }
html[data-a11y-enlarged] .reviews-summary p { max-inline-size: 100%; overflow-wrap: anywhere; text-align: center; }
html[data-a11y-enlarged] .reviews-score { flex-wrap: wrap; justify-content: center; max-inline-size: 100%; }
html[data-a11y-enlarged] :where(.cards:not(.journal-track), .library-grid) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
html[data-a11y-enlarged] .portal-table :is(th, td, bdi) { overflow-wrap: anywhere; white-space: normal; }
html[data-a11y-enlarged] .portal .field-pair { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 920px) {
  html[data-a11y-enlarged] :where(.hero-grid, .feature, .story-feature, .detail-layout.has-image, .contact-layout, .footer-grid) { grid-template-columns: minmax(0, 1fr); }
  html[data-a11y-enlarged] .feature-note { border-inline-start: 0; border-block-start: 1px solid var(--line); padding: 1rem 0 0; }
}
@media (max-width: 680px) {
  html[data-a11y-enlarged] .header-grid { grid-template-columns: auto minmax(0, 1fr); }
  html[data-a11y-enlarged] .members { grid-column: 2; }
  html[data-a11y-enlarged] .menu-button { grid-column: 1 / -1; justify-self: stretch; }
  html[data-a11y-enlarged] .cookie-actions { grid-template-columns: 1fr; }
  html[data-a11y-enlarged] .program-mobile-ready .program-mobile-picker { position: static; }
  html[data-a11y-enlarged] .program-picker-fields { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .a11y-launch, .a11y-dialog, .a11y-dialog button, .a11y-dialog select { border: 2px solid ButtonText; }
}
@media print {
  :root { --a11y-text-scale: 1 !important; }
  #a11y-tools { display: none !important; }
  html.a11y-ready body { padding-block-end: 0; }
}
