/* ═══════════════════════════════════════════════════════════════
   pp10-sitemap.css  –  Mapa strony
   WCAG 2.2 AAA – kontrast, fokus, hierarchia, tryby dostępności
═══════════════════════════════════════════════════════════════ */

/* ── Kontener nawigacji mapy ────────────────────────────────── */
.sitemap-nav {
    gap: 0;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 32px 20px 56px;
    display: grid;
    align-items: start;
}

/* ── Sekcja tematyczna ──────────────────────────────────────── */
.sitemap-section {
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--c-border);
}

.sitemap-section:last-of-type {
  border-bottom: none;
}

/* ── Wersja meta (techniczna) – lekko wyróżniona ────────────── */
.sitemap-section--meta {
 
      background: var(--c-orange-tint);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border) !important;
    margin: 25px 0px;
    padding: 32px 20px 56px;
}


/* ── Tytuł sekcji ───────────────────────────────────────────── */
.sitemap-section-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-purple);
  /* kontrast #722c77 na #FAF7F4 = 7.42:1 → AAA */
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
}

.sitemap-section-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Lista główna (poziom 1) ────────────────────────────────── */
.sitemap-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sitemap-list--root {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sitemap-list--root > li {
  padding-left: 0;
}

/* ── Lista zagnieżdżona (poziom 2 – podkategorie) ───────────── */
.sitemap-list--sub {
  margin-top: 4px;
  margin-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  border-left: 2px solid var(--c-border);
}

/* ── Pojedynczy link ────────────────────────────────────────── */
.sitemap-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 500;
  color: var(--c-orange);
  /* kontrast #993834 na #fff = 7.0:1 → AAA */
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: background var(--trans), color var(--trans), text-decoration-thickness var(--trans);
  word-break: break-word;
}

/* Strzałka przed linkiem (CSS content) */
.sitemap-link::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-top: 1px;
}

.sitemap-link:hover {
  background: var(--c-orange-tint);
  color: var(--c-orange);
  text-decoration-thickness: 2px;
}

/* Link główny (primary – wyróżniony) */
.sitemap-link--primary {
  font-weight: 700;
  font-size: .95rem;
  color: var(--c-purple);
  /* kontrast #722c77 na #fff = 7.42:1 → AAA */
}

.sitemap-link--primary:hover {
  background: var(--c-purple-tint);
  color: var(--c-purple);
}

/* Aktywna strona (aria-current="page") */
.sitemap-link[aria-current="page"] {
  background: var(--c-orange-tint);
  font-weight: 700;
  color: var(--c-orange);
  cursor: default;
  text-decoration: none;
}

.sitemap-link[aria-current="page"]::after {
  content: '← jesteś tutaj';
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-muted);
  letter-spacing: .03em;
  margin-left: 6px;
}

/* ── Focus – WCAG 2.4.11 (AA), 2.4.12 (AAA) ────────────────── */
.sitemap-link:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--radius);
  text-decoration: none;
  background: var(--c-orange-tint);
}

/* ── Element listy z datą ───────────────────────────────────── */
.sitemap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Data ostatniej aktualizacji ────────────────────────────── */
.sitemap-date {
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-muted);
  /* kontrast #4a2e10 na #FAF7F4 = 8.5:1 → AAA */
  font-family: var(--font-body);
  white-space: nowrap;
  background: var(--c-orange-tint);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 2px 9px;
  line-height: 1.6;
  flex-shrink: 0;
}


.sitemap-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 20px;
  background: var(--c-orange-tint);
  border: 1px solid var(--c-border);
  font-size: .72rem;
  font-weight: 700;
  color: var(--c-muted);
  /* kontrast #4a2e10 na #fdf4ec = 8.5:1 → AAA */
  font-family: var(--font-body);
  line-height: 1;
  flex-shrink: 0;
  /* Pusta wartość → ukryj */
  &:empty { display: none; }
}

/* ── Znacznik czasu generowania ─────────────────────────────── */
.sitemap-generated {
  font-size: .98rem;
  color: var(--c-muted);
  font-family: var(--font-body);
  max-width: var(--max-w);
    margin: 32px auto 0px;
}

.sitemap-generated time {
  font-weight: 600;
}

/* ── Responsywność ──────────────────────────────────────────── */
@media (max-width: 560px) {
  .sitemap-section {
    padding: 22px 0 20px;
  }

  .sitemap-section--meta {
    padding: 18px 16px;
  }

  .sitemap-list--sub {
    margin-left: 16px;
    padding-left: 10px;
  }

  .sitemap-link {
    font-size: .88rem;
    padding: 8px 10px 8px 8px;
  }

  .sitemap-link[aria-current="page"]::after {
    display: none; /* na mobile ukryj tekst "← jesteś tutaj" */
  }
}

/* ── Tryby dostępności ──────────────────────────────────────── */

/* Wysoki kontrast */
html.a11y-high-contrast .sitemap-section {
  border-bottom-color: #000;
}

html.a11y-high-contrast .sitemap-section--meta {
  background: #fff;
  border: 2px solid #000;
}

html.a11y-high-contrast .sitemap-section-title {
  color: #000;
}

html.a11y-high-contrast .sitemap-link {
  color: #0000cc;
  text-decoration: underline;
  background: transparent;
}

html.a11y-high-contrast .sitemap-link--primary {
  color: #000;
  font-weight: 700;
}

html.a11y-high-contrast .sitemap-link:hover {
  background: #000;
  color: #fff;
}

html.a11y-high-contrast .sitemap-link:focus-visible {
  outline: 4px solid #0000ff;
  background: transparent;
}

html.a11y-high-contrast .sitemap-list--sub {
  border-left-color: #000;
}

html.a11y-high-contrast .sitemap-count {
  background: #fff;
  border: 1.5px solid #000;
  color: #000;
}

html.a11y-high-contrast .sitemap-link[aria-current="page"] {
  background: #fff;
  color: #000;
  outline: 2px solid #000;
}

/* Negatyw */
html.a11y-inverted .sitemap-section {
  border-bottom-color: #2D1E5A;
}

html.a11y-inverted .sitemap-section--meta {
  background: #150D2E;
  border-color: #2D1E5A;
}

html.a11y-inverted .sitemap-section-title {
  color: #C4ADFF;
}

html.a11y-inverted .sitemap-link {
  color: #7DD9FF;
}

html.a11y-inverted .sitemap-link--primary {
  color: #EDE8FF;
}

html.a11y-inverted .sitemap-link:hover {
  background: #150D2E;
  color: #C4ADFF;
}

html.a11y-inverted .sitemap-list--sub {
  border-left-color: #2D1E5A;
}

html.a11y-inverted .sitemap-count {
  background: #1E1340;
  border-color: #2D1E5A;
  color: #C4ADFF;
}

html.a11y-inverted .sitemap-link[aria-current="page"] {
  background: #1E1340;
  color: #C4ADFF;
}

/* Żółte tło */
html.a11y-yellow .sitemap-section--meta {
  background: #FFFFF5;
  border-color: #888800;
}

html.a11y-yellow .sitemap-section-title {
  color: #00008B;
}

html.a11y-yellow .sitemap-link {
  color: #00008B;
}

html.a11y-yellow .sitemap-link--primary {
  color: #4B0082;
}

html.a11y-yellow .sitemap-link:hover {
  background: #FFFFE0;
  color: #00008B;
}

html.a11y-yellow .sitemap-count {
  background: #FFFFE0;
  border-color: #888800;
  color: #1A1A00;
}

html.a11y-yellow .sitemap-link[aria-current="page"] {
  background: #FFFFE0;
  color: #00008B;
}

html.a11y-high-contrast .sitemap-date {
  background: #fff;
  border: 1.5px solid #000;
  color: #000;
}

html.a11y-inverted .sitemap-date {
  background: #1E1340;
  border-color: #2D1E5A;
  color: #C4ADFF;
}

html.a11y-yellow .sitemap-date {
  background: #FFFFE0;
  border-color: #888800;
  color: #1A1A00;
}

/* ── Druk ────────────────────────────────────────────────────── */
@media print {
  .sitemap-nav {
    font-size: 11pt;
  }

  .sitemap-link {
    color: #000 !important;
    text-decoration: none;
  }

  .sitemap-link::after {
    content: ' (' attr(href) ')';
    font-size: 9pt;
    color: #555;
    font-weight: 400;
  }

  .sitemap-link[aria-current="page"]::after {
    content: ' (' attr(href) ')';
  }

  .sitemap-count,
  .sitemap-section-icon {
    display: none;
  }

  .sitemap-section--meta {
    background: transparent !important;
    border: 1px solid #999 !important;
  }
}
