/*
 * fuw-buttons-legacy.css – MOST dla starych sekcji z ACF (strony, które jeszcze nie są w blokach).
 * Przyciski z ACF mają kolory w atrybucie style="" oraz własne bloki <style> z hoverem dla każdej sekcji osobno
 * (stąd różne zachowania). Ten plik kieruje je do tego samego systemu z fuw-buttons.css.
 *
 * WAŻNE: ładuj PO fuw-buttons.css. Po przeniesieniu wszystkich stron na bloki USUŃ ten plik.
 * Używa !important i #page-wrapper tylko dlatego, że musi przebić style inline i reguły z identyfikatorami.
 */

/* --- A. Wariant z kolorów wpisanych w ACF (zerowa specyficzność – klasy z sekcji B mają pierwszeństwo) --- */
:where(#page-wrapper .buttons-row a.btn[style*="background-color: rgb(219,50,77)"]) { --b-bg: var(--fuw-red); --b-fg: var(--fuw-white); --b-bd: var(--fuw-red); --b-hbg: transparent; --b-hfg: var(--fuw-red); --b-hbd: var(--fuw-red); }
:where(#page-wrapper .buttons-row a.btn[style*="background-color: rgb(51,67,145)"] ) { --b-bg: var(--fuw-navy); --b-fg: var(--fuw-white); --b-bd: var(--fuw-navy); --b-hbg: transparent; --b-hfg: var(--fuw-navy); --b-hbd: var(--fuw-navy); }
:where(#page-wrapper .buttons-row a.btn[style*="background-color: rgb(250,247,240)"]),
:where(#page-wrapper .buttons-row a.btn[style*="background-color: rgb(255,255,255)"]) { --b-bg: var(--fuw-cream); --b-fg: var(--fuw-navy); --b-bd: var(--fuw-cream); --b-hbg: transparent; --b-hfg: var(--fuw-cream); --b-hbd: var(--fuw-cream); }
:where(#page-wrapper .buttons-row a.btn[style]:not([style*="background-color"])[style*="border-color: rgb(51,67,145)"])  { --b-bg: transparent; --b-fg: var(--fuw-navy);  --b-bd: var(--fuw-navy);  --b-hbg: var(--fuw-navy);  --b-hfg: var(--fuw-white); --b-hbd: var(--fuw-navy); }
:where(#page-wrapper .buttons-row a.btn[style]:not([style*="background-color"])[style*="border-color: rgb(219,50,77)"])  { --b-bg: transparent; --b-fg: var(--fuw-red);   --b-bd: var(--fuw-red);   --b-hbg: var(--fuw-red);   --b-hfg: var(--fuw-white); --b-hbd: var(--fuw-red); }
:where(#page-wrapper .buttons-row a.btn[style]:not([style*="background-color"])[style*="border-color: rgb(255,255,255)"]) { --b-bg: transparent; --b-fg: var(--fuw-white); --b-bd: var(--fuw-white); --b-hbg: var(--fuw-white); --b-hfg: var(--fuw-navy-dark); --b-hbd: var(--fuw-white); }

/* --- B. Klasy z Dodatkowego CSS mają pierwszeństwo przed kolorami z ACF (tak jest dziś na stronie) ---- */
#page-wrapper .buttons-row a.btn.btn-1, #page-wrapper a.hero-btn-1, #page-wrapper a.fuw-btn:not(.fuw-btn-2),
#page-wrapper #nabory .goal-item-card:nth-child(1) .goal-card-body-wrapper p:is([style*="text-align: center"], .has-text-align-center) > a
  { --b-bg: var(--fuw-red);  --b-fg: var(--fuw-white); --b-bd: var(--fuw-red);  --b-hbg: transparent; --b-hfg: var(--fuw-red);  --b-hbd: var(--fuw-red); }
#page-wrapper .buttons-row a.btn.btn-2,
#page-wrapper #nabory .goal-item-card:nth-child(2) .goal-card-body-wrapper p:is([style*="text-align: center"], .has-text-align-center) > a
  { --b-bg: var(--fuw-navy); --b-fg: var(--fuw-white); --b-bd: var(--fuw-navy); --b-hbg: transparent; --b-hfg: var(--fuw-navy); --b-hbd: var(--fuw-navy); }
#page-wrapper .buttons-row a.btn.btn-3, #page-wrapper a.fuw-btn-2
  { --b-bg: transparent;     --b-fg: var(--fuw-navy);  --b-bd: var(--fuw-navy); --b-hbg: var(--fuw-navy); --b-hfg: var(--fuw-white); --b-hbd: var(--fuw-navy); }
#page-wrapper .buttons-row a.btn.btn-4
  { --b-bg: transparent;     --b-fg: var(--fuw-red);   --b-bd: var(--fuw-red);  --b-hbg: var(--fuw-red);  --b-hfg: var(--fuw-white); --b-hbd: var(--fuw-red); }

/* --- C. Hero (ciemne tło): czerwony przycisk po najechaniu jest biały, jak w systemie ---------------- */
#page-wrapper .hero-section .buttons-row a.hero-btn { --b-hbg: var(--fuw-white); --b-hfg: var(--fuw-red); --b-hbd: var(--fuw-white); }

/* --- D. Ten sam komponent co w fuw-buttons.css (identyczne wartości, tylko mocniejsze selektory) ------ */
#page-wrapper :is(
  .buttons-row a.btn[style], a.btn.btn-1, a.btn.btn-2, a.btn.btn-3, a.btn.btn-4, a.hero-btn-1,
  a.fuw-btn, a.fuw-btn-2,
  #nabory .goal-card-body-wrapper p:is([style*="text-align: center"], .has-text-align-center) > a
) {
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  box-sizing: border-box;
  padding: var(--fuw-btn-pad) !important;
  font-size: var(--fuw-btn-size) !important; font-weight: var(--fuw-btn-weight) !important;
  line-height: var(--fuw-btn-line) !important; text-align: center !important; text-decoration: none !important;
  color: var(--b-fg) !important; background-color: var(--b-bg) !important; background-image: none !important;
  border: var(--fuw-btn-border) solid var(--b-bd) !important; border-radius: var(--fuw-btn-radius) !important;
  box-shadow: none !important; opacity: 1 !important; transform: none;
  transition: color var(--fuw-btn-time) ease, background-color var(--fuw-btn-time) ease, border-color var(--fuw-btn-time) ease, translate var(--fuw-btn-time) ease !important;
}
#page-wrapper :is(
  .buttons-row a.btn[style], a.btn.btn-1, a.btn.btn-2, a.btn.btn-3, a.btn.btn-4, a.hero-btn-1,
  a.fuw-btn, a.fuw-btn-2,
  #nabory .goal-card-body-wrapper p:is([style*="text-align: center"], .has-text-align-center) > a
):is(:hover, :focus-visible) {
  color: var(--b-hfg) !important; background-color: var(--b-hbg) !important; border-color: var(--b-hbd) !important;
  opacity: 1 !important; transform: none; translate: 0 var(--fuw-btn-lift); text-decoration: none !important;
}
#page-wrapper :is(.buttons-row a.btn[style], a.btn.btn-1, a.btn.btn-2, a.btn.btn-3, a.btn.btn-4, a.hero-btn-1, a.fuw-btn, a.fuw-btn-2):focus-visible {
  outline: 3px solid var(--b-bd) !important; outline-offset: 3px !important;
}
@media (max-width: 767px) {
  #page-wrapper :is(
    .buttons-row a.btn[style], a.btn.btn-1, a.btn.btn-2, a.btn.btn-3, a.btn.btn-4, a.hero-btn-1,
    a.fuw-btn, a.fuw-btn-2,
    #nabory .goal-card-body-wrapper p:is([style*="text-align: center"], .has-text-align-center) > a
  ) { padding: var(--fuw-btn-pad-mobile) !important; }
}
/* Nabory: stary kod wymusza transform z !important – wyłączamy tylko tam. */
#page-wrapper #nabory .goal-card-body-wrapper p:is([style*="text-align: center"], .has-text-align-center) > a:is(:hover, :focus-visible) { transform: none !important; }

/* Wysoki kontrast */
body:is(.high-contrast, .contrast) #page-wrapper :is(.buttons-row a.btn[style], a.btn.btn-1, a.btn.btn-2, a.btn.btn-3, a.btn.btn-4, a.hero-btn-1, a.fuw-btn, a.fuw-btn-2) {
  color: #fff !important; background: #000 !important; border-color: #fff !important;
}
body:is(.high-contrast, .contrast) #page-wrapper :is(.buttons-row a.btn[style], a.btn.btn-1, a.btn.btn-2, a.btn.btn-3, a.btn.btn-4, a.hero-btn-1, a.fuw-btn, a.fuw-btn-2):is(:hover, :focus-visible) {
  color: #000 !important; background: #fff !important; border-color: #fff !important;
}
/*
 * fuw-buttons-posts.css – przyciski w szablonie wpisu (single.php) podpięte pod system przycisków.
 *
 * Dlaczego: motyw ma dla tych przycisków własne reguły (unoszenie o 2 px, przezroczystość 0,9, inny kolor
 * czerwieni #E63946, wielkie litery, ramka 1 px), więc zachowują się inaczej niż reszta strony.
 * Ten plik daje im ten sam wygląd i ten sam hover co wszędzie: pełny <-> obrys, bez unoszenia.
 *
 * Instalacja: dopisz całą zawartość na KOŃCU pliku css/fuw-buttons-legacy.css (ładuje się po motywie i po fuw-buttons.css).
 * Plik działa sam (zmienne mają wartości zapasowe), więc nie zależy od fuw-buttons.css.
 */

/* ---------- 1. Warianty ---------- */
/* Niebieski pasek pod wpisem (ciemne tło): czerwony pełny, po najechaniu biały */
:is(.single-post-blue-cta .btn-cta-primary, .single-post-blue-cta .cta-btn) {
  --b-bg: var(--fuw-red, #DB324D);   --b-fg: var(--fuw-white, #FFFFFF); --b-bd: var(--fuw-red, #DB324D);
  --b-hbg: var(--fuw-white, #FFFFFF);--b-hfg: var(--fuw-red, #DB324D);  --b-hbd: var(--fuw-white, #FFFFFF);
}
/* Niebieski pasek: biały obrys, po najechaniu biały pełny z granatowym tekstem */
:is(.single-post-blue-cta .btn-cta-outline) {
  --b-bg: transparent;               --b-fg: var(--fuw-white, #FFFFFF); --b-bd: var(--fuw-white, #FFFFFF);
  --b-hbg: var(--fuw-white, #FFFFFF);--b-hfg: var(--fuw-navy-dark, #23327B); --b-hbd: var(--fuw-white, #FFFFFF);
}
/* Sekcja projektu i „Wszystkie wpisy” (jasne tło): granatowy pełny, po najechaniu obrys */
:is(.single-post-project-section .btn-project-primary, .single-post-related-blog .all-news-btn) {
  --b-bg: var(--fuw-navy, #334391);  --b-fg: var(--fuw-white, #FFFFFF); --b-bd: var(--fuw-navy, #334391);
  --b-hbg: transparent;              --b-hfg: var(--fuw-navy, #334391); --b-hbd: var(--fuw-navy, #334391);
}
/* Sekcja projektu: granatowy obrys, po najechaniu pełny */
:is(.single-post-project-section .btn-project-outline) {
  --b-bg: transparent;               --b-fg: var(--fuw-navy, #334391);  --b-bd: var(--fuw-navy, #334391);
  --b-hbg: var(--fuw-navy, #334391); --b-hfg: var(--fuw-white, #FFFFFF);--b-hbd: var(--fuw-navy, #334391);
}

/* ---------- 2. Ten sam komponent co w fuw-buttons.css ---------- */
:is(
  .single-post-blue-cta .btn-cta-primary, .single-post-blue-cta .cta-btn, .single-post-blue-cta .btn-cta-outline,
  .single-post-project-section .btn-project-primary, .single-post-project-section .btn-project-outline,
  .single-post-related-blog .all-news-btn
) {
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  box-sizing: border-box;
  padding: var(--fuw-btn-pad, 14px 28px) !important;
  font-size: var(--fuw-btn-size, 1rem) !important; font-weight: var(--fuw-btn-weight, 700) !important;
  line-height: var(--fuw-btn-line, 1.2) !important; letter-spacing: normal !important;
  text-align: center !important; text-decoration: none !important;
  text-transform: none !important;  /* motyw dokłada klasę text-uppercase; usuń tę linię, jeśli chcesz zostawić wielkie litery */
  color: var(--b-fg) !important; background-color: var(--b-bg) !important; background-image: none !important;
  border: var(--fuw-btn-border, 2px) solid var(--b-bd) !important; border-radius: var(--fuw-btn-radius, 999px) !important;
  box-shadow: none !important; opacity: 1 !important; transform: none !important;
  transition: color var(--fuw-btn-time, .2s) ease, background-color var(--fuw-btn-time, .2s) ease,
              border-color var(--fuw-btn-time, .2s) ease, translate var(--fuw-btn-time, .2s) ease !important;
}
:is(
  .single-post-blue-cta .btn-cta-primary, .single-post-blue-cta .cta-btn, .single-post-blue-cta .btn-cta-outline,
  .single-post-project-section .btn-project-primary, .single-post-project-section .btn-project-outline,
  .single-post-related-blog .all-news-btn
):is(:hover, :focus-visible) {
  color: var(--b-hfg) !important; background-color: var(--b-hbg) !important; border-color: var(--b-hbd) !important;
  opacity: 1 !important; transform: none !important; translate: 0 var(--fuw-btn-lift, 0px);
  text-decoration: none !important;
}
:is(
  .single-post-blue-cta .btn-cta-primary, .single-post-blue-cta .cta-btn, .single-post-blue-cta .btn-cta-outline,
  .single-post-project-section .btn-project-primary, .single-post-project-section .btn-project-outline,
  .single-post-related-blog .all-news-btn
):focus-visible { outline: 3px solid var(--b-bd) !important; outline-offset: 3px !important; }

@media (max-width: 767px) {
  :is(
    .single-post-blue-cta .btn-cta-primary, .single-post-blue-cta .cta-btn, .single-post-blue-cta .btn-cta-outline,
    .single-post-project-section .btn-project-primary, .single-post-project-section .btn-project-outline,
    .single-post-related-blog .all-news-btn
  ) { padding: var(--fuw-btn-pad-mobile, 12px 22px) !important; }
}

/* ---------- 3. Wysoki kontrast ---------- */
body:is(.high-contrast, .contrast) :is(
  .single-post-blue-cta .btn-cta-primary, .single-post-blue-cta .cta-btn, .single-post-blue-cta .btn-cta-outline,
  .single-post-project-section .btn-project-primary, .single-post-project-section .btn-project-outline,
  .single-post-related-blog .all-news-btn
) { color: #fff !important; background: #000 !important; border-color: #fff !important; }
body:is(.high-contrast, .contrast) :is(
  .single-post-blue-cta .btn-cta-primary, .single-post-blue-cta .cta-btn, .single-post-blue-cta .btn-cta-outline,
  .single-post-project-section .btn-project-primary, .single-post-project-section .btn-project-outline,
  .single-post-related-blog .all-news-btn
):is(:hover, :focus-visible) { color: #000 !important; background: #fff !important; border-color: #fff !important; }
