/*
 * FizjoBaza — odświeżony szablon
 *
 * Kolory wyprowadzone z logo: cyjan #21B7EA i fiolet #26157C.
 * Schibsted Grotesk prowadzi interfejs i nagłówki, Literata niesie długi tekst
 * notatek (projektowana do czytania ekranowego, pełne polskie znaki).
 */

/*
 * Fonty z własnego serwera, bez zapytań do Google przed zgodą na cookies.
 * Zmienne woff2, podzbiór latin + latin-ext (polskie znaki). Literata ma oś
 * opsz przypiętą do 18, bo długi tekst ma 15–20 px. Przepis: docs/features/theme-fonts.md.
 */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk.woff2") format("woff2");
}

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/literata.woff2") format("woff2");
}

@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/literata-italic.woff2") format("woff2");
}

/*
 * Fallbacki metryczne (T8.5): lokalny Arial/Georgia z size-adjust i nadpisanymi metrykami
 * pionowymi dobranymi do woff2 z motywu, więc podmiana fontu nie przesuwa tekstu.
 * Wartości i przepis przeliczania: docs/features/theme-fonts.md.
 * Brak lokalnego kroju (np. Linux bez Liberation) pomija face i schodzi niżej w stosie.
 */
@font-face {
  font-family: "Schibsted Grotesk Fallback";
  font-style: normal;
  font-weight: 400 500;
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo");
  size-adjust: 104.99%;
  ascent-override: 93.02%;
  descent-override: 24.56%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Schibsted Grotesk Fallback";
  font-style: normal;
  font-weight: 600 800;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Arimo Bold");
  size-adjust: 105.31%;
  ascent-override: 92.73%;
  descent-override: 24.48%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Literata Fallback";
  font-style: normal;
  font-weight: 400 500;
  src: local("Georgia"), local("Gelasio");
  size-adjust: 108.78%;
  ascent-override: 108.20%;
  descent-override: 28.31%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Literata Fallback";
  font-style: normal;
  font-weight: 600 700;
  src: local("Georgia Bold"), local("Georgia-Bold"), local("Gelasio Bold");
  size-adjust: 99.49%;
  ascent-override: 118.31%;
  descent-override: 30.96%;
  line-gap-override: 0%;
}

:root {
  --ink: #141a35;
  --ink-soft: #3d4560;
  --muted: #5d6680;
  --violet: #26157c;
  --violet-deep: #1a0f57;
  --cyan: #21b7ea;
  --cyan-ink: #0a6c92;
  --cyan-wash: #e4f5fc;
  --paper: #f5f7fa;
  --surface: #ffffff;
  --line: #dde3ec;
  --danger: #b3261e;
  --danger-wash: #fdeceb;

  --font-ui: "Schibsted Grotesk", "Schibsted Grotesk Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "Literata", "Literata Fallback", Georgia, "Times New Roman", serif;

  /* Dwa promienie: mały dla kontrolek i miniatur, duży dla każdego pudełka. */
  --radius-s: 6px;
  --radius-m: 12px;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--cyan-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--violet);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--violet);
  color: #fff;
  border-radius: var(--radius-s);
}

.skip-link:focus {
  top: 12px;
}

/* Cel linku „Przejdź do treści”: dostaje fokus, ale nie jest kontrolką, więc bez obwódki. */
main[tabindex="-1"]:focus {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Przyciski i pola ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: var(--violet);
  color: #fff;
  font: 600 0.95rem/1 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn:hover {
  background: var(--violet-deep);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--ink-soft);
  color: var(--ink);
}

.btn--cyan {
  background: var(--cyan);
  color: var(--violet-deep);
}

.btn--cyan:hover {
  background: #5ccbf1;
  color: var(--violet-deep);
}

.field {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  font: 400 1rem var(--font-ui);
}

.field::placeholder {
  color: var(--muted);
}

/* ---------- Nagłówek strony ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-h);
}

.site-header__logo {
  flex: none;
}

.site-header__logo img {
  width: 128px;
  height: 36px;
}

.main-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.main-nav a:hover {
  background: var(--paper);
  color: var(--violet);
}

.main-nav a[aria-current] {
  color: var(--violet);
  box-shadow: inset 0 -2px 0 var(--cyan);
  border-radius: 0;
}

.header-search {
  position: relative;
  margin-left: auto;
  width: 280px;
}

.header-search .field {
  min-height: 40px;
  padding-left: 38px;
  background: var(--paper);
  border-color: transparent;
}

.header-search .field:focus {
  background: var(--surface);
  border-color: var(--line);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.mobile-panel {
  display: none;
  padding: 8px var(--gutter) 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.mobile-panel ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.mobile-panel li a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}

.mobile-panel li a[aria-current] {
  color: var(--violet);
}

.mobile-panel .header-search {
  width: 100%;
  margin: 16px 0 0;
}

.read-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 3px;
  width: 100%;
  background: var(--cyan);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

@media (max-width: 900px) {
  .site-header .main-nav,
  .site-header__bar > .header-search {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-header.is-open .mobile-panel {
    display: block;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ---------- Sekcje ---------- */

.section {
  padding: 72px 0;
}

.section--flush-top {
  padding-top: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
}

.section-head a {
  font-weight: 600;
  white-space: nowrap;
}

.meta {
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Strona główna: otwarcie ---------- */

.section--white {
  background: var(--surface);
}

.hero {
  padding: 56px 0 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.hero h1 {
  max-width: 12ch;
  color: var(--violet);
  font-size: clamp(2.5rem, 5.6vw, 4.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.hero__text {
  max-width: 46ch;
  margin: 24px 0 28px;
  color: var(--ink-soft);
  font-family: var(--font-read);
  font-size: 1.1875rem;
  line-height: 1.6;
}

.big-search {
  display: flex;
  gap: 8px;
}

.big-search__field {
  position: relative;
  flex: 1;
}

.big-search .field {
  min-height: 52px;
  padding-left: 44px;
  font-size: 1.0625rem;
  border-color: var(--ink-soft);
}

.big-search .search-icon {
  left: 15px;
  width: 20px;
  height: 20px;
}

.big-search .btn {
  min-height: 52px;
}

/* Aktualności zawsze są świeże, artykuły to archiwum, więc to one stoją obok wyszukiwarki. */
.hero__news {
  padding: 20px 24px 8px;
  border-radius: var(--radius-m);
  background: var(--paper);
}

.section-head--small {
  margin-bottom: 4px;
}

.section-head--small h2 {
  font-size: 1.125rem;
}

.teasers {
  margin: 0;
  padding: 0;
  list-style: none;
}

.teaser {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.teaser:first-child {
  border-top: 0;
}

/* Bez obrazka tekst zajmuje całą szerokość. */
.teaser:not(:has(.teaser__img)) {
  grid-template-columns: minmax(0, 1fr);
}

.teaser__img {
  width: 88px;
  height: 66px;
  border-radius: var(--radius-s);
  object-fit: cover;
}

.teaser .meta {
  display: block;
  margin-bottom: 2px;
  font-size: 0.8125rem;
}

.teaser a {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.teaser a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.teaser:hover a {
  color: var(--violet);
}

/* ---------- Strona główna: działy ---------- */

/* Działy pogrupowane jak przedmioty na studiach, w grupie od największego.
   Karty w rzędzie mają wspólną wysokość, nawet gdy grupy różnią się liczbą działów. */
.shelves {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.shelf {
  padding: 20px 22px 10px;
  border-radius: var(--radius-m);
  background: var(--surface);
}

.shelf h3 {
  margin-bottom: 8px;
  color: var(--violet);
  font-size: 1.0625rem;
}

.shelf ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shelf li + li {
  border-top: 1px solid var(--line);
}

.shelf a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.shelf a:hover {
  color: var(--violet);
}

.shelf__count {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* ---------- Strona główna: wyróżnione i popularne ---------- */

.card__tag {
  color: var(--cyan-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 56px;
}

.feature-lead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  margin-bottom: 16px;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}

.feature-lead__media img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

.feature-lead__body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 32px;
}

.feature-lead .card__tag {
  color: var(--cyan);
}

.feature-lead h3 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.feature-lead h3 a {
  color: #fff;
  text-decoration: none;
}

.feature-lead h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.feature-lead:hover h3 a {
  text-decoration: underline;
  text-decoration-color: var(--cyan);
  text-decoration-thickness: 3px;
}

.feature-lead p {
  color: #c9cfe0;
  font-family: var(--font-read);
  line-height: 1.6;
}

/* Bez obrazka: sam tekst na fiolecie z logo. */
.feature-lead:not(:has(.feature-lead__media)) {
  grid-template-columns: minmax(0, 1fr);
  background: var(--violet);
}

.feature-lead:not(:has(.feature-lead__media)) .feature-lead__body {
  min-height: 240px;
  padding: 40px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

/* Obrazek jest dodatkiem: bez niego kafel to sam tekst, bez pustego miejsca. */
.tile:not(:has(.tile__img)) {
  grid-template-columns: minmax(0, 1fr);
}

.tile:hover {
  border-color: var(--ink-soft);
}

.tile__img {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-s);
  object-fit: cover;
}

.tile__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tile h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.tile h3 a {
  color: var(--ink);
  text-decoration: none;
}

.tile h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.tile:hover h3 a {
  color: var(--violet);
}

.tile p {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* Lista popularnych jest wybierana ręcznie w CMS, więc bez numeracji pozycji. */
.reading-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.reading-list li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.reading-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.reading-list a {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.reading-list a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.reading-list li:hover a {
  color: var(--violet);
}

@media (max-width: 1000px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .shelves {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 32px 0 40px;
  }

  .hero__news {
    padding: 16px 18px 4px;
  }

  .shelves,
  .tiles {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .feature-lead {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-lead__media img {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .feature-lead__body {
    padding: 24px;
  }

  .big-search {
    flex-direction: column;
  }
}

/* ---------- Reklama ---------- */

.ad-slot {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 120px;
  border: 1px dashed #b9c3d3;
  border-radius: var(--radius-m);
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}

.ad-slot__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ad-band {
  padding: 0 0 72px;
  background: var(--surface);
}

.ad-slot--tall {
  min-height: 600px;
}

/* data-ad-format="auto" mierzy szerokość slotu; place-items: center zwęziłby <ins> do zera. */
.ad-slot .adsbygoogle {
  display: block;
  width: 100%;
}

/* ---------- Newsletter ---------- */

.newsletter {
  padding: 64px 0;
  background: var(--violet);
  color: #fff;
}

.newsletter__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.newsletter h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.newsletter p {
  margin-top: 12px;
  max-width: 40ch;
  color: #d4d0f0;
  font-family: var(--font-read);
}

.newsletter form {
  display: grid;
  gap: 14px;
}

.newsletter label {
  font-weight: 600;
}

.newsletter__row {
  display: flex;
  gap: 8px;
}

.newsletter .field {
  border-color: transparent;
}

.consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #d4d0f0;
  font-size: 0.875rem;
  font-weight: 400 !important;
}

.consent-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--cyan);
}

/* Nazwa polityki nie łamie się w środku; zawinięty wiersz i tak zaczyna się przy tekście, nie pod polem. */
.consent-check a {
  white-space: nowrap;
}

.newsletter a {
  color: #fff;
}

.newsletter__thanks {
  padding: 20px;
  border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.08);
}

.newsletter__thanks strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.125rem;
}

.newsletter form[hidden] {
  display: none;
}

.newsletter .newsletter__error {
  max-width: none;
  margin-top: -6px;
  color: #ffc9cf;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
}

.newsletter .field[aria-invalid="true"],
.consent-check input[aria-invalid="true"] {
  box-shadow: 0 0 0 2px #ff8a95;
}

.newsletter .btn:disabled {
  cursor: progress;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .newsletter__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .newsletter__row {
    flex-direction: column;
  }
}

/* ---------- Stopka ---------- */

.site-footer {
  padding: 56px 0 32px;
  background: var(--violet-deep);
  color: #c5c0ea;
  font-size: 0.9375rem;
}

.site-footer a,
.site-footer button {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer button:hover {
  color: var(--cyan);
}

.site-footer__top {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
}

.site-footer__brand img {
  width: 128px;
  height: 36px;
  margin-bottom: 16px;
}

.site-footer h2 {
  margin-bottom: 14px;
  color: #fff;
  font-size: 0.9375rem;
}

.footer-cats {
  columns: 4 160px;
  column-gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-cats li {
  break-inside: avoid;
}

.footer-cats a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  color: #c5c0ea;
  overflow-wrap: anywhere;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a,
.footer-links button {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}

.footer-links button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  gap: 6px;
}

.social svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 760px) {
  .site-footer__top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-cats {
    columns: 2;
  }
}

/* ---------- Artykuł ---------- */

.article-top {
  padding: 32px 0 0;
  background: var(--surface);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.crumbs li + li::before {
  content: "/";
  margin: 0 10px;
  color: #a6afc2;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--violet);
  text-decoration: underline;
}

.crumbs [aria-current] {
  color: var(--ink-soft);
}

/* Na telefonie tytuł i tak stoi tuż pod spodem jako h1. */
@media (max-width: 640px) {
  .crumbs li:last-child {
    display: none;
  }
}

.article-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: end;
  padding: 40px 0 32px;
}

.article-head__cat {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 10px;
  border-radius: var(--radius-s);
  background: var(--cyan-wash);
  color: var(--cyan-ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.article-head__cat:hover {
  color: var(--violet);
}

.article-head h1 {
  max-width: 22ch;
  color: var(--violet);
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.article-head .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 16px;
  font-size: 0.9375rem;
}

/* Cyfry proporcjonalne: w Schibsted Grotesk tabular-nums daje przecinkowi pełną szerokość
   cyfry, przez co „4,0” czyta się jak „4, 0”. Ocena to tekst, nie kolumna liczb. */
.article-head [data-rating-summary],
.rating .meta {
  font-variant-numeric: proportional-nums;
}

.article-tools {
  display: flex;
  gap: 8px;
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  font: 500 0.875rem var(--font-ui);
  text-decoration: none;
  cursor: pointer;
}

.tool:hover {
  border-color: var(--ink-soft);
  color: var(--violet);
}

.tool svg {
  width: 18px;
  height: 18px;
}

.share {
  position: relative;
}

.share__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  min-width: 220px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(20, 26, 53, 0.14);
  list-style: none;
}

.share__menu[hidden] {
  display: none;
}

.share__menu a,
.share__menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--ink);
  font: 500 0.9375rem var(--font-ui);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.share__menu a:hover,
.share__menu button:hover {
  background: var(--paper);
}

/* 9 na 10 artykułów nie ma obrazka: wtedy nagłówek kończy się linią, a nie zdjęciem. */
.article-top:not(:has(.article-hero)) {
  border-bottom: 1px solid var(--line);
}

.article-top:not(:has(.article-hero)) .article-head {
  padding-bottom: 40px;
}

.article-hero {
  margin: 0;
}

.article-hero img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: var(--radius-m) var(--radius-m) 0 0;
}

@media (max-width: 900px) {
  .article-head {
    grid-template-columns: 1fr;
    padding-top: 28px;
  }

  .article-hero img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 480px) {
  .tool span {
    display: none;
  }

  /* Ikony stawiają Udostępnij blisko lewej krawędzi, więc menu wyrównane do prawej
     wychodziło poza ekran. Przy lewej krawędzi przycisku mieści się w całości. */
  .share__menu {
    left: 0;
    right: auto;
    max-width: calc(100vw - 32px);
  }
}

.article-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 240px;
  gap: 48px;
  padding-top: 56px;
  padding-bottom: 72px;
}

.article-layout--no-toc {
  grid-template-columns: minmax(0, 1fr) 240px;
}

/* Reklama z boku jest opcjonalna: bez niej tekst zajmuje jej miejsce.
   :where() trzyma specyficzność nisko, żeby media queries niżej nadal wygrywały. */
.article-layout:where(:not(:has(.rail))) {
  grid-template-columns: 190px minmax(0, 1fr);
}

.article-layout--no-toc:where(:not(:has(.rail))) {
  grid-template-columns: minmax(0, 1fr);
}

.article-layout:where(:not(:has(.rail))) .prose {
  max-width: none;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow: auto;
}

.toc h2 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--line);
}

.toc a {
  display: block;
  margin-left: -2px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover {
  color: var(--violet);
}

.toc a.is-active {
  border-left-color: var(--cyan);
  color: var(--violet);
  font-weight: 600;
}

.toc .toc__sub a {
  padding-left: 26px;
  font-size: 0.8125rem;
}

.toc-mobile {
  display: none;
}

.rail {
  display: grid;
  align-content: start;
  gap: 24px;
}

.rail .ad-slot {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

@media (max-width: 1180px) {
  .article-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .article-layout--no-toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    display: none;
  }
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 32px;
    gap: 24px;
  }

  .toc {
    display: none;
  }

  .toc-mobile {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    background: var(--surface);
    margin-bottom: 24px;
  }

  .toc-mobile summary {
    padding: 14px 16px;
    font-weight: 600;
    cursor: pointer;
  }

  .toc-mobile ol {
    margin: 0;
    padding: 0 16px 12px 36px;
  }

  .toc-mobile li {
    padding: 4px 0;
  }

  .toc-mobile a {
    color: var(--ink);
  }
}

/* Treść artykułu z CMS — style działają na czystym HTML z edytora. */
.prose {
  max-width: 680px;
  color: var(--ink);
  font-family: var(--font-read);
  font-size: 1.125rem;
  line-height: 1.75;
}

.prose > * + *,
.prose section > * + * {
  margin-top: 1.1em;
}

/* Edytor oddaje treść w <article><header>…<section>…</section></article>,
   więc rytm musi działać także wewnątrz tego opakowania. */
.prose article > * + *,
.prose article header > * + *,
.prose article li > * + * {
  margin-top: 1.1em;
}

/* Globalny reset zeruje marginesy nagłówków; w treści z CMS h2/h3/h4 otwierają
   sekcje i metody, więc dostają ten sam odstęp co akapity. */
.prose article h2,
.prose article h3,
.prose article h4 {
  margin-top: 1.1em;
}

.prose section + section {
  margin-top: 2.2em;
}

.prose header {
  margin: 0;
}

/* Wstęp notatki, np. „Inaczej nazywany testem palce-podłoga.” */
.prose > header > p {
  color: var(--ink-soft);
  font-size: 1.25rem;
  line-height: 1.6;
}

/* Bibliografia i przypisy na końcu notatki; w starych notatkach stopka siedzi w <article>. */
.prose > footer,
.prose > article > footer {
  margin-top: 2.5em;
  padding-top: 1em;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Karta testu lub skali: Cel / Pozycja wyjściowa / Ruch / Wynik. */
.prose dl {
  display: grid;
  grid-template-columns: minmax(120px, 0.3fr) minmax(0, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
}

.prose dt,
.prose dd {
  margin: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.prose dt {
  padding-right: 24px;
  color: var(--violet);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.75rem;
}

@media (max-width: 640px) {
  .prose dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .prose dt {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .prose dd {
    padding-top: 4px;
  }
}

.prose h2,
.prose h3,
.prose h4,
.prose h5 {
  font-family: var(--font-ui);
  color: var(--violet);
}

.prose h3 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.prose h4 {
  margin-top: 0;
  padding-top: 0.25em;
  font-size: 1.375rem;
}

.prose h5 {
  margin-top: 1.6em;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 700;
}

.prose strong {
  font-weight: 600;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.35em;
}

/* Lista zagnieżdżona ma ten sam odstęp, czy przed nią stoi tekst, czy <strong>. */
.prose li > ul,
.prose li > ol {
  margin-top: 0.35em;
}

.prose ul li::marker {
  color: var(--cyan);
}

.prose ol li::marker {
  color: var(--violet);
  font-family: var(--font-ui);
  font-weight: 700;
}

.prose sub,
.prose sup {
  line-height: 0;
}

.prose a {
  color: var(--cyan-ink);
}

.prose blockquote {
  margin-right: 0;
  margin-left: 0;
  padding-left: 20px;
  border-left: 3px solid var(--cyan);
  color: var(--ink-soft);
  font-style: italic;
}

.prose img {
  border-radius: var(--radius-m);
}

/* Ryciny ze starych notatek: <figure> z jednym lub dwoma <img> i podpisem. */
.prose figure {
  margin-right: 0;
  margin-left: 0;
}

.prose figure > * + * {
  margin-top: 8px;
}

.prose figcaption {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* W części notatek podpis to <h2>: ma wyglądać jak podpis, nie jak tytuł sekcji. */
.prose figcaption h2 {
  margin-top: 0;
  color: inherit;
  font-size: 1em;
  font-weight: inherit;
}

.prose-figure {
  margin: 0 0 0.4em;
}

.prose-figure img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Szerokie tabele z edytora przewijają się we własnym pudełku przy każdej szerokości, nie całą stroną. */
.prose table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

/* Osadzenia i kod z CMS nie mogą rozpychać strony na telefonie. */
.prose iframe,
.prose video {
  max-width: 100%;
}

/* Edytor wstawia iframe bez wymiarów (domyślnie 300×150), sam w <p>. */
.prose iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-m);
}

.prose pre {
  overflow-x: auto;
}

/* Filmy, załączniki i linki pod treścią artykułu: każda sekcja jest tylko wtedy, gdy rekord ją ma. */
.article-media,
.article-files,
.article-links {
  margin-top: 56px;
}

.article-media h2,
.article-files h2,
.article-links h2 {
  margin-bottom: 16px;
  font-size: 1.125rem;
}

.video {
  margin: 0;
}

.video + .video {
  margin-top: 24px;
}

.video figcaption,
.article-hero figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.875rem;
}

/* EmbedField::getResponsive() usuwa width/height z iframe i opakowuje go w .embed-responsive. */
.embed-responsive {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--ink);
}

.embed-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Ocena ---------- */

.rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 56px;
  padding: 24px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--line);
}

.rating h2 {
  font-size: 1.125rem;
}

.rating .meta {
  margin-top: 4px;
}

.rating__stars {
  display: flex;
  gap: 2px;
}

.rating__star {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: #c8cfdb;
  cursor: pointer;
}

.rating__star svg {
  width: 28px;
  height: 28px;
}

.rating__star.is-lit {
  color: var(--cyan);
}

.rating__star[aria-disabled="true"] {
  cursor: default;
}

.rating[aria-busy="true"] .rating__star {
  cursor: progress;
}

/* ---------- Więcej z działu ---------- */

.more {
  padding: 64px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.more-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.more-list li {
  border-top: 1px solid var(--line);
}

.more-list a {
  display: block;
  padding: 16px 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.more-list a:hover {
  color: var(--violet);
}

/* Pod aktualnością: te same zajawki co na głównej, tylko w rzędzie. */
.teasers--row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
}

.teasers--row .teaser:first-child {
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .more-list,
  .teasers--row {
    grid-template-columns: 1fr;
  }

  .teasers--row .teaser:not(:first-child) {
    border-top: 1px solid var(--line);
  }
}

/* ---------- Podstrony: nagłówek i układ ---------- */

.page-top {
  padding: 32px 0 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.page-top h1 {
  margin-top: 28px;
  color: var(--violet);
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* Bez okruszków (404) tytuł otwiera page-top, więc nie potrzebuje odstępu od nich. */
.page-top .wrap > h1:first-child {
  margin-top: 0;
}

.page-top__lead {
  max-width: 62ch;
  margin-top: 14px;
  color: var(--ink-soft);
  font-family: var(--font-read);
  font-size: 1.125rem;
  line-height: 1.6;
}

.page-top__lead p + p {
  margin-top: 0.6em;
}

.page-top .big-search {
  max-width: 640px;
  margin-top: 24px;
}

/* Jak w artykule: boczna reklama jest opcjonalna, bez niej lista zajmuje całą szerokość. */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 56px;
  padding-top: 48px;
  padding-bottom: 72px;
}

.page-layout:where(:not(:has(.rail))) {
  grid-template-columns: minmax(0, 1fr);
}

/* Dział: pierwszy blok kolumny (np. same załączniki) zaczyna się od góry. */
.page-layout > div > :first-child {
  margin-top: 0;
}

.page-body {
  padding-top: 48px;
  padding-bottom: 72px;
}

/* Strona ogólna (record.twig): załączniki w szerokości tekstu; bez treści lista zaczyna się od góry. */
.page-body > .article-files {
  max-width: 680px;
}

.page-body > .article-files:first-child {
  margin-top: 0;
}

.page-ad {
  margin-top: 56px;
}

@media (max-width: 1180px) {
  .page-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .page-top {
    padding-bottom: 28px;
  }

  .page-top h1 {
    margin-top: 20px;
  }

  .page-layout,
  .page-body {
    padding-top: 32px;
  }
}

/* ---------- Paginacja ---------- */

.pager {
  margin-top: 40px;
}

.pager ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pager a,
.pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-s);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.pager a {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.pager a:hover {
  border-color: var(--ink-soft);
  color: var(--violet);
}

.pager a[aria-current] {
  border-color: var(--violet);
  background: var(--violet);
  color: #fff;
}

.pager span {
  color: var(--muted);
}

/* Na telefonie zostają poprzednia, bieżąca i następna strona. */
@media (max-width: 640px) {
  .pager li:not(.pager__step):not(:has([aria-current])) {
    display: none;
  }

  .pager ol {
    justify-content: space-between;
  }
}

/* ---------- Aktualności ---------- */

.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-item {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.news-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.news-item:not(:has(.news-item__img)) {
  grid-template-columns: minmax(0, 1fr);
}

.news-item__img {
  width: 220px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-s);
  object-fit: cover;
}

.news-item__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-item h2 {
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.news-item h2 a {
  color: var(--ink);
  text-decoration: none;
}

.news-item h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.news-item:hover h2 a {
  color: var(--violet);
}

.news-item p {
  max-width: 68ch;
  color: var(--ink-soft);
  font-family: var(--font-read);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .news-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .news-item__img {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .news-item h2 {
    font-size: 1.1875rem;
  }
}

/* ---------- Artykuły: wszystkie działy ---------- */

.cat-group + .cat-group {
  margin-top: 56px;
}

.cat-group > h2 {
  margin-bottom: 20px;
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.cat-card:hover {
  border-color: var(--ink-soft);
}

.cat-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.cat-card h3 {
  font-size: 1.125rem;
  line-height: 1.3;
}

.cat-card h3 a {
  color: var(--violet);
  text-decoration: none;
}

.cat-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.cat-card:hover h3 a {
  text-decoration: underline;
  text-decoration-color: var(--cyan);
  text-decoration-thickness: 2px;
}

.cat-card p {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

@media (max-width: 1000px) {
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cat-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

/* ---------- Jeden dział ---------- */

.page-top__meta {
  margin-top: 12px;
}

.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.list-tools h2 {
  font-size: 1.375rem;
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.sort[hidden] {
  display: none;
}

select.field {
  width: auto;
  min-height: 40px;
  padding-right: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6680' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 18px;
  font-size: 0.9375rem;
  cursor: pointer;
}

/* Jedna kolumna, żeby kolejność po sortowaniu była oczywista. Zajawka (<p> pod .meta) jest opcjonalna. */
.entry-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.entry h3 {
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.entry h3 a {
  color: var(--ink);
  text-decoration: none;
}

.entry h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.entry:hover h3 a {
  color: var(--violet);
}

.entry p:not(.meta) {
  display: -webkit-box;
  max-width: 72ch;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ---------- Publikacje ---------- */

.file-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.file-filter {
  position: relative;
  flex: 0 1 420px;
}

.file-filter .field {
  padding-left: 40px;
}

.file-list {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  list-style: none;
}

.file-list li + li {
  border-top: 1px solid var(--line);
}

.file-list li[hidden] {
  display: none;
}

.file {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 20px;
  color: var(--ink);
  text-decoration: none;
}

.file:hover {
  color: var(--violet);
}

.file svg {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--cyan-ink);
}

.file__title {
  font-weight: 500;
  line-height: 1.4;
}

.file__meta {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.file-empty {
  padding: 24px;
  border: 1px dashed #b9c3d3;
  border-radius: var(--radius-m);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 640px) {
  .file {
    grid-template-columns: 22px minmax(0, 1fr);
    padding: 14px 16px;
  }

  .file__meta {
    grid-column: 2;
    margin-top: -8px;
  }
}

/* ---------- Kontakt ---------- */

.form-card {
  max-width: 720px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.form-card h2 {
  margin-bottom: 24px;
  font-size: 1.375rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row--full {
  grid-column: 1 / -1;
}

.form-row > label:not(.check) {
  font-weight: 600;
}

textarea.field {
  min-height: 180px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.field:focus {
  border-color: var(--ink-soft);
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--violet);
}

.check a {
  white-space: nowrap;
}

.form-actions {
  margin-top: 4px;
}

.notice {
  max-width: 720px;
  padding: 20px 24px;
  border-radius: var(--radius-m);
  background: var(--cyan-wash);
  color: var(--ink);
}

.notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--violet);
  font-size: 1.125rem;
}

.notice + .form-card {
  margin-top: 24px;
}

.notice--error {
  background: var(--danger-wash);
}

.notice--error strong {
  color: var(--danger);
}

.notice ul {
  margin: 8px 0 0;
  padding-left: 1.25em;
}

.field-error {
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 600;
}

.form-row .field[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.check input[aria-invalid="true"] {
  box-shadow: 0 0 0 2px var(--danger);
}

@media (max-width: 640px) {
  .form-card {
    padding: 24px 18px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* hCaptcha ma stałe 302×76 px; poniżej 372 px nie mieści się w .form-card, więc skalujemy iframe.
   overflow: clip ucina tylko pustą, nieprzeskalowaną ramkę układu — widoczny widżet (247,6×62,3) mieści się w 248×63. */
@media (max-width: 371px) {
  .h-captcha {
    width: 248px;
    height: 63px;
    overflow: clip;
  }

  .h-captcha > iframe {
    transform: scale(0.82);
    transform-origin: 0 0;
  }
}

/* ---------- Wyniki wyszukiwania ---------- */

.results-summary {
  margin-bottom: 8px;
}

.results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.result {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.result h2 {
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.result h2 a {
  color: var(--ink);
  text-decoration: none;
}

.result h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.result:hover h2 a {
  color: var(--violet);
}

.result p {
  max-width: 72ch;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.result mark,
.empty-state mark {
  padding: 0 1px;
  background: var(--cyan-wash);
  color: var(--ink);
  font-weight: 600;
}

.empty-state {
  max-width: 640px;
}

.empty-state h2 {
  font-size: 1.5rem;
}

.empty-state > p {
  margin-top: 10px;
  color: var(--ink-soft);
}

.empty-state ul {
  margin: 16px 0 0;
  padding-left: 1.2em;
  color: var(--ink-soft);
}

.empty-state li + li {
  margin-top: 6px;
}

.empty-state ul li::marker {
  color: var(--cyan);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.chips a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.chips a:hover {
  border-color: var(--ink-soft);
  color: var(--violet);
}

/* ---------- Okno zgody na cookies ---------- */

.consent {
  width: min(560px, calc(100% - 32px));
  padding: 32px;
  border: 0;
  border-radius: var(--radius-m);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(20, 26, 53, 0.28);
}

.consent::backdrop {
  background: rgba(20, 26, 53, 0.55);
}

.consent:focus {
  outline: none;
}

.consent h2 {
  margin-bottom: 12px;
  padding-right: 32px;
  color: var(--violet);
  font-size: 1.375rem;
}

.consent p {
  margin-bottom: 12px;
  color: var(--ink-soft);
}

.consent__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 16px;
}

.consent__actions .btn {
  flex: 1 1 auto;
}

.consent__note {
  font-size: 0.8125rem;
}

.consent__back {
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cyan-ink);
  font: 600 0.875rem var(--font-ui);
  cursor: pointer;
}

.consent__purpose {
  padding: 16px;
  border-radius: var(--radius-m);
  background: var(--paper);
}

.consent__purpose + .consent__purpose {
  margin-top: 8px;
}

.consent__purpose label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}

.consent__purpose input {
  width: 18px;
  height: 18px;
  accent-color: var(--violet);
}

.consent__purpose p {
  margin: 8px 0 0;
  font-size: 0.875rem;
}

/* ---------- Ruch i druk ---------- */

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

  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .newsletter,
  .rail,
  .toc,
  .toc-mobile,
  .article-tools,
  .rating,
  .article-media,
  .more,
  .ad-band,
  .page-ad {
    display: none !important;
  }

  .article-layout {
    display: block;
    padding: 0;
  }

  .prose table {
    display: table;
    width: 100%;
    max-width: none;
    overflow: visible;
  }
}
