/* ===================== Modul de accesibilitate ===================== */
/* Preluat de pe dashd.ro și adaptat. Culorile se setează pe fiecare site prin
   --a11y-accent și --a11y-accent-dark (vezi :root mai jos). */

:root {
  --a11y-accent: #C2410C;
  --a11y-accent-dark: #2D3748;
}

/* Link „Sari la conținut” — vizibil doar la focus (tastatură) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 10px 16px;
  z-index: 10001;
  border-radius: 0 0 4px 0;
}
.skip-link:focus {
  left: 0;
}

/* Contur de focus vizibil peste tot (tastatură) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* ---------- Buton flotant + panou ---------- */
.a11y-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--a11y-accent);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1500;
}
.a11y-toggle:hover { background: var(--a11y-accent-dark); }

.a11y-panel {
  position: fixed;
  right: 16px;
  bottom: 78px;
  width: 300px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-sizing: border-box;
  background: #fff;
  color: #14251f;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
  padding: 14px 16px 16px;
  z-index: 1500;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  text-align: left;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel h2, .a11y-dictate h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--a11y-accent-dark);
}
.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}
.a11y-row span { font-size: .88rem; }
.a11y-row .a11y-btns { display: flex; gap: 6px; }
.a11y-panel button.a11y-opt,
.a11y-dictate button.a11y-opt {
  background: #eef1ef;
  color: #14251f;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px 9px;
  font-size: .82rem;
  cursor: pointer;
}
.a11y-panel button.a11y-opt[aria-pressed="true"] {
  background: var(--a11y-accent);
  color: #fff;
  border-color: var(--a11y-accent);
}
.a11y-reset {
  width: 100%;
  margin-top: 8px;
  background: #f4f4f4;
  color: #14251f;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 7px;
  cursor: pointer;
  font-size: .85rem;
}
.a11y-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: 0;
  font-size: 1.1rem;
  cursor: pointer;
  color: #555;
}

/* ---------- Stări aplicate pe <html> ---------- */
html.a11y-font-lg { font-size: 112%; }
html.a11y-font-xl { font-size: 125%; }

html.a11y-underline a { text-decoration: underline !important; }

html.a11y-dyslexia body,
html.a11y-dyslexia body *:not(.a11y-toggle) {
  font-family: Verdana, Arial, "Trebuchet MS", sans-serif !important;
  letter-spacing: .02em;
  word-spacing: .05em;
}

/* Contrast ridicat — general, ca să acopere și stilurile scrise direct în
   articole (tabele, casete): fundal negru, text alb, linkuri galbene.
   Imaginile de fundal rămân, se schimbă doar culorile. */
html.a11y-contrast body,
html.a11y-contrast body *:not(img):not(svg):not(svg *):not(video):not(iframe):not(.a11y-toggle) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html.a11y-contrast a,
html.a11y-contrast a * { color: #ffe066 !important; }
html.a11y-contrast .a11y-panel button.a11y-opt[aria-pressed="true"] {
  background-color: #ffe066 !important;
  color: #000 !important;
}
html.a11y-contrast .a11y-toggle { background: #000 !important; border-color: #ffe066 !important; }

/* Filtrul se pune pe copiii lui body, nu pe body: un filter pe body ar face ca
   butonul fix (position: fixed) să se ancoreze de pagină și să plece la scroll. */
html.a11y-grayscale body > *:not(.a11y-root) { filter: grayscale(100%); }

/* ---------- Ghid de citire ---------- */
/* Bandă orizontală care urmărește cursorul; restul paginii se întunecă
   ușor deasupra și dedesubt, ca ochiul să rămână pe rândul curent. */
.a11y-guide-band {
  position: fixed;
  left: 0;
  width: 100%;
  height: 44px;
  top: 40%;
  pointer-events: none;
  z-index: 1400;
  background: rgba(255, 224, 102, .16) !important;
  border-top: 2px solid rgba(169, 122, 47, .75);
  border-bottom: 2px solid rgba(169, 122, 47, .75);
  box-shadow: 0 -100vh 0 100vh rgba(0, 0, 0, .45), 0 100vh 0 100vh rgba(0, 0, 0, .45) !important;
}
.a11y-guide-band[hidden] { display: none; }

/* ---------- Vorbire în text ---------- */
.a11y-dictate {
  position: fixed;
  right: 16px;
  bottom: 78px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  background: #fff;
  color: #14251f;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
  padding: 14px 16px 16px;
  z-index: 1600;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  text-align: left;
}
.a11y-dictate[hidden] { display: none; }
.a11y-dictate-hint { font-size: .82rem; color: #666; margin: 0 0 10px; }
.a11y-dictate textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
  font-family: inherit;
  font-size: .88rem;
  resize: vertical;
}
.a11y-dictate-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
#a11yDictateStart[aria-pressed="true"] {
  background: #b3261e;
  color: #fff;
  border-color: #b3261e;
}

@media print {
  .a11y-root, .skip-link { display: none !important; }
}
