/* Shared accessibility overrides: same controls for students, staff and visitors. */
:root {
  --a11y-control-bg: #bd3515;
  --a11y-control-text: #fff;
}
html[data-font-scale="normal"] { font-size: 100% !important; }
html[data-font-scale="small"] { font-size: 93.75% !important; }
html[data-font-scale="large"] { font-size: 125% !important; }
html[data-font-scale="xlarge"] { font-size: 150% !important; }
html[data-font-scale="largest"] { font-size: 200% !important; }

html .a11y-panel .a11y-segmented--theme { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html .a11y-panel .a11y-segmented--theme button { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
html .a11y-panel .a11y-font-select {
  display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: 10px;
  border: 1px solid var(--border, var(--line, #666)); border-radius: 10px; padding: 8px 10px;
  background: var(--bg, var(--bg-base, #0f1010)); color: inherit; font: inherit; font-size: .75rem;
}
html .a11y-panel .a11y-font-select:focus-visible { outline: 3px solid var(--accent, #bd3515); outline-offset: 3px; }
html .a11y-panel .a11y-panel__header > div { min-width: 0; }
html .a11y-panel .a11y-panel__header { position: sticky; top: -22px; z-index: 2; margin: -22px -22px 0; padding: 22px 22px 8px; background: inherit; }
html .a11y-panel .a11y-toggle > span:first-child > i { font-size: min(1rem, 20px); }
html .a11y-panel h2 { overflow-wrap: anywhere; }
html:is([data-font-scale="xlarge"],[data-font-scale="largest"]) .a11y-panel .a11y-segmented--theme { grid-template-columns: 1fr; }
html:is([data-font-scale="xlarge"],[data-font-scale="largest"]) .news-action-row,
html:is([data-font-scale="xlarge"],[data-font-scale="largest"]) .news-schedule__row { grid-template-columns: minmax(0,1fr); }
html:is([data-font-scale="xlarge"],[data-font-scale="largest"]) .news-stats { flex-direction: column; }
html:is([data-font-scale="xlarge"],[data-font-scale="largest"]) .news-composer { position: static; }

/* Reading preferences affect content, not navigation or the settings dialog. */
html[data-reading-spacing="true"] :is(main,.main-content,.app) :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,blockquote,[contenteditable],.news-rich-body):not(.a11y-panel *) {
  line-height: 1.8 !important; letter-spacing: .12em !important; word-spacing: .16em !important;
  overflow-wrap: anywhere;
}
html[data-reading-spacing="true"] :is(main,.main-content,.app) p:not(.a11y-panel *) { margin-bottom: 2em !important; }

html .a11y-panel .a11y-segmented button[aria-pressed="true"],
html .news-button--primary,
html .sietec-news-editor .news-link-save {
  background: var(--a11y-control-bg) !important;
  border-color: var(--a11y-control-bg) !important;
  color: var(--a11y-control-text) !important;
}
html .a11y-panel .a11y-toggle[aria-pressed="true"] .a11y-switch {
  background: var(--a11y-control-bg) !important;
}
html .a11y-panel :is(.a11y-icon-button,.a11y-segmented button,.a11y-reset) { min-height: 44px; }
html .a11y-panel .a11y-icon-button { width: 44px; height: 44px; }
html .a11y-panel :is(.a11y-setting,.a11y-toggle) { min-width: 0; }
html .a11y-panel .a11y-toggle > span:first-child { min-width: 0; }
html .a11y-panel :is(strong,small) { overflow-wrap: anywhere; }

html[data-contrast="high"] {
  --a11y-control-bg: #8f2200;
  --brand-muted: var(--brand-text);
  --brand-line: var(--brand-text);
}
html[data-contrast="high"][data-theme="light"] {
  --brand-bg: #fff; --brand-surface: #fff; --brand-text: #000;
  --a11y-surface: #fff; --a11y-text: #000; --a11y-line: #333;
}
html[data-contrast="high"][data-theme="dark"] {
  --brand-bg: #000; --brand-surface: #080808; --brand-text: #fff;
  --a11y-surface: #080808; --a11y-text: #fff; --a11y-line: #ddd;
}
html[data-contrast="high"] .a11y-panel {
  background: var(--a11y-surface) !important;
  color: var(--a11y-text) !important;
  border-color: var(--a11y-line) !important;
}
html[data-contrast="high"] .a11y-panel :is(h2,strong,small,.a11y-panel__description,.a11y-panel__eyebrow,.a11y-toggle) { color: var(--a11y-text) !important; }
html[data-contrast="high"] .a11y-panel :is(.a11y-setting,.a11y-toggle) { border-color: var(--a11y-line) !important; }
html[data-contrast="high"] .a11y-panel :is(.a11y-icon-button,.a11y-reset,.a11y-font-select,.a11y-segmented button:not([aria-pressed="true"])) {
  background: var(--a11y-surface) !important; color: var(--a11y-text) !important; border-color: var(--a11y-line) !important;
}
html[data-contrast="high"] .a11y-panel .a11y-switch { background: var(--a11y-line) !important; }
html[data-reduce-motion="true"] *,
html[data-reduce-motion="true"] *::before,
html[data-reduce-motion="true"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important;
  transition-duration: .001ms !important; scroll-behavior: auto !important;
}
