/* ============================================================
   shared.css — MZBM Sosnowiec / Strony projektowe FE SL
   Zgodność z WCAG 2.1 AA
   ============================================================ */

/* ---------- Reset i podstawy ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 100%; /* bazowy rozmiar 16px, kontrolowany przez panel dostępności */
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text, #1a1a1a);
  background-color: var(--bg, #ffffff);
  padding: 1rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ---------- Zmienne kolorów (tryb jasny) ---------- */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --heading: #003366;
  --accent: #0055a4;
  --accent-dark: #003366;
  --border: #d0d7de;
  --card-bg: #f8fafc;
  --card-hover: #eaf2fb;
  --summary-bg: #f2f6fa;
  --meta: #555;
  --focus: #ffbf47;
  --white: #ffffff;
  --black: #000000;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --link: #0055a4;
  --link-underline: underline;
}

/* ---------- Tryb wysokiego kontrastu ---------- */
body.high-contrast {
  --bg: #000000;
  --text: #ffffff;
  --heading: #ffff00;
  --accent: #ffff00;
  --accent-dark: #ffffff;
  --border: #ffffff;
  --card-bg: #1a1a1a;
  --card-hover: #333333;
  --summary-bg: #1a1a1a;
  --meta: #dddddd;
  --focus: #00ffff;
  --white: #ffffff;
  --black: #000000;
  --shadow: none;
  --link: #ffff00;
  --link-underline: underline;
}

body.high-contrast a { color: #ffff00; }
body.high-contrast .top-bar { background: #000000; border: 2px solid #ffffff; }
body.high-contrast .site-header { background: #000000; border: 2px solid #ffffff; }
body.high-contrast .downloads a,
body.high-contrast .card-list a { background: #1a1a1a; border-color: #ffffff; }
body.high-contrast .downloads a:hover,
body.high-contrast .downloads a:focus,
body.high-contrast .card-list a:hover,
body.high-contrast .card-list a:focus { background: #333333; }

/* ---------- Skip link (WCAG 2.4.1) ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #003366;
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 0; outline: 3px solid var(--focus); }

/* ---------- Ukrywanie wizualne ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Kontener ---------- */
.container { max-width: 960px; margin: 0 auto; }

/* ---------- Panel dostępności ---------- */
.a11y-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.a11y-panel button {
  font: inherit;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.a11y-panel button:hover { background: var(--card-hover); }
.a11y-panel button:focus { outline: 3px solid var(--focus); outline-offset: 2px; }

.a11y-panel .a11y-label {
  font-weight: 600;
  color: var(--heading);
  margin-right: 0.25rem;
}

/* ---------- Baner (obraz PNG) ---------- */
.banner {
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}
.banner img { display: block; width: 100%; height: auto; }

/* ---------- Górny pasek (fu.htm) ---------- */
.top-bar {
  background: #003366;
  color: #ffffff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}

.top-bar .brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.3);
  padding-right: 1.5rem;
}

.top-bar nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin: 0;
}

.top-bar nav li { margin: 0; }

.top-bar nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
}

.top-bar nav a:hover,
.top-bar nav a:focus {
  background: rgba(255,255,255,0.15);
  text-decoration: underline;
}

.top-bar nav a[aria-current="page"] {
  background: #ffffff;
  color: #003366;
  font-weight: 700;
}
.top-bar nav a[aria-current="page"]:hover,
.top-bar nav a[aria-current="page"]:focus {
  background: #eaf2fb;
  color: #003366;
}

/* ---------- Nagłówek strony ---------- */
.site-header {
  background: linear-gradient(135deg, #003366 0%, #0055a4 100%);
  color: #ffffff;
  padding: 2rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}
.site-header h1 { font-size: 1.75rem; line-height: 1.3; margin-bottom: 0.5rem; }
.site-header p { font-size: 1rem; opacity: 0.95; }

/* ---------- Sekcje ---------- */
section { margin-bottom: 2.5rem; }

section h2 {
  font-size: 1.4rem;
  color: var(--heading);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

section h3 { font-size: 1.1rem; color: var(--heading); margin: 1rem 0 0.5rem; }

p, li { margin-bottom: 0.75rem; }
ul { padding-left: 1.5rem; }

/* ---------- Karta kluczowych informacji ---------- */
.summary {
  background-color: var(--summary-bg);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 1.5rem;
}

.summary dl { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 700px) { .summary dl { grid-template-columns: 1fr 1fr; } }

.summary dt { font-weight: 700; color: var(--heading); margin-bottom: 0.15rem; }
.summary dd { margin: 0; }

/* ---------- Karty zadań ---------- */
.task-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 700px) { .task-grid { grid-template-columns: repeat(3, 1fr); } }

.task {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.task h3 { margin-top: 0; }

/* ---------- Tabela danych ---------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}
table.data caption {
  text-align: left;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 0.5rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
table.data th { background-color: var(--summary-bg); color: var(--heading); }

/* ---------- Dokumenty do pobrania ---------- */
.downloads {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 700px) { .downloads { grid-template-columns: 1fr 1fr; } }

.downloads li { margin: 0; }

.downloads a {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.downloads a:hover,
.downloads a:focus {
  background: var(--card-hover);
  border-left-color: var(--accent-dark);
}

.downloads .icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: #b00020;
}
body.high-contrast .downloads .icon { color: #ff6666; }

.downloads .file-title {
  display: block;
  font-weight: 600;
  color: var(--heading);
  word-break: break-word;
}

.downloads .file-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--meta);
  margin-top: 0.2rem;
}

/* ---------- Karty listy (fu.htm) ---------- */
.card-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 700px) { .card-list { grid-template-columns: 1fr 1fr; } }

.card-list li { margin: 0; }

.card-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.card-list a:hover,
.card-list a:focus {
  background: var(--card-hover);
  border-left-color: var(--accent-dark);
}

.card-list .card-title { font-weight: 600; color: var(--heading); }
.card-list .card-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--meta);
  margin-top: 0.15rem;
  font-weight: 400;
}
.card-list .arrow { flex-shrink: 0; width: 20px; height: 20px; color: var(--accent); }

.card-list a[aria-current="page"] {
  background: #003366;
  border-left-color: var(--focus);
}
.card-list a[aria-current="page"] .card-title { color: #ffffff; }
.card-list a[aria-current="page"] .card-meta { color: #dbe7f3; }
.card-list a[aria-current="page"] .arrow { color: #ffffff; }
.card-list a[aria-current="page"]:hover,
.card-list a[aria-current="page"]:focus { background: #002a55; }

/* ---------- Stopka ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--meta);
}
.site-footer a { color: var(--link); }

/* ---------- Fokus ---------- */
a:focus, button:focus, [tabindex]:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
a { color: var(--link); text-decoration: var(--link-underline); }
a:hover { text-decoration-thickness: 2px; }

/* ---------- Redukcja animacji ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Responsywność panelu dostępności ---------- */
@media (max-width: 600px) {
  .a11y-panel { font-size: 0.8rem; gap: 0.35rem; }
  .a11y-panel button { padding: 0.35rem 0.5rem; font-size: 0.8rem; }
}