/* czyaizastapiprawnikow.pl: komentarz prawniczy z notami marginesowymi.
   Chłodny papier, atrament, jeden akcent: zieleń płótna introligatorskiego.
   Tekst szeryfowy (Literata), aparat i dane bezszeryfowe (IBM Plex Sans).
   Tylko jasny motyw. */

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --papier: #f2f3ee;
  --papier-2: #e6e9e1;
  --tekst: #16201c;
  --tekst-2: #45514b;
  --tekst-3: #5a6660;
  --plotno: #163529;
  --akcent: #1d5b45;
  --linia: rgba(22, 32, 28, 0.14);
  --linia-mocna: rgba(22, 32, 28, 0.55);
  --szeryf: "Literata", Georgia, "Times New Roman", serif;
  --grotesk: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --kolumna: 39rem;
  --margines: 22rem;
  --spis: 12.5rem;
  --odstep: 3rem;
  --ruch: 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  background: var(--papier);
  scrollbar-color: var(--plotno) var(--papier-2);
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--tekst);
  font-family: var(--szeryf);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-variant-numeric: lining-nums;
  overflow-wrap: break-word;
  caret-color: var(--akcent);
  accent-color: var(--akcent);
}

::selection {
  background: var(--plotno);
  color: var(--papier);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--akcent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--ruch);
}
a:hover {
  color: var(--akcent);
}
:focus-visible {
  outline: 2px solid var(--akcent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  background: var(--papier);
  color: var(--tekst);
  font-family: var(--grotesk);
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 2;
}
.skip:focus {
  top: 12px;
}

/* Wspólna szerokość: spis, kolumna tekstu, margines na noty. */
.w {
  max-width: calc(var(--spis) + var(--kolumna) + var(--margines) + 2 * var(--odstep) + 48px);
  margin-inline: auto;
  padding-inline: 20px;
}

/* Grzbiet: tytuł serwisu na płótnie. Pod nim żywa pagina z nawigacją. */
.grzbiet {
  background: var(--plotno);
  color: var(--papier);
}
.grzbiet .w {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  padding-block: 18px 16px;
}
.tytul {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.tytul:hover {
  color: var(--papier);
  text-decoration: underline;
  text-decoration-color: currentColor;
}
.grzbiet :focus-visible {
  outline-color: var(--papier);
}
.od {
  margin: 0;
  font-family: var(--grotesk);
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: #cfd8d1;
}
.ulsa-mark {
  color: var(--papier);
  flex: none;
}
.pagina {
  font-family: var(--grotesk);
  font-size: 0.9375rem;
  border-bottom: 3px double var(--linia-mocna);
}
.pagina .w {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
}
.pagina a {
  text-decoration: none;
  color: var(--tekst-2);
  padding: 12px 0 9px;
  border-bottom: 3px solid transparent;
  transition: color var(--ruch), border-color var(--ruch);
}
.pagina a:hover {
  color: var(--tekst);
  border-bottom-color: var(--linia-mocna);
}
.pagina a[aria-current="page"] {
  color: var(--tekst);
  font-weight: 600;
  border-bottom-color: var(--akcent);
}

/* Czoło strony. */
main {
  padding-top: 40px;
  padding-bottom: 72px;
}
h1,
h2,
h3 {
  font-family: var(--szeryf);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2rem, 1.25rem + 3.2vw, 3.375rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  max-width: 19em;
}
.lead {
  margin: 16px 0 0;
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--tekst-2);
  max-width: var(--kolumna);
}
.stan {
  margin: 14px 0 0;
  font-family: var(--grotesk);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tekst-3);
}
.npp {
  color: var(--tekst);
  font-weight: 600;
  white-space: nowrap;
}

/* Części komentarza. Każdą otwiera linia przez tekst i margines. */
section {
  margin-top: 56px;
}
.kom > section:not(.wstep) {
  border-top: 1px solid var(--linia-mocna);
  padding-top: 20px;
}
.wstep {
  margin-top: 36px;
}
section > h2 {
  position: relative;
  font-size: 1.625rem;
  letter-spacing: -0.01em;
  max-width: var(--kolumna);
  margin-bottom: 4px;
}
.par {
  display: none;
  position: absolute;
  left: -1.7rem;
  top: 0;
  font-weight: 400;
  color: var(--akcent);
  text-decoration: none;
}
.par:hover {
  color: var(--tekst);
}
h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

/* Ustęp: tekst i jego nota. Na telefonie nota wchodzi pod akapit. */
.ust {
  margin-top: 20px;
  min-width: 0;
}
.ust > :first-child {
  max-width: var(--kolumna);
  min-width: 0;
}
.ust p,
.ust ul {
  margin: 0;
}
.ust ul {
  padding-left: 0;
  list-style: none;
}
.ust li {
  position: relative;
  padding-left: 22px;
}
.ust li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 10px;
  height: 2px;
  background: var(--akcent);
}
.ust li + li {
  margin-top: 10px;
}
.ust-pyt {
  margin-top: 28px;
}

/* Teza strony stoi w ramce, jak komentowany przepis. */
.teza {
  background: var(--papier-2);
  border-top: 3px solid var(--plotno);
  padding: 20px 20px 22px;
  font-size: 1.1875rem;
  line-height: 1.55;
  font-weight: 500;
}

.nota {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--linia-mocna);
  font-family: var(--grotesk);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--tekst-2);
  max-width: var(--kolumna);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.nota p + p {
  margin-top: 6px;
}
.nota-h {
  font-weight: 600;
  color: var(--tekst);
}
.nota .poz {
  white-space: nowrap;
  color: var(--tekst-3);
}
.nota .poz:hover {
  color: var(--akcent);
}

/* Tabele: linia nad i pod, cyfry tabelaryczne, liczby do prawej. */
.tab {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--grotesk);
  font-size: 0.9375rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--linia-mocna);
}
caption {
  caption-side: top;
  text-align: left;
  font-family: var(--szeryf);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--tekst);
  padding-bottom: 10px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 9px 20px 9px 0;
  border-top: 1px solid var(--linia);
  font-weight: 400;
}
thead th,
thead td {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tekst-2);
  border-top: 2px solid var(--plotno);
  vertical-align: bottom;
}
tbody tr:first-child > * {
  border-top-color: var(--linia-mocna);
}
tbody th {
  font-weight: 600;
}
th:last-child,
td:last-child {
  padding-right: 0;
}
.l {
  text-align: right;
  white-space: nowrap;
}
.l:last-child {
  padding-right: 4px;
}
.l + :not(.l) {
  padding-left: 12px;
}

/* Tablica strony głównej: przystąpiło (obrys) i zdało (wypełnienie). */
.tablica {
  margin: 36px 0 0;
  max-width: var(--kolumna);
  font-family: var(--grotesk);
  font-variant-numeric: tabular-nums;
}
.tb {
  border-top: 3px solid var(--plotno);
  border-bottom: 1px solid var(--linia-mocna);
  padding-bottom: 14px;
}
.tb-g,
.tb-w {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.25rem 5.5rem 4.75rem;
  column-gap: 8px;
  align-items: baseline;
}
.tb-g {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tekst-2);
  padding: 8px 0 7px;
  border-bottom: 1px solid var(--linia-mocna);
}
.tb-l {
  text-align: right;
  white-space: nowrap;
}
.tb-k {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border: 1px solid var(--tekst);
}
.tb-k1 {
  background: var(--akcent);
  border-color: var(--akcent);
}
.tb-gr {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: var(--tekst-3);
}
.tb-w {
  font-size: 0.9375rem;
  line-height: 1.3;
  padding-top: 10px;
}
.tb-n {
  font-weight: 600;
  white-space: nowrap;
}
.tb-tor {
  grid-column: 1 / -1;
  display: block;
  height: 16px;
  margin-top: 6px;
}
.tb-pas {
  position: relative;
  display: block;
  height: 100%;
  min-width: 5px;
  border: 1px solid var(--tekst);
  transform-origin: 0 50%;
}
.tb-zd {
  display: block;
  height: 100%;
  background: var(--akcent);
  transform-origin: 0 50%;
}
.tb-roz {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 0;
  border-left: 2px solid var(--tekst);
}
.tb-plus {
  grid-column: 1 / -1;
  text-align: right;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--tekst);
  padding-top: 6px;
}
.tablica figcaption {
  margin-top: 10px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--tekst-2);
}

/* Spis treści: na telefonie ramka pod tezą, na szerokim ekranie lewy łam. */
.spis {
  margin-top: 36px;
  padding: 14px 0 10px;
  border-top: 1px solid var(--linia-mocna);
  border-bottom: 1px solid var(--linia);
  font-family: var(--grotesk);
  font-size: 0.875rem;
  line-height: 1.4;
  max-width: var(--kolumna);
}
.spis p {
  margin: 0 0 4px;
  font-family: var(--szeryf);
  font-size: 1rem;
  font-weight: 600;
}
.spis ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.spis a {
  display: block;
  padding: 7px 0;
  color: var(--tekst-2);
  text-decoration: none;
}
.spis a:hover {
  color: var(--akcent);
  text-decoration: underline;
}

/* Jedno wezwanie do działania, na płótnie jak grzbiet. */
.ulsa {
  margin-top: 72px;
  padding: 28px 20px;
  background: var(--plotno);
  color: var(--papier);
}
.ulsa h2 {
  font-size: 1.375rem;
  margin-bottom: 12px;
}
.ulsa p {
  margin: 0 0 12px;
  max-width: var(--kolumna);
}
.ulsa ::selection {
  background: var(--papier);
  color: var(--plotno);
}
.dalej {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0 0;
  font-family: var(--grotesk);
}
.ulsa .dalej {
  margin-bottom: 0;
}
.dalej span {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #cfd8d1;
  min-width: 0;
}
.przycisk {
  display: inline-block;
  background: var(--papier);
  color: var(--plotno);
  text-decoration: none;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 6px;
  transition: background-color var(--ruch);
}
.przycisk:hover {
  background: #fff;
  color: var(--plotno);
}
.ulsa :focus-visible {
  outline-color: var(--papier);
}

/* Stopka: wykaz źródeł, potem zastrzeżenie i wydawca. */
.stopka {
  border-top: 3px double var(--linia-mocna);
  background: var(--papier-2);
  padding-top: 36px;
  padding-bottom: 48px;
  font-family: var(--grotesk);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--tekst-2);
}
.wykaz {
  margin-top: 0;
}
.wykaz h2 {
  font-size: 1.375rem;
  color: var(--tekst);
  margin-bottom: 8px;
}
.wykaz p {
  margin: 0 0 16px;
  max-width: var(--kolumna);
}
.wykaz ol {
  margin: 0;
  padding-left: 28px;
  font-variant-numeric: tabular-nums;
}
.wykaz li {
  padding-left: 4px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  break-inside: avoid;
  scroll-margin-top: 16px;
}
.wykaz li::marker {
  font-weight: 600;
  color: var(--tekst);
}
.wykaz li:target {
  color: var(--tekst);
  background: var(--papier);
  box-shadow: 0 0 0 6px var(--papier);
}
.wykaz + .wydawca {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--linia-mocna);
}
.wydawca p {
  margin: 0 0 8px;
  max-width: var(--kolumna);
}
.zastrz {
  font-family: var(--szeryf);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--tekst);
}
.wydawca a {
  margin-right: 12px;
  white-space: nowrap;
}

/* Telefon: tytuł na grzbiecie prowadzi na stronę główną, więc pagina jej nie powtarza. */
@media (max-width: 39.99rem) {
  .pagina a:first-child {
    display: none;
  }
  .pagina {
    font-size: 0.875rem;
  }
  .pagina .w {
    gap: 0 20px;
  }
}

/* Od 62rem: noty stają na prawym marginesie, na wysokości akapitu. */
@media (min-width: 62rem) {
  .w {
    padding-inline: 24px;
  }
  .ust {
    display: grid;
    grid-template-columns: minmax(0, var(--kolumna)) minmax(0, var(--margines));
    column-gap: var(--odstep);
    align-items: start;
  }
  .nota {
    margin-top: 5px;
    max-width: none;
  }
  .ust-teza .nota {
    margin-top: 0;
    border-left: 0;
    border-top: 3px solid var(--plotno);
    padding: 12px 0 0;
  }
  .teza {
    padding: 22px 28px 26px;
    font-size: 1.25rem;
  }
  .tytul {
    font-size: 1.625rem;
  }
  .grzbiet .w {
    padding-block: 26px 22px;
  }
  main {
    padding-top: 56px;
  }
  .ulsa {
    display: grid;
    grid-template-columns: minmax(0, var(--kolumna)) minmax(0, var(--margines));
    column-gap: var(--odstep);
    align-items: end;
    padding: 36px 40px;
  }
  .ulsa > div > :last-child {
    margin-bottom: 0;
  }
  .wykaz ol {
    columns: 2;
    column-gap: var(--odstep);
  }
  .wydawca {
    display: grid;
    grid-template-columns: minmax(0, var(--kolumna)) minmax(0, 1fr);
    column-gap: var(--odstep);
  }
}

/* Strona bez not (O serwisie): tytuł części po lewej, tekst po prawej. */
@media (min-width: 62rem) {
  .kom-pros > section:not(.ulsa) {
    display: grid;
    grid-template-columns: minmax(0, var(--margines)) minmax(0, var(--kolumna));
    column-gap: var(--odstep);
  }
  .kom-pros > section > h2 {
    grid-column: 1;
    grid-row: 1 / span 12;
    font-size: 1.5rem;
  }
  .kom-pros .ust {
    grid-column: 2;
    display: block;
  }
  .kom-pros .ust:nth-child(2) {
    margin-top: 4px;
  }
}

/* Od 78rem: trzy łamy. Spis treści po lewej, tablica obok tytułu. */
@media (min-width: 78rem) {
  .kom {
    display: grid;
    grid-template-columns: var(--spis) minmax(0, 1fr);
    column-gap: var(--odstep);
  }
  .kom > section {
    grid-column: 2;
  }
  .czolo {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--margines);
    column-gap: var(--odstep);
    align-items: end;
  }
  .czolo-bok {
    border-top: 3px solid var(--plotno);
    padding-top: 14px;
  }
  .czolo-bok .lead {
    margin-top: 0;
    font-size: 1.125rem;
  }
  h1 {
    font-size: 3.75rem;
    line-height: 1.06;
  }
  .kom-dom .czolo {
    display: block;
    padding-right: calc(var(--margines) + var(--odstep));
  }
  /* Na stronie głównej tablica zajmuje margines obok tytułu i tezy,
     więc noty tezy stają pod nią, w dwóch łamach. */
  .kom-dom .wstep {
    grid-row: 2;
  }
  .kom-dom .wstep .ust {
    display: block;
  }
  .kom-dom .ust-teza .nota {
    columns: 2;
    column-gap: 28px;
    max-width: var(--kolumna);
    border-top: 0;
    padding-top: 10px;
  }
  .kom-dom .ust-teza .nota p {
    break-inside: avoid;
    margin: 0 0 6px;
  }
  .kom-dom .czolo-bok {
    border-top: 0;
    padding-top: 0;
  }
  .kom-dom .czolo-bok .lead {
    margin-top: 18px;
    font-size: 1.1875rem;
  }
  .tablica {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: start;
    width: var(--margines);
    margin: 0;
  }
  .wstep {
    margin-top: 44px;
  }
  .spis {
    grid-column: 1;
    grid-row: 2 / span 40;
    align-self: start;
    position: sticky;
    top: 20px;
    margin-top: 44px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    border-top: 3px solid var(--plotno);
    border-bottom: 0;
    padding-top: 12px;
    font-size: 0.8125rem;
  }
  .spis a {
    padding: 6px 0;
    border-top: 1px solid var(--linia);
  }
  .spis li:first-child a {
    border-top: 0;
  }
  .par {
    display: block;
  }
  .stopka .w > * {
    margin-left: calc(var(--spis) + var(--odstep));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media print {
  .pagina,
  .skip,
  .spis,
  .przycisk {
    display: none;
  }
  body,
  .stopka {
    background: #fff;
  }
}
