/*
 * Meniul Accesibilitate: efectele ajustărilor și aspectul panoului.
 *
 * Ajustările se aplică prin clase pe <html> (setate de a11y-boot.js) și afectează doar .site,
 * deci panoul în sine rămâne lizibil indiferent de setări. Panoul folosește px, ca mărirea
 * fontului să nu-l deformeze.
 */

/* ======================= Ajustări de conținut ======================= */

html.a11y-highlight-titles .site :is(h1, h2, h3, h4, h5, h6) {
  outline: 3px solid var(--c-focus) !important;
  outline-offset: 4px;
}

html.a11y-highlight-links .site a {
  outline: 2px solid var(--c-focus) !important;
  outline-offset: 2px;
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  background-color: rgba(245, 183, 0, 0.18) !important;
}

html.a11y-dyslexic .site,
html.a11y-dyslexic .site *:not(code) {
  font-family: var(--font-dyslexic) !important;
}

html.a11y-letter-spacing .site * {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}

html.a11y-line-height .site * {
  line-height: 2 !important;
}

html.a11y-font-weight .site * {
  font-weight: 700 !important;
}

html.a11y-align-left .site * {
  text-align: left !important;
}

/* ======================= Ajustări de culoare ======================= */

/* Contrast întunecat: text deschis pe fundal închis. */
html.a11y-contrast-dark {
  --c-header-bg: #000000;
  --c-header-text: #ffffff;
  --c-footer-bg: #000000;
  --c-footer-text: #e6e6e6;
  --c-primary: #8fb0ff;
  --c-primary-dark: #b9ccff;
  --c-heading: #ffffff;
  --c-text: #e8e9ed;
  --c-muted: #b9bec8;
  --c-bg: #111318;
  --c-surface: #1b1e25;
  --c-card: #1b1e25;
  --c-border: #444a57;
  --c-link: #a8c2ff;
  --c-link-hover: #d3e0ff;
}

html.a11y-contrast-dark .btn,
html.a11y-contrast-dark .btn:hover,
html.a11y-contrast-dark .pagination a[aria-current="page"] {
  color: #000;
}

html.a11y-contrast-dark .btn--light {
  background: #fff;
  color: #000;
}

/* Contrast deschis: negru pe alb, fără fundaluri gri. */
html.a11y-contrast-light {
  --c-primary: #000000;
  --c-primary-dark: #000000;
  --c-heading: #000000;
  --c-text: #000000;
  --c-muted: #222222;
  --c-bg: #ffffff;
  --c-surface: #ffffff;
  --c-card: #ffffff;
  --c-border: #000000;
  --c-link: #0033aa;
  --c-link-hover: #000000;
}

/* Contrast ridicat și saturația folosesc filtre, combinabile între ele. */
html.a11y-contrast-high { --a11y-f-contrast: contrast(1.5); }
html.a11y-sat-high      { --a11y-f-sat: saturate(2); }
html.a11y-sat-low       { --a11y-f-sat: saturate(0.4); }
html.a11y-sat-mono      { --a11y-f-sat: grayscale(1); }

html.a11y-filter .site {
  filter: var(--a11y-f-contrast,) var(--a11y-f-sat,);
}

/* ======================= Ajustări de navigare ======================= */

html.a11y-stop-animations *,
html.a11y-stop-animations *::before,
html.a11y-stop-animations *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.a11y-big-cursor,
html.a11y-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4l30 18-13 3-6 14z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 8 4, auto !important;
}

html.a11y-big-cursor :is(a, button, label, summary, [role="button"]),
html.a11y-big-cursor :is(a, button, label, summary, [role="button"]) * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M18 22V8a4 4 0 018 0v12l10 2c3 .6 4.6 3 4 6l-2 10c-.4 2-2 4-4.4 4H22c-1.6 0-3-.8-3.8-2L10 30c-1.5-2.4 1.6-5.6 4-3.6z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 22 4, pointer !important;
}

.a11y-reading-guide {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 12px;
  margin-top: -6px;
  z-index: 2147483000;
  pointer-events: none;
  background: rgba(39, 48, 84, 0.85);
  border-top: 2px solid #f5b700;
  border-bottom: 2px solid #f5b700;
}

/* ======================= Panoul Meniu Accesibilitate ======================= */

.a11y-w {
  --w-primary: #273054;
  --w-bg: #f2f2f4;
  --w-tile: #ffffff;
  --w-border: #e9eaec;
  --w-label: #293c5b;
  --w-text: #1d2433;
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: normal;
  word-spacing: normal;
  text-align: left;
  color: var(--w-text);
}

.a11y-w *,
.a11y-w *::before,
.a11y-w *::after {
  box-sizing: border-box;
}

.a11y-w svg {
  display: block;
  flex: none;
}

.a11y-w :focus-visible {
  outline: 3px solid #f5b700;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #192041;
}

/* Butonul rotund: stânga jos pe desktop, dreapta jos pe mobil (ca pe site-ul actual). */
.a11y-w__trigger {
  position: fixed;
  left: 10px;
  bottom: 80px;
  z-index: 2147483100;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  background: var(--w-primary);
  color: #fff;
  border: 1.6px solid #fff;
  box-shadow: 0 5px 15px rgba(37, 44, 97, 0.15), 0 2px 4px rgba(93, 100, 148, 0.2);
  cursor: pointer;
}

.a11y-w__trigger:hover {
  background: #192041;
}

.a11y-w__trigger svg {
  width: 30px;
  height: 30px;
}

.a11y-w__tooltip {
  position: fixed;
  left: 68px;
  bottom: 92px;
  z-index: 2147483100;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.a11y-w__trigger:hover + .a11y-w__tooltip,
.a11y-w__trigger:focus-visible + .a11y-w__tooltip {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 767px) {
  .a11y-w__trigger {
    left: auto;
    right: 20px;
    bottom: 20px;
  }

  .a11y-w__tooltip {
    display: none;
  }
}

/* Când informarea despre cookie-uri e vizibilă pe mobil, butonul urcă deasupra ei (înălțimea vine din main.js). */
@media (max-width: 767px) {
  body.has-cookie-notice .a11y-w__trigger {
    bottom: calc(var(--cookie-notice-height, 120px) + 16px);
  }
}

.a11y-w__overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483200;
  background: rgba(15, 18, 30, 0.25);
}

.a11y-w__overlay[hidden],
.a11y-w__panel[hidden] {
  display: none;
}

.a11y-w__panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2147483300;
  display: flex;
  flex-direction: column;
  width: 462px;
  max-width: 100vw;
  background: var(--w-bg);
  border-radius: 0 12px 12px 0;
  box-shadow: 0 8px 26px -4px rgba(39, 40, 60, 0.35);
  overflow: hidden;
}

.a11y-w__panel:focus {
  outline: none;
}

@media (max-width: 767px) {
  .a11y-w__panel {
    width: 100vw;
    border-radius: 0;
  }
}

.a11y-w__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 15px;
  background: var(--w-primary);
  color: #fff;
}

.a11y-w__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #fff;
  font-family: inherit;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.a11y-w__title svg {
  width: 26px;
  height: 26px;
}

.a11y-w__actions {
  display: flex;
  gap: 8px;
}

.a11y-w__icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  cursor: pointer;
}

.a11y-w__icon-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}

.a11y-w__icon-btn svg {
  width: 18px;
  height: 18px;
}

.a11y-w__content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 22px 16px;
}

/* Selector de limbă */
.a11y-w__lang {
  position: relative;
  margin-bottom: 8px;
}

.a11y-w__lang-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px;
  background: var(--w-tile);
  color: var(--w-text);
  border: 1.5px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.a11y-w__lang-btn:hover {
  border-color: var(--w-primary);
}

.a11y-w__lang-code {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--w-border);
  font-size: 12px;
  font-weight: 600;
}

.a11y-w__lang-label {
  flex: 1;
}

.a11y-w__lang-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.a11y-w__lang-btn[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.a11y-w__lang-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 6px;
  background: var(--w-tile);
  border-radius: 12px;
  border: 1px solid var(--w-border);
}

.a11y-w__lang-list[hidden] {
  display: none;
}

.a11y-w__lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  color: var(--w-text);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.a11y-w__lang-option:hover,
.a11y-w__lang-option[aria-pressed="true"] {
  background: var(--w-bg);
}

.a11y-w__lang-option[aria-pressed="true"] {
  font-weight: 600;
}

/* Secțiuni și plăci */
.a11y-w__section-title {
  margin: 0;
  padding: 15px 0;
  color: var(--w-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.a11y-w__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.a11y-w__tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 110px;
  padding: 12px;
  background: var(--w-tile);
  color: var(--w-label);
  border: 1px solid var(--w-border);
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}

button.a11y-w__tile:hover {
  border-color: var(--w-primary);
}

.a11y-w__tile svg {
  width: 28px;
  height: 28px;
}

.a11y-w__tile[aria-pressed="true"] {
  border: 2px solid var(--w-primary);
  box-shadow: 0 0 0 6px rgba(39, 48, 84, 0.14);
  color: var(--w-primary);
}

.a11y-w__check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  width: 20px;
  height: 20px;
  color: var(--w-primary);
}

.a11y-w__tile[aria-pressed="true"] .a11y-w__check {
  display: block;
}

.a11y-w__check svg {
  width: 20px;
  height: 20px;
}

/* Placa pentru mărimea fontului ocupă două coloane. */
.a11y-w__tile--font {
  grid-column: span 2;
  cursor: default;
}

.a11y-w__font-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.a11y-w__font-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.a11y-w__step {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--w-primary);
  color: #fff;
  cursor: pointer;
}

.a11y-w__step:hover {
  background: #192041;
}

.a11y-w__step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.a11y-w__step svg {
  width: 18px;
  height: 18px;
}

.a11y-w__amount {
  display: grid;
  place-items: center;
  width: 100px;
  height: 40px;
  border-radius: 40px;
  background: var(--w-border);
  color: var(--w-primary);
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 380px) {
  .a11y-w__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .a11y-w__font-controls {
    gap: 8px;
  }

  .a11y-w__amount {
    width: 70px;
  }
}

/* Subsolul panoului */
.a11y-w__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0 8px;
}

.a11y-w__reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--w-primary);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.a11y-w__reset:hover {
  background: #192041;
}

.a11y-w__reset svg {
  width: 18px;
  height: 18px;
}

.a11y-w__statement {
  color: var(--w-primary);
  font-size: 14px;
  font-weight: 500;
}

@media print {
  .a11y-w,
  .a11y-reading-guide {
    display: none !important;
  }
}
