/* Accessibility layer — loaded on every page (see assets/js/a11y.js).
 * 1. A focus ring that is visible on light AND dark backgrounds (WCAG 2.4.7 / 1.4.11).
 * 2. The settings the accessibility panel writes onto <html data-gx-*>.
 * 3. The panel itself. */

/* ---------- 1. Focus ring: dark inner ring + mint outer ring ---------- */
:focus-visible {
  outline: 3px solid #39FF6A !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #1C1E21 !important;
}
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0 !important; }

/* ---------- 2a. Text size ----------
 * Zoom the text blocks, not the page: a zoomed block keeps its container's width and
 * rewraps inside it, so nothing overflows sideways (WCAG 1.4.10) even on a 320 px phone.
 * The :not() stops nested blocks (a <p> inside an <li>) from being zoomed twice. */
html[data-gx-text="1"] :is(p,li,h2,h3,h4,h5,h6,label,dt,dd,td,th,blockquote,figcaption,caption,legend):not(:is(p,li,h2,h3,h4,h5,h6,label,dt,dd,td,th,blockquote,figcaption,caption,legend) *) { zoom: 1.12; }
html[data-gx-text="2"] :is(p,li,h2,h3,h4,h5,h6,label,dt,dd,td,th,blockquote,figcaption,caption,legend):not(:is(p,li,h2,h3,h4,h5,h6,label,dt,dd,td,th,blockquote,figcaption,caption,legend) *) { zoom: 1.25; }
html[data-gx-text="3"] :is(p,li,h2,h3,h4,h5,h6,label,dt,dd,td,th,blockquote,figcaption,caption,legend):not(:is(p,li,h2,h3,h4,h5,h6,label,dt,dd,td,th,blockquote,figcaption,caption,legend) *) { zoom: 1.5; }
html[data-gx-text] .gx-a11y-panel * { zoom: 1 !important; }
html[data-gx-text] body { overflow-wrap: anywhere; } /* long e-mails / URLs at large sizes */

/* ---------- 2b. Stop animations ---------- */
html[data-gx-motion="off"] *, html[data-gx-motion="off"] *::before, html[data-gx-motion="off"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ---------- 2c. Underline links ---------- */
html[data-gx-links="1"] a { text-decoration: underline !important; text-underline-offset: 3px; }

/* ---------- 2d. Text spacing (the WCAG 1.4.12 values) ---------- */
html[data-gx-spacing="1"] body *:not(svg):not(svg *) {
  line-height: 1.5 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}
html[data-gx-spacing="1"] body p { margin-bottom: 2em !important; }

/* ---------- 2e. High contrast: white on black, yellow links ---------- */
html[data-gx-contrast="high"] body,
html[data-gx-contrast="high"] body *:not(svg):not(svg *):not(img):not(canvas):not(video):not(iframe) {
  background-color: #000 !important;
  background-image: none !important;
  color: #FFF !important;
  border-color: #FFF !important;
  text-shadow: none !important;
  box-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}
/* :not(#_) adds id-level specificity so links beat the blanket white-text rule above. */
html[data-gx-contrast="high"] body a:not(#_),
html[data-gx-contrast="high"] body a:not(#_) *:not(svg):not(svg *) { color: #FFE600 !important; }
html[data-gx-contrast="high"] body a { text-decoration: underline !important; }
html[data-gx-contrast="high"] body button,
html[data-gx-contrast="high"] body input,
html[data-gx-contrast="high"] body textarea,
html[data-gx-contrast="high"] body select { border: 2px solid #FFF !important; }
html[data-gx-contrast="high"] :focus-visible { outline-color: #FFE600 !important; box-shadow: 0 0 0 2px #000 !important; }
html[data-gx-contrast="high"] img[src*="logo_dark"] { filter: invert(1) hue-rotate(180deg); }

/* ---------- Footer legal row ----------
 * Pages position Privacy · Cookies · Accessibility absolutely beside the centred social icons;
 * with three links it collides with them. Give it its own centred line instead. */
.site-footer .gx-footer-legal {
  position: static !important;
  transform: none !important;
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ---------- 3. Panel ---------- */
.gx-a11y-fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border: 2px solid #FFFFFF;
  border-radius: 999px;
  background: #1C1E21;
  color: #FFFFFF;
  font: 600 14px/1 "DM Sans", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.gx-a11y-fab svg { width: 24px; height: 24px; fill: currentColor; flex-shrink: 0; }
.gx-a11y-fab:hover { background: #000; }
@media (max-width: 640px) {
  .gx-a11y-fab { padding: 0 10px; }
  .gx-a11y-fab .gx-a11y-fab-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Header variant: sits next to the EN/PL toggle and inherits the header's colours. */
.gx-a11y-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: 8px;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
}
.gx-a11y-btn svg { width: 24px; height: 24px; fill: currentColor; }
.gx-a11y-btn:hover { background: rgba(127,127,127,0.18); }
.gx-a11y-btn-wrap { display: inline-flex; align-items: center; }
.gx-a11y-menu-wrap { display: contents; align-items: center; justify-self: end; }
@media (max-width: 360px) {
  .gx-a11y-btn { width: 36px; height: 36px; margin-right: 4px; }
  .gx-a11y-btn svg { width: 20px; height: 20px; }
  /* make room for the extra header button on the narrowest phones */
  .site-header .brand-logo img { height: 26px !important; width: auto !important; }
}
@media print { .gx-a11y-fab, .gx-a11y-btn, .gx-a11y-panel { display: none !important; } }

.gx-a11y-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.5);
}
.gx-a11y-panel {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 9999;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  border: 2px solid #1C1E21;
  border-radius: 14px;
  background: #FFFFFF;
  color: #1C1E21;
  font: 400 16px/1.5 "DM Sans", system-ui, sans-serif;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.gx-a11y-panel[hidden], .gx-a11y-backdrop[hidden] { display: none; }
.gx-a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.gx-a11y-panel h2 { margin: 0; font: 800 20px/1.2 "Nunito", "DM Sans", sans-serif; color: #1C1E21; }
.gx-a11y-panel button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 2px solid #1C1E21;
  border-radius: 10px;
  background: #FFFFFF;
  color: #1C1E21;
  font: 600 15px/1 "DM Sans", system-ui, sans-serif;
  cursor: pointer;
}
.gx-a11y-panel button:hover { background: #F5F5F3; }
.gx-a11y-panel button[aria-pressed="true"] { background: #1C1E21; color: #FFFFFF; }
.gx-a11y-close { font-size: 22px !important; padding: 0 !important; }
.gx-a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(0,0,0,0.12);
}
.gx-a11y-row > span:first-child { font-weight: 600; }
.gx-a11y-size { display: flex; align-items: center; gap: 8px; }
.gx-a11y-size output { min-width: 3.5em; text-align: center; font-weight: 600; }
.gx-a11y-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid rgba(0,0,0,0.12); }
.gx-a11y-foot a { color: #1C1E21; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.gx-a11y-hint { margin: 10px 0 0; font-size: 13px; color: rgba(0,0,0,0.68); }
.gx-a11y-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html[data-gx-contrast="high"] body .gx-a11y-panel button[aria-pressed="true"] { background-color: #FFE600 !important; color: #000 !important; }
