/* HBL Accessibility widget. */
.hbla11y {
  all: revert; position: fixed; z-index: 2147483000;
  --hbla11y-primary: #A72C32;
  --hbla11y-accent-active: #AC302E;
  --hbla11y-panel-bg: #EDEBE8;
  --hbla11y-surface: #DBD8D3;
  --hbla11y-icon: #AC302E;
}
.hbla11y, .hbla11y * { box-sizing: border-box; font-family: Verdana, Geneva, sans-serif; }
.hbla11y--bottom-right { right: 16px; bottom: 16px; }
.hbla11y--bottom-left  { left: 16px;  bottom: 16px; }
.hbla11y--top-right    { right: 16px; top: 16px; }
.hbla11y--top-left     { left: 16px;  top: 16px; }

.hbla11y__launcher {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--hbla11y-primary, #A72C32);
  background: rgba(255,255,255,.9); color: var(--hbla11y-primary, #A72C32); cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
}
.hbla11y__launcher:hover, .hbla11y--open .hbla11y__launcher {
  background: var(--hbla11y-primary, #A72C32); color: #fff;
}
.hbla11y__icon { display: flex; }
.hbla11y__launcher:focus-visible, .hbla11y__ctl:focus-visible,
.hbla11y__close:focus-visible, .hbla11y__reset:focus-visible, .hbla11y__step:focus-visible {
  outline: 3px solid #ffbf47; outline-offset: 2px;
}
.hbla11y__panel {
  position: absolute; bottom: 70px; width: min(250px, calc(100vw - 32px)); max-height: calc(100vh - 96px); overflow: auto;
  background: var(--hbla11y-panel-bg); color: #1a1a1a; border: 1px solid #767676; border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,.4); padding: 8px;
}
.hbla11y--bottom-right .hbla11y__panel, .hbla11y--top-right .hbla11y__panel { right: 0; }
.hbla11y--bottom-left  .hbla11y__panel, .hbla11y--top-left  .hbla11y__panel { left: 0; }
.hbla11y--top-right .hbla11y__panel, .hbla11y--top-left .hbla11y__panel { top: 70px; bottom: auto; }
.hbla11y__header {
  display: flex; align-items: center; gap: 8px;
  margin: -8px -8px 6px; padding: 6px 10px;
  background: var(--hbla11y-primary, #A72C32); color: #fff;
  border-radius: 8px 8px 0 0;
}
.hbla11y__headicon { display: flex; color: #fff; }
.hbla11y__title { font-size: 16px; margin: 0; color: #fff; text-transform: uppercase; letter-spacing: .04em; flex: 1; }
.hbla11y__close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: #fff; }
.hbla11y__group {
  border: 1px solid var(--hbla11y-accent-active, #AC302E); border-radius: 6px; margin: 0 0 6px; padding: 5px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.hbla11y__legend {
  grid-column: 1 / -1; margin: 0; padding: 0 4px; border: 0; width: auto; float: none;
  font-weight: bold; font-size: 12px; line-height: 1.4;
  color: var(--hbla11y-accent-active, #AC302E); text-transform: uppercase; letter-spacing: .04em;
}
.hbla11y__ctl, .hbla11y__step, .hbla11y__reset {
  margin: 0; padding: 3px 8px; min-height: 28px; font-size: 13px;
  border: 1px solid #767676; border-radius: 6px; background: var(--hbla11y-surface, #DBD8D3); color: #1a1a1a; cursor: pointer;
}
.hbla11y__toggle {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
}
.hbla11y__toggle .hbla11y__ico { color: var(--hbla11y-icon, #AC302E); display: flex; }
.hbla11y__toggle:hover { background: var(--hbla11y-primary, #A72C32); color: #fff; }
.hbla11y__toggle:hover .hbla11y__ico { color: #fff; }
.hbla11y__toggle[aria-pressed="true"] { background: var(--hbla11y-accent-active, #AC302E); color: #fff; border-color: var(--hbla11y-accent-active, #AC302E); }
.hbla11y__toggle[aria-pressed="true"] .hbla11y__ico { color: #fff; }
.hbla11y__stepper { grid-column: 1 / -1; display: flex; align-items: stretch; gap: 0; }
.hbla11y__stepper .hbla11y__step {
  border-radius: 0; margin: 0; min-width: 48px; font-weight: bold; flex: 0 0 auto;
}
.hbla11y__stepper .hbla11y__step:first-child { border-radius: 6px 0 0 6px; }
.hbla11y__stepper .hbla11y__step:last-child { border-radius: 0 6px 6px 0; }
.hbla11y__stepval { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; border: 1px solid #767676; border-left: 0; border-right: 0; background: #fff; padding: 0 8px; text-align: center; }
.hbla11y__cycle { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; text-align: left; }
.hbla11y__cycle .hbla11y__ico { color: var(--hbla11y-icon, #AC302E); display: flex; }
.hbla11y__cycle .hbla11y__label { flex: 1; }
.hbla11y__cycle .hbla11y__chev { font-size: 18px; line-height: 1; color: var(--hbla11y-accent-active, #AC302E); }
.hbla11y__cycle:hover { background: var(--hbla11y-primary, #A72C32); color: #fff; }
.hbla11y__cycle:hover .hbla11y__ico, .hbla11y__cycle:hover .hbla11y__chev { color: #fff; }
.hbla11y__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.hbla11y__reset { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--hbla11y-surface, #DBD8D3); }
.hbla11y__reset .hbla11y__ico { color: var(--hbla11y-accent-active, #AC302E); display: flex; }
.hbla11y__reset:hover { background: var(--hbla11y-primary, #A72C32); color: #fff; }
.hbla11y__reset:hover .hbla11y__ico { color: #fff; }
.hbla11y__statement { font-size: 13px; color: var(--hbla11y-accent-active, #AC302E); white-space: nowrap; }
.hbla11y__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hbla11y__panel[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .hbla11y, .hbla11y * { transition: none !important; } }

/* Typography effects (scoped to page, not the widget UI). */
/* Scale text from the ROOT only. Multiplying every element by `em` would compound
   with DOM nesting (depth^scale), so we scale the root font-size once; rem/em/%-based
   page text then scales uniformly without compounding. */
html.hbla11y-fontscale { font-size: calc(100% * var(--hbla11y-fontscale, 1)) !important; }
html.hbla11y-font-readable body *:not(.hbla11y):not(.hbla11y *) {
  font-family: Arial, Verdana, "Segoe UI", sans-serif !important;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../fonts/OpenDyslexic-Regular.woff2') format('woff2');
  font-display: swap;
}
html.hbla11y-font-dyslexic body *:not(.hbla11y):not(.hbla11y *) {
  font-family: 'OpenDyslexic', Arial, sans-serif !important;
}
html.hbla11y-bold body *:not(.hbla11y):not(.hbla11y *) { font-weight: 700 !important; }

/* Contrast / color effects. Filters on <html> exclude the widget root. */
html.hbla11y-contrast-invert    { filter: invert(1) hue-rotate(180deg); background: #fff; }
html.hbla11y-contrast-grayscale { filter: grayscale(1); }
html.hbla11y-contrast-invert .hbla11y,
html.hbla11y-contrast-grayscale .hbla11y { filter: none; } /* keep widget legible */
html.hbla11y-contrast-hc-dark body *:not(.hbla11y):not(.hbla11y *) {
  background-color: #000 !important; color: #fff !important; border-color: #fff !important;
}
html.hbla11y-contrast-hc-dark body a:not(.hbla11y *) { color: #ffff00 !important; }
html.hbla11y-contrast-hc-light body *:not(.hbla11y):not(.hbla11y *) {
  background-color: #fff !important; color: #000 !important; border-color: #000 !important;
}
html.hbla11y-contrast-hc-light body a:not(.hbla11y *) { color: #00309d !important; }

/* Reading aids. */
html.hbla11y-hl-links body a:not(.hbla11y *) {
  outline: 2px solid #ffbf47 !important; background: #fff8e1 !important;
  text-decoration: underline !important; color: #00309d !important;
}
html.hbla11y-hl-headings body :is(h1,h2,h3,h4,h5,h6):not(.hbla11y *) {
  outline: 2px dashed var(--hbla11y-primary, #A72C32) !important; background: #fbecec !important;
}
html.hbla11y-big-cursor, html.hbla11y-big-cursor body *:not(.hbla11y *) {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M6 2l30 18-12 3 7 14-5 3-7-14-9 9z" fill="black" stroke="white" stroke-width="2"/></svg>') 4 2, auto !important;
}
.hbla11y-overlay { position: fixed; left: 0; right: 0; pointer-events: none; z-index: 2147482000; }
#hbla11y-mask  { top: 0; bottom: 0; }

/* Motion & media. */
html.hbla11y-no-motion body *:not(.hbla11y):not(.hbla11y *) {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
html.hbla11y-no-blink body *:not(.hbla11y):not(.hbla11y *) { animation: none !important; }
html.hbla11y-hide-images body img:not(.hbla11y *) { visibility: hidden !important; }
html.hbla11y-hide-images body *:not(.hbla11y):not(.hbla11y *) { background-image: none !important; }
