:root {
    --bs-blue: #0d6efd;
    --bs-indigo: #6610f2;
    --bs-purple: #6f42c1;
    --bs-pink: #d63384;
    --bs-red: #dc3545;
    --bs-orange: #fd7e14;
    --bs-yellow: #ffc107;
    --bs-green: #198754;
    --bs-teal: #20c997;
    --bs-cyan: #0dcaf0;
    --bs-black: #000;
    --bs-white: #fff;
    --bs-gray: #6c757d;
    --bs-gray-dark: #343a40;
    --bs-gray-100: #f8f8f8;
    --bs-gray-200: #e9ecef;
    --bs-gray-300: #dee2e6;
    --bs-gray-400: #ced4da;
    --bs-gray-500: #adb5bd;
    --bs-gray-600: #6c757d;
    --bs-gray-700: #495057;
    --bs-gray-800: #343a40;
    --bs-gray-900: #232222;
    --bs-primary: #232222;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #D93636;
    --bs-light: #f8f8f8;
    --bs-dark: #232222;
    --bs-primary-rgb: 13, 110, 253;
    --bs-secondary-rgb: 108, 117, 125;
    --bs-success-rgb: 25, 135, 84;
    --bs-info-rgb: 13, 202, 240;
    --bs-warning-rgb: 255, 193, 7;
    --bs-danger-rgb: 220, 53, 69;
    --bs-light-rgb: 248, 249, 250;
    --bs-dark-rgb: 33, 37, 41;
    --bs-white-rgb: 255, 255, 255;
    --bs-black-rgb: 0, 0, 0;
    --bs-body-color-rgb: 33, 37, 41;
    --bs-body-bg-rgb: 255, 255, 255;
    --bs-font-sans-serif: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-body-font-size: 0.875rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 24px;
    --bs-body-color: #232222;
    --bs-body-bg: #fff;
    --bs-border-width: 1px;
    --bs-border-style: solid;
    --bs-border-color: #A8A6A6;
    --bs-border-color-translucent: rgba(0, 0, 0, 0.175);
    /* --bs-border-radius: 6.25rem; */
    --bs-border-radius: 0.375rem;
    --bs-border-radius-sm: 0.25rem;
    --bs-border-radius-lg: 6.25rem;
    /* --bs-border-radius-lg: 0.5rem; */
    --bs-border-radius-xl: 1rem;
    --bs-border-radius-2xl: 2rem;
    --bs-border-radius-pill: 50rem;
    --bs-link-color: #0d6efd;
    --bs-link-hover-color: #0a58ca;
    --bs-code-color: #d63384;
    --bs-highlight-bg: #fff3cd;
}

.offcanvas {
    --bs-offcanvas-bg: var(--bs-gray-100);
}

.navbar {
    --bs-navbar-padding-x: 4rem;
    --bs-navbar-padding-y: 1rem;
}

.btn {
    --bs-btn-border-width: 0;
    --bs-btn-border-radius-sm: var(--bs-border-radius-lg);
    /* --bs-btn-border-radius: var(--bs-border-radius-lg); */
    --bs-btn-border-radius: var(--bs-border-radius-lg);
    --bs-btn-border-radius-lg: var(--bs-border-radius-lg);
}

.btn-link {
    --bs-btn-font-weight: #{$font-weight-normal};
    --bs-btn-color: #232323;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #820005;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: #F40009;
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-color: #939393;
    --bs-btn-disabled-border-color: transparent;
    --bs-btn-box-shadow: 0 0 0 #000; // Can't use `none` as keyword negates all values when used with multiple shadows
    --bs-btn-focus-shadow-rgb: #{$btn-link-focus-shadow-rgb};
  
    text-decoration: $link-decoration;
    @if $enable-gradients {
      background-image: none;
    }
  
    &:hover,
    &:focus-visible {
      text-decoration: $link-hover-decoration;
    }
  
    &:focus-visible {
      color: var(--bs-btn-color);
    }
  
    &:hover {
      color: var(--bs-btn-hover-color);
    }
  
    // No need for an active state here
  }
  
.btn-link {
    text-align: left;
    padding-right: 0;
    padding-left: 0;
}

.pagination {
    --bs-pagination-color: #7C7979;
    --bs-pagination-active-color: #232222;
    --bs-pagination-active-bg: #fff;
    --bs-pagination-border-width: none;
    --bs-pagination-disabled-bg: #fff;
    --bs-pagination-disabled-color: #D3D8DC;
    
    .active {
        font-weight: 700;
    }
}


.dropdown-menu {
    --bs-dropdown-box-shadow: 0px 8px 18px 0px rgba(0, 0, 0, 0.16);
    box-shadow: var(--bs-dropdown-box-shadow);
    background-color: var(--bs-gray-100);
    border: 0;
    border-top: 4px solid #D93636;
    border-radius: 0;
}

.navbar .dropdown-menu {
    top: 61px !important;
}

.dropdown-header {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.075rem;
}

.dropdown-item {
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.0875rem;
}

/* Pierwsza litera każdej pozycji menu (temat badawczy + menu hamburger) wielką literą */
header .dropdown-item::first-letter {
    text-transform: uppercase;
}

.btn {
    --bs-btn-line-height: 1.5;
    --bs-btn-font-size: 0.875rem;
    letter-spacing: 0.0875rem;
    text-transform: uppercase;
}

.btn-group-lg>.btn, .btn-lg {
    --bs-btn-padding-x: 1.5rem;
    --bs-btn-padding-y: 0.75rem;
}

label,
.form-label {
    font-size: 0.625rem;
    font-style: normal;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.0625rem;
}

.form-control {
    height: auto;
    min-height: 2.5rem;

    --bs-border-color: #A8A6A6;
    /* border-radius: var(--bs-border-radius-lg); */
    border-radius: var(--bs-border-radius-xl);
}

.form-control::placeholder {
    color: #A8A6A6;
}

/* Checkbox/radio nie powinny dziedziczyc rozmiaru pola tekstowego (.form-control) */
input[type="checkbox"].form-control,
input[type="radio"].form-control {
    -webkit-appearance: auto !important;
    appearance: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: inline-block !important;
    vertical-align: middle;
    margin-right: 0.5rem;
    transform: scale(1.4);
    transform-origin: left center;
}

label {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.form-select {
    /* border-radius: var(--bs-border-radius-lg); */
    border-radius: var(--bs-border-radius-xl);
}

select {
    height: auto;
    min-height: 2.5rem;

    --bs-form-select-bg-img: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e);
    display: block;
    width: 100%;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--bs-body-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--bs-body-bg);
    background-image: var(--bs-form-select-bg-img),var(--bs-form-select-bg-icon,none);
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;

    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    /* font-size: 1.25rem; */
    /* border-radius: var(--bs-border-radius-lg); */
    border-radius: var(--bs-border-radius-xl);
}

select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}

.button-yes:hover path {
    fill: #34C759;
}

.button-no:hover path {
    fill: #F8683A;
}

.button-unknown:hover path {
    fill: #FBDC89;
}

.pagination {
    background-color: #fff;
    align-items: center;
}

.active>.page-link, .page-link.active {
    background-color: #fff;
    color: initial !important;
}

.disabled>.page-link, .page-link.disabled {
    background-color: #fff;
}

div.dataTables_wrapper div.dataTables_info {
    background-color: #fff;
}

.toast-info {
    background-color: #939393;
}

/* ── Skalowanie czcionki (WCAG 1.4.4) ── */
html.fs-large { font-size: 150%; }
html.fs-xl    { font-size: 200%; }

/* ── Navbar mobilny (tylko wąskie ekrany) ── */
/* Wiersz 1: logo | a11y | hamburger  /  Wiersz 2: wyszukiwarka pełna szerokość */
@media (max-width: 991.98px) {
    header.navbar {
        --bs-navbar-padding-x: 1rem;
    }

    header.navbar nav.container-xxl {
        flex-wrap: wrap;
        row-gap: 0.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    header.navbar nav.container-xxl > .navbar-brand {
        order: 1;
    }

    header.navbar nav.container-xxl > .a11y-controls {
        order: 2;
        margin-left: auto !important;
    }

    header.navbar nav.container-xxl > .dropdown {
        order: 2;
    }

    header.navbar nav.container-xxl > span.d-inline-flex {
        order: 3;
        position: static !important;
        transform: none !important;
        left: auto !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* Przy dużych czcionkach na mobile: kompaktowe przyciski a11y */
    html.fs-large .btn-a11y,
    html.fs-xl .btn-a11y {
        padding: 0.05rem 0.2rem;
    }

    html.fs-large .a11y-divider,
    html.fs-xl .a11y-divider {
        margin: 0;
    }

    html.fs-large header.navbar,
    html.fs-xl header.navbar {
        --bs-navbar-padding-x: 0.5rem;
    }
}


/* ── Przyciski dostępności w navbarze ── */
.a11y-controls {
    border-left: 1px solid rgba(255,255,255,0.25);
    padding-left: 0.625rem;
}

.btn-a11y {
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255,255,255,0.65);
    border-radius: var(--bs-border-radius);
    padding: 0.2rem 0.45rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.btn-a11y:hover,
.btn-a11y[aria-pressed="true"] {
    color: #ffffff;
    border-color: rgba(255,255,255,0.55);
    background-color: rgba(255,255,255,0.12);
}

.btn-a11y:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
    color: #ffffff;
}

.a11y-divider {
    display: inline-block;
    width: 1px;
    height: 1.2rem;
    background: rgba(255,255,255,0.25);
    margin: 0 0.15rem;
    vertical-align: middle;
}

/* ── Wysoki kontrast żółto-czarny (WCAG 1.4.3, kontrast 19.56:1) ── */
.high-contrast,
.high-contrast body {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

/* Tło strony i głównych kontenerów */
.high-contrast .container-xxl,
.high-contrast main,
.high-contrast footer,
.high-contrast .bg-light,
.high-contrast .bg-white,
.high-contrast .card,
.high-contrast .offcanvas {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

/* Navbar */
.high-contrast .navbar.bg-dark {
    background-color: #000000 !important;
    border-bottom: 2px solid #ffff00 !important;
}

.high-contrast .navbar-brand img {
    filter: brightness(0) invert(1) sepia(1) saturate(7500%) !important;
}

.high-contrast img[src="/static/img/saz-logo.png"] {
    filter: brightness(0) invert(1) sepia(1) saturate(7500%) !important;
}

/* ── Navbar: search bar truly centered ── */
header.navbar nav.container-xxl {
    position: relative;
}

header.navbar nav.container-xxl > span.d-inline-flex {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* With search out of normal flow, push a11y controls to the right */
/* z-index:2 so buttons stay clickable above the absolutely-positioned search pill */
header.navbar nav.container-xxl > .a11y-controls {
    margin-left: auto !important;
    position: relative;
    z-index: 2;
}

header.navbar nav.container-xxl > .dropdown {
    position: relative;
    z-index: 2;
}

/* Linki */
.high-contrast a,
.high-contrast a:visited {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

.high-contrast a:hover,
.high-contrast a:focus {
    color: #000000 !important;
    background-color: #ffff00 !important;
    text-decoration: underline !important;
}

/* Przyciski */
.high-contrast .btn,
.high-contrast .btn-dark,
.high-contrast .btn-danger,
.high-contrast .btn-light,
.high-contrast .btn-secondary {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}

.high-contrast .btn:hover,
.high-contrast .btn:focus {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #ffff00 !important;
}

.high-contrast .btn-link {
    background-color: transparent !important;
    color: #ffff00 !important;
    border: none !important;
    text-decoration: underline !important;
}

.high-contrast .btn-link:hover,
.high-contrast .btn-link:focus {
    color: #000000 !important;
    background-color: #ffff00 !important;
}

/* Dropdown */
.high-contrast .dropdown-menu {
    background-color: #000000 !important;
    border: 2px solid #ffff00 !important;
    border-top: 3px solid #ffff00 !important;
}

.high-contrast .dropdown-item,
.high-contrast .dropdown-header {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

.high-contrast .dropdown-item:hover,
.high-contrast .dropdown-item:focus {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

.high-contrast .dropdown-divider {
    border-color: #ffff00 !important;
}

/* Formularze */
.high-contrast .form-control,
.high-contrast select,
.high-contrast input,
.high-contrast textarea {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}

.high-contrast .form-control::placeholder {
    color: #cccc00 !important;
}

.high-contrast .form-control:focus,
.high-contrast select:focus {
    border-color: #ffff00 !important;
    box-shadow: 0 0 0 0.25rem rgba(255,255,0,0.4) !important;
    outline: none !important;
}

/* Paginacja */
.high-contrast .page-link {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 1px solid #ffff00 !important;
}

.high-contrast .page-link:hover,
.high-contrast .page-link:focus {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

.high-contrast .page-item.active .page-link {
    background-color: #ffff00 !important;
    color: #000000 !important;
    font-weight: 700;
}

.high-contrast .page-item.disabled .page-link {
    color: #888800 !important;
    border-color: #888800 !important;
}

/* Wyniki wyszukiwania */
.high-contrast .search-result-rating {
    background: rgba(0,0,0,0.97) !important;
    border: 1px solid #ffff00 !important;
}

.high-contrast .button-yes path,
.high-contrast .button-no path,
.high-contrast .button-unknown path {
    stroke: #ffff00 !important;
}

/* Focus ring — żółty na czarnym */
.high-contrast :focus-visible {
    outline: 3px solid #ffff00 !important;
    outline-offset: 2px !important;
}

/* Przyciski a11y w navbarze */
.high-contrast .btn-a11y {
    color: #ffff00 !important;
    border-color: transparent !important;
}

.high-contrast .btn-a11y[aria-pressed="true"],
.high-contrast .btn-a11y:hover {
    color: #000000 !important;
    background-color: #ffff00 !important;
    border-color: #ffff00 !important;
}

/* DataTables */
.high-contrast table,
.high-contrast th,
.high-contrast td {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

.high-contrast .dataTables_wrapper,
.high-contrast div.dataTables_wrapper div.dataTables_info,
.high-contrast div.dataTables_wrapper div.dataTables_paginate,
.high-contrast div.dataTables_wrapper div.dataTables_length,
.high-contrast div.dataTables_wrapper div.dataTables_filter {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

/* DataTables Bootstrap 5 pagination — .page-link classes */
.high-contrast .page-link,
.high-contrast .dataTables_wrapper .paginate_button {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

.high-contrast .page-item.active .page-link,
.high-contrast .dataTables_wrapper .paginate_button.current,
.high-contrast .dataTables_wrapper .paginate_button.current:hover {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #ffff00 !important;
}

.high-contrast .page-link:hover,
.high-contrast .dataTables_wrapper .paginate_button:hover {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #ffff00 !important;
}

.high-contrast .page-item.disabled .page-link,
.high-contrast .dataTables_wrapper .paginate_button.disabled,
.high-contrast .dataTables_wrapper .paginate_button.disabled:hover {
    background-color: #000000 !important;
    color: rgba(255,255,0,0.4) !important;
    border-color: rgba(255,255,0,0.4) !important;
}

.high-contrast ul.pagination {
    background-color: #000000 !important;
}

/* Toast */
.high-contrast .toast-info {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}

/* ── Skip link (WCAG 2.4.1 Bypass Blocks) ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0.5rem;
    z-index: 9999;
    padding: 0.5rem 1.25rem;
    background: #232222;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
    transition: top 0.1s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

/* ── Widoczny focus (WCAG 2.4.7 Focus Visible) ── */
:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 2px;
}

.btn:focus-visible,
.btn-link:focus-visible,
.dropdown-toggle:focus-visible,
.dropdown-item:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
    box-shadow: none;
}

.page-link:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
    box-shadow: none;
    color: #232222;
}

/* ── Overlay oceny: widoczny na hover i focus klawiaturowym (WCAG 2.1.1) ── */
.search-result-rating {
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    background: rgba(35, 34, 34, 0.80);
    backdrop-filter: blur(2px);
}

.search-result > div:hover .search-result-rating,
.search-result > div:focus-within .search-result-rating {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.button-yes:focus-visible path  { fill: #34C759; }
.button-no:focus-visible path   { fill: #F8683A; }
.button-unknown:focus-visible path { fill: #FBDC89; }

/* ── Tagify: ring focusu na widżecie tagów (WCAG 2.4.7) ── */
tags:focus-within {
    border-color: #86b7fe !important;
    outline: 3px solid rgba(13, 110, 253, 0.25);
    outline-offset: 0;
}