/* ==========================================================================
   NaviAble - dostępna wersja strony.
   Warstwa wizualna oparta o Pure.css (reset, siatka, przyciski, menu, tabele)
   plus 5 motywów czytelnych dla seniorów i osób słabowidzących.
   Zasady: kontrast >= 4.5:1, focus 4px/2px, płynna typografia.
   ========================================================================== */

/* --- Zmienne bazowe (nadpisywane przez motywy) ---------------------------- */
.accessible-body {
  --a-bg: #ffffff;
  --a-text: #16202e;
  --a-muted: #475569;
  --a-accent: #1d4ed8;
  --a-accent-text: #ffffff;
  --a-link: #173ea5;
  --a-border: #d9e1ee;
  --a-header-bg: #f5f8fc;
  --a-nav-bg: #ffffff;
  --a-soft: #eef3fb;
  --a-radius: 10px;
  --a-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --a-font-heading: var(--a-font);
  --a-size: 1.0625rem;
  --a-line: 1.7;

  margin: 0;
  background: var(--a-bg);
  color: var(--a-text);
  font-family: var(--a-font);
  font-size: var(--a-size);
  line-height: var(--a-line);
}

/* --- Motywy --------------------------------------------------------------- */
.theme-classic {
  --a-bg: #ffffff;
  --a-text: #16202e;
  --a-muted: #475569;
  --a-accent: #1d4ed8;
  --a-link: #173ea5;
  --a-border: #d9e1ee;
  --a-header-bg: #f5f8fc;
  --a-soft: #eef3fb;
}

.theme-warm {
  --a-bg: #fbf7ef;
  --a-text: #2b2118;
  --a-muted: #5c4a3a;
  --a-accent: #7a3e12;
  --a-accent-text: #ffffff;
  --a-link: #8a3d0c;
  --a-border: #e3d6c2;
  --a-header-bg: #f4ebdc;
  --a-soft: #f1e7d6;
  --a-radius: 8px;
  --a-font-heading: Georgia, "Times New Roman", "DejaVu Serif", serif;
}

.theme-contrast {
  --a-bg: #000000;
  --a-text: #ffffff;
  --a-muted: #e6e6e6;
  --a-accent: #ffd400;
  --a-accent-text: #000000;
  --a-link: #ffd400;
  --a-border: #ffffff;
  --a-header-bg: #000000;
  --a-nav-bg: #000000;
  --a-soft: #1a1a1a;
  --a-radius: 0;
}

.theme-calm {
  --a-bg: #eef3f7;
  --a-text: #1f2d3d;
  --a-muted: #3f5368;
  --a-accent: #0e7490;
  --a-accent-text: #ffffff;
  --a-link: #0b5f75;
  --a-border: #cbdae6;
  --a-header-bg: #e3edf4;
  --a-soft: #dfeaf2;
}

.theme-large {
  --a-bg: #ffffff;
  --a-text: #111827;
  --a-muted: #374151;
  --a-accent: #1d4ed8;
  --a-link: #173ea5;
  --a-border: #c9d4e4;
  --a-header-bg: #f0f5fc;
  --a-soft: #e8f0fb;
  --a-size: 1.3rem;
  --a-line: 1.85;
}

/* --- Siatka --------------------------------------------------------------- */
.a-container {
  width: min(100% - 2.5rem, 900px);
  margin-inline: auto;
}

/* --- Pasek narzędzi ------------------------------------------------------- */
.a-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0b1220;
  color: #e6edf7;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.theme-contrast .a-bar {
  background: #000;
  border-bottom: 2px solid #fff;
}

.a-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
  padding-block: 0.7rem;
  width: min(100% - 2.5rem, 1140px);
}

.a-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.a-brand__able {
  color: #7dd3fc;
}

.a-brand__tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #b6c4da;
  border-left: 1px solid rgb(255 255 255 / 25%);
  padding-left: 0.5rem;
}

.a-bar__tools {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* --- Przyciski (nakładka na Pure) ----------------------------------------- */
.a-btn.pure-button {
  border-radius: var(--a-radius);
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  line-height: 1.2;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  background: #fff;
  color: #0b1220;
}

.a-btn.pure-button:hover,
.a-btn.pure-button:focus {
  background: #e8efff;
}

.a-btn--ghost.pure-button {
  background: transparent;
  color: #e6edf7;
  border-color: rgb(255 255 255 / 35%);
}

.a-btn--ghost.pure-button:hover,
.a-btn--ghost.pure-button:focus {
  background: rgb(255 255 255 / 12%);
}

.a-btn--primary.pure-button {
  background: var(--a-accent);
  color: var(--a-accent-text);
}

.a-btn--primary.pure-button:hover,
.a-btn--primary.pure-button:focus {
  filter: brightness(0.94);
}

/* --- Przełącznik motywów -------------------------------------------------- */
.a-themes {
  padding-bottom: 0.55rem;
}

.a-themes nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
}

.a-themes__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b6c4da;
}

.a-themes__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a-themes__list li {
  margin: 0;
}

.a-theme {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 30%);
  color: #dbe4f0;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.a-theme:hover {
  background: rgb(255 255 255 / 12%);
  color: #fff;
}

.a-theme.is-active {
  background: #fff;
  color: #0b1220;
  border-color: #fff;
}

.a-theme:focus-visible {
  outline: 4px solid #93c5fd;
  outline-offset: 2px;
}

.a-theme__dot {
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  border: 1px solid rgb(0 0 0 / 25%);
}

.a-theme__dot--classic { background: #1d4ed8; }
.a-theme__dot--warm { background: #7a3e12; }
.a-theme__dot--contrast { background: #ffd400; }
.a-theme__dot--calm { background: #0e7490; }
.a-theme__dot--large { background: #111827; }

/* --- Nagłówek dokumentu --------------------------------------------------- */
.a-header {
  padding-block: 2.6rem 1.5rem;
  background: var(--a-header-bg);
  border-bottom: 1px solid var(--a-border);
}

.a-header h1 {
  margin: 0.35rem 0 0;
  font-family: var(--a-font-heading);
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--a-text);
}

.theme-large .a-header h1 {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
}

.a-eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-link);
}

.a-lead {
  margin: 0.9rem 0 0;
  max-width: 68ch;
  color: var(--a-muted);
  font-size: 1.05em;
}

/* --- Nawigacja: dostępne menu rozwijane (natywny details/summary) --------- */
.a-nav {
  background: var(--a-nav-bg);
  border-bottom: 1px solid var(--a-border);
  padding-block: 0.9rem;
}

.a-nav__details {
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-soft);
}

.a-nav__summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--a-font-heading);
  font-size: 1.02em;
  font-weight: 700;
  color: var(--a-text);
  border-radius: var(--a-radius);
}

/* Ukrycie domyślnego markera i własna strzałka (dekoracyjna). */
.a-nav__summary::-webkit-details-marker {
  display: none;
}

.a-nav__summary::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.15s ease;
}

.a-nav__details[open] .a-nav__summary::before {
  transform: rotate(90deg);
}

.a-nav__summary:hover {
  background: rgb(0 0 0 / 4%);
}

.theme-contrast .a-nav__summary:hover {
  background: #1a1a1a;
}

.a-nav__summary:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: -4px;
  border-radius: var(--a-radius);
}

.a-nav__count {
  font-weight: 500;
  font-size: 0.9em;
  color: var(--a-muted);
}

.a-nav__hint {
  margin: 0 1rem 0.4rem;
  font-size: 0.85em;
  color: var(--a-muted);
}

/* Przewijany region: długa lista nie wydłuża strony. */
.a-nav__scroll {
  max-height: clamp(16rem, 55vh, 32rem);
  overflow-y: auto;
  border-top: 1px solid var(--a-border);
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--a-muted) transparent;
}

.a-nav__scroll::-webkit-scrollbar {
  width: 10px;
}

.a-nav__scroll::-webkit-scrollbar-thumb {
  background: var(--a-border);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.a-nav__scroll:hover::-webkit-scrollbar-thumb {
  background: var(--a-muted);
  background-clip: content-box;
}

.a-nav__scroll:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: -4px;
}

.a-nav__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 2rem;
  margin: 0;
  padding: 0.6rem 1rem 1rem;
  list-style: none;
}

.a-nav__list li {
  margin: 0;
  padding: 0;
}

.a-nav__list a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  max-width: 100%;
  padding: 0.12rem 0;
  color: var(--a-link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.a-nav__list a > span {
  overflow-wrap: anywhere;
}

.a-nav__icon {
  width: 1.35em;
  height: 1.35em;
  flex: none;
  object-fit: contain;
  border-radius: 3px;
}

.a-nav__list a:hover {
  color: var(--a-text);
}

.a-nav__list a:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Treść ---------------------------------------------------------------- */
.a-main {
  padding-block: 2rem 3.5rem;
}

.a-prose {
  max-width: 74ch;
  overflow-wrap: break-word;
}

.a-prose :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--a-font-heading);
  color: var(--a-text);
  line-height: 1.25;
  margin: 1.8em 0 0.5em;
}

.a-prose h2 {
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
}

.a-prose h3 {
  font-size: clamp(1.2rem, 1.05rem + 0.6rem, 1.45rem);
}

.a-prose p,
.a-prose li {
  font-size: 1em;
}

.a-prose p {
  margin: 0 0 1em;
}

.a-prose ul,
.a-prose ol {
  padding-left: 1.4em;
  margin: 0 0 1em;
}

.a-prose li {
  margin-bottom: 0.35em;
}

.a-prose a {
  color: var(--a-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  font-weight: 600;
}

.a-prose a:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.a-prose img {
  margin: 1.2em 0;
  border-radius: var(--a-radius);
  border: 1px solid var(--a-border);
  height: auto;
}

.a-prose blockquote {
  margin: 1.2em 0;
  padding: 0.6em 1.1em;
  border-left: 4px solid var(--a-accent);
  background: var(--a-soft);
  color: var(--a-text);
}

.a-prose table.pure-table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  border: 1px solid var(--a-border);
  font-size: 0.98em;
}

.a-prose table.pure-table :where(th, td) {
  border: 1px solid var(--a-border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.a-prose table.pure-table thead th {
  background: var(--a-soft);
  color: var(--a-text);
}

.a-prose pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--a-radius);
  background: #0b1220;
  color: #e6edf7;
}

.a-prose code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.92em;
}

.a-prose :not(pre) > code {
  background: var(--a-soft);
  color: var(--a-text);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.a-prose hr {
  border: 0;
  border-top: 1px solid var(--a-border);
  margin: 2em 0;
}

/* --- Stopka --------------------------------------------------------------- */
.a-footer {
  padding-block: 2rem;
  background: var(--a-header-bg);
  border-top: 1px solid var(--a-border);
  color: var(--a-muted);
  font-size: 0.95em;
}

.a-note {
  padding-block: 1.5rem;
  border-top: 1px solid var(--a-border);
  background: var(--a-bg);
}

.a-note p {
  margin: 0;
  color: var(--a-muted);
  font-size: 0.92em;
}

.a-note a {
  color: var(--a-link);
}

/* --- Formularz narzędzia (Pure form) -------------------------------------- */
.a-hero {
  padding-block: 4rem 3rem;
}

.a-hero h1 {
  margin: 0.4rem 0 0;
  color: #fff;
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.a-form {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #fff;
  color: #0b1220;
  border-radius: 12px;
  box-shadow: 0 30px 60px -30px rgb(15 23 42 / 35%);
  max-width: 640px;
}

.a-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
  color: #0b1220;
}

.a-form input[type="text"],
.a-form input[type="url"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: #0b1220;
  border: 2px solid #b8c4d8;
  border-radius: 8px;
  background: #fff;
}

.a-form input:focus-visible {
  outline: 4px solid #1d4ed8;
  outline-offset: 2px;
  border-color: #1d4ed8;
}

.a-form input[aria-invalid="true"] {
  border-color: #b91c1c;
}

.a-form__row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.a-form__row input {
  flex: 1 1 320px;
}

.a-form__error {
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: #fdeaea;
  color: #b91c1c;
  font-weight: 600;
}

.a-form__hint {
  margin: 0.7rem 0 0;
  color: #475569;
  font-size: 0.9rem;
}

.a-form code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.88em;
  background: #eaf0f9;
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

/* --- Responsywność -------------------------------------------------------- */
@media (max-width: 620px) {
  .a-bar__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .a-brand__tag {
    display: none;
  }

  .a-container {
    width: min(100% - 1.6rem, 900px);
  }

  .a-nav__list {
    grid-template-columns: 1fr;
  }

  .a-nav__scroll {
    max-height: 50vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .a-nav__summary::before {
    transition: none;
  }
}

/* --- Skróty obrazkowe (banery, kafle) ------------------------------------- */
.a-quick {
  background: var(--a-nav-bg);
  border-bottom: 1px solid var(--a-border);
  padding-block: 0.9rem 1.1rem;
}

.a-quick__title {
  margin: 0 0 0.6rem;
  font-family: var(--a-font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-muted);
}

.a-quick__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a-quick__list li {
  margin: 0;
}

.a-quick__list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-soft);
  color: var(--a-link);
  font-weight: 600;
  text-decoration: none;
  height: 100%;
  box-sizing: border-box;
}

.a-quick__list a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.a-quick__list a:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
}

.a-quick__icon {
  width: 32px;
  height: 32px;
  flex: none;
  object-fit: contain;
}

@media (max-width: 620px) {
  .a-quick__list {
    grid-template-columns: 1fr;
  }
}

/* --- Komunikat o nieczytelnej treści -------------------------------------- */
.a-empty {
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  border: 2px solid var(--a-accent);
  border-radius: var(--a-radius);
  background: var(--a-soft);
  color: var(--a-text);
}

.a-empty p {
  margin: 0 0 0.6rem;
}

.a-empty__actions {
  margin: 0 !important;
}

.a-embed {
  margin: 1em 0;
  padding: 0.6em 0.9em;
  border-left: 4px solid var(--a-accent);
  background: var(--a-soft);
}
