/* Nutograf — static legal pages (/polityka-prywatnosci/, /regulamin/, /zrodla/
   and the English versions /en/privacy-policy/, /en/terms/, /en/credits/).
   Self-contained: no JS, same tokens as the app (src/styles.css). */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efebe3;
  --ink: #1b2233;
  --ink-2: #4a5468;
  --line: #d9d3c7;
  --brand: #1f2a44;
  --link: #9a3412;
  --todo-bg: #fff4d6;
  --todo-ink: #6b4a00;
  --focus: #2563eb;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 24px);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151f;
    --surface: #1a2030;
    --surface-2: #232b3d;
    --ink: #eef1f7;
    --ink-2: #b4bccc;
    --line: #333d52;
    --brand: #c9d6f2;
    --link: #ffab7a;
    --todo-bg: #3a3012;
    --todo-ink: #ffe08a;
    --focus: #8ab4ff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: anywhere;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 8px;
  z-index: 10;
}

.skip-link:focus {
  top: 8px;
}

.site-head,
.site-foot {
  padding: 12px var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
}

/* PL ⇄ EN switch: a plain link to the translated document. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch:hover {
  background: var(--surface-2);
}

.lang-switch:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: 24px var(--gutter) 48px;
}

h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2em 0 0.5em;
}

h3 {
  font-size: 1.1rem;
  margin: 1.5em 0 0.4em;
}

.meta {
  color: var(--ink-2);
  font-size: 0.9375rem;
  margin: 0 0 16px;
}

.draft {
  border: 1px solid var(--line);
  border-left: 4px solid var(--todo-ink);
  background: var(--todo-bg);
  color: var(--todo-ink);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0 24px;
}

.draft p {
  margin: 0;
}

mark.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  border: 1px dashed currentColor;
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 600;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.toc ol {
  margin: 0;
  padding-left: 1.4em;
}

.toc li {
  margin: 4px 0;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin: 0.3em 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 12px 0;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

dl.attr {
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) 1fr;
  gap: 4px 12px;
  margin: 0;
}

dl.attr dt {
  color: var(--ink-2);
}

dl.attr dd {
  margin: 0;
}

@media (max-width: 420px) {
  dl.attr {
    grid-template-columns: 1fr;
  }

  dl.attr dd {
    margin-bottom: 6px;
  }
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 12px 0;
}

.table-wrap:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
}

th,
td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  background: var(--surface-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* Narrow phones: tables become stacked cards instead of scrolling sideways. */
@media (max-width: 560px) {
  .stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .stack tr {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
  }

  .stack tbody tr:last-child {
    border-bottom: 0;
  }

  .stack td {
    display: block;
    border: 0;
    padding: 2px 0;
  }

  .stack td::before {
    content: attr(data-label) ': ';
    color: var(--ink-2);
  }
}

code {
  font-size: 0.9em;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0 4px;
}

.site-foot {
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.site-foot nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 46rem;
}

.site-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-foot a[aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
}

@media print {
  .site-head,
  .site-foot,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}

.toc h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Highlighted factual summary (e.g. how sheet-music photos are handled). */
.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent, currentColor);
  border-radius: var(--radius);
  padding: 12px 16px 4px;
  margin: 16px 0 24px;
}
.callout h2 {
  margin-top: 0;
}

/* Price list page (/cennik/, /en/pricing/): price cards and the purchase-path links. */
.price-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 12px;
  margin: 12px 0;
}

.price-cards .card {
  margin: 0;
}

.price-label {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.price {
  margin: 4px 0 0;
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.cta:hover {
  background: var(--surface-2);
}

.cta--primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.cta--primary:hover {
  background: var(--brand);
  filter: brightness(1.1);
}

@media (prefers-color-scheme: dark) {
  .cta--primary {
    color: #11151f;
  }
}

.cta:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
