.wl-site-main {
  min-height: 60vh;
  padding-top: var(--header-height);
}

/* Kontener - gutter przez padding: max(30px, (100% - max-width) / 2) */
.wl-container {
  padding-inline: max(var(--space-page-fluid), calc((100% - var(--container-max)) / 2));
}

.wl-container--wide {
  padding-inline: max(var(--space-page), calc((100% - var(--container-hero)) / 2));
}

.wl-container--narrow {
  padding-inline: max(var(--space-page), calc((100% - var(--container-narrow)) / 2));
}

.wl-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-page);
  background: transparent;
  transition: padding 0.25s ease, background 0.25s ease, transform 0.3s ease;
}

.wl-header.is-sticky {
  position: fixed;
}

.wl-header.is-hidden {
  transform: translateY(-100%);
}

.wl-header.is-scrolled {
  padding-top: 0;
  padding-bottom: 0;
  background: var(--color-bg);
}

.wl-header__inner {
  display: flex;
  align-items: center;
  gap: 50px;
  padding: var(--space-page);
}

@media (max-width: 768px) {
  :root {
    --header-height: 95px;
  }

  .wl-header {
    padding: 15px 20px;
  }

  .wl-header__inner {
    padding: 0;
  }
}

.wl-header__brand {
  display: inline-flex;
}

.wl-header__brand img {
  height: 65px;
  width: auto;
}

.wl-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.wl-menu {
  display: flex;
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

.wl-menu a {
  text-decoration: none;
  font-size: var(--fs-base);
  color: var(--color-primary);
}

.wl-menu .current-menu-item > a,
.wl-menu a:hover {
  color: var(--color-accent);
}

.wl-header__meta {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-left: auto;
}

/* Drawer (na desktop dzieci są bezpośrednio w flexie, na mobile slide-in) */
.wl-header__drawer {
  display: contents;
}

.wl-header__close,
.wl-header__backdrop {
  display: none;
}

.wl-header__email,
.wl-header__lang {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--fs-base);
  color: var(--color-primary);
  text-decoration: none;
}

.wl-header__email-icon img {
  width: 34px;
  height: 34px;
}

.wl-header__lang-arrow {
  width: 14px;
  height: 8px;
}

.wl-lang-switcher {
  position: relative;
}

.wl-lang-switcher__current {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: var(--fs-base);
  font-family: inherit;
  color: var(--color-primary);
}

.wl-lang-switcher__list {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 150px;
  margin: var(--space-xs) 0 0;
  padding: var(--space-2xs);
  list-style: none;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(12, 54, 92, 0.14);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 20;
}

.wl-lang-switcher.is-open .wl-lang-switcher__list {
  opacity: 1;
  visibility: visible;
}

.wl-lang-switcher.is-open .wl-header__lang-arrow {
  transform: rotate(180deg);
}

.wl-header__lang-arrow {
  transition: transform 0.2s ease;
}

.wl-lang-switcher__item a {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 8px 10px;
  font-size: var(--fs-base);
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
}

.wl-lang-switcher__item a:hover {
  color: var(--color-accent);
  background: var(--color-surface-soft);
}

/* Strony z entry headerem (ciemny nagłówek navy): biała nawigacja u góry */
@media (min-width: 1025px) {
  .has-entry-header .wl-header:not(.is-scrolled) .wl-menu a,
  .has-entry-header .wl-header:not(.is-scrolled) .wl-menu a:hover,
  .has-entry-header .wl-header:not(.is-scrolled) .wl-menu .current-menu-item > a {
    color: var(--color-white);
  }

  .has-entry-header .wl-header:not(.is-scrolled) .wl-header__email,
  .has-entry-header .wl-header:not(.is-scrolled) .wl-header__lang,
  .has-entry-header .wl-header:not(.is-scrolled) .wl-lang-switcher__current {
    color: var(--color-white);
  }

  .has-entry-header .wl-header:not(.is-scrolled) .wl-header__email-icon img,
  .has-entry-header .wl-header:not(.is-scrolled) .wl-header__lang-arrow {
    filter: brightness(0) invert(1);
  }

  .has-entry-header .wl-header:not(.is-scrolled) .wl-header__meta .wl-btn__body {
    background: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
  }
}

.wl-lang-switcher__flag {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  flex: 0 0 auto;
}

.wl-footer {
  background: var(--color-bg-dark);
  color: var(--color-text-invert);
  padding: 0 0 var(--space-sm);
}

.wl-footer__logos {
  overflow: hidden;
  background: var(--color-bg);
  padding: var(--space-md) 0;
}

.wl-footer__logos-track {
  display: flex;
  width: max-content;
  animation: wl-marquee var(--marquee-duration) linear infinite;
}

.wl-footer__logos-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-right: var(--space-sm);
  flex: 0 0 auto;
}

.wl-footer__logo {
  flex: 0 0 auto;
}

.wl-footer__logo img {
  height: 72px;
  width: auto;
}

@keyframes wl-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .wl-footer__logos-track {
    animation: none;
  }
}

.wl-footer__grid {
  display: grid;
  grid-template-columns: 384px repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  align-items: start;
}

/*
 * W tym miejscu jest logotyp marki — dlatego bez zaokrąglenia i bez przycinania
 * (wcześniej była tu grafika w zaokrąglonym „kafelku").
 * `width: auto` + `max-width: 100%`: logo renderuje się w swoim naturalnym
 * rozmiarze (bez rozmycia od powiększania) i skaluje się w dół na mobile.
 */
.wl-footer__image img {
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
}

.wl-footer__contact a {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.wl-footer__contact img {
  flex: 0 0 auto;
}

.wl-footer__col-title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  line-height: var(--lh-heading);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: var(--space-2xs);
  margin-bottom: var(--space-sm);
}

.wl-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-xs);
}

.wl-footer__links a {
  color: var(--color-text-invert);
  text-decoration: none;
  opacity: 0.85;
}

.wl-footer__links a:hover {
  opacity: 1;
}

.wl-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: var(--space-sm);
}

@media (max-width: 1024px) {
  .wl-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wl-footer__image {
    grid-column: 1 / -1;
    max-width: 384px;
  }
}

@media (max-width: 768px) {
  .wl-footer__logos {
    padding: var(--space-sm) 0;
  }

  .wl-footer__logo img {
    height: 48px;
  }

  .wl-footer__grid {
    grid-template-columns: 1fr;
  }

  .wl-footer__image {
    grid-column: auto;
    max-width: none;
  }

  .wl-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

.wl-single-post__header,
.wl-single-post__body,
.wl-single-post__author {
  padding-top: var(--space-xl);
}

.wl-single-post__header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: var(--space-xl);
  padding: calc(var(--space-xl) * 2) var(--space-xl) var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--color-text-rgb), 0.16);
  background: linear-gradient(145deg, #ffffff 0%, #efefef 100%);
}

.wl-single-post__header > * {
  position: relative;
  z-index: 1;
}

.wl-single-post__header--with-media {
  color: var(--color-white);
}

.wl-single-post__header--with-media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--wl-post-cover);
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.15) brightness(0.45);
  transform: scale(1.04);
}

.wl-single-post__header--with-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.wl-single-post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  color: var(--color-muted);
}

.wl-single-post__meta > * {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--color-text-rgb), 0.14);
  background: rgba(var(--color-text-rgb), 0.04);
  line-height: 1.2;
}

.wl-single-post__header--with-media .wl-single-post__meta {
  color: rgba(255, 255, 255, 0.92);
}

.wl-single-post__header--with-media .wl-single-post__meta > * {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
  .wl-single-post__header {
    margin-top: var(--space-lg);
    padding: calc(var(--space-lg) * 2) var(--space-lg) var(--space-lg);
  }
}

.wl-single-post__body {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: start;
}

.post-toc {
  margin-bottom: 0;
  padding: var(--space-lg);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  position: sticky;
  top: calc(var(--space-xl) + 72px);
}

.post-toc__title {
  margin-bottom: var(--space-md);
  font-size: var(--fs-h3);
}

.post-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.post-toc__item a {
  display: flex;
  gap: var(--space-sm);
  align-items: start;
  text-decoration: none;
}

.post-toc__number {
  color: var(--color-accent);
  font-weight: 700;
  min-width: 2.8ch;
}

.post-toc__text {
  color: var(--color-text);
}

.post-toc__item--h3 {
  padding-left: var(--space-md);
  font-size: 0.95em;
}

@media (max-width: 1024px) {
  .wl-single-post__body {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .post-toc {
    position: static;
  }
}

/* ===== Nawigacja mobilna (drawer) ===== */
.wl-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.wl-header__toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.wl-header:not(.is-scrolled) .wl-header__toggle span {
  background: var(--color-white);
}

body.is-menu-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .wl-header__inner {
    gap: 0;
  }

  .wl-header__toggle {
    display: flex;
    margin-left: auto;
  }

  .wl-header__drawer {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, 88vw);
    z-index: 1200;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm);
    background: var(--color-bg);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .wl-header.is-open .wl-header__drawer {
    transform: translateX(0);
  }

  .wl-header__close {
    display: flex;
    align-self: flex-end;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    font-size: 36px;
    line-height: 1;
    color: var(--color-primary);
    cursor: pointer;
  }

  .wl-header__nav {
    display: flex;
    margin-top: var(--space-sm);
  }

  .wl-header__nav,
  .wl-header__meta {
    flex-basis: auto;
  }

  .wl-header__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-left: 0;
    margin-top: var(--space-lg);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-line);
  }

  .wl-menu {
    flex-direction: column;
    gap: var(--space-2xs);
  }

  .wl-menu a {
    font-size: var(--fs-h3);
  }

  .wl-header__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .wl-header.is-open .wl-header__backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===== Entry header (nagłówek strony, gdy brak hero na pierwszym miejscu) ===== */
.wl-entry-header {
  padding: var(--space-page);
  margin-top: calc(-1 * var(--header-height));
}

.wl-entry-header__inner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-sm);
  padding: calc(var(--header-height) + var(--space-md)) var(--space-sm) var(--space-lg);
  border-radius: var(--radius-hero-top) var(--radius-hero-top) var(--radius-hero-bottom) var(--radius-hero-bottom);
  background: var(--color-navy);
  color: var(--color-text-invert);
}

.wl-entry-header__breadcrumbs {
  font-size: var(--fs-badge);
  color: var(--color-eyebrow-invert);
}

.wl-entry-header__breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.wl-entry-header__breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}

.wl-entry-header__breadcrumbs li + li::before {
  content: '/';
  color: rgba(255, 255, 255, 0.5);
}

.wl-entry-header__breadcrumbs a {
  color: inherit;
  text-decoration: none;
  opacity: 0.8;
}

.wl-entry-header__breadcrumbs a:hover {
  opacity: 1;
}

.wl-entry-header__title {
  margin: 0;
  color: var(--color-text-invert);
}

.wl-entry-header__desc {
  max-width: 800px;
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}

.wl-entry-header .wl-btn-row {
  justify-content: center;
}

@media (max-width: 768px) {
  .wl-entry-header {
    padding: 0;
  }

  .wl-entry-header__inner {
    border-radius: 0;
    padding: calc(var(--header-height) + var(--space-md)) var(--space-sm) var(--space-lg);
  }

  .wl-entry-header .wl-btn-row {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  .wl-entry-header .wl-btn {
    width: 100%;
  }

  .wl-entry-header .wl-btn__label {
    white-space: normal;
  }
}
