/* Accessibility menu and the display modes it turns on */

/* ---------- launcher button ---------- */
.a11y-widget { position: fixed; bottom: 16px; inset-inline-start: 16px; z-index: 9000; font-family: Arial, "Heebo", sans-serif; }
.a11y-open {
  width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; cursor: pointer;
  background: #0b57d0; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.a11y-open:hover { background: #0842a0; }
.a11y-open svg { width: 32px; height: 32px; fill: currentColor; }
.a11y-open:focus-visible { outline: 3px solid #000; outline-offset: 3px; }

/* ---------- panel ---------- */
.a11y-panel {
  position: fixed; bottom: 84px; inset-inline-start: 16px;
  width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 110px); overflow-y: auto;
  background: #fff; color: #1a1a1a; border: 1px solid #767676; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25); font-size: 16px; line-height: 1.4; text-align: right;
  letter-spacing: normal; word-spacing: normal; filter: none !important;
}
.a11y-panel[hidden] { display: none; }
.a11y-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  background: #0b57d0; color: #fff; padding: 12px 16px; border-radius: 10px 10px 0 0;
}
.a11y-title { margin: 0; font-size: 18px; font-weight: 700; color: #fff; }
.a11y-close { background: #fff; color: #0b57d0; border: 0; border-radius: 6px; padding: 8px 14px; min-height: 40px; font: inherit; font-weight: 700; cursor: pointer; }
.a11y-body { padding: 8px 16px 16px; }
.a11y-group-title { font-size: 15px; font-weight: 700; margin: 16px 0 8px; color: #1a1a1a; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-panel button {
  font: inherit; font-size: 15px; color: #1a1a1a; background: #f1f3f6; text-align: center;
  border: 2px solid #c4c7cc; border-radius: 8px; padding: 10px 8px; min-height: 48px; cursor: pointer;
}
.a11y-panel button:hover { border-color: #0b57d0; }
.a11y-panel button:focus-visible { outline: 3px solid #0b57d0; outline-offset: 2px; }
.a11y-panel button[aria-pressed="true"] { background: #0b57d0; color: #fff; border-color: #0b57d0; }
.a11y-panel button[aria-pressed="true"]::before { content: "✓ "; }
.a11y-size { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.a11y-size-value { min-width: 56px; text-align: center; font-weight: 700; }
.a11y-sitemap { margin-top: 10px; border: 1px solid #c4c7cc; border-radius: 8px; padding: 8px 12px; }
.a11y-sitemap ul { list-style: none; margin: 0; padding: 0; }
.a11y-sitemap li { margin: 0; }
.a11y-sitemap a { display: block; padding: 8px 0; color: #0b57d0; }
.a11y-sitemap .lvl-3 a { padding-inline-start: 16px; }
.a11y-footer { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; border-top: 1px solid #ddd; padding-top: 12px; }
.a11y-footer a { color: #0b57d0; padding: 6px 0; }
.a11y-panel .a11y-reset { background: #fff; border-color: #b3261e; color: #b3261e; font-weight: 700; }

/* ---------- reading guide, mask and tooltip ---------- */
.a11y-guide-line, .a11y-mask-layer, .a11y-tip { display: none; pointer-events: none; }
html.a11y-guide .a11y-guide-line {
  display: block; position: fixed; left: 0; right: 0; height: 10px; z-index: 8999;
  background: #ffeb3b; border-top: 2px solid #000; border-bottom: 2px solid #000; transform: translateY(-50%);
}
html.a11y-mask .a11y-mask-layer { display: block; position: fixed; inset: 0; z-index: 8998; }
.a11y-mask-top, .a11y-mask-bottom { position: absolute; left: 0; right: 0; background: rgba(0,0,0,.6); }
.a11y-mask-top { top: 0; }
.a11y-mask-bottom { bottom: 0; }
.a11y-tip {
  position: fixed; z-index: 9001; max-width: min(520px, 90vw);
  background: #1a1a1a; color: #fff; border: 2px solid #ffeb3b; border-radius: 8px;
  padding: 10px 14px; font: 400 22px/1.5 Arial, sans-serif; text-align: right;
}
.a11y-tip.is-on { display: block; }

/* ---------- text modes ---------- */
html.a11y-spacing body * { letter-spacing: .12em !important; word-spacing: .16em !important; }
html.a11y-lineheight body * { line-height: 2 !important; }
html.a11y-lineheight p { margin-bottom: 2em !important; }
html.a11y-readable body *:not(svg):not(path) { font-family: Arial, "Heebo", sans-serif !important; font-weight: 400 !important; }
html.a11y-readable .quote-hero blockquote p { text-transform: none; letter-spacing: .03em; }
html.a11y-align main, html.a11y-align main * { text-align: right !important; }
html.a11y-align main [lang="en"] { text-align: left !important; }

/* ---------- colour modes (filters skip the menu itself) ---------- */
html.a11y-invert body > *:not(.a11y-widget):not(.a11y-guide-line):not(.a11y-mask-layer):not(.a11y-tip) { filter: invert(1) hue-rotate(180deg); }
html.a11y-invert img { filter: invert(1) hue-rotate(180deg); }
html.a11y-grayscale body > *:not(.a11y-widget):not(.a11y-guide-line):not(.a11y-mask-layer):not(.a11y-tip) { filter: grayscale(1); }
html.a11y-lowsat body > *:not(.a11y-widget):not(.a11y-guide-line):not(.a11y-mask-layer):not(.a11y-tip) { filter: saturate(.4); }

html.a11y-contrast {
  --bg: #000; --bg-soft: #000; --text: #fff; --text-muted: #fff; --line: #fff; --accent: #ffeb3b; --focus: #ffeb3b;
}
html.a11y-contrast body, html.a11y-contrast .site-header { background: #000 !important; color: #fff; }
html.a11y-contrast main a, html.a11y-contrast .site-footer a, html.a11y-contrast .site-nav a { color: #ffeb3b; }
html.a11y-contrast .logo img { filter: invert(1); }
html.a11y-contrast .btn { background: #ffeb3b; color: #000; border-color: #ffeb3b; }
html.a11y-contrast .btn-ghost { background: #000; color: #ffeb3b; }
html.a11y-contrast .field input, html.a11y-contrast .field textarea { background: #000; color: #fff; border-color: #fff; }
html.a11y-contrast .field-error { color: #ff8a80; }
html.a11y-contrast .nav-toggle { color: #fff; }

html.a11y-light {
  --bg: #fff; --bg-soft: #fff; --text: #000; --text-muted: #000; --line: #000; --accent: #000; --focus: #0000cc;
}
html.a11y-light body { font-weight: 400; }
html.a11y-light main a, html.a11y-light .site-footer a { color: #0000cc; }
html.a11y-light .field input, html.a11y-light .field textarea { border-color: #000; }

html.a11y-hideimg main img, html.a11y-hideimg .site-footer img { visibility: hidden; }
html.a11y-hideimg .gallery-item, html.a11y-hideimg .card a, html.a11y-hideimg .press-card a { outline: 1px dashed var(--line); }

/* ---------- highlighting ---------- */
html.a11y-links a { text-decoration: underline !important; text-underline-offset: 3px; font-weight: 700 !important; }
html.a11y-links main a:not(.gallery-item):not(.btn), html.a11y-links .site-footer a, html.a11y-links .site-nav a { background: #fff59d !important; color: #000 !important; }
html.a11y-headings h1, html.a11y-headings h2, html.a11y-headings h3 { outline: 2px solid #0b57d0; outline-offset: 4px; background: #e8f0fe; color: #000; }
html.a11y-headings .a11y-panel h2, html.a11y-headings .a11y-panel h3 { outline: 0; background: none; }
html.a11y-focus :focus, html.a11y-focus :focus-visible { outline: 5px solid #ff6d00 !important; outline-offset: 4px !important; box-shadow: 0 0 0 9px rgba(255,109,0,.3) !important; }
html.a11y-alttext .gallery-item, html.a11y-alttext .card a, html.a11y-alttext .about-photo { cursor: help; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
html.a11y-nomotion { scroll-behavior: auto; }
html.a11y-nomotion *, html.a11y-nomotion *::before, html.a11y-nomotion *::after { transition: none !important; animation: none !important; }

/* ---------- big cursors ---------- */
html.a11y-cursorblack, html.a11y-cursorblack * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-6.5 1 3.8 7.2-2.6 1.3-3.8-7.3L4 20z' fill='%23000' stroke='%23fff' stroke-width='1.2'/%3E%3C/svg%3E") 6 3, auto !important;
}
html.a11y-cursorwhite, html.a11y-cursorwhite * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-6.5 1 3.8 7.2-2.6 1.3-3.8-7.3L4 20z' fill='%23fff' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") 6 3, auto !important;
}

@media (max-width: 340px) {
  .a11y-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .a11y-panel { bottom: 80px; max-height: calc(100vh - 100px); }
  .a11y-panel button { font-size: 14px; padding: 8px 6px; }
}
