/* linguas.pl — autorski arkusz stylów (zero frameworków CSS, WCAG AAA) */
:root {
  --l-bg: #fbfbf9;
  --l-surface: #ffffff;
  --l-surface-alt: #f2f5f2;
  --l-border: #d7dfd8;
  --l-border-strong: #b4c2b7;
  --l-ink: #162019;
  --l-ink-soft: #3c4a40;
  --l-ink-muted: #526356;
  --l-brand: #14532d;
  --l-brand-dark: #0e3c20;
  --l-brand-tint: #e8f3ec;
  --l-accent: #9a3412;
  --l-accent-tint: #fff3ec;
  --l-accent-border: #fdba74;
  --l-focus: #14532d;
  --l-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --l-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --l-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --l-radius: 12px;
  --l-radius-sm: 8px;
  --l-max: 1120px;
}

/* Skala czcionki z paska dostępności */
html[data-font-scale="112"] { font-size: 112.5%; }
html[data-font-scale="125"] { font-size: 125%; }

/* Tryb wysokiego kontrastu (WCAG AAA) */
html[data-contrast="high"] {
  --l-bg: #000000;
  --l-surface: #0b0b0b;
  --l-surface-alt: #141414;
  --l-border: #ffffff;
  --l-border-strong: #ffffff;
  --l-ink: #ffffff;
  --l-ink-soft: #f5f5f5;
  --l-ink-muted: #e5e5e5;
  --l-brand: #fde047;
  --l-brand-dark: #facc15;
  --l-brand-tint: #1f1f1f;
  --l-accent: #fde047;
  --l-accent-tint: #1f1f1f;
  --l-accent-border: #fde047;
  --l-focus: #fde047;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--l-bg);
  color: var(--l-ink);
  font-family: var(--l-sans);
  line-height: 1.68;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--l-brand);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--l-brand-dark);
}

:focus-visible {
  outline: 3px solid var(--l-focus);
  outline-offset: 2px;
}

.l-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--l-brand);
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-weight: 700;
  z-index: 100;
}

html[data-contrast="high"] .l-skip,
html[data-contrast="high"] .l-btn-primary,
html[data-contrast="high"] .l-chip[aria-pressed="true"] {
  color: #000000;
}

.l-skip:focus {
  left: 0.75rem;
  top: 0.75rem;
  border-radius: var(--l-radius-sm);
}

.l-shell {
  width: 100%;
  max-width: var(--l-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Górny pasek dostępności */
.l-a11y-strip {
  background: var(--l-surface-alt);
  border-bottom: 1px solid var(--l-border);
  font-size: 0.8125rem;
}

.l-a11y-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.45rem 0;
}

.l-a11y-motto {
  color: var(--l-ink-muted);
  margin: 0;
}

.l-a11y-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.l-a11y-btn {
  background: var(--l-surface);
  color: var(--l-ink);
  border: 1px solid var(--l-border-strong);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.l-a11y-btn[aria-pressed="true"] {
  background: var(--l-brand);
  color: #ffffff;
  border-color: var(--l-brand);
}

html[data-contrast="high"] .l-a11y-btn[aria-pressed="true"] {
  color: #000000;
}

/* Nagłówek główny */
.l-header {
  background: var(--l-surface);
  border-bottom: 1px solid var(--l-border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.l-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.9rem 0;
}

.l-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--l-ink);
  font-family: var(--l-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.l-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  background: var(--l-brand);
  color: #ffffff;
  font-family: var(--l-sans);
  font-weight: 800;
  font-size: 1rem;
}

html[data-contrast="high"] .l-brand-mark {
  color: #000000;
}

.l-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.l-nav a {
  text-decoration: none;
  color: var(--l-ink-soft);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--l-radius-sm);
}

.l-nav a:hover {
  background: var(--l-surface-alt);
  color: var(--l-ink);
}

.l-nav a[aria-current="page"] {
  background: var(--l-brand-tint);
  color: var(--l-brand);
}

main {
  flex: 1;
}

/* Sekcje i siatki */
.l-section {
  padding: 2.5rem 0;
}

.l-hero {
  background: var(--l-surface);
  border-bottom: 1px solid var(--l-border);
  padding: 3rem 0 2.75rem;
}

.l-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--l-accent);
  background: var(--l-accent-tint);
  border: 1px solid var(--l-accent-border);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

h1, h2, h3 {
  font-family: var(--l-serif);
  color: var(--l-ink);
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  margin: 0.85rem 0 0.75rem;
}

h2 {
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  margin-bottom: 0.65rem;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.45rem;
}

.l-lead {
  font-size: 1.08rem;
  color: var(--l-ink-soft);
  max-width: 68ch;
  margin: 0;
}

.l-grid {
  display: grid;
  gap: 1.25rem;
}

.l-grid-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.l-grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.l-card {
  background: var(--l-surface);
  border: 1px solid var(--l-border);
  border-radius: var(--l-radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
}

.l-card-alt {
  background: var(--l-surface-alt);
}

.l-card-title {
  margin: 0;
  font-size: 1.2rem;
}

.l-card-title a {
  text-decoration: none;
  color: var(--l-ink);
}

.l-card-title a:hover {
  color: var(--l-brand);
  text-decoration: underline;
}

.l-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--l-ink-muted);
}

.l-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--l-brand-tint);
  color: var(--l-brand);
  border: 1px solid var(--l-border);
}

/* Przyciski */
.l-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.05rem;
  border-radius: var(--l-radius-sm);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--l-sans);
}

.l-btn-primary {
  background: var(--l-brand);
  color: #ffffff;
}

.l-btn-primary:hover {
  background: var(--l-brand-dark);
  color: #ffffff;
}

.l-btn-secondary {
  background: var(--l-surface);
  color: var(--l-ink);
  border-color: var(--l-border-strong);
}

.l-btn-secondary:hover {
  border-color: var(--l-brand);
  background: var(--l-brand-tint);
}

.l-btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.84rem;
}

.l-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.l-chip {
  background: var(--l-surface);
  color: var(--l-ink-soft);
  border: 1px solid var(--l-border-strong);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.l-chip[aria-pressed="true"] {
  background: var(--l-brand);
  color: #ffffff;
  border-color: var(--l-brand);
}

/* Okruszki */
.l-crumbs {
  font-size: 0.85rem;
  color: var(--l-ink-muted);
  margin-bottom: 1.25rem;
}

.l-crumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.l-crumbs li::after {
  content: "/";
  margin-left: 0.4rem;
  opacity: 0.5;
}

.l-crumbs li:last-child::after { content: ""; }

/* Układ artykułu z panelem bocznym */
.l-article-grid {
  display: grid;
  gap: 2.25rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 960px) {
  .l-article-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
  .l-aside-sticky {
    position: sticky;
    top: 5.2rem;
  }
}

/* Typografia długich tekstów */
.l-prose {
  font-size: 1.05rem;
  line-height: 1.78;
}

.l-prose h2 {
  margin-top: 2.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--l-border);
  scroll-margin-top: 5.5rem;
}

.l-prose h3 {
  margin-top: 1.6rem;
  scroll-margin-top: 5.5rem;
}

.l-prose p { margin: 0 0 1.1rem; color: var(--l-ink); }
.l-prose ul, .l-prose ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.l-prose li { margin-bottom: 0.45rem; }

.l-prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--l-surface-alt);
  border-left: 4px solid var(--l-brand);
  border-radius: 0 var(--l-radius-sm) var(--l-radius-sm) 0;
}

.l-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--l-border);
  border-radius: var(--l-radius-sm);
  margin: 1.4rem 0;
  background: var(--l-surface);
}

.l-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.l-table-wrap th {
  text-align: left;
  background: var(--l-surface-alt);
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--l-border-strong);
}

.l-table-wrap td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--l-border);
  vertical-align: top;
}

.l-table-wrap tr:last-child td { border-bottom: none; }

/* Interaktywne panele narzędzi */
.l-tool-panel {
  background: var(--l-surface);
  border: 1px solid var(--l-border);
  border-radius: var(--l-radius);
  padding: 1.5rem;
  margin-top: 1.25rem;
}

.l-result-box {
  background: var(--l-brand-tint);
  border: 2px solid var(--l-brand);
  border-radius: var(--l-radius);
  padding: 1.35rem;
  margin-top: 1.25rem;
}

.l-cefr-row {
  border: 1px solid var(--l-border);
  border-radius: var(--l-radius-sm);
  padding: 1rem;
  background: var(--l-bg);
  margin-bottom: 0.85rem;
}

.l-cefr-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.l-radio-card {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--l-border-strong);
  background: var(--l-surface);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}

.l-radio-card:has(input:checked) {
  border-color: var(--l-brand);
  background: var(--l-brand-tint);
}

.l-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--l-radius-sm);
  border: 1px solid var(--l-border-strong);
  background: var(--l-surface);
  color: var(--l-ink);
  font-size: 0.95rem;
  font-family: var(--l-sans);
}

.l-code-box {
  font-family: var(--l-mono);
  font-size: 0.88rem;
  background: var(--l-surface);
  border: 1px solid var(--l-border-strong);
  border-radius: var(--l-radius-sm);
  padding: 0.9rem;
  white-space: pre-wrap;
}

.l-hidden { display: none !important; }

/* FAQ */
.l-faq {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--l-border);
}

.l-faq-list {
  border: 1px solid var(--l-border);
  border-radius: var(--l-radius);
  background: var(--l-surface);
  overflow: hidden;
}

.l-faq details {
  border-bottom: 1px solid var(--l-border);
  padding: 1rem 1.2rem;
}

.l-faq details:last-child { border-bottom: none; }

.l-faq summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--l-ink);
}

.l-faq details p {
  margin: 0.65rem 0 0;
  color: var(--l-ink-soft);
}

/* Stopka */
.l-footer {
  margin-top: 3rem;
  background: var(--l-surface-alt);
  border-top: 1px solid var(--l-border);
  padding: 2.5rem 0 2rem;
  font-size: 0.9rem;
}

.l-footer-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.l-footer h2 {
  font-family: var(--l-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--l-ink-muted);
  margin-bottom: 0.75rem;
}

.l-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.l-footer a {
  text-decoration: none;
  color: var(--l-ink-soft);
}

.l-footer a:hover {
  color: var(--l-brand);
  text-decoration: underline;
}

.l-footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--l-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--l-ink-muted);
}
