/* Wspólny nagłówek i odstęp kotwic. */
:root {
  --header-logo-width: clamp(145px, 23vw, 300px);
  --header-min-height: 76px;
  --header-padding: 8px;
  --header-logo-ratio: calc(724 / 2172);
  --header-offset: calc(
    max(
        var(--header-min-height),
        var(--header-logo-width) * var(--header-logo-ratio) + 2 *
          var(--header-padding)
      ) +
      12px + var(--extra-header-space, 0px)
  );
  scroll-padding-top: var(--header-offset);
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  isolation: isolate;
  background-color: transparent;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* Półprzezroczyste przyciemnienie zachowuje czytelność na jasnych zdjęciach. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    rgb(0 0 0 / 64%),
    rgb(0 0 0 / 55%) 70%,
    transparent
  );
  transition: opacity 0.3s ease;
}

.site-header.is-scrolled {
  background-color: #fff;
  box-shadow: 0 2px 12px rgb(0 0 0 / 12%);
}

.site-header.is-scrolled::before {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header::before {
    transition: none;
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 28px);
  min-height: var(--header-min-height);
  padding-block: var(--header-padding);
}

.brand {
  display: block;
  width: var(--header-logo-width);
  flex-shrink: 0;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

/* Follow the visible pixels of each transparent logo, including the dark wordmark. */
.site-header:not(.is-scrolled) .brand img {
  filter:
    drop-shadow(0 0 1px #fff)
    drop-shadow(0 0 1.5px #fff)
    drop-shadow(0 0 2px rgb(255 255 255 / 90%));
}

.site-header a {
  text-decoration: none;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vw, 16px);
  font-size: clamp(12px, 1.05vw, 16px);
  font-weight: 700;
  white-space: nowrap;
}

.desktop-nav a {
  padding: 9px 7px;
  border-radius: 999px;
  color: #0f172a;
}

.desktop-nav a:hover {
  text-decoration: underline;
}

.desktop-nav .nav-start {
  padding-inline: 16px;
  color: #fff;
  background: var(--blue, #006bd6);
}

.site-header:not(.is-scrolled) .desktop-nav a:not(.nav-start),
.site-header:not(.is-scrolled) .mobile-menu summary {
  color: #fff;
  text-shadow: 0 1px 4px #000;
}

.site-header .button-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px clamp(10px, 2vw, 22px);
  border: 2px solid var(--blue, #006af5);
  border-radius: 999px;
  color: var(--blue-dark, #0053c4);
  background: transparent;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.site-header.is-scrolled .button-contact:hover {
  background: var(--soft, #f3f7fc);
}

.site-header:not(.is-scrolled) .button-contact {
  border-color: #fff;
  color: #fff;
  text-shadow: 0 1px 4px #000;
}

.site-header .button-contact:hover {
  text-decoration: underline;
}

.site-header .button-contact svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.mobile-menu {
  display: none;
}

.menu-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1000px) {
  .site-header:not(.site-header--dish) .header-inner > .button-contact {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-logo-width: clamp(108px, 36vw, 156px);
    --header-min-height: 72px;
    --header-padding: 6px;
    --header-logo-ratio: calc(897 / 1752);
  }

  .site-header:not(.site-header--home) .brand {
    width: calc(var(--header-logo-width) - 4px);
  }

  .site-header .header-inner {
    width: calc(100% - 32px);
    margin-inline: auto;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .mobile-menu summary {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 27px;
    list-style: none;
    cursor: pointer;
  }

  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu nav {
    position: absolute;
    top: 100%;
    right: 16px;
    width: min(240px, calc(100% - 32px));
    max-height: calc(100vh - var(--header-offset));
    max-height: calc(100dvh - var(--header-offset));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 8px;
    border: 1px solid var(--line, #dbe5f0);
    border-radius: 12px;
    color: #0f172a;
    background: #fff;
    box-shadow: 0 8px 24px rgb(7 21 45 / 15%);
  }

  .mobile-menu nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    color: inherit;
    border-radius: 8px;
    font-weight: 700;
  }

  .mobile-menu nav a:hover {
    background: var(--soft, #f3f7fc);
  }
}

/* Wspólne elementy dostępności i ikony SVG. */
.svg-sprite {
  position: absolute;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 30;
  padding: 10px 14px;
  color: #0f172a;
  background: #fff;
  border: 2px solid currentColor;
  border-radius: 8px;
  transform: translateY(calc(-100% - 12px));
}

.skip-link:focus {
  transform: none;
}

:where(a, button, summary):focus-visible {
  outline: 3px solid #a94700;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px white;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
