:root {
  /* Paleta KIW ZHP — bez logotypów i znaków organizacji */
  --zhp-green: #87a428;
  --zhp-green-light: #afca0b;
  --zhp-green-dark: #587d18;
  --zhp-white: #ffffff;
  --zhp-yellow: #f8c409;
  --zhp-yellow-light: #fbcd44;
  --zhp-yellow-dark: #f6a11a;
  --zhp-scout-purple: #5d2f88;
  --zhp-scout-purple-light: #80539b;
  --zhp-scout-purple-dark: #3f1457;
  --zhp-navy: #252e78;
  --zhp-navy-light: #194093;
  --zhp-navy-dark: #232740;
  --zhp-red: #e30613;
  --zhp-red-light: #e94f2d;
  --zhp-red-dark: #9b1006;
  --zhp-orange: #ef7d00;
  --zhp-orange-light: #f39200;
  --zhp-orange-dark: #e15c11;
  --zhp-blue: #26b4e6;
  --zhp-blue-light: #94d3f1;
  --zhp-blue-dark: #0083ac;
  --zhp-brown: #a3521f;
  --zhp-brown-light: #c7833f;
  --zhp-brown-dark: #603519;
  --zhp-magenta: #8a0e68;
  --zhp-pink: #e58795;
  --zhp-gray-light: #cfd3d7;
  --zhp-gray: #a6adb3;
  --zhp-gray-dark: #717d85;
  --zhp-black: #000000;

  --zhp-ink: #172013;
  --zhp-ink-muted: #53604d;
  --zhp-surface: #ffffff;
  --zhp-surface-soft: #f3f5f0;
  --zhp-surface-warm: #faf8ef;
  --zhp-border: rgba(23, 32, 19, 0.13);
  --zhp-shadow: 0 1.5rem 4.5rem rgba(35, 39, 64, 0.14);
  --zhp-shadow-soft: 0 0.75rem 2.5rem rgba(35, 39, 64, 0.08);
  --zhp-shadow-md: 0 1rem 3rem rgba(35, 39, 64, 0.12);
  --zhp-text-muted: var(--zhp-ink-muted);

  /* KIW wskazuje Museo Sans. Paczka nie dystrybuuje plików fontu. */
  --zhp-font-display: "Museo Sans", "MuseoSans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --zhp-font-body: "Museo Sans", "MuseoSans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --zhp-font-print: "Museo", Georgia, serif;

  --zhp-content: 80rem;
  --zhp-content-wide: 100rem;
  --zhp-content-narrow: 52rem;
  --zhp-gutter: clamp(1rem, 3.5vw, 3rem);
  --zhp-space-2xs: 0.375rem;
  --zhp-space-xs: clamp(0.5rem, 0.8vw, 0.75rem);
  --zhp-space-sm: clamp(0.75rem, 1.3vw, 1.25rem);
  --zhp-space-md: clamp(1.25rem, 2.2vw, 2rem);
  --zhp-space-lg: clamp(2rem, 4.2vw, 4rem);
  --zhp-space-xl: clamp(3.25rem, 7vw, 7.25rem);
  --zhp-radius-sm: clamp(0.75rem, 1vw, 1rem);
  --zhp-radius-md: clamp(1rem, 1.8vw, 1.6rem);
  --zhp-radius-lg: clamp(1.25rem, 2.8vw, 2.5rem);
  --zhp-radius-xl: clamp(1.5rem, 4vw, 3.75rem);
  --zhp-transition: 220ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

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

body.has-zhp-design-system {
  color: var(--zhp-ink);
  font-family: var(--zhp-font-body);
  font-size: clamp(1rem, 0.18vw + 0.96rem, 1.08rem);
  font-weight: 400;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.has-zhp-design-system *,
.has-zhp-design-system *::before,
.has-zhp-design-system *::after {
  box-sizing: border-box;
}

.has-zhp-design-system h1,
.has-zhp-design-system h2,
.has-zhp-design-system h3,
.has-zhp-design-system h4,
.has-zhp-design-system h5,
.has-zhp-design-system h6 {
  font-family: var(--zhp-font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.has-zhp-design-system p,
.has-zhp-design-system li {
  line-height: 1.62;
}

.has-zhp-design-system img,
.has-zhp-design-system video,
.has-zhp-design-system iframe {
  display: block;
  max-width: 100%;
}

.has-zhp-design-system button,
.has-zhp-design-system input,
.has-zhp-design-system select,
.has-zhp-design-system textarea {
  font: inherit;
}

.has-zhp-design-system :focus-visible {
  outline: 0.2rem solid var(--zhp-yellow);
  outline-offset: 0.2rem;
}

.zhp-component {
  --theme-bg: var(--zhp-surface);
  --theme-text: var(--zhp-ink);
  --theme-muted: var(--zhp-ink-muted);
  --theme-accent: var(--zhp-green-dark);
  --theme-accent-contrast: var(--zhp-white);
  background: var(--theme-bg);
  color: var(--theme-text);
  container-type: inline-size;
  display: block;
  isolation: isolate;
  min-width: 0;
  overflow: clip;
  position: relative;
  width: 100%;
}

.zhp-component > * { min-width: 0; }

.zhp-component[data-theme="soft"] { --theme-bg: var(--zhp-surface-soft); }

.zhp-component[data-theme="green"] {
  --theme-bg: var(--zhp-green);
  --theme-text: var(--zhp-white);
  --theme-muted: rgba(255, 255, 255, 0.86);
  --theme-accent: var(--zhp-yellow);
  --theme-accent-contrast: var(--zhp-ink);
}

.zhp-component[data-theme="darkGreen"] {
  --theme-bg: var(--zhp-green-dark);
  --theme-text: var(--zhp-white);
  --theme-muted: rgba(255, 255, 255, 0.84);
  --theme-accent: var(--zhp-yellow);
  --theme-accent-contrast: var(--zhp-ink);
}

.zhp-component[data-theme="navy"] {
  --theme-bg: var(--zhp-navy-dark);
  --theme-text: var(--zhp-white);
  --theme-muted: rgba(255, 255, 255, 0.84);
  --theme-accent: var(--zhp-yellow);
  --theme-accent-contrast: var(--zhp-ink);
}

.zhp-component[data-theme="yellow"] {
  --theme-bg: var(--zhp-yellow);
  --theme-text: var(--zhp-ink);
  --theme-muted: rgba(23, 32, 19, 0.76);
  --theme-accent: var(--zhp-green-dark);
  --theme-accent-contrast: var(--zhp-white);
}

.zhp-component[data-spacing="default"] { padding-block: var(--zhp-space-xl); }
.zhp-component[data-spacing="compact"] { padding-block: var(--zhp-space-lg); }
.zhp-component[data-spacing="none"] { padding-block: 0; }

.zhp-container {
  margin-inline: auto;
  max-width: var(--zhp-content);
  padding-inline: var(--zhp-gutter);
  width: 100%;
}

.zhp-container--wide { max-width: var(--zhp-content-wide); }
.zhp-container--narrow { max-width: var(--zhp-content-narrow); }

.zhp-eyebrow {
  color: var(--theme-accent);
  font-size: clamp(0.76rem, 0.4vw + 0.68rem, 0.88rem);
  font-weight: 800;
  letter-spacing: 0.075em;
  line-height: 1.3;
  margin: 0 0 var(--zhp-space-sm);
  text-transform: uppercase;
}

.zhp-title {
  font-size: clamp(2.35rem, 5.8vw, 6.3rem);
  letter-spacing: -0.045em;
  line-height: 0.96;
  margin: 0;
  max-width: 17ch;
  text-transform: none;
}

.zhp-title--medium {
  font-size: clamp(2rem, 4.3vw, 4.65rem);
  max-width: 18ch;
}

.zhp-title--small {
  font-size: clamp(1.4rem, 2.4vw, 2.55rem);
  line-height: 1.02;
}

.zhp-lead {
  color: var(--theme-muted);
  font-size: clamp(1.05rem, 0.7vw + 0.92rem, 1.35rem);
  line-height: 1.55;
  margin: var(--zhp-space-md) 0 0;
  max-width: 45rem;
}

.zhp-richtext {
  color: var(--theme-muted);
  overflow-wrap: anywhere;
}

.zhp-richtext > :first-child { margin-top: 0; }
.zhp-richtext > :last-child { margin-bottom: 0; }
.zhp-richtext a { color: currentColor; font-weight: 700; text-underline-offset: 0.18em; }

.zhp-actions,
.zhp-buttons {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--zhp-space-md);
}

.zhp-button {
  align-items: center;
  border: 0.1rem solid transparent;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-family: var(--zhp-font-display);
  font-size: clamp(0.9rem, 0.2vw + 0.86rem, 1rem);
  font-weight: 700;
  gap: 0.5rem;
  justify-content: center;
  line-height: 1.15;
  min-height: 3.15rem;
  padding: 0.8rem 1.35rem;
  text-align: center;
  text-decoration: none;
  transition: transform var(--zhp-transition), box-shadow var(--zhp-transition), background var(--zhp-transition);
}

.zhp-button:hover { transform: translateY(-0.14rem); }
.zhp-button--primary { background: var(--theme-accent); color: var(--theme-accent-contrast); }
.zhp-button--primary:hover { box-shadow: 0 0.75rem 2rem color-mix(in srgb, var(--theme-accent) 34%, transparent); }
.zhp-button--secondary { border-color: currentColor; color: var(--theme-text); }
.zhp-button--text { color: var(--theme-text); min-height: auto; padding-inline: 0; }

.zhp-card {
  background: color-mix(in srgb, var(--theme-bg) 94%, var(--theme-text) 6%);
  border: 1px solid color-mix(in srgb, var(--theme-text) 13%, transparent);
  border-radius: var(--zhp-radius-md);
  box-shadow: var(--zhp-shadow-soft);
  min-width: 0;
  overflow: hidden;
}

.zhp-media {
  background: var(--zhp-gray-light);
  display: block;
  overflow: hidden;
  position: relative;
}

.zhp-media img,
.zhp-media video,
.zhp-media iframe {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.zhp-grid {
  display: grid;
  gap: var(--zhp-space-md);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.zhp-sectionHeader {
  margin-bottom: var(--zhp-space-lg);
  max-width: 58rem;
}

.zhp-sectionHeader .zhp-title { max-width: 16ch; }

.zhp-meta {
  color: var(--theme-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  gap: 0.5rem 1rem;
}

.zhp-pill {
  background: color-mix(in srgb, var(--theme-accent) 18%, transparent);
  border-radius: 999px;
  color: var(--theme-text);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  text-transform: uppercase;
}

.zhp-component[data-accent="green"] { --component-accent: var(--zhp-green); }
.zhp-component[data-accent="yellow"] { --component-accent: var(--zhp-yellow); }
.zhp-component[data-accent="navy"] { --component-accent: var(--zhp-navy); }
.zhp-component[data-accent="purple"] { --component-accent: var(--zhp-scout-purple); }
.zhp-component[data-accent="red"] { --component-accent: var(--zhp-red); }
.zhp-component[data-accent="blue"] { --component-accent: var(--zhp-blue); }
.zhp-component[data-accent="orange"] { --component-accent: var(--zhp-orange); }
.zhp-component[data-accent="pink"] { --component-accent: var(--zhp-pink); }
.zhp-component[data-accent="brown"] { --component-accent: var(--zhp-brown); }

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

/* Wspólny responsywny szlif dla kart i siatek. */
@media (max-width: 47.99rem) {
  :root {
    --zhp-gutter: 1rem;
    --zhp-space-xl: 3.75rem;
  }

  .zhp-component[data-spacing="compact"] { padding-block: 2.75rem; }
  .zhp-title { font-size: clamp(2.25rem, 11.5vw, 4.2rem); }
  .zhp-title--medium { font-size: clamp(1.95rem, 9.5vw, 3.5rem); }
  .zhp-actions, .zhp-buttons { align-items: stretch; flex-direction: column; }
  .zhp-actions .zhp-button, .zhp-buttons .zhp-button { width: 100%; }
  .zhp-card { border-radius: 1.15rem; }
}

@media (min-width: 48rem) and (max-width: 79.99rem) {
  :root {
    --zhp-content: 72rem;
    --zhp-content-wide: 88rem;
    --zhp-gutter: clamp(1.5rem, 3vw, 2.25rem);
  }
}

@media (min-width: 100rem) {
  :root {
    --zhp-content: 84rem;
    --zhp-content-wide: 108rem;
  }
}

@media (hover: none) {
  .zhp-button:hover { transform: none; }
}

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