/* Custom BIP Styling for Cassiopeia Template - Replica of the Legacy BIP Site */
:root {
  --cassiopeia-color-primary: #85221d;
  --cassiopeia-color-hover: #a82e27;
  --cassiopeia-color-link: #85221d;
  --bip-red: #85221d;
  --bip-dark-red: #52120e;
  --bip-border-color: #dcdfe6;
}

/* Base Body Styling */
body {
  background-color: #ffffff;
  color: #333333;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
}

/* 1. Topbar Styling */
.container-topbar {
  background-color: var(--bip-red) !important;
  color: #ffffff !important;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  border-bottom: 2px solid var(--bip-dark-red);
}
.container-topbar a {
  color: #ffffff !important;
  text-decoration: none;
  margin-right: 1.5rem;
  font-weight: bold;
}
.container-topbar a:hover {
  text-decoration: underline;
}

/* 2. Header / Brand area */
header.header {
  background-color: #ffffff !important;
  background-image: none !important;
  color: #333333 !important;
  border-bottom: 1px solid var(--bip-border-color);
  padding-top: 0 !important;
  padding-bottom: 1.5rem !important;
  box-shadow: none;
}
header.header a, header.header a:hover {
  color: var(--bip-red) !important;
  text-decoration: none;
}
header.header .navbar-brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
header.header .logo {
  max-height: 85px;
}
header.header .header-brand-container {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 1.5rem;
}
header.header .header-menu-container {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
header.header .header-menu-link {
  color: var(--bip-red) !important;
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.15s ease;
}
header.header .header-menu-link:hover {
  text-decoration: underline;
  color: var(--bip-dark-red) !important;
}
header.header .header-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--bip-red);
  border-radius: 2px;
  color: var(--bip-red) !important;
  transition: all 0.15s ease;
}
header.header .header-menu-icon:hover {
  background-color: var(--bip-red);
  color: #ffffff !important;
}

@media (max-width: 768px) {
  header.header .header-brand-container {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
  }
  header.header .header-menu-container {
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
  }
}


/* Hide default site description if brand title is added */
header.header .site-description {
  display: none;
}

/* 3. Layout Grid & Columns - Native Cassiopeia Grid structure */
.site-grid {
  margin-top: 1.5rem;
  max-width: 1700px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

/* 4. Breadcrumbs styling */
.mod-breadcrumbs {
  background-color: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 1.5rem;
  margin-top: 0 !important;
  padding: 0.5rem 0;
  box-shadow: none;
  font-size: 0.85rem;
  border-bottom: 1px solid #ebeef5;
}
.container-component {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.container-component > :first-child {
  margin-top: 0 !important;
}

/* 5. Left Sidebar Menu - Solid Red Style */
.container-sidebar-left {
  padding: 0;
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.container-sidebar-left .sidebar-left,
.container-sidebar-left .sidebar-left:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.container-sidebar-left .card {
  border: none;
  box-shadow: none;
  background: transparent;
  margin-bottom: 1.5rem;
  margin-top: 0 !important;
}
.container-sidebar-left .card-body {
  padding: 0;
}
.container-sidebar-left ul.mod-menu,
.container-sidebar-left ul.menu,
.container-sidebar-left ul.nav {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
  border: none;
  border-radius: 0;
  overflow: hidden;
}
.container-sidebar-left ul.mod-menu li,
.container-sidebar-left ul.menu li,
.container-sidebar-left ul.nav li {
  margin: 0 !important;
  padding: 0 !important;
  border-bottom: 1px solid #ffffff;
}
/* Main menu items (Level 1) - links AND headers (spans) */
.container-sidebar-left ul.mod-menu > li > a,
.container-sidebar-left ul.mod-menu > li > span.mod-menu__heading,
.container-sidebar-left ul.mod-menu > li > span.nav-header,
.container-sidebar-left ul.menu > li > a,
.container-sidebar-left ul.menu > li > span.mod-menu__heading,
.container-sidebar-left ul.menu > li > span.nav-header,
.container-sidebar-left ul.nav > li > a,
.container-sidebar-left ul.nav > li > span.mod-menu__heading,
.container-sidebar-left ul.nav > li > span.nav-header {
  display: block;
  padding: 0.75rem 1rem;
  background-color: #ab3f39 !important; /* Red/brown matching parent items in image */
  color: #ffffff !important;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.85rem;
  text-transform: uppercase;
  transition: background-color 0.15s ease;
  border-left: none;
}
.container-sidebar-left ul.mod-menu > li > a:hover,
.container-sidebar-left ul.mod-menu > li > span.mod-menu__heading:hover,
.container-sidebar-left ul.mod-menu > li > span.nav-header:hover,
.container-sidebar-left ul.menu > li > a:hover,
.container-sidebar-left ul.menu > li > span.mod-menu__heading:hover,
.container-sidebar-left ul.menu > li > span.nav-header:hover,
.container-sidebar-left ul.nav > li > a:hover,
.container-sidebar-left ul.nav > li > span.mod-menu__heading:hover,
.container-sidebar-left ul.nav > li > span.nav-header:hover {
  background-color: #be534c !important; /* Hover background matching lighter red in image */
  color: #ffffff !important;
  cursor: pointer;
}

/* Submenu items (Level 2) */
.container-sidebar-left ul.mod-menu ul,
.container-sidebar-left ul.menu ul,
.container-sidebar-left ul.nav ul {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
}
.container-sidebar-left ul.mod-menu ul li a,
.container-sidebar-left ul.menu ul li a,
.container-sidebar-left ul.nav ul li a {
  display: block;
  background-color: #97302c !important; /* Darker red for child items in image */
  color: #ffffff !important;
  padding: 0.75rem 1rem 0.75rem 1.75rem;
  font-size: 0.82rem;
  font-weight: bold;
  text-transform: none;
  transition: background-color 0.15s ease;
}
.container-sidebar-left ul.mod-menu ul li a:hover,
.container-sidebar-left ul.menu ul li a:hover,
.container-sidebar-left ul.nav ul li a:hover {
  background-color: #aa3f3a !important; /* Child hover background */
}

/* Active item */
.container-sidebar-left ul.mod-menu li.active > a,
.container-sidebar-left ul.mod-menu li.current > a,
.container-sidebar-left ul.menu li.active > a,
.container-sidebar-left ul.menu li.current > a,
.container-sidebar-left ul.nav li.active > a,
.container-sidebar-left ul.nav li.current > a {
  background-color: #be534c !important; /* Active / current item (e.g. STRONA GŁÓWNA) */
  color: #ffffff !important;
}

/* 6. Main Content Area */
.com-content-article,
.com-content-category {
  background-color: #ffffff;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 2rem;
}
.com-content-article .page-header,
.com-content-category .page-header,
.content-category {
  border-bottom: 2px solid var(--bip-red);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}
.com-content-article h1,
.com-content-article h2,
.com-content-category h1,
.com-content-category h2,
.content-category h1,
.content-category h2,
.page-header h1,
.page-header h2 {
  color: var(--bip-red) !important;
  font-size: 1.8rem;
  font-weight: bold;
  text-transform: none !important; /* Mixed case matching user's image */
  margin: 0 0 0.5rem 0;
}
.com-content-article__body {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Category List Table Styling */
table.category thead th {
  background-color: #ab3f39 !important; /* Red/brown matching parent items in image */
  color: #ffffff !important;
  text-align: center;
  font-weight: bold;
  padding: 0.75rem !important;
  vertical-align: middle;
  border: 1px solid #ffffff;
}
table.category thead th a {
  color: #ffffff !important;
  text-decoration: none;
  font-weight: bold;
}
table.category thead th a:hover {
  text-decoration: underline;
}

/* Article Title Links in List Table */
table.category td.list-title a,
table.category th.list-title a {
  color: #ab3f39 !important;
  font-weight: bold;
  text-decoration: none;
}
table.category td.list-title a:hover,
table.category th.list-title a:hover {
  text-decoration: underline;
  color: #be534c !important;
}

/* Prepended Text for Author */
table.category td.list-author {
  font-size: 0.85rem;
  color: #333333;
}
table.category td.list-author::before {
  content: "Udostępniony przez: ";
  font-weight: normal;
  color: #666666;
}

/* Hits Badge Styling */
table.category td.list-hits .badge {
  background-color: #ab3f39 !important;
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: bold;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
}
table.category td.list-hits .badge::before {
  content: "Odsłon: ";
}

/* 7. Right Sidebar Cards */
.container-sidebar-right {
  padding: 0;
}
.container-sidebar-right .card {
  border: 1px solid var(--bip-border-color);
  border-radius: 4px;
  box-shadow: none;
  background-color: #ffffff;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.container-sidebar-right .card-body {
  padding: 0.75rem;
}
.container-sidebar-right .mod-custom {
  padding: 0;
}
.container-sidebar-right .mod-custom p {
  margin: 0;
  text-align: center;
}
.container-sidebar-right .mod-custom img {
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

/* Redakcja BIP Card Styling */
.container-sidebar-right .card-header,
.container-sidebar-right .card h3.card-header {
  background-color: transparent !important;
  color: var(--bip-red) !important;
  border-bottom: 1px solid var(--bip-border-color);
  font-weight: bold;
  font-size: 0.9rem;
  padding: 0.75rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}
.container-sidebar-right .vcard {
  margin-bottom: 0.75rem;
}
.container-sidebar-right .vcard dt,
.container-sidebar-right .card-body p {
  font-size: 0.85rem;
  color: #333333;
}

/* 8. Footer Styling */
footer {
  background-color: var(--bip-red) !important;
  color: #ffffff !important;
  padding: 2.5rem 0 !important;
  margin-top: 4rem;
  border-top: 4px solid var(--bip-dark-red);
}
footer a {
  color: #ffffff !important;
  text-decoration: underline !important;
}
footer a:hover {
  color: #ffcccc !important;
}
footer h3, footer .card-header {
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  padding-bottom: 0.5rem;
}

/* Hide frontend submit / edit icons and buttons (e.g., "Nowy artykuł" button) */
a[href*="task=article.edit"],
a[href*="task=article.add"],
a[href*="layout=edit"][href*="view=form"],
.icon-cog,
.icons-wrapper,
.actions,
.com-content-article__actions,
.com-content-category__create {
  display: none !important;
}

/* Hide Joomla's native "Details" / "Szczegóły" section */
.article-info,
.article-info-mute,
.info-block,
.com-content-category-blog__item-info {
  display: none !important;
}

/* Category Blog View Article Titles */
.blog-items .item-title a,
.blog-item .item-title a,
.com-content-category-blog__item h2 a,
h2.item-title a,
h2[itemprop="name"] a {
  color: #ab3f39 !important;
  font-weight: bold;
  text-decoration: none !important;
  font-size: 1.5rem;
}
.blog-items .item-title a:hover,
.blog-item .item-title a:hover,
.com-content-category-blog__item h2 a:hover,
h2.item-title a:hover,
h2[itemprop="name"] a:hover {
  text-decoration: underline !important;
  color: #be534c !important;
}

/* Pagination Styling */
.pagination .page-item.active .page-link {
  background-color: #ab3f39 !important;
  border-color: #ab3f39 !important;
  color: #ffffff !important;
}
.pagination .page-link {
  color: #ab3f39 !important;
}
.pagination .page-link:hover {
  background-color: #f5f7fa !important;
  color: #be534c !important;
}

/* WCAG Accessibility Toolbar Styling */
.container-topbar {
  background-color: var(--bip-red) !important;
  border-bottom: 2px solid var(--bip-dark-red);
}
.container-topbar .topbar-inner {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
/* Ensure the joomla topbar module outputs nicely on left - hidden visually by default (for screen readers/keyboard navigation only) */
.container-topbar .mod-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.container-topbar .mod-menu li a:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  background-color: #ab3f39;
  color: #ffffff !important;
  padding: 0.5rem 1rem;
  z-index: 99999;
  width: auto;
  height: auto;
  clip: auto;
  white-space: normal;
  border: 2px solid #ffffff;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ==========================================================================
   EXPANDED WCAG ACCESSIBILITY SYSTEM
   ========================================================================== */

.wcag-toolbar-expanded {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 100%;
}

.wcag-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.wcag-label {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: bold;
  margin-right: 0.2rem;
}

/* WCAG Mode Button (Tryb domyślny, Tryb nocny) */
.wcag-mode-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.wcag-mode-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}
.wcag-mode-btn .wcag-box {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid #ffffff;
  margin-right: 6px;
  position: relative;
}
.wcag-mode-btn.active .wcag-box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background-color: #ffffff;
}

/* General WCAG Button */
.wcag-btn {
  background: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
  width: 28px;
  height: 28px;
}
.wcag-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* Active Highlight */
.wcag-btn.active {
  background-color: rgba(255, 255, 255, 0.3) !important;
  border: 2px solid #ffffff !important;
}

/* Contrast Buttons */
.wcag-btn.contrast-bw {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}
.wcag-btn.contrast-bg {
  background-color: #000000 !important;
  color: #00ff00 !important;
  border: 2px solid #00ff00 !important;
}
.wcag-btn.contrast-yb {
  background-color: #ffff00 !important;
  color: #000000 !important;
  border: 2px solid #000000 !important;
}

/* Custom SVG-like Layout Icons */
.wcag-layout-icon {
  display: inline-block;
  width: 14px;
  height: 12px;
  position: relative;
  color: inherit;
}
.wcag-layout-icon.standard {
  border: 1px solid currentColor;
}
.wcag-layout-icon.standard::after {
  content: "";
  position: absolute;
  top: 0;
  left: 4px;
  bottom: 0;
  width: 1px;
  background-color: currentColor;
}
.wcag-layout-icon.text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.wcag-layout-icon.text::before,
.wcag-layout-icon.text::after,
.wcag-layout-icon.text span {
  content: "";
  height: 2px;
  background-color: currentColor;
  width: 100%;
}
.wcag-layout-icon.text span {
  width: 75%;
}

/* Font Sizing Buttons Labeled A-, A, A+ */
.wcag-btn.font-minus {
  font-size: 0.72rem;
}
.wcag-btn.font-normal {
  font-size: 0.85rem;
}
.wcag-btn.font-plus {
  font-size: 1.05rem;
}

/* Search Form */
.wcag-search-form {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 0.4rem;
}
.wcag-search-input {
  height: 28px;
  padding: 0 0.5rem;
  border: 1px solid #ffffff;
  border-radius: 2px;
  background-color: #ffffff;
  color: #333333;
  font-size: 0.85rem;
  width: 170px;
}
.wcag-search-input::placeholder {
  color: #888888;
}
.wcag-search-btn {
  height: 28px;
  padding: 0 0.8rem;
  background-color: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
}
.wcag-search-btn:hover {
  background-color: #ffffff;
  color: var(--bip-red);
}

/* ==========================================================================
   HIGH CONTRAST & ACCESSIBILITY LOGIC IMPLEMENTATION (CSS)
   ========================================================================== */

/* 1. Tryb Nocny (Night Mode) */
body.wcag-night-mode,
body.wcag-night-mode div,
body.wcag-night-mode section,
body.wcag-night-mode main,
body.wcag-night-mode table,
body.wcag-night-mode tr,
body.wcag-night-mode td,
body.wcag-night-mode th,
body.wcag-night-mode .card,
body.wcag-night-mode .card-body,
body.wcag-night-mode .main-content {
  background-color: #1e1e1e !important;
  color: #e2e2e2 !important;
  border-color: #444444 !important;
}
body.wcag-night-mode header.header,
body.wcag-night-mode footer {
  background-color: #111111 !important;
  border-color: #333333 !important;
}
body.wcag-night-mode a {
  color: #64b5f6 !important;
}
body.wcag-night-mode a:hover {
  color: #90caf9 !important;
}
body.wcag-night-mode .container-sidebar-left ul.mod-menu > li > a,
body.wcag-night-mode .container-sidebar-left ul.mod-menu > li > span.nav-header {
  background-color: #2c2c2c !important;
  border-color: #444444 !important;
}

/* 2. Czarno-biały (Black & White Contrast) */
body.wcag-contrast-bw,
body.wcag-contrast-bw *,
body.wcag-contrast-bw div,
body.wcag-contrast-bw section,
body.wcag-contrast-bw header,
body.wcag-contrast-bw footer,
body.wcag-contrast-bw main,
body.wcag-contrast-bw table,
body.wcag-contrast-bw tr,
body.wcag-contrast-bw td,
body.wcag-contrast-bw th,
body.wcag-contrast-bw card,
body.wcag-contrast-bw ul,
body.wcag-contrast-bw li,
body.wcag-contrast-bw a {
  background-color: #000000 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
body.wcag-contrast-bw a:hover,
body.wcag-contrast-bw a:focus {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* 3. Czarno-zielony (Black & Green Contrast) */
body.wcag-contrast-bg,
body.wcag-contrast-bg *,
body.wcag-contrast-bg div,
body.wcag-contrast-bg section,
body.wcag-contrast-bg header,
body.wcag-contrast-bg footer,
body.wcag-contrast-bg main,
body.wcag-contrast-bg table,
body.wcag-contrast-bg tr,
body.wcag-contrast-bg td,
body.wcag-contrast-bg th,
body.wcag-contrast-bg card,
body.wcag-contrast-bg ul,
body.wcag-contrast-bg li,
body.wcag-contrast-bg a {
  background-color: #000000 !important;
  background-image: none !important;
  color: #00ff00 !important;
  border-color: #00ff00 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
body.wcag-contrast-bg a:hover,
body.wcag-contrast-bg a:focus {
  background-color: #00ff00 !important;
  color: #000000 !important;
}

/* 4. Żółto-czarny (Yellow & Black Contrast) */
body.wcag-contrast-yb,
body.wcag-contrast-yb *,
body.wcag-contrast-yb div,
body.wcag-contrast-yb section,
body.wcag-contrast-yb header,
body.wcag-contrast-yb footer,
body.wcag-contrast-yb main,
body.wcag-contrast-yb table,
body.wcag-contrast-yb tr,
body.wcag-contrast-yb td,
body.wcag-contrast-yb th,
body.wcag-contrast-yb card,
body.wcag-contrast-yb ul,
body.wcag-contrast-yb li,
body.wcag-contrast-yb a {
  background-color: #ffff00 !important;
  background-image: none !important;
  color: #000000 !important;
  border-color: #000000 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
body.wcag-contrast-yb a:hover,
body.wcag-contrast-yb a:focus {
  background-color: #000000 !important;
  color: #ffff00 !important;
}

/* 5. Widok tekstowy (Text Only View) - lewe menu pozostaje widoczne jako lista linków bez grafik */
body.wcag-view-text-only .container-sidebar-right,
body.wcag-view-text-only .container-below-top,
body.wcag-view-text-only .navbar-brand,
body.wcag-view-text-only img,
body.wcag-view-text-only svg,
body.wcag-view-text-only iframe,
body.wcag-view-text-only .banner,
body.wcag-view-text-only .card-img-top {
  display: none !important;
}
body.wcag-view-text-only .site-grid {
  display: block !important;
  max-width: 900px !important;
  margin: 0 auto !important;
  padding: 1rem !important;
}
body.wcag-view-text-only .grid-child.main-content,
body.wcag-view-text-only .container-sidebar-left {
  grid-column: span 12 !important;
  width: 100% !important;
  float: none !important;
  margin: 0 0 1.5rem 0 !important;
}
body.wcag-view-text-only .container-sidebar-left,
body.wcag-view-text-only .container-sidebar-left *,
body.wcag-view-text-only .container-sidebar-left div,
body.wcag-view-text-only .container-sidebar-left ul,
body.wcag-view-text-only .container-sidebar-left li,
body.wcag-view-text-only .container-sidebar-left a {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important; /* Keep inherited color (important for contrast modes) */
  padding: 4px 0 !important;
  margin: 0 !important;
}
body.wcag-view-text-only .container-sidebar-left a {
  text-decoration: underline !important;
}
body.wcag-view-text-only .container-sidebar-left a:hover {
  text-decoration: none !important;
}

/* 6. Skalowanie czcionek (Font Sizing) */
body.wcag-font-small,
body.wcag-font-small p,
body.wcag-font-small a,
body.wcag-font-small span,
body.wcag-font-small td,
body.wcag-font-small li {
  font-size: 0.88rem !important;
}

body.wcag-font-large,
body.wcag-font-large p,
body.wcag-font-large a,
body.wcag-font-large span,
body.wcag-font-large td,
body.wcag-font-large li {
  font-size: 1.25rem !important;
}
body.wcag-font-large h1 {
  font-size: 2.3rem !important;
}
body.wcag-font-large h2 {
  font-size: 2.0rem !important;
}
body.wcag-font-large h3 {
  font-size: 1.5rem !important;
}

/* Responsywność paska narzędziowego WCAG */
@media (max-width: 992px) {
  .container-topbar .topbar-inner {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }
  .wcag-toolbar-expanded {
    justify-content: center;
  }
  .wcag-search-form {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

/* Hide Joomla Contact form and its heading on the contact page */
.com-contact__form,
.contact-form,
.com-contact h2:has(+ .com-contact__form),
.com-contact h2:has(+ .contact-form) {
  display: none !important;
}

/* ==========================================================================
   EXPLICIT LEFT MENU CONTRAST & NIGHT MODE OVERRIDES
   ========================================================================== */

/* 1. Tryb Nocny (Night Mode) Menu Overrides */
body.wcag-night-mode .container-sidebar-left ul.mod-menu > li > a,
body.wcag-night-mode .container-sidebar-left ul.menu > li > a,
body.wcag-night-mode .container-sidebar-left ul.nav > li > a,
body.wcag-night-mode .container-sidebar-left ul.mod-menu > li > span,
body.wcag-night-mode .container-sidebar-left ul.menu > li > span,
body.wcag-night-mode .container-sidebar-left ul.nav > li > span {
  background-color: #2c2c2c !important;
  color: #e2e2e2 !important;
  border-bottom: 1px solid #444444 !important;
}
body.wcag-night-mode .container-sidebar-left ul.mod-menu > li > a:hover,
body.wcag-night-mode .container-sidebar-left ul.menu > li > a:hover,
body.wcag-night-mode .container-sidebar-left ul.nav > li > a:hover {
  background-color: #3d3d3d !important;
  color: #ffffff !important;
}
body.wcag-night-mode .container-sidebar-left ul.mod-menu ul li a,
body.wcag-night-mode .container-sidebar-left ul.menu ul li a,
body.wcag-night-mode .container-sidebar-left ul.nav ul li a {
  background-color: #1e1e1e !important;
  color: #64b5f6 !important;
  border-bottom: 1px solid #333333 !important;
}
body.wcag-night-mode .container-sidebar-left ul.mod-menu ul li a:hover,
body.wcag-night-mode .container-sidebar-left ul.menu ul li a:hover,
body.wcag-night-mode .container-sidebar-left ul.nav ul li a:hover {
  background-color: #2c2c2c !important;
  color: #90caf9 !important;
}

/* 2. Czarno-biały (Black & White Contrast) Menu Overrides */
body.wcag-contrast-bw .container-sidebar-left ul.mod-menu > li > a,
body.wcag-contrast-bw .container-sidebar-left ul.menu > li > a,
body.wcag-contrast-bw .container-sidebar-left ul.nav > li > a,
body.wcag-contrast-bw .container-sidebar-left ul.mod-menu > li > span,
body.wcag-contrast-bw .container-sidebar-left ul.menu > li > span,
body.wcag-contrast-bw .container-sidebar-left ul.nav > li > span {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #ffffff !important;
}
body.wcag-contrast-bw .container-sidebar-left ul.mod-menu > li > a:hover,
body.wcag-contrast-bw .container-sidebar-left ul.menu > li > a:hover,
body.wcag-contrast-bw .container-sidebar-left ul.nav > li > a:hover,
body.wcag-contrast-bw .container-sidebar-left ul.mod-menu li.active > a,
body.wcag-contrast-bw .container-sidebar-left ul.menu li.active > a,
body.wcag-contrast-bw .container-sidebar-left ul.nav li.active > a {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
}
body.wcag-contrast-bw .container-sidebar-left ul.mod-menu ul li a,
body.wcag-contrast-bw .container-sidebar-left ul.menu ul li a,
body.wcag-contrast-bw .container-sidebar-left ul.nav ul li a {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 1px dashed #ffffff !important;
}
body.wcag-contrast-bw .container-sidebar-left ul.mod-menu ul li a:hover,
body.wcag-contrast-bw .container-sidebar-left ul.menu ul li a:hover,
body.wcag-contrast-bw .container-sidebar-left ul.nav ul li a:hover {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* 3. Czarno-zielony (Black & Green Contrast) Menu Overrides */
body.wcag-contrast-bg .container-sidebar-left ul.mod-menu > li > a,
body.wcag-contrast-bg .container-sidebar-left ul.menu > li > a,
body.wcag-contrast-bg .container-sidebar-left ul.nav > li > a,
body.wcag-contrast-bg .container-sidebar-left ul.mod-menu > li > span,
body.wcag-contrast-bg .container-sidebar-left ul.menu > li > span,
body.wcag-contrast-bg .container-sidebar-left ul.nav > li > span {
  background-color: #000000 !important;
  color: #00ff00 !important;
  border: 1px solid #00ff00 !important;
}
body.wcag-contrast-bg .container-sidebar-left ul.mod-menu > li > a:hover,
body.wcag-contrast-bg .container-sidebar-left ul.menu > li > a:hover,
body.wcag-contrast-bg .container-sidebar-left ul.nav > li > a:hover,
body.wcag-contrast-bg .container-sidebar-left ul.mod-menu li.active > a,
body.wcag-contrast-bg .container-sidebar-left ul.menu li.active > a,
body.wcag-contrast-bg .container-sidebar-left ul.nav li.active > a {
  background-color: #00ff00 !important;
  color: #000000 !important;
  border-color: #00ff00 !important;
}
body.wcag-contrast-bg .container-sidebar-left ul.mod-menu ul li a,
body.wcag-contrast-bg .container-sidebar-left ul.menu ul li a,
body.wcag-contrast-bg .container-sidebar-left ul.nav ul li a {
  background-color: #000000 !important;
  color: #00ff00 !important;
  border: 1px dashed #00ff00 !important;
}
body.wcag-contrast-bg .container-sidebar-left ul.mod-menu ul li a:hover,
body.wcag-contrast-bg .container-sidebar-left ul.menu ul li a:hover,
body.wcag-contrast-bg .container-sidebar-left ul.nav ul li a:hover {
  background-color: #00ff00 !important;
  color: #000000 !important;
}

/* 4. Żółto-czarny (Yellow & Black Contrast) Menu Overrides */
body.wcag-contrast-yb .container-sidebar-left ul.mod-menu > li > a,
body.wcag-contrast-yb .container-sidebar-left ul.menu > li > a,
body.wcag-contrast-yb .container-sidebar-left ul.nav > li > a,
body.wcag-contrast-yb .container-sidebar-left ul.mod-menu > li > span,
body.wcag-contrast-yb .container-sidebar-left ul.menu > li > span,
body.wcag-contrast-yb .container-sidebar-left ul.nav > li > span {
  background-color: #ffff00 !important;
  color: #000000 !important;
  border: 1px solid #000000 !important;
}
body.wcag-contrast-yb .container-sidebar-left ul.mod-menu > li > a:hover,
body.wcag-contrast-yb .container-sidebar-left ul.menu > li > a:hover,
body.wcag-contrast-yb .container-sidebar-left ul.nav > li > a:hover,
body.wcag-contrast-yb .container-sidebar-left ul.mod-menu li.active > a,
body.wcag-contrast-yb .container-sidebar-left ul.menu li.active > a,
body.wcag-contrast-yb .container-sidebar-left ul.nav li.active > a {
  background-color: #000000 !important;
  color: #ffff00 !important;
  border-color: #000000 !important;
}
body.wcag-contrast-yb .container-sidebar-left ul.mod-menu ul li a,
body.wcag-contrast-yb .container-sidebar-left ul.menu ul li a,
body.wcag-contrast-yb .container-sidebar-left ul.nav ul li a {
  background-color: #ffff00 !important;
  color: #000000 !important;
  border: 1px dashed #000000 !important;
}
body.wcag-contrast-yb .container-sidebar-left ul.mod-menu ul li a:hover,
body.wcag-contrast-yb .container-sidebar-left ul.menu ul li a:hover,
body.wcag-contrast-yb .container-sidebar-left ul.nav ul li a:hover {
  background-color: #000000 !important;
  color: #ffff00 !important;
}

/* ==========================================================================
   FOOTER STYLING
   ========================================================================== */
footer.container-footer {
  background-color: var(--bip-red) !important;
  color: #ffffff !important;
  border-top: none !important;
  padding: 1.5rem 0 !important;
  margin-top: 3rem;
  box-shadow: none !important;
}
footer.container-footer a {
  color: #ffffff !important;
  text-decoration: none;
}
footer.container-footer a:hover {
  text-decoration: underline;
}
.footer-inner {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
}
.footer-copyright {
  flex-grow: 1;
  text-align: center;
}
.footer-back-to-top {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* WCAG Contrast & Night Mode Overrides for Footer */
body.wcag-night-mode footer.container-footer {
  background-color: #111111 !important;
  color: #e2e2e2 !important;
  border-top: 1px solid #333333 !important;
}
body.wcag-night-mode footer.container-footer a {
  color: #64b5f6 !important;
}

body.wcag-contrast-bw footer.container-footer {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-top: 1px solid #ffffff !important;
}
body.wcag-contrast-bw footer.container-footer a {
  color: #ffffff !important;
}

body.wcag-contrast-bg footer.container-footer {
  background-color: #000000 !important;
  color: #00ff00 !important;
  border-top: 1px solid #00ff00 !important;
}
body.wcag-contrast-bg footer.container-footer a {
  color: #00ff00 !important;
}

body.wcag-contrast-yb footer.container-footer {
  background-color: #ffff00 !important;
  color: #000000 !important;
  border-top: 1px solid #000000 !important;
}
body.wcag-contrast-yb footer.container-footer a {
  color: #000000 !important;
}


