/**
 * UJK WCAG - Frontend Styles
 * Zgodność z WCAG 2.2, lekki, nieinwazyjny dla Bootstrapa
 */

:root {
    --ujk-wcag-primary: #e52528; /* Barwa UJK / domyślna czerwień */
    --ujk-wcag-primary-hover: #b81b1e;
    --ujk-wcag-bg: #ffffff;
    --ujk-wcag-text: #212529;
    --ujk-wcag-border: #dee2e6;
    --ujk-wcag-focus-ring: #000000; /* Domyślny czarny fokus */
    --ujk-wcag-radius: 8px;
    --ujk-wcag-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    --ujk-wcag-font-scale: 1;
}

/* -------------------------------------------------------------
 * 1. Elementy ułatwień bazowych (Screen reader & Skip Link)
 * ----------------------------------------------------------- */
.ujk-wcag-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ujk-wcag-skip-link {
    position: fixed !important;
    top: -150px;
    left: 20px;
    background: #000000 !important;
    color: #ffff00 !important;
    padding: 12px 22px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    z-index: 9999999 !important;
    border: 3px solid #ffff00 !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7) !important;
    transition: top 0.2s ease-in-out !important;
}

.ujk-wcag-skip-link:focus,
.ujk-wcag-skip-link:focus-visible {
    top: 20px !important;
    outline: 3px solid #ffcc00 !important;
    outline-offset: 3px !important;
}

.ujk-wcag-skip-link.ujk-skip-content:focus {
    top: 75px !important;
}

/* -------------------------------------------------------------
 * 2. Przycisk wywołujący (Floating Trigger)
 * ----------------------------------------------------------- */
.ujk-wcag-floating-trigger {
    position: fixed !important;
    top: 50% !important;
    z-index: 999990 !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.ujk-wcag-floating-trigger.pos-right {
    right: 0 !important;
    left: auto !important;
}

.ujk-wcag-floating-trigger.pos-left {
    left: 0 !important;
    right: auto !important;
}

.ujk-wcag-trigger-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background-color: var(--ujk-wcag-primary) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 14px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s !important;
    line-height: 1 !important;
    text-decoration: none !important;
    vertical-align: middle !important;
}

.ujk-wcag-floating-trigger.pos-right .ujk-wcag-trigger-btn {
    border-radius: var(--ujk-wcag-radius) 0 0 var(--ujk-wcag-radius) !important;
    padding-left: 14px !important;
}

.ujk-wcag-floating-trigger.pos-left .ujk-wcag-trigger-btn {
    border-radius: 0 var(--ujk-wcag-radius) var(--ujk-wcag-radius) 0 !important;
    padding-right: 14px !important;
}

/* Wariant: Tylko ikona */
.ujk-wcag-trigger-btn.ujk-trigger-icon-only {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.ujk-wcag-floating-trigger.pos-right .ujk-wcag-trigger-btn.ujk-trigger-icon-only {
    border-radius: 12px 0 0 12px !important;
}

.ujk-wcag-floating-trigger.pos-left .ujk-wcag-trigger-btn.ujk-trigger-icon-only {
    border-radius: 0 12px 12px 0 !important;
}

.ujk-wcag-trigger-btn:hover {
    background-color: var(--ujk-wcag-primary-hover) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
}

.ujk-wcag-trigger-btn:focus-visible {
    outline: 3px solid var(--ujk-wcag-focus-ring) !important;
    outline-offset: 3px !important;
}

/* Wymuszenie pełnej widoczności ikony SVG w każdym motywie */
.ujk-wcag-icon-wheelchair,
.ujk-wcag-icon,
.ujk-wcag-brand-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    flex-shrink: 0 !important;
}

.ujk-wcag-trigger-btn svg,
.ujk-wcag-icon-wheelchair svg,
.ujk-wcag-icon svg,
.ujk-wcag-menu-trigger svg,
.ujk-wcag-custom-trigger svg,
.ujk-wcag-brand-icon svg {
    display: inline-block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    fill: currentColor !important;
    color: inherit !important;
    vertical-align: middle !important;
    overflow: visible !important;
}

.ujk-wcag-trigger-btn svg *,
.ujk-wcag-icon-wheelchair svg *,
.ujk-wcag-icon svg * {
    fill: currentColor !important;
}

@media (max-width: 767.98px) {
    .ujk-wcag-floating-trigger.ujk-hide-mobile {
        display: none !important;
    }
    .ujk-wcag-trigger-text {
        display: none;
    }
    .ujk-wcag-floating-trigger .ujk-wcag-trigger-btn {
        padding: 10px 10px;
    }
}

/* -------------------------------------------------------------
 * 3. Integracja z Menu nawigacyjnym & Shortcode
 * ----------------------------------------------------------- */
.ujk-wcag-menu-item .ujk-wcag-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ujk-wcag-custom-trigger {
    border-radius: var(--ujk-wcag-radius);
}

/* -------------------------------------------------------------
 * 4. Nakładka (Overlay) i Panel (Drawer / Modal)
 * ----------------------------------------------------------- */
.ujk-wcag-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}

.ujk-wcag-panel-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.ujk-wcag-panel-wrapper {
    position: fixed;
    background: var(--ujk-wcag-bg);
    color: var(--ujk-wcag-text);
    z-index: 99999;
    box-shadow: var(--ujk-wcag-shadow);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    visibility: hidden !important;
    pointer-events: none !important;
}

.ujk-wcag-panel-wrapper *,
.ujk-wcag-panel-wrapper *::before,
.ujk-wcag-panel-wrapper *::after {
    box-sizing: border-box;
}

/* Gdy panel jest otwarty: staje się widoczny i aktywny dla klawiatury */
.ujk-wcag-panel-wrapper.is-open {
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Po otwarciu panelu boczny pływający badge natychmiast się chowa (nie nachodzi na panel) */
body.ujk-wcag-panel-open .ujk-wcag-floating-trigger,
html:has(.ujk-wcag-panel-wrapper.is-open) .ujk-wcag-floating-trigger {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Typ: Drawer (boczny wysuwany panel) */
.ujk-wcag-panel-wrapper.type-drawer {
    top: 0;
    bottom: 0;
    height: 100vh;
    width: 380px;
    max-width: 92vw;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.ujk-wcag-panel-wrapper.type-drawer.drawer-right {
    right: 0;
    transform: translateX(100%);
    border-left: 1px solid var(--ujk-wcag-border);
}

.ujk-wcag-panel-wrapper.type-drawer.drawer-right.is-open {
    transform: translateX(0);
}

.ujk-wcag-panel-wrapper.type-drawer.drawer-left {
    left: 0;
    transform: translateX(-100%);
    border-right: 1px solid var(--ujk-wcag-border);
}

.ujk-wcag-panel-wrapper.type-drawer.drawer-left.is-open {
    transform: translateX(0);
}

/* Typ: Modal (wycentrowany) */
.ujk-wcag-panel-wrapper.type-modal {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(0.96);
    width: 580px;
    max-width: 94vw;
    max-height: 88vh;
    border-radius: 12px;
    border: 1px solid var(--ujk-wcag-border);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.ujk-wcag-panel-wrapper.type-modal.is-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ujk-wcag-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

/* Nagłówek panelu */
.ujk-wcag-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ujk-wcag-border);
    background: #f8f9fa;
}

.ujk-wcag-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ujk-wcag-brand-icon {
    color: var(--ujk-wcag-primary);
    display: flex;
}

.ujk-wcag-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--ujk-wcag-text);
}

.ujk-wcag-close-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.ujk-wcag-close-btn:hover {
    background: #e9ecef;
    color: #000;
}

.ujk-wcag-close-btn:focus-visible {
    outline: 2px solid var(--ujk-wcag-focus-ring);
    outline-offset: 2px;
}

/* Ciało panelu z sekcjami */
.ujk-wcag-panel-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

.ujk-wcag-section {
    border: none;
    padding: 0;
    margin: 0 0 22px 0;
}

.ujk-wcag-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 10px;
    padding: 0;
}

/* Siatka przycisków */
.ujk-wcag-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ujk-contrast-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.ujk-wcag-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid var(--ujk-wcag-border);
    border-radius: var(--ujk-wcag-radius);
    color: var(--ujk-wcag-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease-in-out;
}

.ujk-wcag-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.ujk-wcag-btn:focus-visible {
    outline: 3px solid var(--ujk-wcag-focus-ring);
    outline-offset: 2px;
}

.ujk-wcag-btn.active,
.ujk-wcag-btn[aria-pressed="true"] {
    background: #e7f1ff;
    border-color: #0d6efd;
    color: #0d6efd;
    box-shadow: 0 0 0 1px #0d6efd;
}

.ujk-btn-icon {
    font-size: 15px;
    min-width: 18px;
    display: inline-flex;
    justify-content: center;
}

/* Kontrolki kontrastu */
.ujk-contrast-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid #adb5bd;
}

.preview-default {
    background: #ffffff;
    color: #212529;
}

.preview-yb {
    background: #000000;
    color: #ffff00;
    border-color: #ffff00;
}

.preview-by {
    background: #ffff00;
    color: #000000;
    border-color: #000000;
}

.preview-dark {
    background: #121212;
    color: #ffffff;
    border-color: #444444;
}

.preview-gray {
    background: #777777;
    color: #ffffff;
    border-color: #555555;
}

/* Kontrolki rozmiaru tekstu */
.ujk-font-size-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ujk-font-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    text-align: center;
}

.ujk-font-size-indicator {
    padding: 6px 12px;
    background: #f1f3f5;
    border-radius: var(--ujk-wcag-radius);
    font-weight: 700;
    font-size: 13px;
    color: var(--ujk-wcag-text);
    min-width: 52px;
    text-align: center;
}

/* Stopka panelu */
.ujk-wcag-panel-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--ujk-wcag-border);
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ujk-wcag-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #0d6efd;
    text-decoration: underline;
    font-size: 13px;
    font-weight: 600;
    padding: 6px;
}

.ujk-wcag-footer-link:focus-visible {
    outline: 2px solid var(--ujk-wcag-focus-ring);
    outline-offset: 2px;
}

.ujk-wcag-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: var(--ujk-wcag-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ujk-wcag-reset-btn:hover {
    background: #dc3545;
    color: #ffffff;
}

.ujk-wcag-reset-btn:focus-visible {
    outline: 3px solid var(--ujk-wcag-focus-ring);
    outline-offset: 2px;
}

/* -------------------------------------------------------------
 * 5. Narzędzia asystujące: Linijka i Maska czytania
 * ----------------------------------------------------------- */
.ujk-wcag-reading-ruler {
    position: fixed;
    left: 0;
    width: 100vw;
    height: 4px;
    background: #ffff00;
    box-shadow: 0 0 0 2px #000000;
    z-index: 99995;
    pointer-events: none;
    display: none;
    transform: translateY(-50%);
}

.ujk-wcag-reading-ruler.is-active {
    display: block;
}

.ujk-wcag-reading-mask {
    position: fixed;
    left: 0;
    width: 100vw;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99994;
    pointer-events: none;
    display: none;
}

.ujk-wcag-reading-mask.is-active {
    display: block;
}

/* -------------------------------------------------------------
 * 6. Tryby Dostępności Aplikowane na stronę (HTML / BODY)
 * ----------------------------------------------------------- */

/* A. Wysoki kontrast: Czarno-żółty (żółte elementy na czarnym tle) */
html.ujk-contrast-yellow-black,
html.ujk-contrast-yellow-black body {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

/* Główne elementy treści i tła - z wykluczeniem zdjęć, grafik i nakładek motywu */
html.ujk-contrast-yellow-black *:not(.ujk-wcag-panel-wrapper):not(.ujk-wcag-panel-wrapper *):not(#ujk-wcag-panel-overlay):not(.ujk-wcag-floating-trigger):not(.ujk-wcag-floating-trigger *):not(.ujk-wcag-quick-toolbar):not(.ujk-wcag-quick-toolbar *):not(img):not(picture):not(picture *):not(figure):not(figure *):not(video):not(canvas):not([class*="overlay"]):not([class*="caption"]):not(figcaption):not(.ujk-news-overlay):not(.ujk-pro-tiles__caption):not(.ujk-pro-tiles__link):not(.header-extra-html):not(.header-extra-html *):not(.header-html-item):not(.header-html-item *) {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Zachowanie pełnej czytelności i widoczności wszystkich zdjęć, galerii i grafik */
html.ujk-contrast-yellow-black img,
html.ujk-contrast-yellow-black picture,
html.ujk-contrast-yellow-black picture *,
html.ujk-contrast-yellow-black figure,
html.ujk-contrast-yellow-black figure *,
html.ujk-contrast-yellow-black video,
html.ujk-contrast-yellow-black canvas,
html.ujk-contrast-yellow-black svg:not(.ujk-quick-toolbar svg):not(.ujk-wcag-floating-trigger svg):not(.ujk-wcag-panel-wrapper svg):not(.ujk-menu-icon svg) {
    filter: none !important;
    visibility: visible !important;
    background-color: transparent !important;
    border: none !important;
}

/* Zachowanie zdjęć w elementach z tłem graficznym (np. sekcja UJK w obiektywie, karty, slajdery) */
html.ujk-contrast-yellow-black [style*="background"],
html.ujk-contrast-yellow-black [style*="background"] *,
html.ujk-contrast-yellow-black .card-img,
html.ujk-contrast-yellow-black .card-img-top,
html.ujk-contrast-yellow-black [class*="thumbnail"],
html.ujk-contrast-yellow-black [class*="gallery"],
html.ujk-contrast-yellow-black [class*="slide"] {
    background-color: transparent !important;
}

/* Wyłączenie ciemnych/gradientowych nakładek motywu, które zasłaniały zdjęcia w kartach */
html.ujk-contrast-yellow-black .card-img-overlay,
html.ujk-contrast-yellow-black .overlay,
html.ujk-contrast-yellow-black [class*="overlay"],
html.ujk-contrast-yellow-black [class*="gradient"],
html.ujk-contrast-yellow-black [class*="mask"],
html.ujk-contrast-yellow-black .ujk-news-overlay,
html.ujk-contrast-yellow-black .ujk-pro-tiles__caption,
html.ujk-contrast-yellow-black .ujk-pro-tiles__link,
html.ujk-contrast-yellow-black figcaption,
html.ujk-contrast-yellow-black [class*="card"]::before,
html.ujk-contrast-yellow-black [class*="card"]::after,
html.ujk-contrast-yellow-black [class*="thumb"]::before,
html.ujk-contrast-yellow-black [class*="thumb"]::after,
html.ujk-contrast-yellow-black [class*="photo"]::before,
html.ujk-contrast-yellow-black [class*="photo"]::after {
    background: transparent !important;
    background-image: none !important;
}

html.ujk-contrast-yellow-black a:has(img):not(.header-extra-html a):not(.header-html-item a),
html.ujk-contrast-yellow-black a:has(picture),
html.ujk-contrast-yellow-black a:has(figure) {
    background-color: transparent !important;
}

/* Linki w trybie czarno-żółtym */
html.ujk-contrast-yellow-black a {
    color: #ffff00 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    font-weight: 600;
}

html.ujk-contrast-yellow-black a:hover,
html.ujk-contrast-yellow-black a:focus {
    background-color: #ffff00 !important;
    color: #000000 !important;
    text-decoration: none !important;
}

/* Przyciski i kontrolki formularzy */
html.ujk-contrast-yellow-black button:not(.ujk-wcag-trigger-btn):not(.ujk-wcag-btn):not(.ujk-wcag-close-btn),
html.ujk-contrast-yellow-black .btn,
html.ujk-contrast-yellow-black input,
html.ujk-contrast-yellow-black select,
html.ujk-contrast-yellow-black textarea {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
    border-radius: 4px;
    font-weight: 600;
}

html.ujk-contrast-yellow-black button:not(.ujk-wcag-trigger-btn):not(.ujk-wcag-btn):not(.ujk-wcag-close-btn):hover,
html.ujk-contrast-yellow-black .btn:hover {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

/* Wyraźne obramowanie kart, kontenerów i nawigacji (Bootstrap cards & navbars) */
html.ujk-contrast-yellow-black .card,
html.ujk-contrast-yellow-black .card-body,
html.ujk-contrast-yellow-black [class*="card-"],
html.ujk-contrast-yellow-black .navbar,
html.ujk-contrast-yellow-black header,
html.ujk-contrast-yellow-black nav,
html.ujk-contrast-yellow-black footer,
html.ujk-contrast-yellow-black table,
html.ujk-contrast-yellow-black th,
html.ujk-contrast-yellow-black td,
html.ujk-contrast-yellow-black .dropdown-menu {
    border: 2px solid #ffff00 !important;
}

html.ujk-contrast-yellow-black header,
html.ujk-contrast-yellow-black .navbar {
    border-bottom: 2px solid #ffff00 !important;
}

/* B. Kontrast odwrócony: Żółto-czarny (czarny tekst na żółtym tle) */
html.ujk-contrast-black-yellow,
html.ujk-contrast-black-yellow body {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

html.ujk-contrast-black-yellow *:not(.ujk-wcag-panel-wrapper):not(.ujk-wcag-panel-wrapper *):not(#ujk-wcag-panel-overlay):not(.ujk-wcag-floating-trigger):not(.ujk-wcag-floating-trigger *):not(.ujk-wcag-quick-toolbar):not(.ujk-wcag-quick-toolbar *):not(img):not(picture):not(picture *):not(figure):not(figure *):not(video):not(canvas):not([class*="overlay"]):not([class*="caption"]):not(figcaption):not(.ujk-news-overlay):not(.ujk-pro-tiles__caption):not(.ujk-pro-tiles__link):not(.header-extra-html):not(.header-extra-html *):not(.header-html-item):not(.header-html-item *) {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Zachowanie pełnej czytelności i widoczności wszystkich zdjęć, galerii i grafik */
html.ujk-contrast-black-yellow img,
html.ujk-contrast-black-yellow picture,
html.ujk-contrast-black-yellow picture *,
html.ujk-contrast-black-yellow figure,
html.ujk-contrast-black-yellow figure *,
html.ujk-contrast-black-yellow video,
html.ujk-contrast-black-yellow canvas,
html.ujk-contrast-black-yellow svg:not(.ujk-quick-toolbar svg):not(.ujk-wcag-floating-trigger svg):not(.ujk-wcag-panel-wrapper svg):not(.ujk-menu-icon svg) {
    filter: none !important;
    visibility: visible !important;
    background-color: transparent !important;
    border: none !important;
}

/* Zachowanie zdjęć w elementach z tłem graficznym (np. sekcja UJK w obiektywie, karty, slajdery) */
html.ujk-contrast-black-yellow [style*="background"],
html.ujk-contrast-black-yellow [style*="background"] *,
html.ujk-contrast-black-yellow .card-img,
html.ujk-contrast-black-yellow .card-img-top,
html.ujk-contrast-black-yellow [class*="thumbnail"],
html.ujk-contrast-black-yellow [class*="gallery"],
html.ujk-contrast-black-yellow [class*="slide"] {
    background-color: transparent !important;
}

/* Wyłączenie ciemnych/gradientowych nakładek motywu, które zasłaniały zdjęcia w kartach */
html.ujk-contrast-black-yellow .card-img-overlay,
html.ujk-contrast-black-yellow .overlay,
html.ujk-contrast-black-yellow [class*="overlay"],
html.ujk-contrast-black-yellow [class*="gradient"],
html.ujk-contrast-black-yellow [class*="mask"],
html.ujk-contrast-black-yellow .ujk-news-overlay,
html.ujk-contrast-black-yellow .ujk-pro-tiles__caption,
html.ujk-contrast-black-yellow .ujk-pro-tiles__link,
html.ujk-contrast-black-yellow figcaption,
html.ujk-contrast-black-yellow [class*="card"]::before,
html.ujk-contrast-black-yellow [class*="card"]::after,
html.ujk-contrast-black-yellow [class*="thumb"]::before,
html.ujk-contrast-black-yellow [class*="thumb"]::after,
html.ujk-contrast-black-yellow [class*="photo"]::before,
html.ujk-contrast-black-yellow [class*="photo"]::after {
    background: transparent !important;
    background-image: none !important;
}

html.ujk-contrast-black-yellow a:has(img):not(.header-extra-html a):not(.header-html-item a),
html.ujk-contrast-black-yellow a:has(picture),
html.ujk-contrast-black-yellow a:has(figure) {
    background-color: transparent !important;
}

html.ujk-contrast-black-yellow a {
    color: #000000 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    font-weight: 700;
}

html.ujk-contrast-black-yellow a:hover,
html.ujk-contrast-black-yellow a:focus {
    background-color: #000000 !important;
    color: #ffff00 !important;
    text-decoration: none !important;
}

html.ujk-contrast-black-yellow button:not(.ujk-wcag-trigger-btn):not(.ujk-wcag-btn):not(.ujk-wcag-close-btn),
html.ujk-contrast-black-yellow .btn,
html.ujk-contrast-black-yellow input,
html.ujk-contrast-black-yellow select,
html.ujk-contrast-black-yellow textarea {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    border-radius: 4px;
    font-weight: 600;
}

html.ujk-contrast-black-yellow button:not(.ujk-wcag-trigger-btn):not(.ujk-wcag-btn):not(.ujk-wcag-close-btn):hover,
html.ujk-contrast-black-yellow .btn:hover {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

html.ujk-contrast-black-yellow .card,
html.ujk-contrast-black-yellow .card-body,
html.ujk-contrast-black-yellow [class*="card-"],
html.ujk-contrast-black-yellow .navbar,
html.ujk-contrast-black-yellow header,
html.ujk-contrast-black-yellow nav,
html.ujk-contrast-black-yellow footer,
html.ujk-contrast-black-yellow table,
html.ujk-contrast-black-yellow th,
html.ujk-contrast-black-yellow td,
html.ujk-contrast-black-yellow .dropdown-menu {
    border: 2px solid #000000 !important;
}

/* C. Tryb ciemny (Dark Mode) */
html.ujk-contrast-dark,
html.ujk-contrast-dark body {
    background-color: #121212 !important;
    color: #e4e6eb !important;
}

html.ujk-contrast-dark *:not(.ujk-wcag-panel-wrapper):not(.ujk-wcag-panel-wrapper *):not(#ujk-wcag-panel-overlay):not(.ujk-wcag-floating-trigger):not(.ujk-wcag-floating-trigger *):not(.ujk-wcag-quick-toolbar):not(.ujk-wcag-quick-toolbar *):not(img):not(picture):not(picture *):not(figure):not(figure *):not(video):not(canvas):not([class*="overlay"]):not([class*="caption"]):not(figcaption):not(.ujk-news-overlay):not(.ujk-pro-tiles__caption):not(.ujk-pro-tiles__link):not(.header-extra-html):not(.header-extra-html *):not(.header-html-item):not(.header-html-item *) {
    background-color: #1e1e1e !important;
    color: #e4e6eb !important;
    border-color: #333333 !important;
    box-shadow: none !important;
}

html.ujk-contrast-dark a {
    color: #64b5f6 !important;
}

/* Zachowanie pełnej czytelności i widoczności wszystkich zdjęć w trybie ciemnym */
html.ujk-contrast-dark img,
html.ujk-contrast-dark picture,
html.ujk-contrast-dark picture *,
html.ujk-contrast-dark figure,
html.ujk-contrast-dark figure *,
html.ujk-contrast-dark video,
html.ujk-contrast-dark canvas {
    filter: none !important;
    visibility: visible !important;
    background-color: transparent !important;
    border: none !important;
}

html.ujk-contrast-dark [style*="background"],
html.ujk-contrast-dark [style*="background"] *,
html.ujk-contrast-dark .card-img,
html.ujk-contrast-dark .card-img-top,
html.ujk-contrast-dark [class*="thumbnail"],
html.ujk-contrast-dark [class*="gallery"],
html.ujk-contrast-dark [class*="slide"] {
    background-color: transparent !important;
}

html.ujk-contrast-dark .card-img-overlay,
html.ujk-contrast-dark .overlay,
html.ujk-contrast-dark [class*="overlay"],
html.ujk-contrast-dark [class*="gradient"],
html.ujk-contrast-dark [class*="mask"],
html.ujk-contrast-dark .ujk-news-overlay,
html.ujk-contrast-dark .ujk-pro-tiles__caption,
html.ujk-contrast-dark .ujk-pro-tiles__link,
html.ujk-contrast-dark figcaption,
html.ujk-contrast-dark [class*="card"]::before,
html.ujk-contrast-dark [class*="card"]::after,
html.ujk-contrast-dark [class*="thumb"]::before,
html.ujk-contrast-dark [class*="thumb"]::after,
html.ujk-contrast-dark [class*="photo"]::before,
html.ujk-contrast-dark [class*="photo"]::after {
    background: transparent !important;
    background-image: none !important;
}

html.ujk-contrast-dark a:has(img):not(.header-extra-html a):not(.header-html-item a),
html.ujk-contrast-dark a:has(picture),
html.ujk-contrast-dark a:has(figure) {
    background-color: transparent !important;
}

/* Półprzezroczyste tło napisów w nakładkach kafelków motywu UJK (ujk-news-overlay, ujk-pro-tiles) dla czytelności tekstu nad widocznym zdjęciem */
html.ujk-contrast-yellow-black .ujk-news-overlay,
html.ujk-contrast-yellow-black .ujk-pro-tiles__caption,
html.ujk-contrast-yellow-black .ujk-pro-tiles__link {
    background: rgba(0, 0, 0, 0.65) !important;
    color: #ffff00 !important;
}

html.ujk-contrast-black-yellow .ujk-news-overlay,
html.ujk-contrast-black-yellow .ujk-pro-tiles__caption,
html.ujk-contrast-black-yellow .ujk-pro-tiles__link {
    background: rgba(255, 255, 0, 0.75) !important;
    color: #000000 !important;
}

html.ujk-contrast-dark .ujk-news-overlay,
html.ujk-contrast-dark .ujk-pro-tiles__caption,
html.ujk-contrast-dark .ujk-pro-tiles__link {
    background: rgba(0, 0, 0, 0.6) !important;
    color: #ffffff !important;
}

html.ujk-contrast-yellow-black .ujk-news-overlay *,
html.ujk-contrast-yellow-black .ujk-pro-tiles__caption * {
    color: #ffff00 !important;
}

html.ujk-contrast-black-yellow .ujk-news-overlay *,
html.ujk-contrast-black-yellow .ujk-pro-tiles__caption * {
    color: #000000 !important;
}

html.ujk-contrast-dark .ujk-news-overlay *,
html.ujk-contrast-dark .ujk-pro-tiles__caption * {
    color: #ffffff !important;
}

/* D. Tryb achromatyczny (Skala szarości) */
html.ujk-contrast-grayscale {
    filter: grayscale(100%) !important;
}

/* -------------------------------------------------------------
 * 7. Logo UJK w trybach kontrastowych
 * Pełna czytelność logotypu uczelni z Tożsamości Witryny (Księga Znaku)
 * ----------------------------------------------------------- */
html.ujk-contrast-yellow-black .custom-logo,
html.ujk-contrast-yellow-black .custom-logo-link img,
html.ujk-contrast-yellow-black .logos-center img,
html.ujk-contrast-yellow-black img[data-ujk-logo="site"],
html.ujk-contrast-yellow-black .navbar-brand,
html.ujk-contrast-black-yellow .custom-logo,
html.ujk-contrast-black-yellow .custom-logo-link img,
html.ujk-contrast-black-yellow .logos-center img,
html.ujk-contrast-black-yellow img[data-ujk-logo="site"],
html.ujk-contrast-black-yellow .navbar-brand,
html.ujk-contrast-dark .custom-logo,
html.ujk-contrast-dark .custom-logo-link img,
html.ujk-contrast-dark .logos-center img,
html.ujk-contrast-dark img[data-ujk-logo="site"],
html.ujk-contrast-dark .navbar-brand {
    background-color: transparent !important;
    border: none !important;
}

/* Tryb Naturalnego Logo: inteligentna adaptacja barwy logotypu z zachowaniem przezroczystości */
html.ujk-contrast-yellow-black:not(.ujk-has-custom-logo) .custom-logo,
html.ujk-contrast-yellow-black:not(.ujk-has-custom-logo) .custom-logo-link img,
html.ujk-contrast-yellow-black:not(.ujk-has-custom-logo) .logos-center img,
html.ujk-contrast-yellow-black:not(.ujk-has-custom-logo) img[data-ujk-logo="site"] {
    filter: brightness(0) saturate(100%) invert(88%) sepia(90%) saturate(1200%) hue-rotate(355deg) brightness(105%) contrast(105%) !important;
}

html.ujk-contrast-black-yellow:not(.ujk-has-custom-logo) .custom-logo,
html.ujk-contrast-black-yellow:not(.ujk-has-custom-logo) .custom-logo-link img,
html.ujk-contrast-black-yellow:not(.ujk-has-custom-logo) .logos-center img,
html.ujk-contrast-black-yellow:not(.ujk-has-custom-logo) img[data-ujk-logo="site"] {
    filter: brightness(0) !important;
}

html.ujk-contrast-dark:not(.ujk-has-custom-logo) .custom-logo,
html.ujk-contrast-dark:not(.ujk-has-custom-logo) .custom-logo-link img,
html.ujk-contrast-dark:not(.ujk-has-custom-logo) .logos-center img,
html.ujk-contrast-dark:not(.ujk-has-custom-logo) img[data-ujk-logo="site"] {
    filter: brightness(0) invert(1) !important;
}

/* Logotypy w nagłówku (.header-extra-html - UE / Budżet Państwa / HR / dowolne inne znaki) w trybach kontrastu */
html.ujk-contrast-yellow-black:not(.ujk-no-partner-apla) .header-extra-html a,
html.ujk-contrast-yellow-black:not(.ujk-no-partner-apla) .header-extra-html .header-html-item a,
html.ujk-contrast-yellow-black:not(.ujk-no-partner-apla) .header-extra-html .header-html-item:not(:has(a)) {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 2px solid #ffff00 !important;
    border-radius: 4px !important;
    padding: 3px 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 0 0 1px #000000 !important;
    transition: transform 0.15s ease !important;
}

html.ujk-contrast-black-yellow:not(.ujk-no-partner-apla) .header-extra-html a,
html.ujk-contrast-black-yellow:not(.ujk-no-partner-apla) .header-extra-html .header-html-item a,
html.ujk-contrast-black-yellow:not(.ujk-no-partner-apla) .header-extra-html .header-html-item:not(:has(a)) {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 4px !important;
    padding: 3px 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.15s ease !important;
}

html.ujk-contrast-dark:not(.ujk-no-partner-apla) .header-extra-html a,
html.ujk-contrast-dark:not(.ujk-no-partner-apla) .header-extra-html .header-html-item a,
html.ujk-contrast-dark:not(.ujk-no-partner-apla) .header-extra-html .header-html-item:not(:has(a)) {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 4px !important;
    padding: 3px 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.15s ease !important;
}

html.ujk-contrast-yellow-black .header-extra-html a:hover,
html.ujk-contrast-black-yellow .header-extra-html a:hover,
html.ujk-contrast-dark .header-extra-html a:hover {
    background: #f5f5f5 !important;
    background-color: #f5f5f5 !important;
    transform: translateY(-1px) !important;
}

html.ujk-contrast-yellow-black .header-extra-html img,
html.ujk-contrast-black-yellow .header-extra-html img,
html.ujk-contrast-dark .header-extra-html img {
    filter: none !important;
    opacity: 1 !important;
    max-height: 44px !important;
    width: auto !important;
    display: block !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* -------------------------------------------------------------
 * 8. Typografia i Narzędzia
 * ----------------------------------------------------------- */

/* Odstępy tekstu (WCAG 1.4.12 Text Spacing) */
html.ujk-text-spacing *:not(.ujk-wcag-panel-wrapper):not(.ujk-wcag-panel-wrapper *) {
    line-height: 1.8 !important;
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}

html.ujk-text-spacing p,
html.ujk-text-spacing ul,
html.ujk-text-spacing ol {
    margin-bottom: 2em !important;
}

/* Czcionka bezszeryfowa / dysleksja */
html.ujk-dyslexic-font *:not(.ujk-wcag-panel-wrapper):not(.ujk-wcag-panel-wrapper *) {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Wyrównanie tekstu do lewej (usunięcie justowania) */
html.ujk-align-left *:not(.ujk-wcag-panel-wrapper):not(.ujk-wcag-panel-wrapper *) {
    text-align: left !important;
}

/* Podkreślenie linków */
html.ujk-underline-links a {
    text-decoration: underline !important;
    text-underline-offset: 4px !important;
}

/* Wyraźny fokus klawiatury (WCAG 2.4.7 & 2.4.11) */
html.ujk-focus-highlight *:focus-visible {
    outline: 3px solid #ffcc00 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px #000000 !important;
}

/* Zatrzymanie animacji (WCAG 2.2.2 & 2.3.3) */
html.ujk-stop-animations *,
html.ujk-stop-animations *::before,
html.ujk-stop-animations *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

/* Duży kursor myszy */
html.ujk-big-cursor,
html.ujk-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24' fill='%23000000' stroke='%23ffffff' stroke-width='1.5'%3E%3Cpath d='M3 3l7 18 3-7 7-3L3 3z'/%3E%3C/svg%3E"), auto !important;
}

/* Szybki Pasek Narzędzi w Menu / Top-Barze oraz Pozycja Menu */
.ujk-wcag-menu-item {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
}

button.nav-link.ujk-wcag-menu-trigger {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: transparent !important;
    border: none !important;
    padding: var(--bs-nav-link-padding-y, 0.5rem) var(--bs-nav-link-padding-x, 0.75rem) !important;
    margin: 0 !important;
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    cursor: pointer !important;
    text-decoration: none !important;
    vertical-align: middle !important;
}

button.nav-link.ujk-wcag-menu-trigger:hover {
    color: inherit !important;
    opacity: 0.85 !important;
}

button.nav-link.ujk-wcag-menu-trigger:focus-visible {
    outline: 2px solid var(--ujk-wcag-focus-ring) !important;
    outline-offset: 2px !important;
}

html.ujk-contrast-yellow-black button.nav-link.ujk-wcag-menu-trigger {
    color: #ffff00 !important;
}

html.ujk-contrast-black-yellow button.nav-link.ujk-wcag-menu-trigger {
    color: #000000 !important;
}

.ujk-wcag-quick-toolbar {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 2px 4px !important;
    margin: 0 !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    background: transparent !important;
}

.ujk-wcag-nav-quick-item {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    list-style: none !important;
}

/* Przycisk kontrastu (Księżyc 🌙) */
.ujk-quick-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    padding: 4px 6px !important;
    margin: 0 !important;
    color: inherit !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    line-height: 1 !important;
    transition: transform 0.15s ease, opacity 0.15s ease !important;
}

.ujk-quick-btn:hover {
    opacity: 0.8 !important;
    transform: scale(1.08) !important;
}

.ujk-quick-btn:focus-visible {
    outline: 2px solid var(--ujk-wcag-focus-ring) !important;
    outline-offset: 2px !important;
}

.ujk-quick-contrast-btn {
    color: inherit !important;
}

.ujk-quick-contrast-btn svg.ujk-icon-moon {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2 !important;
}

/* Gdy aktywny wysoki kontrast: księżyc wypełnia się na żółto */
html.ujk-contrast-yellow-black .ujk-quick-contrast-btn svg.ujk-icon-moon,
.ujk-quick-contrast-btn.active svg.ujk-icon-moon {
    stroke: #ffff00 !important;
    fill: #ffff00 !important;
    filter: drop-shadow(0 0 4px rgba(255, 255, 0, 0.7)) !important;
}

/* Pionowa kreska separatora | */
.ujk-quick-divider {
    display: inline-block !important;
    width: 1px !important;
    height: 20px !important;
    background-color: currentColor !important;
    opacity: 0.35 !important;
    margin: 0 4px !important;
    vertical-align: middle !important;
}

/* Grupa powiększania czcionki [A] [A] [A] */
.ujk-quick-font-group {
    display: inline-flex !important;
    align-items: stretch !important;
    border: 1px solid rgba(128, 128, 128, 0.5) !important;
    border-radius: 2px !important;
    overflow: hidden !important;
    vertical-align: middle !important;
    background: transparent !important;
}

/* Poszczególne kafelki A */
.ujk-quick-font-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    color: inherit !important;
    border: none !important;
    border-right: 1px solid rgba(128, 128, 128, 0.5) !important;
    font-family: inherit !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.ujk-quick-font-btn:last-child {
    border-right: none !important;
}

.ujk-quick-font-btn:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.ujk-quick-font-btn:focus-visible {
    outline: 2px solid var(--ujk-wcag-focus-ring) !important;
    outline-offset: -2px !important;
    z-index: 2 !important;
}

/* Aktywny kafelek czcionki (dokładnie jak na screenie: białe tło, czarna litera) */
.ujk-quick-font-btn.active,
.ujk-quick-font-btn[aria-pressed="true"] {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-weight: 900 !important;
}

/* Stopnie wielkości liter A */
.ujk-font-a-sm {
    font-size: 13px !important;
}
.ujk-font-a-md {
    font-size: 15px !important;
}
.ujk-font-a-lg {
    font-size: 18px !important;
}

/* Przycisk pełnego panelu WCAG w szybkim pasku */
.ujk-quick-panel-btn {
    color: inherit !important;
}
.ujk-quick-panel-btn svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    fill: currentColor !important;
}

/* Wysoki kontrast Żółto-Czarny */
html.ujk-contrast-yellow-black .ujk-wcag-quick-toolbar {
    color: #ffff00 !important;
}
html.ujk-contrast-yellow-black .ujk-quick-divider {
    background-color: #ffff00 !important;
    opacity: 0.8 !important;
}
html.ujk-contrast-yellow-black .ujk-quick-font-group {
    border-color: #ffff00 !important;
}
html.ujk-contrast-yellow-black .ujk-quick-font-btn {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-right-color: #ffff00 !important;
}
html.ujk-contrast-yellow-black .ujk-quick-font-btn.active,
html.ujk-contrast-yellow-black .ujk-quick-font-btn[aria-pressed="true"] {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

/* Wysoki kontrast Czarno-Żółty */
html.ujk-contrast-black-yellow .ujk-wcag-quick-toolbar {
    color: #000000 !important;
}
html.ujk-contrast-black-yellow .ujk-quick-divider {
    background-color: #000000 !important;
    opacity: 0.8 !important;
}
html.ujk-contrast-black-yellow .ujk-quick-font-group {
    border-color: #000000 !important;
}
html.ujk-contrast-black-yellow .ujk-quick-font-btn {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-right-color: #000000 !important;
}
html.ujk-contrast-black-yellow .ujk-quick-font-btn.active,
html.ujk-contrast-black-yellow .ujk-quick-font-btn[aria-pressed="true"] {
    background-color: #000000 !important;
    color: #ffff00 !important;
}
