/* =========================================================================
   Myślenie designem dla dostępności — main.css
   Wersja: 0.1.0
   Bazowe style: zmienne, reset, typografia.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. CSS variables — aliasy do WP tokens + dodatkowe zmienne motywu
   ------------------------------------------------------------------------- */

:root {
  /* Kolory — fallback do hardcoded wartości jeśli WP nie wygeneruje presets */
  --color-primary: var(--wp--preset--color--primary, #1600ff);
  --color-white: var(--wp--preset--color--white, #ffffff);
  --color-black: var(--wp--preset--color--black, #000000);
  --color-bg-grey: var(--wp--preset--color--bg-grey, #f2f2f2);
  --color-grey: var(--wp--preset--color--grey, #636363);
  --color-border: var(--wp--preset--color--border, #dcdcdc);
  --color-orange: var(--wp--preset--color--orange, #ff4326);
  --color-grey-2: var(--wp--preset--color--grey-2, #6e7080);

  /* Typografia */
  --font-primary: var(
    --wp--preset--font-family--primary,
    "neue-haas-unica",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif
  );

  --fs-caption: var(--wp--preset--font-size--caption, 10.7px);
  --fs-caption-2: 12px;
  --fs-tag: var(--wp--preset--font-size--tag, 14px);
  --fs-body: var(--wp--preset--font-size--body, 16px);
  --fs-h4: var(--wp--preset--font-size--h4, 20px);
  --fs-heading: var(--wp--preset--font-size--heading, 25.7px);
  --fs-h1: var(--wp--preset--font-size--h1, 48px);

  /* Display type — gigantyczna nawigacja w lewej kolumnie */
  --fs-display: clamp(2rem, 4.5vw, 3rem);

  /* Line heights */
  --lh-tight: 1;
  --lh-body: 1.125;
  --lh-caption: 1.4;

  /* Letter spacing */
  --ls-tight: -0.3px;
  --ls-body: -0.36px;
  --ls-normal: 0;

  /* Spacing — fallback do hardcoded wartości */
  --space-xs: var(--wp--preset--spacing--20, 8px);
  --space-sm: var(--wp--preset--spacing--30, 16px);
  --space-md: var(--wp--preset--spacing--40, 24px);
  --space-lg: var(--wp--preset--spacing--50, 48px);
  --space-xl: 96px;
  --space-2xl: 144px;

  /* Layout */
  --left-col-width: 50vw;
  --left-col-padding: var(--space-lg);
  --right-col-padding: var(--space-lg);
  --content-padding-x: 50px;
}

/* -------------------------------------------------------------------------
   2. Reset i normalizacja
   ------------------------------------------------------------------------- */

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

* {
  margin: 0;
  padding: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--color-black);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 150ms ease;
}

a:hover,
a:focus-visible {
  color: var(--color-primary);
}

ul,
ol {
  list-style: none;
}

/* -------------------------------------------------------------------------
   3. Focus management — accessibility
   ------------------------------------------------------------------------- */

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

/* Skip link — pokazuje się tylko przy focus z klawiatury */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-black);
  color: var(--color-white);
  text-decoration: none;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 150ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: -3px;
}

/* Screen reader only — utility do ukrywania tekstu wizualnie,
   ale dostępnego dla technologii wspomagających (czytniki ekranu). */
.screen-reader-text,
.sr-only {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* -------------------------------------------------------------------------
   4. Typografia bazowa
   ------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-normal);
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: var(--ls-normal);
}

h2 {
  font-size: var(--fs-heading);
  letter-spacing: var(--ls-tight);
}

h3 {
  font-size: var(--fs-heading);
  letter-spacing: var(--ls-tight);
}

h4 {
  font-size: var(--fs-h4);
  letter-spacing: var(--ls-normal);
}

p {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
}

p + p {
  margin-top: 1em;
}

small,
.caption {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
}

strong,
b {
  font-weight: 700;
}

/* -------------------------------------------------------------------------
   5. Utility classes
   ------------------------------------------------------------------------- */

.uppercase {
  text-transform: uppercase;
}

.text-tag {
  font-size: var(--fs-tag);
  letter-spacing: var(--ls-body);
}

.text-caption {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
}

/* -------------------------------------------------------------------------
   6. Layout — split screen (lewa sticky + prawa scrollable)
   ------------------------------------------------------------------------- */

/* Site wrapper — grid 50/50 na desktop */
.site-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ---- LEWA KOLUMNA — sticky ---- */

.site-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background-color: var(--color-primary);
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--space-md);
}

.site-sidebar__inner {
  flex: 1;
  padding: var(--space-lg) var(--content-padding-x);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Górny pasek — logo + a11y toolbar + hamburger */
.site-sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.site-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  text-transform: uppercase;
  letter-spacing: 0;
  width: 100%;
}

.site-sidebar__logo {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 400;
  transition: color 150ms ease;
}

.site-sidebar__logo:hover,
.site-sidebar__logo:focus-visible {
  color: var(--color-black);
}

.site-sidebar__breadcrumb-sep {
  color: var(--color-black);
}

.site-sidebar__breadcrumb-current {
  font-weight: 700;
  color: var(--color-white);
  /* Truncate w jednej linii */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  text-overflow: ellipsis;
  overflow: hidden;
}

.site-sidebar__breadcrumb-link {
  color: var(--color-white);
  text-decoration: none;
}

.site-sidebar__breadcrumb-link:hover,
.site-sidebar__breadcrumb-link:focus {
  opacity: 1;
  color: var(--color-black);
}

/* Accessibility toolbar */
.site-sidebar__a11y {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  justify-content: end;
}

.a11y-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-white);
  color: var(--color-white);
  background: transparent;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.a11y-btn:hover,
.a11y-btn:focus-visible {
  background-color: var(--color-white);
  color: var(--color-primary);
}

.a11y-btn sup {
  font-size: 0.7em;
  margin-left: 1px;
}

/* Hamburger — schowany na desktop, pokazany na mobile */
.site-sidebar__menu-toggle {
  display: none;
}

/* Tagline */
.site-sidebar__tagline {
  font-size: var(--fs-h4);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  margin-bottom: var(--space-md);
  max-width: 18em;
}

/* Caption pomiędzy taglinem a menu — wycentrowany pionowo */
.site-sidebar__caption {
  font-size: var(--fs-caption);
  line-height: 1.1;
  letter-spacing: 0;
  margin-top: auto;
  margin-bottom: auto;
}

.site-sidebar__caption strong {
  font-weight: 700;
}

/* Wielka typograficzna nawigacja */
.site-sidebar__nav {
  margin-bottom: var(--space-md);
  margin-top: auto;
}

.site-sidebar__menu {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.site-sidebar__menu li {
  display: block;
}

.site-sidebar__menu a {
  display: inline-block;
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: var(--ls-tight);
  color: var(--color-white);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 150ms ease;
}

.site-sidebar__menu a:hover,
.site-sidebar__menu a:focus-visible {
  color: var(--color-black);
}

/* Aktywna pozycja menu — strona, na której jesteśmy */
.site-sidebar__menu .current-menu-item > a,
.site-sidebar__menu .current_page_item > a,
.site-sidebar__menu .current-menu-ancestor > a,
.site-sidebar__menu .current-page-ancestor > a,
.site-sidebar__menu .current-menu-item > .menu-item-wrap > a,
.site-sidebar__menu .current_page_item > .menu-item-wrap > a {
  color: var(--color-black);
}

/* -------------------------------------------------------------------------
   Submenu — wersja przez wp_nav_menu()
   
   WordPress renderuje wszystkie pozycje menu jako <a>. Pozycje z URL #
   i klasą menu-item-has-children-toggle są przejmowane przez JS i
   zachowują się jak przyciski rozwijające submenu.
   ------------------------------------------------------------------------- */

/* Pozycje menu, które mają submenu — dodajemy ikonę +/× */
.site-sidebar__menu .menu-item-has-children > a::after,
.site-sidebar__menu .menu-item-has-children-toggle > a::after {
  content: "×";
  display: inline-block;
  margin-left: var(--space-xs);
  transform: rotate(45deg);
  transition: transform 250ms ease;
  color: var(--color-black);
}

/* Stan otwarty — × bez rotacji */
.site-sidebar__menu .menu-item-has-children.is-open > a::after,
.site-sidebar__menu .menu-item-has-children-toggle.is-open > a::after,
.site-sidebar__menu .menu-item-has-children.current-menu-parent > a::after,
.site-sidebar__menu
  .menu-item-has-children-toggle.current-menu-parent
  > a::after,
.site-sidebar__menu .menu-item-has-children.current-menu-ancestor > a::after,
.site-sidebar__menu
  .menu-item-has-children-toggle.current-menu-ancestor
  > a::after {
  transform: rotate(0deg);
}

/* Toggle link (Baza wiedzy z URL #) — cursor pointer */
.site-sidebar__menu .menu-item-has-children-toggle > a {
  cursor: pointer;
}

/* Submenu (Artykuły/Materiały/Webinary pod Bazą wiedzy) */
.site-sidebar__menu .sub-menu {
  padding-left: var(--space-lg);
  margin-top: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 300ms ease;
}

/* Gdy parent ma .is-open → submenu się rozwija */
/* Gdy parent jest na ścieżce do bieżącej strony (.current-menu-parent / .current-menu-ancestor)
   → submenu też jest rozwinięte, niezależnie od is-open */
.site-sidebar__menu .menu-item-has-children.is-open > .sub-menu,
.site-sidebar__menu .menu-item-has-children-toggle.is-open > .sub-menu,
.site-sidebar__menu .menu-item-has-children.current-menu-parent > .sub-menu,
.site-sidebar__menu
  .menu-item-has-children-toggle.current-menu-parent
  > .sub-menu,
.site-sidebar__menu .menu-item-has-children.current-menu-ancestor > .sub-menu,
.site-sidebar__menu
  .menu-item-has-children-toggle.current-menu-ancestor
  > .sub-menu {
  max-height: 500px;
}
/* Linki w submenu */
.site-sidebar__menu .sub-menu a {
  color: var(--color-white);
  transition: color 150ms ease;
}

.site-sidebar__menu .sub-menu a:hover,
.site-sidebar__menu .sub-menu a:focus-visible {
  color: var(--color-black);
}

/* Aktywna pozycja submenu */
.site-sidebar__menu .sub-menu .current-menu-item > a,
.site-sidebar__menu .sub-menu .current_page_item > a {
  color: var(--color-black);
}

/* Force-closed: user kliknął × żeby zamknąć submenu nawet gdy jest na podstronie */
.site-sidebar__menu .menu-item-has-children.is-force-closed > .sub-menu,
.site-sidebar__menu .menu-item-has-children-toggle.is-force-closed > .sub-menu {
  max-height: 0;
}

.site-sidebar__menu .menu-item-has-children.is-force-closed > a::after,
.site-sidebar__menu .menu-item-has-children-toggle.is-force-closed > a::after {
  transform: rotate(45deg);
}

/* Search */
.site-sidebar__search {
  padding-top: var(--space-md);
}

.site-sidebar__search .search-form {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--color-white);
  padding-bottom: var(--space-xs);
}

.site-sidebar__search input[type="search"] {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-white);
  font-size: var(--fs-body);
  letter-spacing: var(--ls-body);
  padding: var(--space-xs) 0;
}

.site-sidebar__search input[type="search"]::placeholder {
  color: var(--color-white);
  opacity: 0.7;
}

.site-sidebar__search input[type="search"]:focus-visible {
  outline: none;
}

.site-sidebar__search button[type="submit"] {
  color: var(--color-white);
  padding: var(--space-xs);
}
/* === SZUKAJKA === */
.search-form {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.search-form__label {
  flex: 1;
  margin: 0;
}

.search-form__input {
  width: 100%;
  padding: 12px 48px 12px 16px; /* prawy padding 48px na ikonkę */
  font-size: 16px;
  line-height: 1.4;
  background: transparent;
  border: 1px solid currentColor; /* lub konkretny kolor */
  border-radius: 0;
  color: inherit;
  font-family: inherit;
}

.search-form__input::placeholder {
  color: inherit;
  opacity: 0.6;
}

.search-form__input:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Button z lupką = absolute, po prawej stronie inputa */
.search-form__submit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-form__submit:hover {
  opacity: 0.7;
}

.search-form__submit svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* Reader-only (jeśli nie masz już zdefiniowanej) */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Ukryj natywny X w Safari/Chrome/Edge */
.search-form__input::-webkit-search-cancel-button,
.search-form__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

/* Padding-right większy żeby zmieścić X + lupkę */
.search-form__input {
  padding-right: 76px; /* 12 + 12 + 16 + 12 + 12 + 12 = miejsce na 2 ikony */
}

/* Własny X — schowany domyślnie */
.search-form__clear {
  position: absolute;
  right: 40px; /* na lewo od lupy */
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  color: inherit;
  display: none; /* domyślnie ukryty */
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.search-form__clear:hover {
  opacity: 1;
}

.search-form__clear svg {
  display: block;
  width: 12px;
  height: 12px;
}

/* Pokaż X gdy form ma klasę --has-value (dodawana przez JS) */
.search-form.search-form--has-value .search-form__clear {
  display: flex;
}

/* ---- PRAWA KOLUMNA — scrollable content ---- */

.site-content {
  background-color: var(--color-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Pasek z oznaczeniami grantowymi */
.site-content__grants {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--color-white);
  padding: var(--space-md) var(--content-padding-x);
  display: flex;
  justify-content: center;
}

.site-content__grants-img {
  width: 478.4px;
  max-height: none;
  height: auto;
}

/* Główny content */
.site-content__main {
  flex: 1;
  padding: var(--space-lg) var(--content-padding-x); /* większy padding po bokach, żeby content nie przyklejał się do krawędzi */
}

.site-content__main:focus {
  outline: none;
}

/* -------------------------------------------------------------------------
   7. Stopka — wewnątrz prawej kolumny
   ------------------------------------------------------------------------- */

.site-footer {
  padding-left: var(--content-padding-x);
  padding-right: var(--content-padding-x);
  padding-bottom: var(--space-lg);
  padding-top: 120px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: var(--space-lg);
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.site-footer__heading {
  font-size: var(--fs-tag);
  line-height: var(--lh-tight);
  letter-spacing: 0;
  font-weight: 400;
  color: var(--color-black);
  margin-bottom: var(--space-xs);
}

.site-footer__text {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
}

.site-footer__list {
  display: flex;
  flex-direction: column;
  gap: none;
}

.site-footer__list a {
  color: var(--color-black);
  text-decoration: none;
}

.site-footer__list a:hover,
.site-footer__list a:focus-visible {
  color: var(--color-primary);
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-top: var(--space-md);
}

.site-footer__copyright,
.site-footer__credit {
  font-size: var(--fs-tag);
  letter-spacing: 0;
}

.site-footer__credit a {
  color: var(--color-black);
}
.site-footer p + p {
  margin-top: 0;
}

/* -------------------------------------------------------------------------
   9. Archive — grid kart (Artykuły, Materiały, taksonomie)
   ------------------------------------------------------------------------- */

.archive-page {
  /* Brak kontenera — content już jest w site-content__main z paddingiem */
}

.archive-page__header {
  margin-bottom: var(--space-lg);
}

.archive-page__title {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.archive-page__description {
  font-size: var(--fs-body);
  color: var(--color-grey);
  max-width: 50em;
}

.archive-page__empty {
  padding: var(--space-lg) 0;
  color: var(--color-grey);
}

/* Grid kart — 2 kolumny */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.875rem;
  margin-bottom: var(--space-lg);
}

/* Co piąta karta (3, 8, 13...) — szeroka na pełną szerokość */
.card-grid__item:nth-child(5n + 3) {
  grid-column: 1 / -1;
}
/* Szeroka karta — poziomy aspect-ratio */
.card-grid__item:nth-child(5n + 3) .card-grid__media {
  aspect-ratio: 3 / 2;
}

/* Pojedyncza karta */
.card-grid__item {
  position: relative;
}

.card-grid__link {
  display: block;
  color: var(--color-black);
  text-decoration: none;
  transition: opacity 200ms ease;
}

.card-grid__link:hover,
.card-grid__link:focus-visible {
  color: var(--color-black);
  opacity: 0.85;
}
/* ===== RAPORTY — równy grid, pionowe okładki ===== */

/* Kasuje szeroką kartę editorialu — wszystkie karty równe */
.category-raporty .card-grid__item:nth-child(5n + 3) {
  grid-column: auto;
}

/* Pionowe okładki — także na tej co była szeroka */
.category-raporty .card-grid__media,
.category-raporty .card-grid__item:nth-child(5n + 3) .card-grid__media {
  aspect-ratio: 3 / 4;
}
/* Raporty — bez gradientu na dole okładki */
.category-raporty .card-grid__media::after {
  display: none;
}
/* === HOVER ZOOM NA OBRAZKU === */

/* Maska — nic nie wychodzi poza ramkę */
.card-grid__media {
  overflow: hidden;
}

/* Obrazek z transitionem */
.card-grid__image,
.card-grid__media img {
  transition: transform 0.5s ease;
  transform-origin: center;
}

/* Zoom na hover karty */
.card-grid__item:hover .card-grid__image,
.card-grid__item:hover .card-grid__media img {
  transform: scale(1.05);
}

/* Link tytułu rozciągnięty na całą kartę */
.card-grid__title-link {
  color: inherit;
  text-decoration: none;
}

.card-grid__title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Sekcja obrazka */
.card-grid__media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background-color: var(--color-bg-grey);
  margin-bottom: var(--space-sm);
}

.card-grid__image,
.card-grid__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Gradient overlay od dołu */
.card-grid__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0) 30.99%, #000 100%);
  pointer-events: none;
}

.card-grid__placeholder {
  width: 100%;
  height: 100%;
  background-color: var(--color-black);
}

/* Etykiety nałożone na obrazku — lewy dolny róg */
.card-grid__labels {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 24px;
  z-index: 2; /* nad gradientem */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.label {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 60px;
  border: 1px solid var(--color-orange);
  background-color: var(--color-orange);
  color: var(--color-white);
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 14px;
  letter-spacing: -0.36px;
  text-transform: none;
  white-space: nowrap;
  position: relative; /* żeby z-index zadziałał */
  text-decoration: none;
  cursor: pointer;
}

.label:hover {
  opacity: 0.85;
}
.label:link,
.label:visited,
.label:hover,
.label:focus,
.label:active {
  color: var(--color-white);
  text-decoration: none;
}

/* Wyjątek: archiwalna etykieta webinaru (szary tekst na białym tle) */
.label.webinar-status--archived,
.label.webinar-status--archived:link,
.label.webinar-status--archived:visited,
.label.webinar-status--archived:hover,
.label.webinar-status--archived:focus,
.label.webinar-status--archived:active {
  color: var(--color-grey-2);
}

/* Modifikatory etykiet — wszystkie pomarańczowe (z makiety klienta) */
.label--category,
.label--type,
.label--accent {
  /* dziedziczą wszystkie style z .label */
}
.label--category {
  border-radius: 5px;
}

/* Body karty — tytuł i meta */
.card-grid__body {
  padding: 0;
}

.card-grid__title {
  font-size: var(--fs-heading);
  line-height: 1;
  letter-spacing: -0.3px;
  margin-bottom: var(--space-xs);
  text-align: center;
  margin-top: 16px; /* odstęp od obrazka */
}

/* === TYTUŁ KARTY — kolor dziedziczony, bez zmian na hover === */
.card-grid__title-link,
.card-grid__title-link:link,
.card-grid__title-link:visited,
.card-grid__title-link:hover,
.card-grid__title-link:focus,
.card-grid__title-link:active {
  color: inherit;
  text-decoration: none;
}

.card-grid__meta {
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-black);
  letter-spacing: 0;
  margin-bottom: 0;
  text-align: center;
  margin-top: 8px;
}

.card-grid__date {
  color: var(--color-grey);
}

/* Paginacja */
.archive-pagination {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.archive-pagination .nav-links {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  align-items: center;
}

.archive-pagination .page-numbers {
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-black);
  text-decoration: none;
  transition: opacity 150ms ease;
}

.archive-pagination .page-numbers:hover,
.archive-pagination .page-numbers:focus-visible {
  opacity: 0.6;
}

.archive-pagination .page-numbers.current {
  font-weight: 700;
}

/* -------------------------------------------------------------------------
   10. Card list — lista pozioma (Forum, Webinary)
   ------------------------------------------------------------------------- */

.card-list {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-lg);
}

/* Pojedyncza pozycja listy */
.card-list__item {
  padding: var(--space-md) 0;
  margin-bottom: 1rem;
  width: 75%;
}

.card-list__item:first-child {
  padding-top: 0;
}

.card-list__link {
  display: block;
  color: var(--color-black);
  text-decoration: none;
  transition: opacity 200ms ease;
}

.card-list__link:hover,
.card-list__link:focus-visible {
  color: var(--color-black);
  opacity: 0.7;
}

.card-list__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: var(--space-sm);
}

.card-list__title {
  font-size: var(--fs-heading);
  line-height: 1.1;
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--space-sm);
}

.card-list__excerpt {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-black);
  max-width: 50em;
}

.card-list__excerpt p {
  margin: 0;
}

/* Etykiety statusu webinaru */
.webinar-status--upcoming {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 60px;
  border: 1px solid var(--color-orange);
  background-color: var(--color-orange);
  color: var(--color-white);
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 14px;
  letter-spacing: -0.36px;
  text-transform: none;
  white-space: nowrap;
}

.webinar-status--archived {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 60px;
  border: 1px solid #6e7080;
  background-color: var(--color-white);
  color: #6e7080;
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 14px;
  letter-spacing: -0.36px;
  text-transform: none;
  white-space: nowrap;
}

.webinar-status--unknown {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 60px;
  border: 1px solid var(--color-grey);
  background-color: var(--color-grey);
  color: var(--color-white);
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 14px;
  letter-spacing: -0.36px;
  text-transform: none;
  white-space: nowrap;
}

/* Meta karty list — Webinar | Baza wiedzy / Prowadzący / Data */
.card-list__meta {
  margin-top: var(--space-sm);
  font-size: 12px;
  line-height: var(--lh-caption);
  color: var(--color-black);
  letter-spacing: 0;
}

.card-list__date {
  color: var(--color-grey);
}

/* -------------------------------------------------------------------------
   11. Single post — pojedynczy wpis (artykuł, materiał, forum)
   ------------------------------------------------------------------------- */

/* Grafika artykułu — full-bleed prawej kolumny, pozioma */
.single-post__cover {
  margin: 0 calc(var(--content-padding-x) * -1) var(--space-xl);
  /* ujemny margines = wychodzi poza padding .site-content__main do krawędzi */
}

.single-post__cover img {
  display: block;
  width: 100%;
  height: 420px; /* pozioma, panoramiczna proporcja */
  object-fit: cover; /* kadruje bez zniekształceń */
}

/* Nagłówek wpisu */
.single-post__header {
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.single-post__title {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-normal);
  margin-bottom: var(--space-md);
}

.single-post__labels {
  margin-bottom: var(--space-sm);
}

.single-post__date {
  font-size: var(--fs-caption-2);
  color: var(--color-grey);
  letter-spacing: 0;
}

/* Treść wpisu */
.single-post__content {
  margin-bottom: var(--space-lg);
}

.single-post__content > * {
  margin-bottom: var(--space-md);
}

.single-post__content h2 {
  text-align: center;
  font-size: var(--fs-heading);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
}

.single-post__content h3 {
  font-size: var(--fs-h4);
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

.single-post__content p {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
}

.single-post__content strong {
  font-weight: 700;
}

.single-post__content a {
  color: var(--color-black);
  text-decoration: underline;
}

.single-post__content a:hover,
.single-post__content a:focus-visible {
  color: var(--color-black);
}

.single-post__content ul,
.single-post__content ol {
  padding-left: var(--space-md);
  margin-bottom: var(--space-md);
}

.single-post__content ul {
  list-style: disc;
}

.single-post__content ol {
  list-style: decimal;
}

.single-post__content li {
  margin-bottom: var(--space-xs);
}

.single-post__content blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
  font-style: italic;
  color: var(--color-grey);
}

.single-post__content img,
.single-post__content figure {
  margin: var(--space-md) 0;
}

.single-post__content figcaption {
  font-size: var(--fs-caption);
  color: var(--color-grey);
  text-align: center;
  margin-top: var(--space-xs);
}

/* Metadane (tematy, typy, tagi) */
.single-post__meta {
  margin-bottom: var(--space-lg);
  padding: var(--space-md) 0;
}

.single-post__meta-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xs);
  font-size: var(--fs-caption-2);
}

.single-post__meta-row:last-child {
  margin-bottom: 0;
}

.single-post__meta-label {
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0;
}

.single-post__meta-values a {
  color: var(--color-black);
  text-decoration: underline;
}

.single-post__meta-values a:hover,
.single-post__meta-values a:focus-visible {
  color: var(--color-primary);
}

/* Nawigacja poprzedni / następny */
.single-post__nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.single-post__nav-prev,
.single-post__nav-next {
  flex: 1;
  font-size: var(--fs-body);
}

.single-post__nav-next {
  text-align: right;
}

.single-post__nav a {
  color: var(--color-black);
  text-decoration: none;
  transition: color 150ms ease;
}

.single-post__nav a:hover,
.single-post__nav a:focus-visible {
  color: var(--color-primary);
}

/* Single Webinar — dodatkowe sekcje (prowadzący, CTA) */
.single-webinar__details {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.single-webinar__detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: var(--fs-body);
}

.single-webinar__detail-label {
  font-size: var(--fs-caption);
  font-weight: 700;
  color: var(--color-grey);
  letter-spacing: 0;
}

.single-webinar__detail-value {
  font-size: var(--fs-body);
  color: var(--color-black);
}

/* CTA — duży przycisk "Dołącz do webinaru" / "Obejrzyj nagranie" */
.single-webinar__cta {
  flex-shrink: 0;
}

.single-webinar__cta-btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-primary);
  color: var(--color-white) !important;
  text-decoration: none !important;
  font-size: var(--fs-body);
  font-weight: 700;
  letter-spacing: var(--ls-body);
  transition: opacity 150ms ease;
}

.single-webinar__cta-btn:hover,
.single-webinar__cta-btn:focus-visible {
  opacity: 0.85;
  color: var(--color-white) !important;
}

/* -------------------------------------------------------------------------
   12. Search results — brak wyników, sugestie
   ------------------------------------------------------------------------- */

.search-query {
  color: var(--color-primary);
}

.search-empty {
  padding: var(--space-md) 0;
}

.search-empty p {
  font-size: var(--fs-body);
  margin-bottom: var(--space-md);
}

.search-suggestions {
  list-style: disc;
  padding-left: var(--space-md);
  margin-bottom: var(--space-md);
}

.search-suggestions li {
  margin-bottom: var(--space-xs);
}

.search-suggestions a {
  color: var(--color-primary);
  text-decoration: underline;
}

.search-suggestions a:hover,
.search-suggestions a:focus-visible {
  color: var(--color-black);
}

/* -------------------------------------------------------------------------
   13. Error 404
   ------------------------------------------------------------------------- */

.error-404__header {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.error-404__title {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-md);
}

.error-404__lead {
  font-size: var(--fs-body);
  color: var(--color-grey);
}

.error-404__actions {
  margin-top: var(--space-lg);
}

.error-404__actions p {
  margin-bottom: var(--space-sm);
}

.error-404__suggestions {
  list-style: disc;
  padding-left: var(--space-md);
  margin-bottom: var(--space-lg);
}

.error-404__suggestions li {
  margin-bottom: var(--space-xs);
}

.error-404__suggestions a {
  color: var(--color-primary);
  text-decoration: underline;
}

.error-404__suggestions a:hover,
.error-404__suggestions a:focus-visible {
  color: var(--color-black);
}

.error-404__search {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.error-404__search p {
  margin-bottom: var(--space-sm);
}

/* -------------------------------------------------------------------------
   14. Blok File — natywny WP, ostylowany jak makieta
   ------------------------------------------------------------------------- */

/* Blok File — kontener */
.wp-block-file {
  display: flex !important;
  flex-wrap: wrap; /* przycisk schodzi pod nazwę, gdy brak miejsca */
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  margin: 0 !important;
}

/* Link z nazwą pliku — wyświetlamy jako tytuł */
.wp-block-file > a:not(.wp-block-file__button) {
  flex: 1;
  color: var(--color-black);
  text-decoration: none;
  font-size: var(--fs-h4);
  line-height: 1.2;
  letter-spacing: 0;
  transition: color 150ms ease;
}

.wp-block-file > a:not(.wp-block-file__button):hover,
.wp-block-file > a:not(.wp-block-file__button):focus-visible {
  color: var(--color-primary);
}
.wp-block-file > a:first-child {
  min-width: 0; /* pozwala zwęzić się poniżej długości tekstu */
  overflow-wrap: anywhere; /* łamie długą nazwę także w środku ciągu */
  word-break: break-word;
}
/* Pomarańczowy przycisk "Pobierz" */
.wp-block-file .wp-block-file__button {
  display: inline-block;
  flex-shrink: 0;
  padding: var(--space-xs) var(--space-md);
  background-color: var(--color-orange) !important;
  color: var(--color-white) !important;
  text-decoration: none !important;
  border-radius: 0 !important;
  border: none;
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  cursor: pointer;
  transition: opacity 150ms ease;
}

.wp-block-file .wp-block-file__button:hover,
.wp-block-file .wp-block-file__button:focus-visible {
  opacity: 0.85;
  color: var(--color-white) !important;
}

/* -------------------------------------------------------------------------
   15. Strona główna
   ------------------------------------------------------------------------- */

/* Hero „O inicjatywie" */
.home-hero {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-xl);
  max-width: 46rem;
  margin-inline: auto;
}

.home-hero__label {
  font-size: var(--fs-tag);
  text-transform: uppercase;
  letter-spacing: -0.3px;
  color: var(--color-black);
  margin-bottom: var(--space-lg);
}

.home-hero__title {
  font-size: var(--fs-heading);
  line-height: 100%;
  letter-spacing: -0.3px;
  text-transform: uppercase;
}

/* Wspólny nagłówek sekcji homepage (wycentrowany) */
.home-section {
  margin-bottom: var(--space-2xl);
}

.home-section__head {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.home-section__title {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.home-section__subtitle {
  font-size: var(--fs-label);
  line-height: var(--lh-caption);
  color: var(--color-grey);
}

/* Grid kategorii 2×2 */
.home-categories__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.home-category {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.home-category__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.home-category__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  transform-origin: center;
}

.home-category:hover .home-category__image,
.home-category:focus-visible .home-category__image {
  transform: scale(1.05);
}

/* Gradient overlay od dołu — jak w kartach archiwum */
.home-category__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0) 40%,
    rgba(0, 0, 0, 0.75) 100%
  );
  pointer-events: none;
}

/* Pill etykiety — wyśrodkowany w dolnej części */
.home-category__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  border-radius: 6px;
}
/* -------------------------------------------------------------------------
   16. Formularz kontaktowy (Contact Form 7)
   ------------------------------------------------------------------------- */

.wpcf7 {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}
.cf7-field {
  margin-bottom: var(--space-md);
}

/* Pola tekstowe — tylko dolna linia cobalt, jak w makiecie */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--color-primary);
  background-color: var(--color-white);
  padding: 12px 14px;
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 18px;
  letter-spacing: var(--ls-body);
  color: var(--color-black);
  border-radius: 0px;
}

.wpcf7 textarea {
  min-height: 120px;
  resize: vertical;
  border-radius: 0px;
}

/* Placeholder — ciemniejszy niż w makiecie, żeby przeszedł kontrast WCAG */
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
  color: var(--color-grey);
  opacity: 1;
}

/* Focus — wyraźny, dla dostępności klawiaturowej */
.wpcf7 input:focus,
.wpcf7 textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Zgoda RODO */
.cf7-field--consent {
  display: flex;
  align-items: flex-start;
  font-size: 12px;
  gap: var(--space-xs);
  font-size: var(--fs-caption);
  line-height: 1.4;
  color: var(--color-grey);
  margin-top: var(--space-md);
}

.cf7-field--consent .wpcf7-list-item {
  margin: 0;
  font-size: 14px;
}

.cf7-field--consent a {
  color: var(--color-primary);
  text-decoration: underline;
}

.cf7-field--consent input[type="checkbox"] {
  accent-color: var(--color-primary);
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Nota administratora */
.cf7-admin-note {
  font-size: 14px !important;
  line-height: 1.4;
  color: var(--color-grey);
  margin: var(--space-sm) 0 var(--space-md);
}

/* Przycisk wyślij — pełna szerokość, cobalt */
.wpcf7 .cf7-submit input[type="submit"] {
  width: 100%;
  height: 40px;
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 16px;
  letter-spacing: var(--ls-body);
  cursor: pointer;
  transition: opacity 150ms ease;
}

.wpcf7 .cf7-submit input[type="submit"]:hover,
.wpcf7 .cf7-submit input[type="submit"]:focus-visible {
  opacity: 0.9;
}

.wpcf7 .cf7-submit input[type="submit"]:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

/* Komunikaty walidacji CF7 — dostępne kolory */
.wpcf7 .wpcf7-not-valid-tip {
  color: #b00020;
  font-size: var(--fs-caption);
  margin-top: var(--space-xs);
}

.wpcf7-response-output {
  margin: var(--space-md) 0 0 !important;
  padding: var(--space-sm) var(--space-md) !important;
  font-size: var(--fs-caption-2);
}

/* -------------------------------------------------------------------------
   17. Pasek chipów tematów (archiwum taksonomii temat)
   ------------------------------------------------------------------------- */
.topic-chips {
  margin-bottom: var(--space-lg);
}

.topic-chips__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.topic-chips__item {
  margin: 0;
}

/* Chip nieaktywny — outline pomarańczowy */
.topic-chip {
  background-color: transparent;
  color: var(--color-orange);
  border: 1px solid var(--color-orange);
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.topic-chip:link,
.topic-chip:visited {
  color: var(--color-orange);
}

/* Hover — delikatne wypełnienie */
.topic-chip:hover,
.topic-chip:focus-visible {
  background-color: var(--color-orange);
  color: var(--color-white);
}

.topic-chip:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

/* Chip aktywny — wypełniony pomarańczowy */
.topic-chip.is-active,
.topic-chip.is-active:link,
.topic-chip.is-active:visited {
  background-color: var(--color-orange);
  color: var(--color-white);
}

/* -------------------------------------------------------------------------
   Pattern: Sekcja z labelką (strona O projekcie itp.)
   ------------------------------------------------------------------------- */

.section-label {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 50px;
  margin-bottom: var(--space-lg);
  align-items: start;
}

/* Pill etykiety — pomarańczowy, dopasowany do tekstu */
.section-label__pill {
  display: inline-block;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 5px;
  background-color: var(--color-orange);
  color: var(--color-white);
  font-size: 14px;
  line-height: 14px;
  letter-spacing: -0.36px;
  white-space: nowrap;
  margin: 0 !important;
}

/* Treść — bez górnego marginesu pierwszego elementu, żeby równała z pillem */

@media (max-width: 600px) {
  .section-label {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
}

/* -------------------------------------------------------------------------
   Pattern: Cele projektu — numerowane sekcje z zygzakiem
   ------------------------------------------------------------------------- */
.numbered-section {
  max-width: 62%;
  margin-bottom: var(--space-xl);
}

.numbered-section:nth-of-type(even) {
  margin-right: auto;
  margin-left: 0;
  text-align: left;
}

.numbered-section:nth-of-type(odd) {
  margin-left: auto;
  margin-right: 0;
  text-align: left;
}
/* Numer #1 — mały, szary */
.numbered-section > p {
  font-size: var(--fs-caption);
  color: var(--color-grey);
  letter-spacing: 0;
  margin-bottom: var(--space-xs);
}

/* Tytuł celu — duży uppercase */
.numbered-section > h3 {
  font-size: var(--fs-heading);
  line-height: 1.15;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  margin: 0;
}
/* Sama etykieta sekcji — nagłówek nad blokiem treści */
.section-pill {
  display: block;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 5px;
  background-color: var(--color-orange);
  color: var(--color-white);
  font-size: 14px;
  line-height: 14px;
  letter-spacing: -0.36px;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* -------------------------------------------------------------------------
   Pattern: Harmonogram (timeline)
   ------------------------------------------------------------------------- */
.timeline-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  align-items: start;
}

/* Lewa kolumna — okres + faza */
.timeline-row__period {
  font-size: var(--fs-tag) !important;
    font-weight: 300;
  text-transform: lowercase;
  letter-spacing: 0;
  margin: 0 0 var(--space-xs);
}

.timeline-row__phase {
  font-size: var(--fs-tag) !important;
 text-transform: none;
  color: var(--color-grey);
  letter-spacing: 0;
  margin: 0;
}

/* Prawa kolumna — opis */
.timeline-row__body > * {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

.timeline-row__body > *:last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .timeline-row {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
}

:root :where(.is-layout-flow) > * {
  margin-block-start: 0px;
}

/* Autofill w polu wyszukiwania w sidebarze — kolor tła i tekstu jak w makiecie, bez przebłysku błękitu */

.site-sidebar__search input:-webkit-autofill,
.site-sidebar__search input:-webkit-autofill:hover,
.site-sidebar__search input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--color-primary) inset;
  box-shadow: 0 0 0 1000px var(--color-primary) inset;
  -webkit-text-fill-color: var(--color-white);
  caret-color: var(--color-white);
  transition: background-color 9999s ease-in-out 0s; /* blokuje przebłysk błękitu */
}
/* -------------------------------------------------------------------------
   8. Responsywność — mobile (<768px) i tablet
   ------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .site-sidebar__menu a {
    font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  }
}

@media (max-width: 979.98px) {
  /* Layout jednokolumnowy */
  .site-wrapper {
    grid-template-columns: 1fr !important;
  }
  .site-content__grants {
    position: static !important;
    padding: var(--space-sm) var(--space-md);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
  }

  .site-content__grants-img {
    max-width: 100%;
    height: auto;
  }
  .home-section__title,
  .home-hero__title {
    overflow-wrap: break-word;
    max-width: 100%;
  }
  .card-list__item {
  width: 96%;
}
.category-materialy-edukacyjne .single-post__content h2 {
    
    margin-top: var(--space-lg);
    

}
  /* === SIDEBAR ZAMKNIĘTY = przezroczysty pasek === */
  .site-sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: auto;
    min-height: 0;
    background-color: transparent;
  }

  .site-sidebar__inner {
    padding: 0;
    overflow: visible;
    min-height: 0;
    height: auto;
  }

  /* Top-bar: toolbar (lewo) + hamburger (prawo) */
  .site-sidebar__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: 0;
  }

  /* Logo i breadcrumb schowane na mobile */
  .site-sidebar__logo,
  .site-sidebar__breadcrumb-sep,
  .site-sidebar__breadcrumb-link,
  .site-sidebar__breadcrumb-current {
    display: none;
  }

  /* Toolbar dostępności — cobaltowy pill */
  .site-sidebar__a11y {
    display: flex;
    width: 100%;
    align-items: center;
    gap: var(--space-xs);
    background-color: var(--color-primary);
    border-radius: 99px;
    padding: 8px;
    justify-content: start;
  }

  /* Hamburger — cobaltowe koło, nie rozjeżdża się */
  .site-sidebar__menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: var(--color-white);
    flex-shrink: 0;
  }

  .hamburger {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    width: 18px;
  }

  .hamburger span {
    display: block;
    height: 2px;
    background-color: currentColor;
    transition:
      transform 200ms ease,
      opacity 200ms ease;
  }

  /* Aktywny hamburger = X */
  .site-sidebar__menu-toggle[aria-expanded="true"]
    .hamburger
    span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .site-sidebar__menu-toggle[aria-expanded="true"]
    .hamburger
    span:nth-child(2) {
    opacity: 0;
  }
  .site-sidebar__menu-toggle[aria-expanded="true"]
    .hamburger
    span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* Elementy menu — ukryte gdy zamknięte */
  .site-sidebar__tagline,
  .site-sidebar__caption,
  .site-sidebar__nav,
  .site-sidebar__search {
    display: none;
  }

  .site-content__main {
    padding: var(--space-md);
  }

  /* === SIDEBAR OTWARTY = pełnoekranowy cobaltowy overlay === */
  .site-wrapper.is-menu-open .site-sidebar {
    position: fixed;
    inset: 0;
    width: auto;
    height: 100vh;
    min-height: 100dvh;
    margin: 0;
    border-radius: 0;
    z-index: 200;
    overflow-y: auto;
    background-color: var(--color-primary);
  }

  .site-wrapper.is-menu-open .site-sidebar__inner {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  /* W otwartym menu toolbar i hamburger tracą własne tło (są na cobalcie) */
  .site-wrapper.is-menu-open .site-sidebar__a11y {
    background-color: transparent;
    padding: 0;
  }
  .site-wrapper.is-menu-open .site-sidebar__menu-toggle {
    background-color: transparent;
  }

  /* Menu i search widoczne, menu wypełnia środek, search na dole */
  .site-wrapper.is-menu-open .site-sidebar__nav {
    display: block;
    margin-top: var(--space-lg);
    flex: 1;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  .site-wrapper.is-menu-open .site-sidebar__search {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    display: block;
    padding-top: var(--space-md);
  }
  .site-wrapper.is-menu-open .site-sidebar__menu a {
    font-size: clamp(2rem, 8vw, 2.75rem);
    line-height: 1.1;
  }

  /* Tagline i caption w otwartym menu — ukryte (jak w makiecie) */
  .site-wrapper.is-menu-open .site-sidebar__tagline,
  .site-wrapper.is-menu-open .site-sidebar__caption {
    display: none;
  }
  /* Mobile — reset sklejonego focus TYLKO dla nieaktywnych przycisków */
  .a11y-btn[aria-pressed="false"]:focus:not(:focus-visible) {
    background-color: transparent;
    color: var(--color-white);
  }
  html.a11y-contrast .a11y-btn[aria-pressed="false"]:focus:not(:focus-visible) {
    background-color: transparent;
    color: #ffff00;
  }
  /* === Kontrast na mobile — overlay menu === */
  html.a11y-contrast .site-wrapper.is-menu-open .site-sidebar {
    background-color: #000 !important;
  }

  /* Toolbar i hamburger pill w kontraście (zamknięty stan) */
  html.a11y-contrast .site-sidebar__a11y {
    background-color: #000 !important;
    border: 1px solid #ffff00;
  }
  html.a11y-contrast .site-sidebar__menu-toggle {
    background-color: #000 !important;
    border: 1px solid #ffff00 !important;
    color: #ffff00;
  }
  .site-sidebar__brand {
    display: none;
  }
  /* Stopka mobile */
  .site-footer {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  /* Powiększony tekst nie wypycha layoutu w bok */

  .single-post__title {
    font-size: clamp(1.5rem, 7vw, 2rem);
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
  }
  .site-content__main,
  .single-post__content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
  }
  /* Karty archiwum — z 3 kolumn na 1, większe odstępy */
  .card-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .single-post__content p,
  .single-post__content a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
