/* ─────────────────────────────────────────────────────────────
   PSP 114 — base tokens. Pastel + crayon edition.
   ───────────────────────────────────────────────────────────── */

:root {
  /* ── Paper + ink (warm, not pure black) ── */
  --psp-cream:  #FDF9EE;
  --psp-paper:  #F8F1DD;
  --psp-paper-2: #FBF4E2;
  --psp-ink:    #3A2E1D;
  --psp-ink-soft: #6E5E48;
  --psp-ink-mute: #A29684;
  --psp-line:   rgba(58,46,29,0.18);

  /* ── Pastel palette derived from logo ── */
  --psp-green:  #C9DC83;
  --psp-green-deep: #8FAE3E;
  --psp-yellow: #FFE38A;
  --psp-yellow-deep: #E8A800;
  --psp-blue:   #B6DEF0;
  --psp-blue-deep: #5BA7CA;
  --psp-coral:  #F5B5A2;
  --psp-coral-deep: #D46A45;
  --psp-gold:   #C99A3F;
  --psp-rose:   #F0C6D4;
  --psp-lilac:  #D9CAE8;

  --psp-shadow: rgba(58,46,29,0.18);
  --psp-shadow-hard: rgba(58,46,29,0.85);

  /* ── Tweak-controlled ── */
  --psp-primary: var(--psp-gold);
  --psp-primary-deep: var(--psp-coral-deep);
  --psp-density: 1;
  --psp-font-display: "Dekko", "Patrick Hand", cursive;
  --psp-font-hand:    "Dekko", "Patrick Hand", cursive;
  --psp-font-body:    "Plus Jakarta Sans", system-ui, sans-serif;

  /* ── Crayon hatch background — applied via background-image ── */
  --cr-hatch:
    repeating-linear-gradient(38deg,
      rgba(58,46,29,0.13) 0 1.4px,
      transparent 1.4px 5px),
    repeating-linear-gradient(38deg,
      rgba(58,46,29,0.07) 2.6px 3.4px,
      transparent 3.4px 8px);
  --cr-hatch-light:
    repeating-linear-gradient(38deg,
      rgba(58,46,29,0.08) 0 1px,
      transparent 1px 6px);
  --cr-hatch-strong:
    repeating-linear-gradient(35deg,
      rgba(0,0,0,0.20) 0 1.8px,
      transparent 1.8px 5px),
    repeating-linear-gradient(35deg,
      rgba(0,0,0,0.10) 2.8px 3.6px,
      transparent 3.6px 8px);
}

/* Font swap — classic = mixed; playful = handwriting body too */
[data-font="playful"] {
  --psp-font-body: "Patrick Hand", "Plus Jakarta Sans", sans-serif;
}
[data-font="classic"] {
  --psp-font-display: "Dekko", "Patrick Hand", cursive;
  --psp-font-hand:    "Dekko", "Patrick Hand", cursive;
}

/* Primary color swatches (hex stored, mapped via JS to token below) */
[data-primary="green"]  { --psp-primary: var(--psp-green-deep); --psp-primary-deep: #6E8A2A; }
[data-primary="yellow"] { --psp-primary: var(--psp-yellow-deep); --psp-primary-deep: #B58800; }
[data-primary="blue"]   { --psp-primary: var(--psp-blue-deep);   --psp-primary-deep: #3E89AC; }
[data-primary="coral"]  { --psp-primary: var(--psp-coral-deep);  --psp-primary-deep: #B5482C; }
[data-primary="gold"]   { --psp-primary: var(--psp-gold);        --psp-primary-deep: #9F761E; }

[data-density="compact"]  { --psp-density: 0.72; }
[data-density="spacious"] { --psp-density: 1.15; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--psp-font-body);
  color: var(--psp-ink);
  background: var(--psp-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ───────── Crayon button — shared primitive ───────── */
/* Wonky border-radius + offset shadow + slight tilt = "kredka". */
.cr-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  border: 2.5px solid var(--psp-ink);
  border-radius: 28px 22px 30px 20px / 18px 28px 22px 30px;
  font-family: var(--psp-font-hand);
  font-size: 22px; font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
  background-color: white;
  background-image: var(--cr-hatch);
  color: var(--psp-ink);
  cursor: pointer;
  transform: rotate(-1deg);
  box-shadow: 4px 4px 0 var(--psp-shadow-hard);
  transition: transform 0.18s, box-shadow 0.18s, background-color 0.18s;
  white-space: nowrap;
}
.cr-btn:hover {
  transform: rotate(0) translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--psp-shadow-hard);
}
.cr-btn:active {
  transform: rotate(0) translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--psp-shadow-hard);
}
.cr-btn--yellow { background-color: var(--psp-yellow); }
.cr-btn--green  { background-color: var(--psp-green); }
.cr-btn--blue   { background-color: var(--psp-blue); }
.cr-btn--coral  { background-color: var(--psp-coral); }
.cr-btn--rose   { background-color: var(--psp-rose); }
.cr-btn--ghost  { background-color: transparent; background-image: var(--cr-hatch-light); }
.cr-btn--lg     { font-size: 28px; padding: 18px 34px; }
.cr-btn--sm     { font-size: 18px; padding: 10px 18px; box-shadow: 3px 3px 0 var(--psp-shadow-hard); }

/* ───────── Crayon pill — for nav links ───────── */
.cr-pill {
  display: inline-flex; align-items: center;
  padding: 8px 16px; border-radius: 999px;
  font-family: var(--psp-font-hand);
  font-size: 21px; font-weight: 400;
  line-height: 1.25;
  background: transparent;
  background-image: linear-gradient(transparent 60%, var(--psp-yellow) 60%);
  background-size: 0% 100%; background-repeat: no-repeat;
  transition: background-size 0.25s, color 0.18s;
}
.cr-pill:hover {
  background-size: 100% 100%;
}

/* ───────── Crayon underline — for "marked" words ───────── */
.cr-mark {
  background-image: linear-gradient(transparent 55%, var(--mark, var(--psp-yellow)) 55%);
  padding: 0 4px;
}
.cr-mark--blue   { --mark: var(--psp-blue); }
.cr-mark--green  { --mark: var(--psp-green); }
.cr-mark--coral  { --mark: var(--psp-coral); }
.cr-mark--rose   { --mark: var(--psp-rose); }

/* ───────── Photo placeholder ───────── */
.cr-photo {
  background:
    repeating-linear-gradient(45deg, rgba(58,46,29,0.05) 0 5px, transparent 5px 10px),
    var(--psp-paper);
  display: flex; align-items: center; justify-content: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px; letter-spacing: 0.02em;
  color: var(--psp-ink-mute);
  text-align: center; padding: 10px;
  border-radius: 2px;
}

/* ─────────────────────────────────────────────────────────────
   PSP 114 — Notatnik 114 (pastele + kredka)
   ───────────────────────────────────────────────────────────── */

.v4-page {
  --gap: calc(88px * var(--psp-density));
  --pad: clamp(40px, 7vw, 112px);
  background:
    /* red margin line ~ school notebook */
    linear-gradient(to right,
      transparent calc(var(--pad) - 30px),
      rgba(213,106,69,0.28) calc(var(--pad) - 30px),
      rgba(213,106,69,0.28) calc(var(--pad) - 29px),
      transparent calc(var(--pad) - 29px)),
    /* horizontal blue rule lines */
    repeating-linear-gradient(to bottom,
      transparent 0 31px,
      rgba(91,167,202,0.18) 31px 32px),
    /* paper color */
    var(--psp-cream);
  position: relative;
  overflow-x: hidden;
}

/* ───────── Nav ───────── */
.v4-nav-wrap {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253,249,238,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--psp-line);
}
.v4-nav {
  display: flex; align-items: center;
  gap: 24px;
  padding: 16px var(--pad);
}
.v4-brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.v4-brand img { height: 54px; width: auto; }
.v4-nav__items {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 16px 4px;
  flex-wrap: wrap;
}
.v4-nav__panel { margin: 0 auto 0 12px; }
.v4-nav__items .cr-pill { font-size: 18px; padding: 6px 14px; }
.v4-librus {
  font-size: 16px;
  flex-shrink: 0;
}

/* ───────── Floating FB (right edge, vertical) ───────── */
.v4-fab {
  position: fixed;
  right: 18px; top: 50%;
  transform: translateY(-50%) rotate(-2deg);
  z-index: 40;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  background: var(--psp-blue);
  color: var(--psp-ink);
  padding: 18px 12px;
  border: 2.5px solid var(--psp-ink);
  border-radius: 22px 18px 24px 16px / 16px 24px 18px 22px;
  font-family: var(--psp-font-hand);
  box-shadow: 4px 4px 0 var(--psp-shadow-hard);
  transition: transform 0.22s, box-shadow 0.22s;
  text-align: center;
}
.v4-fab:hover {
  transform: translateY(-50%) rotate(0) translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--psp-shadow-hard);
}
.v4-fab__icon {
  width: 40px; height: 40px; border-radius: 999px;
  background: white;
  display: flex; align-items: center; justify-content: center;
  color: #1877F2;
}
.v4-fab__text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 17px; font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

/* ───────── Hero ───────── */
.v4-hero {
  padding: 56px var(--pad) var(--gap);
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 48px;
  align-items: start;
  position: relative;
}
.v4-hero__copy { position: relative; padding-top: 16px; }

.v4-hello {
  display: inline-block;
  font-family: var(--psp-font-hand);
  font-size: 56px; line-height: 1;
  color: var(--psp-coral-deep);
  transform: rotate(-6deg);
  position: absolute; top: -4px; left: 0;
}

.v4-title {
  font-family: var(--psp-font-hand);
  font-weight: 400;
  margin: 56px 0 28px;
  display: flex; flex-direction: column;
  gap: 4px;
  line-height: 0.92;
}
.v4-title__small {
  font-size: clamp(64px, 6.5vw, 96px);
  color: var(--psp-ink);
  padding-left: 16px;
  font-weight: 400;
}
.v4-title__big {
  font-size: clamp(120px, 13.5vw, 196px);
  color: var(--psp-primary);
  -webkit-text-stroke: 3px var(--psp-ink);
  letter-spacing: -0.01em;
  position: relative;
  padding: 0 8px;
  line-height: 0.9;
  align-self: flex-start;
  text-shadow:
    0 2px 0 rgba(58,46,29,0.06),
    1px 0 0 rgba(58,46,29,0.08);
}
.v4-title__num {
  color: var(--psp-blue-deep);
}
.v4-title__scribble {
  position: absolute; left: 0; right: 0;
  bottom: -8px;
  width: 100%; height: 24px;
  color: var(--psp-yellow-deep);
  opacity: 0.85;
  pointer-events: none;
}

.v4-lede {
  font-size: clamp(19px, 1.5vw, 22px);
  line-height: 1.55;
  color: var(--psp-ink);
  max-width: 540px;
  margin: 0 0 36px;
}

.v4-hero__cta {
  display: flex; flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* YouTube crayon button */
.v4-yt {
  background-color: #FFD1C5;
  background-image: var(--cr-hatch);
  display: inline-flex; align-items: center; gap: 16px;
  padding: 12px 22px 12px 14px;
  font-family: var(--psp-font-hand);
  transform: rotate(2deg);
}
.v4-yt:hover { transform: rotate(0) translate(-2px, -2px); }
.v4-yt__play {
  width: 44px; height: 32px; border-radius: 10px 12px 9px 11px / 9px 11px 10px 12px;
  background-color: #E14437;
  background-image: var(--cr-hatch-strong);
  border: 2.5px solid var(--psp-ink);
  color: white;
  display: flex; align-items: center; justify-content: center;
  padding-left: 4px;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 var(--psp-shadow-hard);
}
.v4-yt__txt { display: flex; flex-direction: column; line-height: 1; gap: 2px; }
.v4-yt__row1 { font-size: 14px; font-weight: 500; color: var(--psp-ink-soft); font-family: var(--psp-font-body); }
.v4-yt__row2 { font-size: 26px; font-weight: 400; font-family: var(--psp-font-hand); }

/* Facebook crayon button */
.v4-fb {
  background-color: var(--psp-blue);
  background-image: var(--cr-hatch);
  display: inline-flex; align-items: center; gap: 16px;
  padding: 12px 22px 12px 14px;
  font-family: var(--psp-font-hand);
  transform: rotate(-2deg);
}
.v4-fb:hover { transform: rotate(0) translate(-2px, -2px); }
.v4-fb__icon {
  width: 42px; height: 42px;
  border-radius: 10px 12px 9px 11px / 9px 11px 10px 12px;
  background-color: #4A7AB8;
  background-image: var(--cr-hatch-strong);
  border: 2.5px solid var(--psp-ink);
  color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 var(--psp-shadow-hard);
  font-family: var(--psp-font-hand);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  padding-bottom: 4px;
}
.v4-fb__txt { display: flex; flex-direction: column; line-height: 1; gap: 2px; }
.v4-fb__row1 { font-size: 14px; font-weight: 500; color: var(--psp-ink-soft); font-family: var(--psp-font-body); }
.v4-fb__row2 { font-size: 26px; font-weight: 400; font-family: var(--psp-font-hand); }

/* Hero polaroid stack — fixed-height containers, slightly tilted */
.v4-hero__side {
  position: relative;
  min-height: 560px;
}
.v4-polaroid {
  position: absolute;
  width: 280px;
  background: white;
  padding: 14px 14px 18px;
  border-radius: 4px;
  box-shadow: 8px 12px 28px rgba(58,46,29,0.18);
  margin: 0;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.v4-polaroid:hover {
  transform: rotate(0) scale(1.04) !important;
  z-index: 10;
  box-shadow: 10px 16px 36px rgba(58,46,29,0.28);
}
.v4-polaroid--1 { top: 0; left: 30px; transform: rotate(-6deg); z-index: 3; }
.v4-polaroid--2 { top: 210px; right: 0; transform: rotate(5deg); z-index: 2; }
.v4-polaroid--3 { top: 380px; left: 70px; transform: rotate(-3deg); z-index: 1; }
.v4-photo { aspect-ratio: 1.15 / 1; }
.v4-photo--yellow { background-color: rgba(255,227,138,0.5); }
.v4-photo--green  { background-color: rgba(201,220,131,0.5); }
.v4-polaroid figcaption {
  font-family: var(--psp-font-hand);
  font-size: 20px;
  color: var(--psp-ink-soft);
  text-align: center;
}

/* ───────── Headings ───────── */
.v4-eyebrow {
  display: inline-block;
  font-family: var(--psp-font-hand);
  font-size: 26px;
  color: var(--psp-coral-deep);
  transform: rotate(-2deg);
}
.v4-eyebrow--light { color: var(--psp-yellow); }
.v4-h2 {
  font-family: var(--psp-font-hand);
  font-size: clamp(56px, 5.8vw, 88px);
  font-weight: 400;
  line-height: 1.05;
  margin: 8px 0 0;
  padding-bottom: 0.15em;
  color: var(--psp-ink);
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
}
.v4-h2::after {
  content: ""; position: absolute;
  left: 4px; right: 16%; bottom: 0.1em;
  height: 12px; background: var(--psp-yellow);
  z-index: -1;
  border-radius: 6px 8px 5px 9px / 6px 5px 8px 7px;
  opacity: 0.7;
}
.v4-h2--light { color: var(--psp-cream); }
.v4-h2--light::after { background: var(--psp-coral); opacity: 0.6; }

.v4-link {
  font-family: var(--psp-font-hand);
  font-size: 26px;
  color: var(--psp-primary-deep);
  border-bottom: 2.5px solid var(--psp-primary);
  align-self: flex-end;
  margin-left: auto;
}

/* ───────── News scroller ───────── */
.v4-news { padding: var(--gap) 0 calc(var(--gap) + 24px); position: relative; }
.v4-news__head {
  padding: 0 var(--pad);
  display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap;
  margin-bottom: 36px;
}
.v4-news__hint {
  margin: 0 0 0 auto;
  font-family: var(--psp-font-hand);
  font-size: 22px;
  color: var(--psp-ink-soft);
  transform: rotate(-1deg);
}

.v4-news__track {
  display: flex; gap: 22px;
  padding: 32px var(--pad);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-left: var(--pad);
  -webkit-overflow-scrolling: touch;
}
.v4-news__track::-webkit-scrollbar { height: 8px; }
.v4-news__track::-webkit-scrollbar-track { background: transparent; }
.v4-news__track::-webkit-scrollbar-thumb {
  background: var(--psp-line);
  border-radius: 4px;
}
.v4-news__edge { flex: 0 0 calc(var(--pad) - 22px); }

/* Sticky note card */
.v4-note {
  flex: 0 0 320px;
  background-color: var(--psp-yellow);
  background-image: var(--cr-hatch);
  padding: 22px 22px 18px;
  position: relative;
  scroll-snap-align: start;
  box-shadow:
    6px 8px 20px rgba(58,46,29,0.16),
    inset 0 -28px 36px rgba(255,255,255,0.10);
  transform: rotate(var(--tilt, -1deg));
  transition: transform 0.3s ease, flex-basis 0.4s ease, box-shadow 0.3s;
  border-radius: 2px 4px 3px 2px;
  display: flex; flex-direction: column;
  border: 1.5px solid rgba(58,46,29,0.15);
}
.v4-note:hover { transform: rotate(0) translate(-2px, -2px); box-shadow: 8px 12px 26px rgba(58,46,29,0.22); }
.v4-note--green  { background-color: var(--psp-green); }
.v4-note--yellow { background-color: var(--psp-yellow); }
.v4-note--blue   { background-color: var(--psp-blue); }
.v4-note--coral  { background-color: var(--psp-coral); }

.v4-note.is-open {
  flex: 0 0 580px;
  transform: rotate(0);
  z-index: 5;
  box-shadow: 10px 14px 36px rgba(58,46,29,0.26);
}

.v4-note__pin {
  position: absolute; top: -10px; left: 50%;
  width: 22px; height: 22px; border-radius: 999px;
  background-color: var(--psp-coral-deep);
  background-image: var(--cr-hatch-strong);
  border: 2px solid var(--psp-ink);
  transform: translateX(-50%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.25), inset 1px 1px 3px rgba(255,255,255,0.4);
}

.v4-note__hit {
  appearance: none; -webkit-appearance: none;
  border: 0; padding: 0; margin: 0;
  background: transparent; color: inherit;
  text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  font: inherit;
}
.v4-note__meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700;
}
.v4-note__tag {
  background: rgba(58,46,29,0.16);
  padding: 3px 8px; border-radius: 4px;
}
.v4-note__date { color: var(--psp-ink-soft); }
.v4-note__title {
  font-family: var(--psp-font-hand);
  font-size: 36px; font-weight: 400;
  line-height: 1.15;
  margin: 4px 0 4px;
  padding-bottom: 0.15em;
  color: var(--psp-ink);
}
.v4-note__teaser {
  margin: 0;
  font-size: 15.5px; line-height: 1.5;
  color: var(--psp-ink);
}
.v4-note__more {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--psp-font-hand);
  font-size: 22px;
  color: var(--psp-coral-deep);
  border-bottom: 2px solid var(--psp-coral-deep);
  align-self: flex-start;
}

.v4-note__body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.45s ease, margin-top 0.45s ease, opacity 0.4s ease 0.05s;
  opacity: 0;
}
.v4-note.is-open .v4-note__body {
  max-height: 900px;
  margin-top: 16px;
  opacity: 1;
  padding-top: 16px;
  border-top: 1.5px dashed rgba(58,46,29,0.3);
}
.v4-note__body p {
  font-size: 15.5px; line-height: 1.6;
  color: var(--psp-ink);
  margin: 0 0 12px;
}
.v4-note__body p:last-of-type { margin-bottom: 14px; }
.v4-note__cta { margin-top: 4px; }

/* ───────── Z życia szkoły ───────── */
.v4-life { padding: var(--gap) var(--pad); }
.v4-life__head { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.v4-life__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  padding: 16px 0;
}
.v4-life__card {
  background: white;
  padding: 14px;
  border-radius: 4px;
  position: relative;
  box-shadow: 6px 10px 24px rgba(58,46,29,0.16);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.25s, box-shadow 0.25s;
  margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.v4-life__card:hover {
  transform: rotate(0) translateY(-4px);
  box-shadow: 10px 16px 32px rgba(58,46,29,0.22);
  z-index: 5;
}
.v4-life__tape {
  position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 80px; height: 22px;
  background-color: rgba(255,227,138,0.85);
  background-image: var(--cr-hatch-light);
  border: 1px solid rgba(58,46,29,0.18);
}
.v4-life__pic { aspect-ratio: 4 / 3; }
.v4-life__pic--green  { background-color: rgba(201,220,131,0.45); }
.v4-life__pic--yellow { background-color: rgba(255,227,138,0.45); }
.v4-life__pic--blue   { background-color: rgba(182,222,240,0.45); }
.v4-life__pic--coral  { background-color: rgba(245,181,162,0.45); }
.v4-life__card figcaption { padding: 0 4px 8px; display: flex; flex-direction: column; gap: 8px; }
.v4-life__cap {
  font-family: var(--psp-font-hand);
  font-size: 18px;
  color: var(--psp-ink-mute);
}
.v4-life__card h3 {
  font-family: var(--psp-font-hand);
  font-size: 28px; font-weight: 400;
  margin: 0; line-height: 1.15;
  padding-bottom: 0.25em;
  color: var(--psp-ink);
}
.v4-life__card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--psp-ink-soft);
}

/* ───────── "Wszystkie aktualności" CTA card (last in news scroller) ───────── */
.v4-note--cta {
  flex: 0 0 280px;
  background: var(--psp-ink);
  color: var(--psp-cream);
  padding: 28px 24px 22px;
  position: relative;
  display: flex; flex-direction: column;
  gap: 8px;
  text-decoration: none;
  scroll-snap-align: start;
  border-radius: 4px 2px 3px 2px;
  box-shadow:
    6px 8px 20px rgba(58,46,29,0.22),
    inset 0 -40px 60px rgba(0,0,0,0.18);
  transform: rotate(var(--tilt, 2deg));
  transition: transform 0.25s, box-shadow 0.25s;
}
.v4-note--cta:hover {
  transform: rotate(0) translate(-3px, -3px);
  box-shadow: 10px 14px 28px rgba(58,46,29,0.3);
}
.v4-note--cta .v4-note__pin {
  background: var(--psp-yellow);
  border-color: var(--psp-cream);
}
.v4-note__cta-eyebrow {
  font-family: var(--psp-font-hand);
  font-size: 20px;
  color: var(--psp-yellow);
  transform: rotate(-2deg);
  align-self: flex-start;
}
.v4-note__cta-title {
  font-family: var(--psp-font-hand);
  font-size: 44px;
  font-weight: 400;
  line-height: 0.95;
  margin: 4px 0 8px;
  color: var(--psp-cream);
}
.v4-note__cta-arrow {
  font-family: var(--psp-font-hand);
  font-size: 64px;
  line-height: 0.8;
  color: var(--psp-yellow);
  margin: 4px 0;
  align-self: flex-end;
}
.v4-note__cta-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1.5px dashed rgba(253,249,238,0.3);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(253,249,238,0.7);
  font-weight: 600;
}

/* ───────── (old .v4-foot kept below for reference but not used) ───────── */
.v4-foot {
  padding: var(--gap) var(--pad) 32px;
  background: var(--psp-ink);
  color: var(--psp-cream);
  position: relative;
  margin-top: 32px;
}
.v4-foot::before {
  content: ""; position: absolute;
  top: -22px; left: 0; right: 0; height: 22px;
  background:
    radial-gradient(circle at 16px 22px, var(--psp-ink) 14px, transparent 15px) 0 0 / 32px 22px;
}
.v4-foot__lead { max-width: 880px; margin-bottom: 56px; }
.v4-foot__sub { font-size: 19px; color: rgba(253,249,238,0.78); margin: 16px 0 28px; line-height: 1.5; }
.v4-foot__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.v4-foot .cr-btn { color: var(--psp-ink); }
.v4-foot .cr-btn--ghost { color: var(--psp-cream); border-color: var(--psp-cream); background: transparent; }

.v4-foot__cols {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 40px 0;
  border-top: 1.5px solid rgba(253,249,238,0.16);
  border-bottom: 1.5px solid rgba(253,249,238,0.16);
}
.v4-foot__lab {
  display: block; font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--psp-yellow);
  font-weight: 700; margin-bottom: 12px;
}
.v4-foot__cols p {
  font-family: var(--psp-font-hand);
  font-size: 22px; line-height: 1.45;
  margin: 0 0 10px;
}
.v4-foot__cols a { border-bottom: 1.5px solid rgba(253,249,238,0.4); color: var(--psp-cream); }
.v4-foot__cols a:hover { border-color: var(--psp-yellow); color: var(--psp-yellow); }
.v4-foot__hand {
  display: inline-block;
  font-family: var(--psp-font-hand);
  font-size: 18px;
  color: var(--psp-yellow);
  margin-top: 6px;
  transform: rotate(-1deg);
}
.v4-foot__base {
  padding-top: 24px;
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: rgba(253,249,238,0.6);
}
.v4-foot__base img { height: 44px; filter: brightness(0) invert(1); opacity: 0.85; }
.v4-foot__base > .v4-foot__hand { margin-left: auto; margin-top: 0; }

/* ─────────────────────────────────────────────────────────────
   PSP 114 — shared subpage styles (page hero + footer + active nav).
   ───────────────────────────────────────────────────────────── */

/* ───────── Active nav link ───────── */
.cr-pill.is-active {
  background-image: linear-gradient(transparent 60%, var(--psp-yellow) 60%);
  background-size: 100% 100%;
  color: var(--psp-ink);
}

/* ───────── Subpage hero header ───────── */
.psp-phero {
  padding: 48px var(--pad, clamp(40px, 7vw, 112px)) 32px;
  position: relative;
}
.psp-phero__inner {
  max-width: 1080px;
  position: relative;
  display: flex; flex-direction: column;
  align-items: flex-start;
}
.psp-phero__back {
  display: inline-flex; align-items: center;
  font-family: var(--psp-font-hand);
  font-size: 22px;
  line-height: 1.25;
  color: var(--psp-ink-soft);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
  margin-bottom: 4px;
}
.psp-phero__back:hover {
  color: var(--psp-coral-deep);
  border-color: var(--psp-coral-deep);
  transform: translateX(-2px);
}
.psp-phero__eyebrow {
  display: inline-block;
  margin-top: 28px;
  background: var(--psp-yellow);
  color: var(--psp-ink);
  font-family: var(--psp-font-hand);
  font-size: 22px;
  line-height: 1.4;
  padding: 4px 16px;
  border: 2px solid var(--psp-ink);
  border-radius: 22px 18px 26px 16px / 16px 24px 18px 22px;
  box-shadow: 3px 3px 0 var(--psp-shadow-hard);
}
.psp-phero__title {
  font-family: var(--psp-font-hand);
  font-size: clamp(72px, 9vw, 144px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 20px 0 18px;
  color: var(--psp-ink);
  max-width: 11ch;
}
.psp-phero__lede {
  font-size: clamp(19px, 1.6vw, 24px);
  line-height: 1.5;
  color: var(--psp-ink);
  max-width: 720px;
  margin: 0 0 8px;
}
.psp-phero__lede .cr-mark { padding: 0 6px; }

/* ───────── Page section helpers ───────── */
.psp-section {
  padding: 48px var(--pad, clamp(40px, 7vw, 112px));
}
.psp-section--alt {
  background:
    linear-gradient(to right, rgba(213,106,69,0.1) 1px, transparent 1px) 0 0 / 100% 100%,
    rgba(255,227,138,0.18);
  border-top: 1.5px dashed var(--psp-line);
  border-bottom: 1.5px dashed var(--psp-line);
}
.psp-h2 {
  font-family: var(--psp-font-hand);
  font-size: clamp(48px, 5vw, 76px);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 16px;
  position: relative;
  display: inline-block;
}
.psp-h2::after {
  content: ""; position: absolute;
  left: 4px; right: 18%; bottom: 0.12em;
  height: 11px; background: var(--psp-yellow);
  z-index: -1;
  border-radius: 6px 8px 5px 9px;
  opacity: 0.7;
}
.psp-section__lede {
  font-size: 19px; line-height: 1.55;
  max-width: 720px; margin: 0 0 36px;
  color: var(--psp-ink);
}

/* ───────── New Footer ───────── */
.psp-foot {
  position: relative;
  margin-top: 80px;
  padding: 64px var(--pad, clamp(40px, 7vw, 112px)) 28px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255,227,138,0.55), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(182,222,240,0.45), transparent 55%),
    var(--psp-paper);
  color: var(--psp-ink);
  overflow: hidden;
}
.psp-foot__edge {
  position: absolute; top: -2px; left: 0; right: 0;
  height: 18px;
  color: var(--psp-coral-deep);
  opacity: 0.45;
  pointer-events: none;
}
.psp-foot__edge svg { width: 100%; height: 100%; }

.psp-foot__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: stretch;
  padding-bottom: 48px;
  border-bottom: 1.5px dashed rgba(58,46,29,0.25);
}
.psp-foot__lead { padding-right: 16px; }
.psp-foot__h {
  font-family: var(--psp-font-hand);
  font-size: clamp(40px, 4.5vw, 64px);
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 16px;
  color: var(--psp-ink);
}
.psp-foot__star {
  display: inline-block;
  color: var(--psp-coral-deep);
  transform: translateY(-4px);
}
.psp-foot__lead p {
  font-size: 18px; line-height: 1.55;
  color: var(--psp-ink);
  max-width: 520px;
  margin: 0 0 24px;
}
.psp-foot__cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* "Address card" — looks like a postcard / business card pinned in the corner */
.psp-foot__card {
  position: relative;
  background: white;
  border: 2.5px solid var(--psp-ink);
  border-radius: 6px 4px 8px 5px;
  padding: 26px 26px 24px;
  box-shadow: 6px 8px 0 var(--psp-shadow-hard);
  transform: rotate(1.2deg);
}
.psp-foot__stamp {
  position: absolute;
  top: -16px; right: 20px;
  font-family: var(--psp-font-hand);
  font-size: 22px;
  background: var(--psp-yellow);
  color: var(--psp-ink);
  padding: 2px 14px;
  border: 2px solid var(--psp-ink);
  border-radius: 18px 14px 22px 16px;
  transform: rotate(4deg);
}
.psp-foot__card .psp-foot__label { margin-top: 0; }
.psp-foot__addr {
  font-family: var(--psp-font-hand);
  font-size: 22px;
  line-height: 1.35;
  margin: 8px 0 14px;
}
.psp-foot__addr:last-of-type { margin-bottom: 0; }
.psp-foot__addr a {
  border-bottom: 1.5px solid currentColor;
}
.psp-foot__addr a:hover {
  color: var(--psp-coral-deep);
}
.psp-foot__small {
  display: inline-block;
  font-size: 17px;
  color: var(--psp-ink-soft);
}

.psp-foot__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 36px 0 40px;
  border-bottom: 1.5px dashed rgba(58,46,29,0.25);
}
.psp-foot__col {
  display: flex; flex-direction: column; gap: 12px;
}
.psp-foot__label {
  display: block;
  font-family: var(--psp-font-body);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--psp-ink-mute);
  margin-bottom: 4px;
}
.psp-foot__col a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--psp-font-hand);
  font-size: 21px;
  line-height: 1.35;
  color: var(--psp-ink);
  padding: 2px 0;
  background-image: linear-gradient(transparent 65%, rgba(255,227,138,0.85) 65%);
  background-size: 0% 100%; background-repeat: no-repeat;
  transition: background-size 0.2s, transform 0.2s;
}
.psp-foot__col a:hover {
  background-size: 100% 100%;
  transform: translateX(2px);
}
.psp-foot__icn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1.8px solid var(--psp-ink);
  font-size: 14px;
  font-weight: 700;
  color: var(--psp-ink);
}
.psp-foot__icn--fb { background: var(--psp-blue); font-style: italic; }
.psp-foot__icn--yt { background: var(--psp-coral); padding-left: 3px; }

.psp-foot__base {
  display: flex; align-items: center; gap: 16px;
  padding-top: 22px;
  font-size: 13px;
  color: var(--psp-ink-mute);
}
.psp-foot__base img { height: 44px; opacity: 0.85; }
.psp-foot__base-name { font-family: var(--psp-font-body); }
.psp-foot__base-hand {
  margin-left: auto;
  font-family: var(--psp-font-hand);
  font-size: 22px;
  color: var(--psp-coral-deep);
  transform: rotate(-2deg);
}

/* ───────── Hide old V4 footer (homepage now uses .psp-foot) ───────── */
.v4-foot { display: none !important; }

/* ─────────────────────────────────────────────────────────────
   PSP 114 — per-subpage styles.
   Loaded only on /podstrony/*.html.
   ───────────────────────────────────────────────────────────── */

.psp-page {
  --gap: calc(72px * var(--psp-density));
  --pad: clamp(40px, 7vw, 112px);
  background:
    linear-gradient(to right,
      transparent calc(var(--pad) - 30px),
      rgba(213,106,69,0.22) calc(var(--pad) - 30px),
      rgba(213,106,69,0.22) calc(var(--pad) - 29px),
      transparent calc(var(--pad) - 29px)),
    repeating-linear-gradient(to bottom,
      transparent 0 31px,
      rgba(91,167,202,0.16) 31px 32px),
    var(--psp-cream);
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ───────── 1) Filozofia — principles grid ───────── */
.sp-principles__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 16px;
}
.sp-principle {
  background: white;
  border: 2.5px solid var(--psp-ink);
  border-radius: 26px 22px 30px 20px / 22px 28px 22px 26px;
  padding: 28px 28px 26px;
  box-shadow: 5px 6px 0 var(--psp-shadow-hard);
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  transform: rotate(calc(var(--tilt, 0) * 1deg));
  transition: transform 0.2s, box-shadow 0.2s;
}
.sp-principle:hover {
  transform: translate(-3px, -3px) rotate(0);
  box-shadow: 8px 10px 0 var(--psp-shadow-hard);
}
.sp-principle--yellow { background: var(--psp-yellow); }
.sp-principle--green  { background: var(--psp-green); }
.sp-principle--blue   { background: var(--psp-blue); }
.sp-principle--coral  { background: var(--psp-coral); }
.sp-principle__num {
  font-family: var(--psp-font-hand);
  font-size: 36px;
  color: var(--psp-ink);
  line-height: 1;
  opacity: 0.7;
}
.sp-principle h3 {
  font-family: var(--psp-font-hand);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}
.sp-principle p {
  margin: 0;
  font-size: 16px; line-height: 1.55;
  color: var(--psp-ink);
}

.sp-quote { padding: 72px var(--pad); }
.sp-quote__fig {
  max-width: 780px; margin: 0 auto;
  position: relative;
  padding: 0 0 0 40px;
}
.sp-quote__fig::before {
  content: "\201E";
  position: absolute;
  left: -12px; top: -56px;
  font-family: Georgia, serif;
  font-size: 200px;
  color: var(--psp-coral);
  line-height: 1;
}
.sp-quote__fig blockquote {
  font-family: var(--psp-font-hand);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.25;
  margin: 0 0 18px;
  color: var(--psp-ink);
}
.sp-quote__fig figcaption {
  font-family: var(--psp-font-hand);
  font-size: 22px;
  color: var(--psp-coral-deep);
}

/* ───────── 2) Pedagodzy ───────── */
.sp-teachers__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 8px;
}
.sp-teacher {
  background: white;
  padding: 14px 14px 18px;
  box-shadow: 6px 10px 22px rgba(58,46,29,0.15);
  border-radius: 4px;
  margin: 0;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex; flex-direction: column; gap: 14px;
}
.sp-teacher:hover {
  transform: rotate(0) translateY(-4px);
  box-shadow: 10px 16px 30px rgba(58,46,29,0.22);
  z-index: 4;
}
.sp-teacher__photo { aspect-ratio: 1 / 1; }
.sp-teacher__photo--yellow { background-color: rgba(255,227,138,0.45); }
.sp-teacher__photo--green  { background-color: rgba(201,220,131,0.45); }
.sp-teacher__photo--blue   { background-color: rgba(182,222,240,0.45); }
.sp-teacher__photo--coral  { background-color: rgba(245,181,162,0.45); }
.sp-teacher figcaption {
  padding: 0 6px 4px;
  display: flex; flex-direction: column; gap: 4px;
}
.sp-teacher h3 {
  font-family: var(--psp-font-hand);
  font-size: 26px; font-weight: 400;
  margin: 0; line-height: 1.05;
  color: var(--psp-ink);
}
.sp-teacher__role {
  font-family: var(--psp-font-body);
  font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--psp-coral-deep);
}
.sp-teacher__subject {
  font-family: var(--psp-font-hand);
  font-size: 19px;
  color: var(--psp-ink);
}
.sp-teacher__years {
  font-size: 13px;
  color: var(--psp-ink-soft);
  font-family: var(--psp-font-body);
}
.sp-teacher__fun {
  font-family: var(--psp-font-hand);
  font-size: 18px;
  color: var(--psp-ink-soft);
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1.5px dashed rgba(58,46,29,0.18);
  line-height: 1.25;
}

/* ───────── 3) Program ───────── */
.sp-program { display: flex; flex-direction: column; gap: 36px; }
.sp-prog {
  background: white;
  border: 2.5px solid var(--psp-ink);
  border-radius: 18px 14px 22px 16px;
  box-shadow: 6px 7px 0 var(--psp-shadow-hard);
  overflow: hidden;
}
.sp-prog__head {
  padding: 28px 32px 22px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
}
.sp-prog--yellow .sp-prog__head { background: var(--psp-yellow); }
.sp-prog--green  .sp-prog__head { background: var(--psp-green); }
.sp-prog--blue   .sp-prog__head { background: var(--psp-blue); }
.sp-prog__id {
  font-family: var(--psp-font-hand);
  font-size: 56px;
  color: var(--psp-ink);
  line-height: 1;
}
.sp-prog__head h3 {
  font-family: var(--psp-font-body);
  font-size: 13px; letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--psp-ink-soft);
  margin: 0;
}
.sp-prog__head p {
  font-size: 16px; line-height: 1.55;
  margin: 6px 0 0;
  max-width: 760px;
}
.sp-prog__body {
  display: grid; grid-template-columns: 1.6fr 1fr;
  gap: 0;
  border-top: 2.5px solid var(--psp-ink);
}
.sp-prog__table { padding: 26px 32px; border-right: 1.5px dashed rgba(58,46,29,0.25); }
.sp-prog__extras { padding: 26px 32px; }
.sp-prog__lab {
  display: block;
  font-family: var(--psp-font-body);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--psp-ink-mute);
  font-weight: 700;
  margin-bottom: 12px;
}
.sp-prog__table ul, .sp-prog__extras ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 8px;
}
.sp-prog__table li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0;
  font-size: 17px;
  border-bottom: 1.5px dashed rgba(58,46,29,0.18);
}
.sp-prog__table li:last-child { border-bottom: none; }
.sp-prog__h {
  font-family: var(--psp-font-hand);
  font-size: 22px;
  color: var(--psp-coral-deep);
  margin-left: 16px;
  white-space: nowrap;
}
.sp-prog__extras li {
  font-family: var(--psp-font-hand);
  font-size: 22px;
  color: var(--psp-ink);
  line-height: 1.3;
}

/* ───────── 4) Osiągnięcia ───────── */
.sp-exams__list {
  display: flex; flex-direction: column;
  gap: 40px;
  margin: 24px 0 0;
}
.sp-exam {
  background: white;
  border: 2.5px solid var(--psp-ink);
  border-radius: 22px 18px 26px 20px;
  box-shadow: 6px 8px 0 var(--psp-shadow-hard);
  overflow: hidden;
}
.sp-exam__head {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px 36px;
  align-items: center;
  padding: 32px 36px 28px;
}
.sp-exam--yellow .sp-exam__head { background: var(--psp-yellow); }
.sp-exam--blue   .sp-exam__head { background: var(--psp-blue); }
.sp-exam--green  .sp-exam__head { background: var(--psp-green); }
.sp-exam--coral  .sp-exam__head { background: var(--psp-coral); }

.sp-exam__yr-wrap {
  display: flex; flex-direction: column; gap: 4px;
  background: white;
  border: 2.5px solid var(--psp-ink);
  border-radius: 18px 14px 22px 16px;
  box-shadow: 4px 4px 0 var(--psp-shadow-hard);
  padding: 14px 18px;
  transform: rotate(-2deg);
  align-self: start;
}
.sp-exam__yr-lab {
  font-family: var(--psp-font-body);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--psp-ink-soft); font-weight: 700;
}
.sp-exam__yr {
  font-family: var(--psp-font-hand);
  font-size: 44px; line-height: 1;
  color: var(--psp-ink);
}
.sp-exam__place {
  grid-column: 2; grid-row: 1;
  display: flex; align-items: center; gap: 16px;
}
.sp-exam__trophy {
  font-size: 56px;
  color: var(--psp-coral-deep);
  line-height: 1;
  transform: rotate(-8deg);
}
.sp-exam__place > div { display: flex; flex-direction: column; gap: 2px; }
.sp-exam__place-num {
  font-family: var(--psp-font-hand);
  font-size: 44px; line-height: 1.1;
  color: var(--psp-ink);
}
.sp-exam__place-scope {
  font-family: var(--psp-font-body);
  font-size: 14px; font-weight: 600;
  color: var(--psp-ink-soft);
}
.sp-exam__intro {
  grid-column: 1 / -1; grid-row: 2;
  margin: 0;
  font-size: 16px; line-height: 1.55;
  color: var(--psp-ink);
}

.sp-exam__subjects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 2.5px solid var(--psp-ink);
}
.sp-exam__subj {
  padding: 24px 28px 28px;
  border-right: 1.5px dashed rgba(58,46,29,0.25);
}
.sp-exam__subj:last-child { border-right: none; }
.sp-exam__subj-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--psp-line);
}
.sp-exam__subj-lab {
  font-family: var(--psp-font-hand);
  font-size: 26px;
  color: var(--psp-ink);
}
.sp-exam__subj-psp {
  font-family: var(--psp-font-body);
  font-size: 13px;
  color: var(--psp-ink-soft);
}
.sp-exam__subj-psp strong {
  font-family: var(--psp-font-hand);
  font-size: 26px;
  font-weight: 400;
  color: var(--psp-coral-deep);
  margin-left: 4px;
}

.sp-exam__bars {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 10px;
}
.sp-exam__bar {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
}
.sp-exam__who {
  font-family: var(--psp-font-body);
  font-size: 12.5px; font-weight: 600;
  color: var(--psp-ink-soft);
  text-align: right;
}
.sp-exam__bar.is-highlight .sp-exam__who {
  color: var(--psp-ink);
  font-weight: 700;
}
.sp-exam__track {
  display: block;
  height: 24px;
  background: rgba(58,46,29,0.06);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.sp-exam__fill {
  display: flex; align-items: center; justify-content: flex-end;
  height: 100%;
  border-radius: 4px;
  padding-right: 8px;
  position: relative;
  border-right: 2px solid var(--psp-ink);
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(58,46,29,0.18) 0 2px,
      transparent 2px 7px);
  transition: width 0.6s ease;
}
.sp-exam__fill--blue   { background-color: var(--psp-blue); }
.sp-exam__fill--green  { background-color: var(--psp-green); }
.sp-exam__fill--yellow { background-color: var(--psp-yellow); }
.sp-exam__fill--coral  { background-color: var(--psp-coral); }
.sp-exam__bar.is-highlight .sp-exam__fill {
  border-right-width: 3px;
  filter: saturate(1.2);
}
.sp-exam__val {
  font-family: var(--psp-font-hand);
  font-size: 16px;
  color: var(--psp-ink);
  line-height: 1;
}
.sp-exam__bar.is-highlight .sp-exam__val {
  font-size: 20px;
  color: var(--psp-ink);
}

.sp-ach { display: flex; flex-direction: column; gap: 40px; }
.sp-ach .psp-h2 { margin-bottom: 8px; }
.sp-ach__head {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 20px;
}
.sp-ach__yr {
  font-family: var(--psp-font-hand);
  font-size: 56px;
  line-height: 1;
  padding: 0 16px 0;
  background: var(--psp-yellow);
  border: 2.5px solid var(--psp-ink);
  border-radius: 18px 14px 22px 16px;
  box-shadow: 4px 4px 0 var(--psp-shadow-hard);
  transform: rotate(-2deg);
}
.sp-ach__year--green  .sp-ach__yr { background: var(--psp-green); }
.sp-ach__year--blue   .sp-ach__yr { background: var(--psp-blue); }
.sp-ach__year--coral  .sp-ach__yr { background: var(--psp-coral); }
.sp-ach__line {
  flex: 1; height: 0;
  border-top: 3px dashed rgba(58,46,29,0.3);
}
.sp-ach__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.sp-ach__item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 22px;
  align-items: baseline;
  padding: 18px 22px;
  background: white;
  border: 1.5px solid var(--psp-line);
  border-radius: 12px 10px 14px 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.sp-ach__item:hover {
  transform: translateX(4px);
  box-shadow: 4px 5px 0 var(--psp-shadow-hard);
}
.sp-ach__tag {
  grid-column: 1; grid-row: 1;
  font-family: var(--psp-font-body);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--psp-coral-deep);
  background: rgba(245,181,162,0.3);
  padding: 4px 8px;
  border-radius: 6px;
  align-self: start;
  justify-self: start;
}
.sp-ach__title {
  grid-column: 2; grid-row: 1;
  font-family: var(--psp-font-hand);
  font-size: 28px;
  line-height: 1.05;
  color: var(--psp-ink);
}
.sp-ach__who {
  grid-column: 2; grid-row: 2;
  font-size: 14px;
  color: var(--psp-ink-soft);
  font-weight: 600;
}
.sp-ach__note {
  grid-column: 2; grid-row: 3;
  font-size: 15px;
  color: var(--psp-ink);
  line-height: 1.45;
  margin-top: 4px;
}

/* ───────── 5) Rankingi ───────── */
.sp-rank-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 56px;
  align-items: center;
}
.sp-rank-stamp {
  background: var(--psp-yellow);
  border: 3px solid var(--psp-ink);
  border-radius: 24px 18px 28px 20px;
  box-shadow: 6px 8px 0 var(--psp-shadow-hard);
  padding: 28px 24px;
  text-align: center;
  transform: rotate(-3deg);
  display: flex; flex-direction: column; gap: 6px;
  align-items: center;
}
.sp-rank-stamp__num {
  font-family: var(--psp-font-hand);
  font-size: 124px;
  line-height: 0.8;
  color: var(--psp-coral-deep);
}
.sp-rank-stamp__txt {
  font-family: var(--psp-font-hand);
  font-size: 22px;
  line-height: 1.2;
  color: var(--psp-ink);
}
.sp-rank-stamp__year {
  font-family: var(--psp-font-body);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--psp-ink-soft);
  margin-top: 6px;
}
.sp-rank-hero__copy h2 { margin-bottom: 16px; }
.sp-rank-hero__copy p { font-size: 17px; line-height: 1.55; max-width: 540px; }

.sp-rank { padding-top: 48px; }
.sp-rank__list {
  list-style: none; margin: 24px 0 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 0;
}
.sp-rank__row {
  display: grid;
  grid-template-columns: 90px 140px 1fr 220px;
  gap: 24px;
  align-items: baseline;
  padding: 22px 16px;
  border-bottom: 2px dashed rgba(58,46,29,0.18);
  transition: background 0.2s, padding 0.2s;
}
.sp-rank__row:hover { padding-left: 24px; background: rgba(255,227,138,0.18); }
.sp-rank__year {
  font-family: var(--psp-font-body);
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--psp-ink-mute);
}
.sp-rank__num {
  font-family: var(--psp-font-hand);
  font-size: 44px;
  color: var(--psp-ink);
  line-height: 1;
}
.sp-rank__row--yellow .sp-rank__num { color: var(--psp-yellow-deep); }
.sp-rank__row--green  .sp-rank__num { color: var(--psp-green-deep); }
.sp-rank__row--blue   .sp-rank__num { color: var(--psp-blue-deep); }
.sp-rank__row--coral  .sp-rank__num { color: var(--psp-coral-deep); }
.sp-rank__scope { font-size: 18px; line-height: 1.4; color: var(--psp-ink); }
.sp-rank__src {
  font-family: var(--psp-font-hand);
  font-size: 19px;
  color: var(--psp-ink-soft);
  text-align: right;
}
.sp-rank__note {
  margin: 28px 0 0;
  font-family: var(--psp-font-hand);
  font-size: 22px;
  color: var(--psp-ink-soft);
}

/* ───────── 6) Aktualności (full list) ───────── */
.sp-akt__filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center;
  margin-bottom: 36px;
}
.sp-akt__filterLab {
  font-family: var(--psp-font-body);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--psp-ink-mute);
  font-weight: 700;
  margin-right: 8px;
}

.sp-akt__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 24px;
}
.sp-akt__item {
  display: grid;
  grid-template-columns: 96px 1fr 240px;
  gap: 28px;
  padding: 26px 28px;
  background: white;
  border-left: 8px solid;
  border-radius: 4px 12px 10px 4px;
  box-shadow: 4px 5px 18px rgba(58,46,29,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}
.sp-akt__item:hover {
  transform: translateY(-2px);
  box-shadow: 4px 8px 24px rgba(58,46,29,0.16);
}
.sp-akt__item--yellow { border-left-color: var(--psp-yellow-deep); }
.sp-akt__item--green  { border-left-color: var(--psp-green-deep); }
.sp-akt__item--blue   { border-left-color: var(--psp-blue-deep); }
.sp-akt__item--coral  { border-left-color: var(--psp-coral-deep); }

.sp-akt__date {
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--psp-font-hand);
  line-height: 1;
  color: var(--psp-ink);
}
.sp-akt__day { font-size: 56px; }
.sp-akt__mon { font-size: 20px; color: var(--psp-ink-soft); }
.sp-akt__body { display: flex; flex-direction: column; gap: 8px; }
.sp-akt__tag {
  display: inline-block;
  font-family: var(--psp-font-body);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(58,46,29,0.08);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--psp-ink-soft);
  align-self: flex-start;
}
.sp-akt__body h3 {
  font-family: var(--psp-font-hand);
  font-size: 32px; font-weight: 400;
  line-height: 1; margin: 4px 0;
  color: var(--psp-ink);
}
.sp-akt__body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}
.sp-akt__more { color: var(--psp-ink-soft); }
.sp-akt__link {
  margin-top: 6px;
  font-family: var(--psp-font-hand);
  font-size: 22px;
  color: var(--psp-coral-deep);
  border-bottom: 2px solid var(--psp-coral);
  align-self: flex-start;
}
.sp-akt__pic { aspect-ratio: 4 / 3; }
.sp-akt__pic--yellow { background-color: rgba(255,227,138,0.45); }
.sp-akt__pic--green  { background-color: rgba(201,220,131,0.45); }
.sp-akt__pic--blue   { background-color: rgba(182,222,240,0.45); }
.sp-akt__pic--coral  { background-color: rgba(245,181,162,0.45); }

.sp-akt__pager {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1.5px dashed rgba(58,46,29,0.2);
  font-family: var(--psp-font-hand);
  font-size: 22px;
  color: var(--psp-ink-soft);
}



/* ============================================================
   DoodleSchool — WordPress-specific tweaks added at build time.
   ============================================================ */

/* Accessibility helpers */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px;
  background: var(--psp-yellow); color: var(--psp-ink);
  padding: 10px 16px; border-radius: 8px;
  z-index: 200; font-weight: 700; clip: auto !important; width: auto; height: auto;
}
:focus-visible { outline: 3px dashed var(--psp-coral-deep); outline-offset: 4px; border-radius: 4px; }
.cr-btn:focus-visible, .cr-pill:focus-visible {
  outline-offset: 2px;
}

/* Custom logo */
.v4-brand .custom-logo { height: 54px; width: auto; }
.v4-brand img { display: block; }

/* Nav toggle for mobile */
.v4-nav__toggle {
  display: none;
  appearance: none; background: transparent; border: 0;
  font-size: 32px; line-height: 1; padding: 4px 8px;
  cursor: pointer; color: var(--psp-ink);
}
@media (max-width: 900px) {
  .v4-nav { flex-wrap: wrap; }
  .v4-nav__toggle { display: inline-flex; margin-left: auto; }
  .v4-nav__panel { width: 100%; display: none; padding-top: 12px; }
  .v4-nav__panel[data-open="1"] { display: block; }
  .v4-nav__items { flex-direction: column; gap: 8px; }
  .v4-librus { margin-left: auto; }
}

/* WP-friendly main content frame */
.ds-main { display: block; }
.ds-content {
  max-width: 1120px; margin: 0;
  font-size: 17px; line-height: 1.65;
}
.ds-content > * { max-width: 100%; }
.ds-content h2 { font-family: var(--psp-font-hand); font-size: clamp(36px, 4vw, 56px); margin: 1.5em 0 0.4em; }
.ds-content h3 { font-family: var(--psp-font-hand); font-size: 28px; margin: 1.2em 0 0.3em; }
.ds-content .wp-block-image img { border-radius: 8px; box-shadow: 6px 10px 24px rgba(58,46,29,0.18); }
.ds-content blockquote {
  font-family: var(--psp-font-hand); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3;
  padding-left: 24px; border-left: 4px solid var(--psp-coral-deep);
  margin: 1.8em 0;
}

/* Single post hero image */
.ds-single__hero { margin: 32px 0; }
.ds-single__hero img { border-radius: 12px; box-shadow: 8px 12px 28px rgba(58,46,29,0.2); width: 100%; height: auto; }
.ds-single__meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: var(--psp-ink-soft);
  margin: 16px 0 4px;
}
.ds-single__article { max-width: 920px; margin: 0 auto; }
.ds-single__meta time { font-family: var(--psp-font-hand); font-size: 20px; }

/* Search form */
.ds-search { display: flex; gap: 12px; margin-bottom: 24px; }
.ds-search__input {
  flex: 1; padding: 12px 18px;
  border: 2px solid var(--psp-ink); border-radius: 999px;
  font-family: var(--psp-font-body); font-size: 16px;
  background: white;
}
.ds-search__input:focus { outline: 3px dashed var(--psp-coral-deep); }

/* Empty state */
.ds-empty { text-align: center; padding: 64px 0; }
.ds-empty .psp-h2 { display: inline-block; }

/* Pedagog single (BIO page) */
.ds-pedagog__grid {
  display: grid; grid-template-columns: 320px 1fr; gap: 48px;
  margin-top: 32px;
}
.ds-pedagog__side {
  display: flex; flex-direction: column; gap: 18px;
  background: white; padding: 16px 16px 24px;
  border-radius: 4px; box-shadow: 6px 10px 24px rgba(58,46,29,0.16);
  align-self: start;
}
.ds-pedagog__photo, .ds-pedagog__side .cr-photo, .ds-pedagog__side .ds-photo--filled {
  aspect-ratio: 4 / 5;
}
.ds-pedagog__side img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.ds-pedagog__facts { padding: 4px 6px; display: flex; flex-direction: column; gap: 4px; }
.ds-pedagog__name { font-size: clamp(48px, 5vw, 72px) !important; max-width: none !important; margin: 0 !important; }
.ds-pedagog__bio { max-width: 720px; }
@media (max-width: 800px) { .ds-pedagog__grid { grid-template-columns: 1fr; } }

/* Filled photo (when WP has thumbnail) */
.ds-photo--filled {
  overflow: hidden;
  border-radius: 2px;
}
.ds-photo--filled img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Hero video */
.v4-hero { position: relative; isolation: isolate; }
.v4-hero--has-video .v4-hero__copy,
.v4-hero--has-video .v4-hero__side { position: relative; z-index: 2; }
.v4-hero__video {
  position: absolute; inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.v4-hero__video iframe {
  position: absolute;
  top: 50%; left: 50%;
  width: max(100%, 177.78vh);
  height: max(100%, 56.25vw);
  transform: translate(-50%, -50%);
  border: 0;
}
.v4-hero__video-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(253,249,238,0.85), rgba(253,249,238,0.6));
  mix-blend-mode: normal;
}
.v4-hero--has-video .v4-hero__copy,
.v4-hero--has-video .v4-lede,
.v4-hero--has-video .v4-title { text-shadow: 0 1px 12px rgba(253,249,238,0.7); }

/* Cookie banner */
.ds-cookie {
  position: fixed; bottom: 16px; left: 16px; right: 16px;
  max-width: 720px; margin: 0 auto;
  background: white; border: 2.5px solid var(--psp-ink);
  border-radius: 22px 18px 26px 16px;
  box-shadow: 6px 8px 0 var(--psp-shadow-hard);
  padding: 20px 22px;
  z-index: 80;
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.ds-cookie[hidden] { display: none !important; }
.ds-cookie__txt { margin: 0; flex: 1 1 320px; font-size: 15px; line-height: 1.55; }
.ds-cookie__cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* Quote carousel */
.sp-quote { position: relative; }
.sp-quote__viewport {
  position: relative; min-height: 200px;
  max-width: 880px; margin: 0 auto;
}
.sp-quote__slide {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  padding: 0 0 0 40px;
  margin: 0;
  pointer-events: none;
}
.sp-quote__slide.is-current {
  position: relative;
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}
.sp-quote__bracket {
  position: absolute; left: -28px; top: -28px;
  font-family: Georgia, serif; font-size: 160px;
  line-height: 1; color: var(--psp-coral);
  pointer-events: none;
  z-index: 0;
}
.sp-quote__text {
  position: relative; z-index: 1;
  font-family: var(--psp-font-hand);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.3; margin: 0 0 14px;
}
.sp-quote__author {
  font-family: var(--psp-font-hand); font-size: 22px;
  color: var(--psp-coral-deep);
}
.sp-quote__nav {
  display: flex; gap: 8px; margin-top: 24px;
  justify-content: center;
}
.sp-quote__arrow {
  appearance: none; border: 2px solid var(--psp-ink); background: var(--psp-yellow);
  width: 44px; height: 44px; border-radius: 999px;
  font-family: var(--psp-font-hand); font-size: 24px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--psp-shadow-hard);
  transition: transform 0.15s, box-shadow 0.15s;
}
.sp-quote__arrow:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--psp-shadow-hard); }
.sp-quote__dots {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; gap: 8px; justify-content: center;
}
.sp-quote__dot {
  appearance: none; border: 2px solid var(--psp-ink); background: transparent;
  width: 14px; height: 14px; border-radius: 999px; cursor: pointer;
  transition: background 0.15s;
}
.sp-quote__dot.is-current { background: var(--psp-coral-deep); }

/* Teacher modal */
.ds-modal-backdrop {
  position: fixed; inset: 0; background: rgba(58,46,29,0.7);
  z-index: 110; display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.ds-modal-backdrop[data-open="1"] { display: flex; }
.ds-modal {
  background: var(--psp-cream); border: 2.5px solid var(--psp-ink);
  border-radius: 18px 14px 22px 16px;
  max-width: 880px; width: 100%; max-height: 88vh; overflow: auto;
  padding: 28px 32px;
  box-shadow: 10px 12px 0 var(--psp-shadow-hard);
}
.ds-modal__close {
  appearance: none; border: 2px solid var(--psp-ink); background: white;
  border-radius: 999px; width: 40px; height: 40px;
  font-size: 22px; cursor: pointer; float: right;
}
.ds-modal__grid {
  display: grid; grid-template-columns: 220px 1fr; gap: 32px;
  margin-top: 12px;
}
@media (max-width: 700px) { .ds-modal__grid { grid-template-columns: 1fr; } }
.ds-modal__photo img { width: 100%; height: auto; border-radius: 4px; display: block; }
.ds-modal h2 {
  font-family: var(--psp-font-hand); margin: 0 0 8px;
  font-size: clamp(36px, 4vw, 56px);
}
.ds-modal__role { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--psp-coral-deep); font-weight: 700; }
.ds-modal__bio { font-size: 16px; line-height: 1.6; }

/* Editor preview helpers */
.ds-edit-block { padding: 8px; }
.ds-edit-empty {
  padding: 16px; background: rgba(255,227,138,0.2);
  border: 1.5px dashed var(--psp-line); border-radius: 8px;
  text-align: center; color: var(--psp-ink-soft);
}
.ds-field-group {
  padding: 12px 0; border-top: 1.5px dashed rgba(58,46,29,0.15);
}
.ds-field-group:first-child { border-top: 0; padding-top: 0; }

/* Pill that grows with content (teachers eyebrow on subpage hero) */
.psp-phero__eyebrow.ds-pill-auto { white-space: nowrap; }

/* Teachers grid CTA */
.sp-teachers__cta {
  margin-top: 56px;
  display: flex; justify-content: center;
}
.sp-teacher { cursor: pointer; }
.sp-teacher__more {
  display: inline-block; margin-top: 8px;
  font-family: var(--psp-font-hand); font-size: 20px;
  color: var(--psp-coral-deep);
  border-bottom: 2px solid currentColor; padding-bottom: 2px;
  align-self: flex-start;
}

/* Pagination */
.sp-akt__pager ul, .pagination ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.sp-akt__pager a, .sp-akt__pager .current, .pagination a, .pagination .current {
  display: inline-flex; align-items: center; padding: 8px 14px;
  background: white; border: 2px solid var(--psp-ink);
  border-radius: 18px 14px 22px 16px;
  font-family: var(--psp-font-hand); font-size: 19px;
  text-decoration: none; color: var(--psp-ink);
  box-shadow: 3px 3px 0 var(--psp-shadow-hard);
}
.sp-akt__pager .current, .pagination .current { background: var(--psp-yellow); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .v4-hero__video iframe { display: none; }
}

/* Print */
@media print {
  .v4-nav-wrap, .ds-cookie, .v4-hero__video, .ds-modal-backdrop, .sp-quote__nav, .sp-quote__dots, .v4-nav__toggle { display: none !important; }
  .v4-hero { background: white !important; }
}


/* ===== Header social icons (FB / YT next to Librus) ===== */
.v4-nav__social { display: flex; gap: 8px; align-items: center; }
.v4-social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px;
  border: 2px solid var(--psp-ink);
  box-shadow: 2px 2px 0 var(--psp-shadow-hard);
  font-family: var(--psp-font-hand); font-size: 19px; line-height: 1;
  color: var(--psp-ink); text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.v4-social:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--psp-shadow-hard); }
.v4-social--fb { background: var(--psp-blue); font-style: italic; }
.v4-social--yt { background: var(--psp-coral); font-size: 14px; padding-left: 2px; }
@media (max-width: 900px) {
  .v4-nav__social { order: 5; }
}


/* ===== Archiwum aktualności (page-news.php) ===== */
.sp-aktarch__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 8px;
}
.sp-aktarch__note {
  position: relative;
  display: flex; flex-direction: column;
  flex: none;
}
.sp-aktarch__link {
  display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; color: inherit;
}
.sp-aktarch__link:hover .v4-note__more { transform: translateX(3px); }
.sp-aktarch__note .v4-note__more { transition: transform 0.15s; }
.sp-aktarch__empty {
  text-align: center; padding: 48px 0;
  display: flex; flex-direction: column; gap: 20px; align-items: center;
}
.sp-aktarch__empty p { max-width: 560px; font-size: 17px; line-height: 1.6; color: var(--psp-ink-soft); }
.sp-akt__pager {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 48px;
}
.sp-akt__pagenum { font-family: var(--psp-font-hand); font-size: 22px; color: var(--psp-ink-soft); }


/* ===== #7 Fix: każda ramka „Z życia szkoły" rusza się niezależnie ===== */
.v4-life__grid { isolation: isolate; align-items: start; }
.v4-life__card { z-index: 1; transform-origin: center center; }
.v4-life__card:hover { z-index: 6; }

/* ===== #12 Wykres kolumnowy (grupowany) — My w rankingach ===== */
.sp-charts__empty {
  font-family: var(--psp-font-hand); font-size: 22px; color: var(--psp-ink-soft);
  background: rgba(255,227,138,0.25); border: 1.5px dashed var(--psp-line);
  border-radius: 12px; padding: 24px; text-align: center;
}
.sp-colchart {
  background: #fff;
  border: 2.5px solid var(--psp-ink);
  border-radius: 22px 18px 26px 20px;
  box-shadow: 6px 8px 0 var(--psp-shadow-hard);
  padding: 28px 28px 24px;
  margin: 28px 0 0;
}
.sp-colchart__head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.sp-colchart__title { font-family: var(--psp-font-hand); font-size: 34px; line-height: 1.05; color: var(--psp-ink); }
.sp-colchart__sub { font-size: 14px; color: var(--psp-ink-soft); }
.sp-colchart__legend {
  list-style: none; margin: 8px 0 18px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 16px;
}
.sp-colchart__legend li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--psp-ink-soft); }
.sp-colchart__chip { width: 18px; height: 18px; border: 2px solid var(--psp-ink); border-radius: 5px; }
.sp-colchart__chip--green  { background:#C9DC83; }
.sp-colchart__chip--blue   { background:#B6DEF0; }
.sp-colchart__chip--coral  { background:#F5B5A2; }
.sp-colchart__chip--yellow { background:#FFE38A; }
.sp-colchart__chip--rose   { background:#F0C6D4; }
.sp-colchart__chip--lilac  { background:#D9CAE8; }

.sp-colchart__plot { display: flex; gap: 14px; }
.sp-colchart__yaxis {
  display: flex; flex-direction: column; justify-content: space-between;
  height: 320px; padding-bottom: 30px; flex: none;
}
.sp-colchart__tick {
  font-size: 11px; color: var(--psp-ink-mute); line-height: 1;
  display: flex; align-items: center; height: 0;
}
.sp-colchart__groups {
  flex: 1; display: flex; gap: 10px; align-items: flex-end;
  height: 320px; padding: 0 4px 30px;
  border-left: 2px solid var(--psp-ink);
  border-bottom: 2px solid var(--psp-ink);
  position: relative;
}
.sp-colchart__group {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  height: 100%; justify-content: flex-end; position: relative;
}
.sp-colchart__bars { display: flex; align-items: flex-end; gap: 5px; height: 100%; width: 100%; justify-content: center; }
.sp-colchart__bar {
  width: clamp(14px, 5.5vw, 46px);
  border: 2px solid var(--psp-ink); border-bottom: none;
  border-radius: 7px 6px 0 0 / 8px 7px 0 0;
  position: relative; min-height: 3px;
  background-image: repeating-linear-gradient(45deg, rgba(58,46,29,0.16) 0 2px, transparent 2px 7px);
  background-color: #B6DEF0;
  transition: height 0.6s cubic-bezier(.2,.7,.2,1);
}
.sp-colchart__bar--green  { background-color:#C9DC83; }
.sp-colchart__bar--blue   { background-color:#B6DEF0; }
.sp-colchart__bar--coral  { background-color:#F5B5A2; }
.sp-colchart__bar--yellow { background-color:#FFE38A; }
.sp-colchart__bar--rose   { background-color:#F0C6D4; }
.sp-colchart__bar--lilac  { background-color:#D9CAE8; }
.sp-colchart__val {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  font-family: var(--psp-font-hand); font-size: 15px; color: var(--psp-ink); white-space: nowrap;
}
.sp-colchart__name {
  position: absolute; bottom: -28px; left: 0; right: 0;
  text-align: center; font-size: 13px; font-weight: 600; color: var(--psp-ink-soft);
  line-height: 1.1;
}
.sp-colchart__group.is-highlight .sp-colchart__name { color: var(--psp-coral-deep); font-weight: 700; }
.sp-colchart__group.is-highlight .sp-colchart__bar { filter: saturate(1.25); border-width: 2.5px; }
@media (max-width: 640px) {
  .sp-colchart__val { font-size: 12px; }
  .sp-colchart__name { font-size: 11px; }
}


/* ===== SVG wykres kolumnowy ===== */
.sp-colchart__svgwrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sp-colchart__svg { width: 100%; height: auto; display: block; min-width: 0; }

/* ===== #13 RESPONSYWNOŚĆ ===== */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, iframe { max-width: 100%; }

@media (max-width: 1100px) {
  .v4-hero { grid-template-columns: 1fr; gap: 28px; }
  .v4-hero__side { position: relative; min-height: 0; display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
  .v4-hero__side .v4-polaroid { position: static; transform: rotate(-2deg); width: 230px; top: auto; left: auto; right: auto; }
  .v4-hero__side .v4-polaroid--2 { transform: rotate(2deg); }
  .v4-life__grid { grid-template-columns: repeat(2, 1fr); }
  .sp-teachers__grid { grid-template-columns: repeat(3, 1fr); }
  .psp-foot__top { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 820px) {
  .sp-teachers__grid { grid-template-columns: repeat(2, 1fr); }
  .sp-principles__grid { grid-template-columns: repeat(2, 1fr); }
  .sp-prog__body, .sp-prog__body--both, .sp-prog__body--single { grid-template-columns: 1fr !important; }
  .sp-prog__table { border-right: none !important; border-bottom: 1.5px dashed rgba(58,46,29,0.25); }
  .psp-foot__cols { grid-template-columns: 1fr 1fr; }
  .sp-rank-hero { grid-template-columns: 1fr; }
  .ds-content { max-width: 100%; }
  .v4-news__hint { margin-left: 0; }
}

@media (max-width: 560px) {
  .v4-hero__side .v4-polaroid { width: 86%; }
  .v4-life__grid { grid-template-columns: 1fr; }
  .sp-teachers__grid { grid-template-columns: 1fr; }
  .sp-principles__grid { grid-template-columns: 1fr; }
  .psp-foot__cols { grid-template-columns: 1fr; }
  .v4-hero__cta { flex-direction: column; align-items: stretch; }
  .v4-hero__cta .cr-btn, .v4-hero__cta .v4-fb, .v4-hero__cta .v4-yt { justify-content: center; width: 100%; }
  .psp-phero__title { font-size: clamp(44px, 12vw, 64px); }
  .v4-title__big { font-size: clamp(68px, 21vw, 110px); }
  .sp-colchart { padding: 18px 14px 16px; }
  .sp-colchart__svgwrap { overflow-x: auto; }
  .sp-colchart__svg { min-width: 560px; }
  .v4-foot__cta, .psp-foot__cta { flex-direction: column; align-items: stretch; }
}


/* ===== Notatka pod wykresem (nagłówek = tytuł wykresu, opis = to pole) ===== */
.sp-colchart__note {
  margin: 14px 0 0;
  font-size: 16px; line-height: 1.6; color: var(--psp-ink);
  max-width: 1120px;
}
.sp-colchart__note p { margin: 0 0 10px; }
.sp-colchart__note p:last-child { margin-bottom: 0; }


/* CHART WIDTH CAP — wykres nie rozdmuchuje się na pełną szerokość strony */
.sp-colchart { max-width: 1060px; margin-left: 0; margin-right: 0; }
.sp-colchart__svg { width: 100%; height: auto; max-height: 470px; }
@media (max-width: 600px){
  .sp-colchart__svg { max-height: none; min-width: 560px; }
}


/* WYKRES CPT — sekcje wykresów z CPT ds_wykres */
.sp-wykres { padding-top: 22px; padding-bottom: 22px; }
.sp-wykres + .sp-wykres { padding-top: 0; }
.sp-wykres__img { max-width: 1060px; margin: 18px 0 0; }
.sp-wykres__img img {
  width: 100%; height: auto; display: block;
  border: 2.5px solid var(--psp-ink); border-radius: 10px;
  box-shadow: 6px 8px 0 var(--psp-shadow-hard);
}
.sp-wykres__text { margin-top: 18px; max-width: 1060px; }


/* Blok wykresu wstawiony w treści strony */
.sp-wykres-block { margin: 24px 0; }
.sp-wykres-block .sp-colchart { max-width: 1060px; margin-left: 0; margin-right: 0; }
.editor-styles-wrapper .sp-colchart { max-width: 100%; }
