/*
Theme Name: NIP Lab
Theme URI: https://niplab.eu
Description: Motyw potomny Kadence dla NIP Lab. Wlasne style i drobne poprawki motywu. Narzedzia (API rejestrow) sa w osobnej wtyczce, nie w motywie.
Author: Storm Cube
Author URI: https://stormcube.pl
Template: kadence
Version: 1.1.15
Text Domain: niplab
*/

/* ==========================================================================
   Sekcje strony zbudowane na blokach Kadence (makieta makiety/strona-v1, DESIGN.md).
   Tu jest TYLKO to, czego bloki nie maja w ustawieniach: pseudoelementy, tabela,
   akordeon <details>, kolko z numerem, podglad wykresu. Kolory i odstepy sekcji
   ustawione w blokach. Klasy dodane w bloku: Zaawansowane -> Dodatkowe klasy CSS.
   ========================================================================== */
:root {
	--nl-granat: #1b2f6b;
	--nl-ink: #0a0b0d;
	--nl-body: #5b616e;
	--nl-mute: #6a707a;
	--nl-hairline: #dee1e6;
	--nl-hairline-soft: #eef0f3;
	--nl-surface-soft: #f5f7fa;
	--nl-zle: #c0202d;
	--nl-uwaga: #8a5a00;
	--nl-uwaga-pasek: #d99a00;
	--nl-wykres-1: #2a78d6;
}

/* Liczby w skrocie: kreska nad rzedem, tylko na szerokosc tresci (bez bocznych marginesow wiersza). */
.nl-liczby-rzad > .kt-row-column-wrap { background: linear-gradient(var(--nl-hairline-soft), var(--nl-hairline-soft)) no-repeat top left / 100% 1px; background-origin: content-box; background-clip: content-box; }
.nl-liczby-rzad > .kt-row-column-wrap > .wp-block-kadence-column { padding-top: 40px; }

/* Jak to dziala: kolko z numerem + linia laczaca kroki. */
.nl-krok-nr { width: 40px; height: 40px; border-radius: 999px; background: var(--nl-granat); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; line-height: 1; }
/* Linia od kolka do nastepnej kolumny (odstep miedzy kolumnami 40 px). */
.nl-kroki .wp-block-kadence-column { position: relative; }
.nl-kroki .wp-block-kadence-column:not(:last-child)::after { content: ""; position: absolute; top: 20px; left: 40px; right: -40px; height: 1px; background: var(--nl-hairline); }

/* Ostrzezenia: pasek w kolorze statusu z lewej, etykieta stanu (znak + slowo) po prawej. */
.nl-ostrz { position: relative; background: #fff; border-left: 3px solid var(--nl-zle); border-radius: 0 16px 16px 0; box-shadow: inset 0 0 0 1px var(--nl-hairline-soft); padding: 16px 120px 16px 20px; color: var(--nl-body); font-size: 15px; line-height: 1.5; min-height: 104px; }
.nl-ostrz strong { display: block; color: var(--nl-ink); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.nl-ostrz::after { position: absolute; top: 16px; right: 18px; font-size: 12px; font-weight: 600; }
.nl-ostrz-zle::after { content: "✕ Problem"; color: var(--nl-zle); }
.nl-ostrz-uwaga { border-left-color: var(--nl-uwaga-pasek); }
.nl-ostrz-uwaga::after { content: "! Warto sprawdzić"; color: var(--nl-uwaga); }

/* Ikona rejestru w kartach narzedzi (to samo kolko co w tabeli wyniku). */
.nl-ikona-rej { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; line-height: 1; background: var(--nl-ink); }
.nl-ikona-rej.nl-ik-vat { background: var(--nl-granat); }
.nl-ikona-rej.nl-ik-vies { background: #3a3f48; }
.nl-ikona-rej.nl-ik-szary { background: var(--nl-mute); }

/* Podglad wykresu (sekcja kondycji finansowej) - przyklad, blok HTML. */
.nl-podglad { background: #fff; border: 1px solid var(--nl-hairline-soft); border-radius: 16px; box-shadow: 0 8px 28px rgba(10,11,13,.06); padding: 24px 28px; }
.nl-podglad-tytul { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 26px; }
.nl-podglad-tytul b { font-weight: 600; color: var(--nl-ink); }
.nl-podglad-tytul span { color: var(--nl-mute); }
.nl-slupki { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; align-items: end; height: 220px; border-bottom: 1px solid var(--nl-hairline); }
.nl-slupek { background: var(--nl-wykres-1); border-radius: 4px 4px 0 0; position: relative; }
.nl-slupek span { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--nl-ink); }
.nl-lata { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; font-size: 12px; color: var(--nl-mute); text-align: center; margin-top: 8px; font-variant-numeric: tabular-nums; }

/* Tabela zrodel danych. */
.nl-tabela-zrodel { margin: 0; }
.nl-tabela-zrodel table { width: 100%; border-collapse: collapse; font-size: 15px; }
.nl-tabela-zrodel th, .nl-tabela-zrodel td { border: 0; border-bottom: 1px solid var(--nl-hairline-soft); padding: 16px 16px 16px 0; text-align: left; vertical-align: top; color: var(--nl-body); background: none; }
.nl-tabela-zrodel thead { border: 0; }
.nl-tabela-zrodel th { font-size: 13px; font-weight: 600; color: var(--nl-mute); padding-top: 0; padding-bottom: 12px; border-bottom-color: var(--nl-hairline); }
.nl-tabela-zrodel td:first-child { color: var(--nl-ink); font-weight: 600; width: 22%; }
.nl-tabela-zrodel td:nth-child(2) { width: 30%; }

/* FAQ: natywny akordeon <details> (blok „Szczegoly”). */
.nl-faq { border-bottom: 1px solid var(--nl-hairline-soft); padding: 20px 0; margin: 0 !important; }
.nl-faq:first-of-type { border-top: 1px solid var(--nl-hairline-soft); }
.nl-faq summary { list-style: none; display: flex; justify-content: space-between; gap: 16px; font-size: 17px; font-weight: 600; color: var(--nl-ink); cursor: pointer; }
.nl-faq summary::-webkit-details-marker { display: none; }
.nl-faq summary::after { content: "+"; color: var(--nl-granat); font-size: 22px; line-height: 1; font-weight: 500; }
.nl-faq[open] summary::after { content: "−"; }
.nl-faq p { color: var(--nl-body); margin: 10px 0 0; max-width: 640px; }

/* Klawisze (Ctrl + D) - format „Klawiatura” w edytorze. */
kbd { font: 600 13px/1.4 inherit; font-family: inherit; border: 1px solid var(--nl-hairline); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; background: #fff; color: var(--nl-ink); }

/* Karty narzedzi: „Otworz →” zawsze na dole karty, niezaleznie od dlugosci opisu. */
.wp-block-kadence-column > .kt-inside-inner-col:has(> .nl-ikona-rej) { display: flex; flex-direction: column; height: 100%; }
.kt-inside-inner-col:has(> .nl-ikona-rej) > .wp-block-kadence-advancedheading:last-child,
.kt-inside-inner-col:has(> .nl-ikona-rej) > a:last-child { margin-top: auto; }

/* Listy w treści (blok „Lista” z klasą nl-lista): kroki z numerem w kółku albo punkty z kreską. */
.nl-lista { margin: 0 0 8px; padding: 0; list-style: none; counter-reset: nl-krok; max-width: 760px; }
.nl-lista > li { position: relative; padding: 10px 0 10px 44px; color: var(--nl-body); font-size: 16px; line-height: 1.55; border-bottom: 1px solid var(--nl-hairline-soft); }
.nl-lista > li strong { color: var(--nl-ink); }
ol.nl-lista > li::before { counter-increment: nl-krok; content: counter(nl-krok); position: absolute; left: 0; top: 10px; width: 28px; height: 28px; border-radius: 999px; background: var(--nl-granat); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
ul.nl-lista > li::before { content: ""; position: absolute; left: 8px; top: 21px; width: 12px; height: 2px; background: var(--nl-granat); }
/* Tabela w treści (np. statusy VAT, wskaźniki, wyniki finansowe) - ten sam styl co tabela źródeł. */
.nl-tabela-zrodel td.nl-liczba, .nl-tabela-zrodel th.nl-liczba { text-align: right; font-variant-numeric: tabular-nums; }
.nl-tabela-podpis { font-size: 13px; color: var(--nl-mute); margin-top: 10px; }

/* Animacja „Jak to działa” (film z Remotion, zaakceptowana 28.09) w ramce okna przeglądarki - pasek z kropkami i adresem. */
.nl-animacja { position: relative; margin: 0 auto; max-width: 1060px; padding-top: 40px; background: var(--nl-surface-soft); border: 1px solid var(--nl-hairline); border-radius: 16px; overflow: hidden; box-shadow: 0 16px 40px -16px rgba(10,11,13,.22); }
.nl-animacja::before { content: ""; position: absolute; top: 15px; left: 18px; width: 10px; height: 10px; border-radius: 999px; background: #d3d7dd; box-shadow: 16px 0 0 #d3d7dd, 32px 0 0 #d3d7dd; }
.nl-animacja::after { content: "niplab.eu"; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); padding: 3px 28px; font-size: 12px; font-weight: 500; color: var(--nl-mute); background: #fff; border: 1px solid var(--nl-hairline-soft); border-radius: 8px; }
.nl-animacja video { display: block; width: 100%; height: auto; border: 0; border-top: 1px solid var(--nl-hairline); background: #fff; }

/* Etykieta nad nagłówkiem sekcji jako plakietka (Michał 28.09: „Jak to działa” było za mało widoczne).
   Wzorzec z Linear/Vercel: krótki tekst na jasnym tle koloru marki. */
/* font-size z !important: Kadence wypisuje rozmiar z bloku (13 px) regułą z jego ID, silniejszą niż klasa. */
p.nl-etykieta.wp-block-kadence-advancedheading { display: inline-block; padding: 7px 14px; border-radius: 8px; background: #eef1f9; color: var(--nl-granat); font-size: 15px !important; font-weight: 600; line-height: 1.3; letter-spacing: .1px; }
/* FAQ w jednej kolumnie (Michał 28.09) - lista pytań w czytelnej szerokości. */
.nl-faq { max-width: 900px; }
/* Podpis pod animacją = opis słowami, co jest na filmie (dla ludzi i dla Google/AI, ten sam tekst trafia do VideoObject). */
.nl-animacja figcaption { margin: 0; padding: 14px 20px; background: #fff; border-top: 1px solid var(--nl-hairline-soft); color: var(--nl-body); font-size: 14px; line-height: 1.55; text-align: left; }

/* Telefon (28.09): wykres w przykładzie czytnika - lata nie mogą się łamać na „201 / 9”. */
@media (max-width: 767px) {
	.nl-podglad { padding: 18px 16px; }
	.nl-podglad-tytul { flex-wrap: wrap; gap: 4px 12px; margin-bottom: 22px; }
	.nl-slupki, .nl-lata { gap: 6px; }
	.nl-lata { font-size: 11px; }
	.nl-slupek span { font-size: 11px; }
	/* Tabele w treści: mieszczą się bez przewijania w bok (węższe komórki, łamanie długich słów). */
	.nl-tabela-zrodel table { font-size: 13.5px; }
	.nl-tabela-zrodel th, .nl-tabela-zrodel td { padding: 12px 10px 12px 0; hyphens: auto; -webkit-hyphens: auto; }
	.nl-tabela-zrodel { overflow-x: auto; }
	.nl-tabela-zrodel th { font-size: 12px; }
}

/* Wykres w artykule (28.09, pierwszy: EBITDA) - karta jak reszta, legenda nad wykresem, źródło pod spodem. */
.nl-wykres-art { margin: 8px 0 24px; padding: 20px 24px 16px; border: 1px solid var(--nl-hairline-soft); border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(10,11,13,.06); }
.nl-wykres-art svg { display: block; width: 100%; height: auto; font-family: inherit; font-variant-numeric: tabular-nums; }
.nl-wykres-art-tytul { font-size: 16px; font-weight: 600; color: var(--nl-ink); margin-bottom: 8px; }
.nl-wykres-legenda { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; font-size: 13px; color: var(--nl-mute); }
.nl-wykres-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.nl-wykres-legenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.nl-wykres-art-zrodlo { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--nl-mute); }
@media (max-width: 767px) {
	.nl-wykres-art { padding: 16px 14px 12px; overflow-x: auto; }
	/* Wykres na telefonie nie maleje do nieczytelnych liczb - przewija się w bok (dokładne liczby są w tabeli pod nim). */
	.nl-wykres-art svg { min-width: 600px; }
}

/* Punkty list „tytuł + opis” (Michał 28.09): pogrubiony początek punktu = tytuł w osobnej linii, opis pod nim.
   Wszędzie tak samo: strony narzędzi i artykuły. Treść punktów jest napisana pod ten układ (opis od wielkiej litery). */
.nl-lista li > strong:first-child { display: block; margin-bottom: 2px; color: var(--nl-ink); }

/* Strona /kontakt/ (28.09): adres e-mail w osobnej linii z ikoną koperty (Michał). Ikona w CSS, bez obrazków i bez obcych czcionek. */
.nl-kontakt-mail { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.nl-kontakt-mail::before {
	content: "";
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: #eef1f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b2f6b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3.5 6.5 8.5 6.5 8.5-6.5'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.nl-kontakt-mail a { text-decoration: none; }
.nl-kontakt-mail a:hover { text-decoration: underline; }

/* Wykres słupkowy poziomy w HTML (artykuł ROE, 28.09) - prefiks nl-poziom, bo .nl-slupek jest już na stronie głównej: długie nazwy + słupki. Komputer: nazwa obok słupka; telefon: nazwa nad słupkiem.
   Zamiast SVG, które na 390 px ucinało słupki (przewijanie w bok) albo dawało nieczytelny tekst. */
.nl-wykres-slupki .nl-poziom { display: grid; grid-template-columns: 40% 1fr; gap: 12px; align-items: center; padding: 3px 0; }
.nl-poziom-nazwa { font-size: 13.5px; line-height: 1.3; color: var(--nl-ink); text-align: right; }
.nl-poziom-tor { position: relative; height: 22px; }
.nl-poziom-tor::before { content: ""; position: absolute; top: -3px; bottom: -3px; left: var(--zero); width: 1px; background: #9aa1ab; }
.nl-poziom-tor i { position: absolute; top: 3px; height: 16px; border-radius: 3px; background: #2a78d6; }
.nl-poziom-tor b { position: absolute; top: 2px; margin-left: 6px; font-size: 12.5px; font-weight: 600; color: var(--nl-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nl-poziom--ogolem .nl-poziom-nazwa { font-weight: 600; }
.nl-poziom--ogolem .nl-poziom-tor i { background: #eb6834; }
.nl-poziom--minus .nl-poziom-tor b { color: #c2511f; }
@media (max-width: 600px) {
	.nl-wykres-slupki { overflow-x: visible; }
	.nl-wykres-slupki .nl-poziom { grid-template-columns: 1fr; gap: 2px; padding: 5px 0; }
	.nl-poziom-nazwa { text-align: left; font-size: 13px; }
}
