/* ═══════════════════════════════════════════════════════════════════
   overrides.css — globalne stylistyczne poprawki (D469, 14.04.2026)
   ─────────────────────────────────────────────────────────────────
   Cel: zastąpić inline style per element czystym zewnętrznym CSS.
   Zmiana stylu = edycja 1 pliku → update na wszystkich artykułach.

   Upload per domena: /overrides.css
   Włączenie w szablonach: <link rel="stylesheet" href="/overrides.css">
   Musi być ładowany PO głównym CSS (inline <style> lub zew link).

   Obowiązuje od: D469 (incydent hardcoded CTA cleanup)
   ═══════════════════════════════════════════════════════════════════ */


/* ─── BLOCKQUOTE — cytaty w artykułach ──────────────────────────── */

blockquote {
  padding: 20px 28px;
  margin: 24px auto;
  max-width: 720px;
  border-left: 4px solid #b89450;
  background: rgba(255, 255, 255, 0.04);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  border-radius: 0 6px 6px 0;
}

blockquote p {
  margin: 0 0 8px 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote footer,
blockquote cite {
  display: block;
  margin-top: 10px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: normal;
}

blockquote footer em,
blockquote cite em {
  color: #b89450;
  font-style: italic;
}

/* Wersja jasna (jeśli strona ma białe tło) */
body.theme-light blockquote,
.theme-light blockquote {
  background: rgba(184, 148, 80, 0.06);
  color: #102644;
}

body.theme-light blockquote footer,
.theme-light blockquote footer {
  color: rgba(16, 38, 68, 0.6);
}


/* ─── CTA LOADER — fallback/safety ──────────────────────────────── */

/* Gdy cta-loader.js nie załadował się z jakiegoś powodu, ukryj pusty cta-zone */
#cta-zone:empty {
  display: none;
}

/* Gdy są ślady starych hardcoded CTA które przeoczył pipeline — DON'T display */
.cta-section[style*="background:#f8f5f0"],
div[style*="background:#f9f9f9"][style*="border-left:4px solid #e74c3c"] {
  display: none !important;
}


/* ─── NAV CTA — konsystencja (D469) ─────────────────────────────── */

/* Nav CTA — D474.2 (15.04.2026) FIX kontrast.
   Wcześniej: color: #b89450 (gold) na bg gold #c0a56e = niewidoczny gold-on-gold.
   Teraz: ciemny navy text (czytelny na gold), bold, hover gold→darker. */
.nav__cta {
  color: #102644 !important;
  font-weight: 700;
  transition: all 0.2s ease;
}

.nav__cta:hover {
  color: #0a1a2e !important;
  transform: translateY(-1px);
}


/* ─── TYPOGRAPHY FIXES ─────────────────────────────────────────── */

/* Polski dywiz (półpauza) - automatyczne "—" zamiast "--" w treści */
article p, article li {
  /* hyphens: auto; /* disabled — polish word breaks are tricky */
  word-wrap: break-word;
}

/* Pierwszy paragraf po H2/H3 — odstęp */
article h2 + p,
article h3 + p {
  margin-top: 12px;
}


/* ─── RESPONSIVE (mobile blockquote fix) ──────────────────────── */

@media (max-width: 700px) {
  blockquote {
    padding: 16px 20px;
    margin: 18px 0;
    font-size: 0.98rem;
  }
}


/* ─── TABLES — D474 (15.04.2026) — fix only when needed ───────────
   Reguły aktywne TYLKO dla tabel BEZ inline background (czyli czysty
   default, dziedziczący body color). Tabele z `style="background:#fff..."`
   mają własny inline kontrast — NIE nadpisujemy ich (psuje light tables
   na dark page'u: white text on white bg).

   Dwa scenariusze:
   1) Article table BEZ inline bg (na dark page) → th + td jasne na ciemnym
   2) Article table z inline `background:#fff` → ZOSTAW (inline rządzi)
*/

article table:not([style*="background"]) th,
.article-body table:not([style*="background"]) th {
  background: rgba(184, 148, 80, 0.18);
  color: #f0e8d4;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid rgba(184, 148, 80, 0.5);
}

article table:not([style*="background"]) td,
.article-body table:not([style*="background"]) td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
}

/* Tabele z inline white bg (light tables na dark page'u) — wymusz
   ciemny tekst i sprzed inheritance body color jasnego.
   !important bo computed-style cascade pokazuje #1a1a1a ale render
   serwuje jasny — coś w głębokiej cascadzie wygrywa. */
article table[style*="background:#fff"],
article table[style*="background: #fff"],
article table[style*="background:#FFF"] {
  color: #1a1a1a !important;
}
article table[style*="background:#fff"] td,
article table[style*="background:#fff"] th,
article table[style*="background: #fff"] td,
article table[style*="background: #fff"] th,
article table[style*="background:#FFF"] td,
article table[style*="background:#FFF"] th {
  color: #1a1a1a !important;
}
/* TR z explicit dark bg + color:#fff (header row np `<tr style="background:#1a1a2e;color:#fff">`)
   muszą mieć th z transparent bg żeby tr granat rządził. Inaczej
   `.article-body th { background: var(--ink) }` daje th kremowy bg + biały color = invisible. */
article table[style*="background:#fff"] tr[style*="color:#fff"] td,
article table[style*="background:#fff"] tr[style*="color:#fff"] th {
  color: #fff !important;
  background: transparent !important;
}
/* INLINE ELEMENTS w light table — strong/b/em/i/a/code dostają color z
   .article-body var(--ink) który na dark theme = kremowy → niewidoczne.
   Wymuszamy ciemny color na light table dla wszystkich inline. */
article table[style*="background:#fff"] strong,
article table[style*="background:#fff"] b,
article table[style*="background:#fff"] em,
article table[style*="background:#fff"] i,
article table[style*="background:#fff"] code,
article table[style*="background:#fff"] span:not([style*="color"]) {
  color: #1a1a1a !important;
}
article table[style*="background:#fff"] a {
  color: #b89450 !important;
}
/* TR z color:#fff (header) — strong w środku też powinien być biały */
article table[style*="background:#fff"] tr[style*="color:#fff"] strong,
article table[style*="background:#fff"] tr[style*="color:#fff"] b,
article table[style*="background:#fff"] tr[style*="color:#fff"] em {
  color: #fff !important;
}


/* ─── A11Y — focus states ──────────────────────────────────────── */

.nav__cta:focus-visible,
.cta-button:focus-visible,
#cta-zone a:focus-visible {
  outline: 2px solid #b89450;
  outline-offset: 3px;
}


/* ─── PRINT ─────────────────────────────────────────────────────── */

@media print {
  .nav__cta,
  #cta-zone,
  .cta-section {
    display: none !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════
   HOW TO INCLUDE (w szablonie per domena)
   ─────────────────────────────────────────────────────────────────
   <head>
     ... existing <style> ...
     <link rel="stylesheet" href="/overrides.css">
   </head>
   ═══════════════════════════════════════════════════════════════════ */
