/* base.css — warstwa bazowa zamiast PicoCSS (redesign 2026-06).
   Reset + typografia + elementy (a, nagłówki, tabele, przyciski, listy, details).
   Ładowany PO tokens.css, PRZED app.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Kolumna treści */
.container {
  width: 100%;
  max-width: var(--col-wide);
  margin-inline: auto;
  padding-inline: var(--s5);
}

main.container {
  padding-block: var(--s6) var(--s9);
}

/* Typografia */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: var(--lh-snug);
  color: var(--ink);
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); font-weight: 700; }
h2 { font-size: var(--fs-h2); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

strong, b { font-weight: 600; }
small { font-size: var(--fs-small); }

em { font-style: italic; }

ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin: 0.15em 0; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

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

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

/* Tabele — jasne, hojny oddech */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1em;
}
th, td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
thead th {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--ink-muted);
}
tbody tr:last-child td { border-bottom: 0; }

/* Formularze / przyciski (baza; warianty w app.css) */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 0.4rem 0.6rem;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

details summary { cursor: pointer; }

::selection { background: var(--accent-soft-2); }

/* Wąski ekran — ciaśniejsze marginesy */
@media (max-width: 640px) {
  .container { padding-inline: var(--s4); }
  main.container { padding-block: var(--s5) var(--s9); }
  :root { --fs-h2: 1.4rem; }
}
