:root {
  --page-bg: #f7f5f0;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --text: #1f2933;
  --muted: #5f6b7a;
  --border: #ded9ce;
  --accent: #8b5e34;
  --accent-dark: #5f3b1d;
  --code-bg: #f2eee7;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.08);
  --radius: 22px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page-bg);
  line-height: 1.65;
  scroll-behavior: smooth;
}

body { margin: 0; min-width: 320px; }

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover, a:focus { color: var(--accent); }

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

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 999;
  transform: translateY(-150%);
  padding: 0.75rem 1rem;
  background: var(--accent-dark);
  color: #fff;
  border-radius: 999px;
}

.skip-link:focus { transform: translateY(0); }

.site-header, .page-shell, .site-footer {
  width: min(var(--max-width), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header { padding: 3.5rem 0 1.25rem; }

.brand-kicker {
  margin: 0 0 0.7rem;
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.site-header p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}


.breadcrumbs {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumbs li + li::before {
  content: "›";
  color: var(--muted);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

.toc h2 { margin-top: 0; font-size: 1.15rem; }

.toc-list, .toc-sublist { margin: 0; padding-left: 1.25rem; }

.toc-list > li { margin-block: 0.35rem; }

.toc-sublist { margin-top: 0.25rem; color: var(--muted); }

.document-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 3rem);
}

.article-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.article-header h1 {
  margin: 0 0 1rem;
  line-height: 1.08;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.04em;
}

.article-subtitle {
  margin: 0 0 1rem;
  color: var(--accent-dark);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.35;
}

.article-header p { color: var(--muted); }

.content-section { margin-block: 2.75rem; }

.content-section > h2 {
  margin-top: 0;
  padding-top: 0.3rem;
  font-size: clamp(1.55rem, 2.5vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h3 { margin-top: 2rem; font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.25; }

h4 { margin-top: 1.55rem; font-size: 1.1rem; line-height: 1.3; }

p, li { font-size: 1rem; }

ul, ol { padding-left: 1.35rem; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.75rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
}

th, td {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

th { background: var(--surface-soft); font-weight: 700; }

td[align="right"], th[align="right"] { text-align: right; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.93em;
  background: var(--code-bg);
  border-radius: 0.35rem;
  padding: 0.12rem 0.35rem;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--code-bg);
}

pre code { padding: 0; background: transparent; border-radius: 0; white-space: pre; }

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
  color: var(--muted);
}

.source-list li { margin-bottom: 0.55rem; }

.source-reference-list {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
  padding: 0;
  counter-reset: source-item;
}

.source-reference-item {
  position: relative;
  padding-left: 2.25rem;
  counter-increment: source-item;
}

.source-reference-item::before {
  content: counter(source-item) ".";
  position: absolute;
  left: 0;
  top: 0;
  min-width: 1.5rem;
  color: var(--accent-dark);
  font-weight: 800;
}

.faq-section {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.faq-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 0.85rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 750;
  color: var(--accent-dark);
}

.faq-item p {
  margin: 0.75rem 0 0;
}

.document-meta-section {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}


.site-footer {
  padding: 0 0 3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

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


img {
  max-width: 100%;
  height: auto;
}

.analysis-image-section {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.image-example-card {
  margin: 1.5rem 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
  box-shadow: 0 12px 34px rgba(31, 41, 51, 0.08);
}

.image-example-card img {
  display: block;
  width: 100%;
  max-height: 820px;
  object-fit: contain;
  background: #111827;
}

.image-example-card figcaption {
  padding: 1rem 1.15rem 0.5rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.image-description {
  margin: 0;
  padding: 0 1.15rem 1.15rem;
  color: var(--muted);
}

.image-fields-table code {
  overflow-wrap: anywhere;
}


.homepage-action-bar {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  padding: 1rem 0 0;
  display: flex;
  justify-content: flex-end;
}

.homepage-action-bar--footer {
  width: 100%;
  justify-content: flex-start;
  padding: 0 0 0.85rem;
}

.homepage-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.78rem 1.05rem;
  border: 1px solid var(--accent-dark);
  border-radius: 999px;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(31, 41, 51, 0.16);
}

.homepage-button:hover,
.homepage-button:focus {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.related-home-section {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.related-home-card {
  margin-top: 1.2rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: 0 12px 34px rgba(31, 41, 51, 0.06);
}

.related-home-card p:last-child {
  margin-bottom: 0;
}

.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.72rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(31, 41, 51, 0.22);
}

.back-to-top:hover,
.back-to-top:focus {
  color: #fff;
  background: var(--accent);
}

@media (max-width: 768px) {
  .homepage-action-bar {
    width: min(100% - 1rem, var(--max-width));
    justify-content: stretch;
  }

  .homepage-action-bar--footer {
    width: 100%;
  }

  .homepage-button {
    width: 100%;
    text-align: center;
  }

  .site-header, .page-shell, .site-footer, .breadcrumbs {
    width: min(100% - 1rem, var(--max-width));
  }

  .site-header {
    padding: 1.6rem 0 0.7rem;
  }

  .document-article,
  .toc {
    border-radius: 16px;
  }

  .article-header h1 {
    font-size: clamp(1.75rem, 9vw, 2.6rem);
  }

  .content-section {
    margin-block: 2rem;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  th, td {
    min-width: 10rem;
  }

  pre {
    font-size: 0.88rem;
  }

  .image-example-card img {
    max-height: 72vh;
  }

  .back-to-top {
    right: 0.8rem;
    bottom: 0.8rem;
    padding: 0.72rem 0.88rem;
  }
}

@media (max-width: 480px) {
  .brand-kicker {
    font-size: 0.72rem;
  }

  .toc-list,
  .toc-sublist {
    padding-left: 1rem;
  }

  .document-article {
    padding: 1rem;
  }

  .image-example-card figcaption,
  .image-description {
    padding-inline: 0.9rem;
  }

  .back-to-top span {
    display: none;
  }

  .back-to-top {
    width: 48px;
    height: 48px;
    justify-content: center;
    padding: 0;
    font-size: 1.15rem;
  }
}

@media (min-width: 1040px) {
  .page-shell {
    grid-template-columns: 290px minmax(0, 1fr);
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }
}

@media print {
  html { background: #fff; }
  .skip-link, .toc { display: none; }
  .site-header, .page-shell, .site-footer { width: 100%; }
  .document-article { box-shadow: none; border: 0; padding: 0; }
  a { color: inherit; }
  pre, table { break-inside: avoid; }
}

/* Responsywne osadzenia wideo w kartach multimedialnych. */
iframe {
  display: block;
  width: 100%;
  border: 0;
}

.image-example-card iframe {
  aspect-ratio: 16 / 9;
  height: auto;
  background: #111827;
}

