/* =========================================================================
   Re-volta v3 – reset i typografia bazowa

   Działa tylko na stronach z przerobioną treścią (<html class="rv3-tresc">) – tam stare
   arkusze nie są ładowane. Na starych stronach pod nową powłoką nic stąd nie obowiązuje.
   Selektory przez :where(), żeby reset miał specyficzność samego elementu – każda klasa
   komponentu (.rv3-btn, .rv3-chip…) wygrywa z nim bez podbijania.
   ========================================================================= */

:where(html.rv3-tresc) {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--rv3-page);
}

:where(html.rv3-tresc) *,
:where(html.rv3-tresc) *::before,
:where(html.rv3-tresc) *::after {
  box-sizing: border-box;
}

/* GRAD musi być ustawiony na każdym elemencie: font-variation-settings dziedziczy się
   jako gotowy napis, więc zmiana --rv3-grad na np. aktywnym chipie zadziała tylko wtedy,
   gdy chip sam przeliczy tę właściwość. */
:where(html.rv3-tresc),
:where(html.rv3-tresc) * {
  font-variation-settings: "GRAD" var(--rv3-grad);
}

:where(html.rv3-tresc) body {
  margin: 0;
  min-height: 100vh;
  background: var(--rv3-page);
  color: var(--rv3-text);
  font-family: var(--rv3-font);
  font-size: var(--rv3-fs-base);
  font-weight: var(--rv3-fw-regular);
  line-height: var(--rv3-lh-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(html.rv3-tresc) :is(h1, h2, h3, h4, h5, h6) {
  margin: 0;
  font-weight: var(--rv3-fw-heading);
  line-height: var(--rv3-lh-tight);
  text-wrap: balance;
}

:where(html.rv3-tresc) :is(p, ul, ol, dl, figure, blockquote) {
  margin: 0;
}

:where(html.rv3-tresc) p {
  text-wrap: pretty;
}

:where(html.rv3-tresc) a {
  color: var(--rv3-link);
  text-decoration: none;
  transition: color var(--rv3-transition);
}

:where(html.rv3-tresc) a:hover {
  color: var(--rv3-link-hover);
}

:where(html.rv3-tresc) :is(img, svg, video, canvas, picture) {
  display: block;
  max-width: 100%;
}

:where(html.rv3-tresc) img {
  height: auto;
}

:where(html.rv3-tresc) :is(input, select, textarea, button) {
  font: inherit;
  color: inherit;
  margin: 0;
}

:where(html.rv3-tresc) button {
  cursor: pointer;
}

:where(html.rv3-tresc) :is(em, i:not([class*="fa-"])) {
  font-style: oblique var(--rv3-slnt);
}

:where(html.rv3-tresc) strong,
:where(html.rv3-tresc) b {
  font-weight: var(--rv3-fw-bold);
}

:where(html.rv3-tresc) hr {
  border: 0;
  border-top: 1px solid var(--rv3-divider);
  margin: var(--rv3-space-8) 0;
}

:where(html.rv3-tresc) ::selection {
  background: var(--rv3-accent-soft);
  color: var(--rv3-text);
}

/* Widoczny fokus tylko przy klawiaturze */
:where(html.rv3-tresc) :focus-visible {
  outline: 2px solid var(--rv3-accent-ink);
  outline-offset: 2px;
}

/* Atrybut hidden ma wygrać z klasami układu (.rv3-grid, .rv3-stack ustawiają display) */
html.rv3-tresc [hidden] {
  display: none;
}

/* .rv3-sr-only (tekst tylko dla czytników ekranu) jest w powloka.css – używa go też powłoka
   nad starą treścią, gdzie baza.css się nie ładuje. */

/* Ograniczony ruch: przejścia wyłącza --rv3-transition (tokeny.css), tu tylko przewijanie */
@media (prefers-reduced-motion: reduce) {
  :where(html.rv3-tresc) {
    scroll-behavior: auto;
  }
}
