/* =====================================================
   MS-PROGRESS - most pomiedzy Elementorem (V4 + V3) a CSS projektu.
   Ladowany PRZED styles.css, wiec reguly projektu wygrywaja.
   Dotyczy tylko stron projektu (body.msp-page).
   ===================================================== */

/* Kontenery V4: zeruj domyslne odstepy Elementora (zmienne, nie wlasciwosci -
   dzieki temu padding/margin z klas projektu dzialaja bez zmian). */
.msp-page .elementor .e-atomic-element {
  --padding-top: 0px; --padding-right: 0px; --padding-bottom: 0px; --padding-left: 0px;
  --margin-top: 0px; --margin-right: 0px; --margin-bottom: 0px; --margin-left: 0px;
  --gap: 0px; --row-gap: 0px; --column-gap: 0px;
}
/* Kontenery V4 (.e-con): Elementor ustawia display:var(--display) (zmienna definiowana
   dopiero w wylaczonym arkuszu base-desktop), position:relative, width:100%, min-width:0.
   Przywroc zachowanie zwyklego znacznika HTML. Specyficznosc (0,1,0): wygrywa z .e-con
   (ten plik laduje sie pozniej), przegrywa z klasami projektu (laduja sie jeszcze pozniej). */
:where(body.msp-page .elementor) .e-atomic-element {
  display: block; position: static; width: auto; height: auto;
  min-width: auto; min-height: auto; max-width: none; overflow: visible; z-index: auto;
}
:where(body.msp-page .elementor) .e-atomic-element:where(a, span) { display: inline; }

/* Widgety V3 (blok tekstowy, HTML) nie tworza wlasnego pudelka -
   ich zawartosc uklada sie tak, jakby byla bezposrednim dzieckiem kontenera. */
body.msp-page:not(.elementor-editor-active) .elementor-widget-text-editor,
body.msp-page:not(.elementor-editor-active) .elementor-widget-text-editor > .elementor-widget-container,
body.msp-page:not(.elementor-editor-active) .elementor-widget-html,
body.msp-page:not(.elementor-editor-active) .elementor-widget-html > .elementor-widget-container {
  display: contents;
}
.msp-page .elementor-widget-text-editor,
.msp-page .elementor-widget-html {
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; line-height: inherit;
  margin: 0; padding: 0;
}
.msp-page .elementor .elementor-widget:not(:last-child) { margin-block-end: 0; }

/* Reset typograficzny Astry wewnatrz tresci Elementora (specyficznosc elementu,
   wiec kazda klasa z projektu nadal wygrywa). */
:where(.msp-page .elementor) :is(p, h1, h2, h3, h4, h5, h6, ul, ol, dl, dd, figure, blockquote, table, pre) {
  margin: 0;
}
:where(.msp-page .elementor) :is(ul, ol) { padding: 0; }
:where(.msp-page .elementor) img { height: auto; }

/* Widgety V4 renderuja czyste znaczniki; wyrownaj drobiazgi po stronie Elementora. */
/* (margines akapitow/naglowkow V4 zeruje reset typograficzny wyzej - o specyficznosci elementu,
   zeby marginesy z klas projektu, np. .cta-strip p, nadal dzialaly) */

/* Edytor Elementora: puste kontenery dekoracyjne (scrim, linie) nie przeszkadzaja w klikaniu. */
body.elementor-editor-active.msp-page .photo-hero__scrim,
body.elementor-editor-active.msp-page .photo-hero__lines { pointer-events: none; }

/* Klasa globalna msp-ukryj: element ukryty na stronie, w edytorze Elementora widoczny
   (polprzezroczysty, przerywana ramka). Aby go pokazac - usun klase w edytorze. */
body:not(.elementor-editor-active) .msp-ukryj { display: none !important; }
body.elementor-editor-active .msp-ukryj { opacity: .35; outline: 2px dashed #168FCA; outline-offset: 4px; }

/* Edytor: elementy z animacja pojawiania (msp-reveal) sa zawsze widoczne - Elementor rysuje
   je po uruchomieniu script.js, wiec nigdy nie dostalyby klasy .is-in. */
body.elementor-editor-active .msp-reveal { opacity: 1 !important; transform: none !important; }

/* Selektory sasiedztwa z projektu (+, :has(+ ...)) nie przechodza przez opakowanie bloku tekstowego V3
   (.elementor-widget-text-editor > .elementor-widget-container > ...). Odpowiedniki: */
.article-body__main p:has(+ .elementor-widget-text-editor > .elementor-widget-container > :is(ul, ol):first-child) { margin-bottom: 10px; }

/* Astra nadaje h5/h6 (0,0,1) krój Heebo, rozmiar, line-height i kolor. Projekt ma bazowe style tylko
   dla h1-h4, wiec dla h5/h6 przywracamy zachowanie przegladarki; reguly projektu z klasami nadal wygrywaja. */
:where(body.msp-page) h5 { font-family: inherit; font-weight: bold; font-size: 0.83em; line-height: inherit; color: inherit; clear: none; }
:where(body.msp-page) h6 { font-family: inherit; font-weight: bold; font-size: 0.67em; line-height: inherit; color: inherit; clear: none; }

/* ---------- Formularze Contact Form 7 (zamiast statycznych formularzy z projektu) ---------- */
/* Opakowania Elementora i CF7 nie tworza pudelek - <form> jest dzieckiem kontenera jak w projekcie. */
body.msp-page:not(.elementor-editor-active) .elementor-widget-shortcode,
body.msp-page:not(.elementor-editor-active) .elementor-widget-shortcode > .elementor-widget-container,
body.msp-page .elementor-shortcode,
body.msp-page .wpcf7 { display: contents; }
/* CF7 (WPCF7_AUTOP) dokleja <p> wokol etykiety i pola oraz <br> - w projekcie ich nie ma. */
body.msp-page .wpcf7-form p { display: contents; }
body.msp-page .wpcf7-form br { display: none; }
body.msp-page .wpcf7-form-control-wrap { display: block; width: 100%; }
.msp-form--kontakt .wpcf7-form { margin-top: 48px; }
/* Komunikat po wyslaniu (zamiast alert() z prototypu) */
body.msp-page .wpcf7 form .wpcf7-response-output {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent-soft);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}
body.msp-page .wpcf7 form.invalid .wpcf7-response-output,
body.msp-page .wpcf7 form.unaccepted .wpcf7-response-output,
body.msp-page .wpcf7 form.payment-required .wpcf7-response-output { border-color: #c2410c; background: #fff4ed; }
body.msp-page .wpcf7 form.failed .wpcf7-response-output,
body.msp-page .wpcf7 form.aborted .wpcf7-response-output,
body.msp-page .wpcf7 form.spam .wpcf7-response-output { border-color: #b42318; background: #fef3f2; }
.theme-dark body.msp-page .wpcf7 form.invalid .wpcf7-response-output,
.theme-dark body.msp-page .wpcf7 form.failed .wpcf7-response-output,
.theme-dark body.msp-page .wpcf7 form.aborted .wpcf7-response-output,
.theme-dark body.msp-page .wpcf7 form.spam .wpcf7-response-output { background: rgba(180, 35, 24, 0.14); }
body.msp-page .wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #b42318;
}
body.msp-page .wpcf7-form .wpcf7-not-valid { border-color: #b42318; }
.theme-dark body.msp-page .wpcf7-not-valid-tip { color: #f97066; }
/* Formularz rekrutacyjny stoi na ciemnym tle */
body.msp-page .wpcf7 form.recruit-form .wpcf7-response-output { background: rgba(255, 255, 255, 0.06); color: #fff; }
body.msp-page .recruit-form .wpcf7-not-valid-tip { color: #fda29b; }
/* Astra (compatibility/contact-form-7) nadpisuje pola: .wpcf7 form>div{margin-bottom:1.2em}, .wpcf7 input{padding:.75em},
   focus, pole pliku. Przywracamy wartosci z pages.css (specyficznosc wyzsza niz u Astry). */
body.msp-page .wpcf7 form > div { margin-bottom: 0; }
body.msp-page .wpcf7 .wpcf7-form-control-wrap > .wpcf7-form-control { display: block; }
body.msp-page .wpcf7 .form-row :is(input, select, textarea) { padding: 6px 0; }
body.msp-page .wpcf7 .form-row :is(input, select, textarea):focus { border-color: transparent; border-bottom-color: var(--ink-900); }
body.msp-page .wpcf7 .recruit-form :is(input, select, textarea) { padding: 11px 12px; }
body.msp-page .wpcf7 .recruit-form :is(input, select, textarea):focus { border-color: var(--accent); }
body.msp-page .wpcf7 .recruit-form input[type=file] { height: auto; padding: 8px; color: var(--ink-300); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 0; box-shadow: none; }.theme-dark body.msp-page .wpcf7 .recruit-form input[type=file] { color: #fff; }

/* Decyzja klienta 2026-09-28: zgoda na newsletter jako pole do zaznaczenia (tekst bez zmian, typografia jak .form-submit small). */
body.msp-page .msp-consent .wpcf7-form-control-wrap,
body.msp-page .msp-consent .wpcf7-acceptance,
body.msp-page .msp-consent .wpcf7-list-item { display: block; margin: 0; }
body.msp-page .msp-consent label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  color: inherit;
}
body.msp-page .wpcf7 .msp-consent input[type=checkbox] {
  -webkit-appearance: auto;
  appearance: auto;
  flex: none;
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 1px 0 0;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--accent);
  cursor: pointer;
}