:root {
  --bg-body: #fff;
  --bg-header: #c80511;

  --text-main: #ffffff;
  --text-dark: #333333;

  --link-color: #0056b3;
  --link-bg: transparent;

  --font-size-base: 16px;
  --line-height-factor: 1.5;

  --container-bg: #ffffff;

  --accent-border: #ffbf47;
  --focus-outline: 3px solid #ffbf47;
  --high-contrast: #ffff00;
}

body {
  background-color: var(--bg-body);
  color: var(--text-dark);
  font-size: 1rem;
  line-height: var(--line-height-factor);
}

a {
  color: var(--link-color);
  background-color: var(--link-bg);
  transition: all 0.2s ease-in-out;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

.skip-link {
  position: fixed;
  top: -200px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 10px 20px;
  z-index: 99999999;
  text-decoration: none;
  font-weight: 700;
  border: 2px solid var(--accent-border);
}

.skip-link:focus {
  top: 0;
  outline: none;
}

body.high-contrast .skip-link {
	background: var(--high-contrast);
	color: #000;
}

/* --- Animacje --- */
body.stop-animations *,
body.stop-animations *::before,
body.stop-animations *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

body.stop-animations {
  scroll-behavior: auto !important;
}

body.stop-animations html {
  scroll-behavior: auto !important;
}

/* --- AUTOMATYCZNA DETEKCJA SYSTEMOWA (WCAG Best Practice) --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto !important;
  }
}

/* --- Podświetlanie linków --- */
body.highlight-links {
  --link-bg: #ffeb3b;
  --link-color: #000000;
}

body.highlight-links a {
	color: #000000;
}

body.high-contrast.highlight-links {
  --link-bg: #ffffff;
  --link-color: #000000;
}

/* --- Wysoki kontrast --- */
body.high-contrast {
  --bg-body: #000000;
  --bg-header: #000000;
  --text-main: var(--high-contrast);
  --text-dark: var(--high-contrast);
  --link-color: var(--high-contrast);
  --container-bg: #000000;
  --accent-border: var(--high-contrast);
  --focus-outline: 4px solid var(--high-contrast);
}

body.high-contrast #acc-menu {
  background: #000 !important;
  border: 2px solid var(--high-contrast) !important;
}

body.high-contrast #acc-menu button,
body.high-contrast #acc-menu .acc-jump {
  background: #000 !important;
  color: var(--high-contrast) !important;
  border: 1px solid var(--high-contrast) !important;
}

body.high-contrast #acc-menu button.active-option {
  background-color: var(--high-contrast) !important;
  color: #000000 !important;
  border: 2px solid #000000 !important;
  border-left: 10px solid #000 !important;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 4px;
}

.acc-wrapper {
  position: relative;
  z-index: 9999999;
  background: #f8f8f8;
}

#acc-trigger {
  color: #000;
  background: none;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.high-contrast #acc-trigger {
  color: var(--high-contrast);
}

body.high-contrast #acc-trigger svg {
  fill: var(--high-contrast);
}

#acc-menu {
  position: absolute;
  top: auto;
  display: none;
  background: var(--container-bg);
  border: 2px solid var(--text-dark);
  margin-top: 5px;
  padding: 15px;
  flex-direction: column;
  gap: 15px;
  width: 320px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
  max-height: 85vh;
  overflow-y: auto;
}

#acc-menu.active {
  display: flex;
}

#acc-menu button,
.acc-jump {
  background: #eee;
  color: var(--text-dark);
  border: none;
  padding: 10px 10px 10px 35px;
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  position: relative;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: all 0.2s ease-in-out;
  border-left: 6px solid transparent;
}

.acc-jump {
  padding-left: 10px;
}

#acc-menu button.active-option {
  background-color: var(--text-dark) !important;
  color: var(--text-main) !important;
  border-left: 6px solid var(--accent-border) !important;
  font-weight: 700;
  padding-left: 34px;
}

#acc-menu button:hover:not(.active-option),
.acc-jump:hover {
  background-color: #ddd;
  border-left: 6px solid #ccc;
}

.acc-icon {
  position: absolute;
  left: 10px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acc-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.5;
}

.acc-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.acc-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid #ccc;
  padding-bottom: 3px;
}


/* Wyraźny focus dla przycisku otwierania menu */
.menu button:focus-visible {
  outline: 3px solid #ffbf47 !important; /* Twój kolor akcentu */
  outline-offset: 2px;
  z-index: 9999;
}

/* Upewnij się, że linki wewnątrz menu też mają focus */
nav .main-nav a:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: -2px;
  background-color: #333; /* Żeby było widać na jasnym tle */
  color: #fff !important;
  padding: 2px;
}