/* ============================
   MENU GŁÓWNE – KONTRASTY + ACTIVE
   ============================ */

/* 🔵 Normalny kontrast */
body[data-contrast="normal"] #menu-menu-glowne {
  background-color: #fff;
  border: 1px solid #e9ecef;
}
body[data-contrast="normal"] #menu-menu-glowne .nav-link {
  color: #212529;
}
body[data-contrast="normal"] #menu-menu-glowne .nav-link.active,
body[data-contrast="normal"] #menu-menu-glowne .dropdown-item.active {
  background-color: #4b6e8a !important;  /* brand */
  color: #fff !important;
  font-weight: 600;                      /* 🔥 wyróżnienie */
}
body[data-contrast="normal"] #menu-menu-glowne .dropdown-menu {
  background-color: #fff;
  border: 1px solid #dee2e6;
}

/* ⚫ High contrast (czarny na białym) */
body[data-contrast="high"] #menu-menu-glowne {
  background-color: #fff !important;
  border: 2px solid #000 !important;
}
body[data-contrast="high"] #menu-menu-glowne .nav-link {
  color: #000 !important;
}
body[data-contrast="high"] #menu-menu-glowne .nav-link.active,
body[data-contrast="high"] #menu-menu-glowne .dropdown-item.active {
  background-color: #000 !important;
  color: #fff !important;
  font-weight: 700;
}
body[data-contrast="high"] #menu-menu-glowne .dropdown-menu {
  background-color: #fff !important;
  border: 2px solid #000 !important;
}
body[data-contrast="high"] #menu-menu-glowne .dropdown-item {
  color: #000 !important;
}

/* 🟡 Max contrast (żółty na czarnym) */
body[data-contrast="max"] #menu-menu-glowne {
  background-color: #000 !important;
  border: 2px solid #ffeb3b !important;
}
body[data-contrast="max"] #menu-menu-glowne .nav-link {
  color: #ffeb3b !important;
}
body[data-contrast="max"] #menu-menu-glowne .nav-link.active,
body[data-contrast="max"] #menu-menu-glowne .dropdown-item.active {
  background-color: #444 !important;
  color: #ffeb3b !important;
  font-weight: 700;
  border-left: 4px solid #ffeb3b;        /* żółty akcent */
}
body[data-contrast="max"] #menu-menu-glowne .dropdown-menu {
  background-color: #000 !important;
  border: 2px solid #ffeb3b !important;
}
body[data-contrast="max"] #menu-menu-glowne .dropdown-item {
  color: #ffeb3b !important;
}

/* =============================
   Navbar toggler – WCAG contrast
   ============================= */

/* Normalny kontrast */
body[data-contrast="normal"] .navbar-toggler {
  border: 1px solid #4b6e8a; /* brand */
  background-color: #fff;
}
body[data-contrast="normal"] .navbar-toggler-icon {
  background-image: var(--bs-navbar-toggler-icon-bg); /* bootstrap domyślny */
}

/* Wysoki kontrast (czarny na białym) */
body[data-contrast="high"] .navbar-toggler {
  border: 2px solid #000;
  background-color: #fff;
}
body[data-contrast="high"] .navbar-toggler-icon {
  background-image: none;
  position: relative;
}
body[data-contrast="high"] .navbar-toggler-icon::before,
body[data-contrast="high"] .navbar-toggler-icon::after,
body[data-contrast="high"] .navbar-toggler-icon span {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background-color: #000;
  margin: 5px auto;
}

/* Maksymalny kontrast (żółty na czarnym) */
body[data-contrast="max"] .navbar-toggler {
  border: 2px solid #ffeb3b;
  background-color: #000;
}
body[data-contrast="max"] .navbar-toggler-icon {
  background-image: none;
  position: relative;
}
body[data-contrast="max"] .navbar-toggler-icon::before,
body[data-contrast="max"] .navbar-toggler-icon::after,
body[data-contrast="max"] .navbar-toggler-icon span {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background-color: #ffeb3b;
  margin: 5px auto;
}



/* ------------ */
/* Hit-target =  i wyrazny focus */
.btn-group .btn {
  min-width: 24px;
}
.btn {
  min-width: 24px;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  line-height: 1.2;
}
.btn:focus-visible {
  outline: 1spx solid #0d6efd;
  outline-offset: 0spx;
}

/* Rozmiary Bootstrapowe - tez zgodne z WCAG */
.btn-sm {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.btn-lg {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

/* Stany aktywne dla przyciskow dostepnosci */
.btn[aria-pressed="true"] {
  background-color: #000;
  border-color: #000;
  color: #fff;
}

/* Tryby rozmiaru fontu */
html[data-font="A"] {
  font-size: 100%;
} /* 16px */
html[data-font="A+"] {
  font-size: 112.5%;
} /* ~18px */
html[data-font="A++"] {
  font-size: 125%;
} /* ~20px */

/* Tryby kontrastu */
body[data-contrast="normal"] {
  color: #212529;
  background: #fff;
}
body[data-contrast="high"] {
  color: #0c0c0d;
  background: #ffffff;
}
body[data-contrast="high"] a:not(.btn):not(.nav-link):not(.navbar-brand) {
  color: #0a58ca;
  text-decoration: underline;
}

body[data-contrast="max"] {
  color: #ffffff;
  background: #000000;
}
body[data-contrast="max"] a:not(.btn):not(.nav-link):not(.navbar-brand) {
  color: #ffeb3b;
  text-decoration: underline;
}
body[data-contrast="max"] .card-text {
  color: #ffffff !important;
  background: #000000;
}
body[data-contrast="max"] time {
  color: #ffffff !important;
  background: #000000;
}

/* opcjonalnie: karty, borders w trybie max */
body[data-contrast="max"] .card {
  background: #000;
  border-color: #fff;
}
body[data-contrast="max"] .btn:not(.a11y-contrast):not(.a11y-font):not(.btnc) {
  border-color: #fff;
  color: #000;
  background: #fff;
}

/* ---------- BASE zmienne ---------- */
:root {
  --bg: #ffffff;
  --text: #212529;
  --link: #0d6efd;
  --link-visited: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
  --card-bg: #ffffff;
  --card-border: #e9ecef;
  --btn-primary-bg: #0d6efd;
  --btn-primary-text: #ffffff;
  --btn-outline: #0d6efd;
}

/* Dark theme */
html[data-theme="dark"] {
  --bg: #121212;
  --text: #e9ecef;
  --link: #84c1ff;
  --link-visited: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
  --card-bg: #1e1e1e;
  --card-border: #343a40;
  --btn-primary-bg: #0d6efd;
  --btn-primary-text: #ffffff;
  --btn-outline: #84c1ff;
}

/* Auto: system prefers dark */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #121212;
    --text: #e9ecef;
    --link: #84c1ff;
    --link-visited: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
    --card-bg: #1e1e1e;
    --card-border: #343a40;
    --btn-primary-bg: #0d6efd;
    --btn-primary-text: #ffffff;
    --btn-outline: #84c1ff;
  }
}

/* Zastosowanie zmiennych (tylko normalny kontrast) */
body[data-contrast="normal"] {
  background: var(--bg);
  color: var(--text);
}
body[data-contrast="normal"]
  a:not(.btn):not(.nav-link):not(.navbar-brand).not(.wp-block-file__button) {
  color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
}
body[data-contrast="normal"]
  a:not(.btn):not(.nav-link):not(.navbar-brand):visited {
  -color: var(--link-visited);
}
body[data-contrast="normal"] .card {
  background: var(--card-bg);
  border-color: var(--card-border);
}

/* ---------- KONTRAST (ma pierwszenstwo nad theme) ---------- */
body[data-contrast="high"] .card {
  background: #fff;
  border-color: #000;
}
body[data-contrast="high"] .btn {
  border-color: #000;
}

/*  */
/* Dropdown dostepnosci w navbarze */
.nav-a11y .dropdown-menu {
  min-width: 220px; /* nie za szerokie */
  max-width: 260px;
  padding: 0.75rem;
  font-size: 0.9rem;
}

.nav-a11y .btn-group .btn {
  flex: 1 1 auto; /* równe szerokosci */
  min-width: 44px; /* WCAG hit target */
  min-height: 44px;
  font-size: 0.85rem;
  padding: 0.375rem 0.5rem;
}

/* Odstepy miedzy grupami w dropdownie */
.nav-a11y .btn-group {
  margin-bottom: 0.5rem;
}

.nav-a11y .btn-group:last-child {
  margin-bottom: 0; /* bez nadmiarowego odstepu */
}

/* Na bardzo malych ekranach (smartfony) */
@media (max-width: 576px) {
  .nav-a11y .dropdown-menu {
    min-width: 180px;
    font-size: 0.85rem;
  }
}

/* ========================= */
/* KONTRAST NORMAL (domyslny) */
/* ========================= */
body[data-contrast="normal"] .navbar .nav-link {
  color: #212529;
  text-transform: uppercase !important;
}
body[data-contrast="normal"] .navbar .nav-link:hover,
body[data-contrast="normal"] .navbar .nav-link:focus {
  color: #222;
  background-color: rgba(13, 110, 253, 0.1);
  text-decoration: underline;
  text-transform: uppercase !important;
}
body[data-contrast="normal"] .navbar .nav-link.active {
  color: #fff;
  background-color: #4b6e8a;
  border-radius: 4px;
}
body[data-contrast="normal"] .navbar-brand {
  color: #000 !important;
}
body[data-contrast="normal"] .navbar-brand:hover,
body[data-contrast="normal"] .navbar-brand:focus {
  color: #444 !important;
  text-decoration: underline;
}
body[data-contrast="normal"] .bg-counters {
  background-color: #4b6e8a;
  border: 1px transparent solid !important;
}

/* ========================= */
/* KONTRAST WYSOKI (high)    */
/* ========================= */
body[data-contrast="high"] .navbar,
body[data-contrast="high"] .dropdown-menu {
  background-color: #ffffff !important;
}
body[data-contrast="high"] .navbar .nav-link {
  color: #0c0c0d !important;
}
body[data-contrast="high"] .navbar .nav-link:hover,
body[data-contrast="high"] .navbar .nav-link:focus {
  color: #0a58ca !important;
  background-color: #e9ecef !important;
  text-decoration: underline;
}
body[data-contrast="high"] .navbar .nav-link.active {
  color: #fff !important;
  background-color: #0a58ca !important;
}
body[data-contrast="high"] .navbar-brand {
  color: #0c0c0d !important;
}
body[data-contrast="high"] .navbar-brand:hover,
body[data-contrast="high"] .navbar-brand:focus {
  color: #0a58ca !important;
  text-decoration: underline;
}
body[data-contrast="high"] .bg-counters {
  background-color: #000;
  border: 1px #fff solid !important;
}

/* ========================= */
/* KONTRAST MAKSYMALNY (max) */
/* ========================= */
body[data-contrast="max"] .navbar,
body[data-contrast="max"] .dropdown-menu {
  background-color: #000000 !important;
  border-bottom: 2px solid #fff;
}
body[data-contrast="max"] .navbar .nav-link {
  color: #000 !important;
}
body[data-contrast="max"] .navbar .nav-link:hover,
body[data-contrast="max"] .navbar .nav-link:focus {
  color: #ffeb3b !important; /* zolty */
  background-color: #222 !important;
  text-decoration: underline;
}
body[data-contrast="max"] .navbar .nav-link.active {
  background-color: #888 !important;
  color: #fff !important;
}
body[data-contrast="max"] .navbar-brand {
  color: #fff !important;
}
body[data-contrast="max"] .navbar-brand:hover,
body[data-contrast="max"] .navbar-brand:focus {
  color: #ffeb3b !important;
  text-decoration: underline;
}
body[data-contrast="max"] .bg-counters {
  background-color: #000 !important;
  border: 1px #fff solid !important;
}

/* ========================= */
/* KONTRASTY - stopka        */
/* ========================= */

/* --- Normal (domyslny) --- */
body[data-contrast="normal"] footer {
  background-color: #f8f9fa !important; /* bg-body-tertiary */
  color: #212529 !important;
}
body[data-contrast="normal"] footer a {
  color: #08244f !important;
  text-decoration: none;
}
body[data-contrast="normal"] footer a:hover,
body[data-contrast="normal"] footer a:focus {
  text-decoration: underline;
}

/* --- Wysoki kontrast (high) --- */
body[data-contrast="high"] footer {
  background-color: #ffffff !important;
  color: #0c0c0d !important;
  border-top: 2px solid #000;
}
body[data-contrast="high"] footer a {
  color: #0a58ca !important;
  text-decoration: underline;
}
body[data-contrast="high"] footer a:hover,
body[data-contrast="high"] footer a:focus {
  background-color: #e9ecef !important;
  text-decoration: underline;
}

/* --- Maksymalny kontrast (max) --- */
body[data-contrast="max"] footer {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-top: 2px solid #fff;
}
body[data-contrast="max"] footer a {
  color: #ffeb3b !important; /* zolty link */
  text-decoration: underline;
}
body[data-contrast="max"] footer a:hover,
body[data-contrast="max"] footer a:focus {
  color: #ffeb3b !important;
  text-decoration: underline !important;
}

/* Tekst w stopce: .text-muted - pelna czytelnosc w kazdym trybie */
body[data-contrast="normal"] footer .text-muted {
  --bs-text-opacity: 1; /* wylacz przygaszenie */
  color: #6c757d !important; /* klasyczne muted */
}

body[data-contrast="high"] footer .text-muted {
  --bs-text-opacity: 1;
  color: #0c0c0d !important; /* prawie czarny na bialym */
}

body[data-contrast="max"] footer .text-muted {
  --bs-text-opacity: 1;
  color: #ffffff !important; /* bialy tekst na czerni */
}

/* Naglowki postow w listach (np. .fs-5.fw-bold) */
body[data-contrast="normal"] h1,
body[data-contrast="normal"] h2,
body[data-contrast="normal"] h3,
body[data-contrast="normal"] h4,
body[data-contrast="normal"] h5,
body[data-contrast="normal"] h6 {
  color: #222 !important; /* ciemny tekst */
}
body[data-contrast="normal"] h2.display-5 {
  color: #fff !important; /* ciemny tekst */
}

body[data-contrast="high"] h1,
body[data-contrast="high"] h2,
body[data-contrast="high"] h3,
body[data-contrast="high"] h4,
body[data-contrast="high"] h5,
body[data-contrast="high"] h6 {
  color: #0c0c0d !important; /* wyrazny czarny */
  background-color: #ffffff !important; /* kontrastowy bialy */
}

body[data-contrast="max"] h1,
body[data-contrast="max"] h2,
body[data-contrast="max"] h3,
body[data-contrast="max"] h4,
body[data-contrast="max"] h5,
body[data-contrast="max"] h6 {
  color: #ffeb3b !important; /* zolty na czerni */
  background-color: #000000 !important;
}

/* ======================================= */
/* Stylowanie panelu dostępności (.a11b)   */
/* ======================================= */

/* Normalny kontrast */
body[data-contrast="normal"] .a11b.btn {
  background-color: #fff;
  border-color: #4b6e8a;
  color: #4b6e8a;
}
body[data-contrast="normal"] .a11b.btn[aria-pressed="true"] {
  background-color: #4b6e8a;
  color: #fff;
}

/* Wysoki kontrast (czarny tekst na białym tle) */
body[data-contrast="high"] .a11b.btn {
  background-color: #ffffff;
  border-color: #000;
  color: #000;
}
body[data-contrast="high"] .a11b.btn[aria-pressed="true"] {
  background-color: #000;
  color: #fff;
}

/* Maksymalny kontrast (żółty na czarnym) */
body[data-contrast="max"] .a11b.btn {
  background-color: #000;
  border-color: #fff;
  color: #fff;
}
body[data-contrast="max"] .a11b.btn[aria-pressed="true"] {
  background-color: #ffeb3b;
  border-color: #ffeb3b;
  color: #000;
}

/* Focus dla WCAG */
.a11b.btn:focus-visible {
  outline: 3px solid #ffeb3b;
  outline-offset: 2px;
}

/* ======================================= */
/* Modal wyszukiwania WCAG                 */
/* ======================================= */

/* Normalny kontrast */
body[data-contrast="normal"] #searchModal .modal-content {
  background-color: #fff;
  color: #212529;
}
body[data-contrast="normal"] #searchModal .form-control {
  background-color: #fff;
  color: #212529;
  border-color: #ced4da;
}
body[data-contrast="normal"] #searchModal .btn {
  background-color: #212529;
  color: #fff;
}

/* Wysoki kontrast */
body[data-contrast="high"] #searchModal .modal-content {
  background-color: #ffffff !important;
  color: #000 !important;
  border: 2px solid #000;
}
body[data-contrast="high"] #searchModal .form-control {
  background-color: #fff !important;
  color: #000 !important;
  border: 2px solid #000;
}
body[data-contrast="high"] #searchModal .btn {
  background-color: #000 !important;
  color: #fff !important;
  border: 2px solid #000;
}

/* Maksymalny kontrast */
body[data-contrast="max"] #searchModal .modal-content {
  background-color: #000 !important;
  color: #fff !important;
  border: 2px solid #fff;
}
body[data-contrast="max"] #searchModal .form-control {
  background-color: #000 !important;
  color: #ffeb3b !important;
  border: 2px solid #ffeb3b;
}
body[data-contrast="max"] #searchModal .btn {
  background-color: #ffeb3b !important;
  color: #000 !important;
  border: 2px solid #ffeb3b;
}

/* Focus — żółta ramka dla wszystkich trybów */
#searchModal .form-control:focus-visible,
#searchModal .btn:focus-visible {
  outline: 3px solid #ffeb3b;
  outline-offset: 2px;
}

/* cookies tekst */
code {
  padding: 0.1em 0.3em;
  border-radius: 0.2em;
  font-family: monospace;
  font-size: 0.95em;
  background: #f8f9fa; /* jasne tlo domyslne */
  color: #c7254e !important; /* ciemny r�z � dobry kontrast */
}
