/*
 * Widgety treści bloga: tabele, ramki (Tip / Uwaga / Przykład), wzory wiadomości, „Czego nie robimy”,
 * sekcje „Jak rozwiązaliśmy …” i „… w skrócie”, schematy (pre), listy numerowane.
 * Jedyny plik ze stylami tych elementów. Klasy dodaje BlogHtml::render() (app/Blog/Html.php, decorate()),
 * a w Markdownie wystarczy zwykła składnia (tabela | a | b |, cytat > **Tip specjalny:** …, blok ```).
 * Kolory z tokenów marki (classme.css); wartości pomocnicze w --bw-* poniżej, żeby zmieniać je w jednym miejscu.
 */
.blog-content {
	--bw-radius: 16px;
	--bw-radius-sm: 12px;
	--bw-gap: 1.5em;
	--bw-tip-bg: #FFFBD6;   --bw-tip-edge: #E5D400;   --bw-tip-ink: #5C5400;
	--bw-note-bg: var(--cm-primary-soft, #E6F0FF); --bw-note-edge: var(--cm-primary, #3485FF); --bw-note-ink: var(--cm-primary-dark, #1D4ED8);
	--bw-ex-bg: #E7F7F2;    --bw-ex-edge: #14A38B;    --bw-ex-ink: #0B6B5A;
	--bw-know-bg: #F3EFFF;  --bw-know-edge: #7C5CFA;  --bw-know-ink: #4A2FB8;
	--bw-warn-bg: #FFF3E0;  --bw-warn-edge: #F59E0B;  --bw-warn-ink: #8A4B00;
	--bw-line: var(--cm-border, #E8EDF3);
	--bw-soft: var(--cm-bg-soft, #F4F7FC);
	--bw-ink: var(--cm-ink, #0B1120);
	--bw-ink-soft: var(--cm-ink-soft, #475569);
}

/* ---------- tabele ---------- */
.blog-content .blog-table-wrap {
	margin: 0 0 var(--bw-gap);
	border: 1px solid var(--bw-line);
	border-radius: var(--bw-radius);
	background: #fff;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	box-shadow: 0 1px 2px rgba(7, 27, 77, .04);
}
.blog-content .blog-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15.5px; line-height: 1.45; font-style: normal; }
.blog-content .blog-table th,
.blog-content .blog-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--bw-line); }
.blog-content .blog-table thead th {
	background: var(--bw-soft); color: var(--bw-ink); font-size: 12.5px; font-weight: 800;
	text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.blog-content .blog-table tbody tr:last-child > * { border-bottom: 0; }
.blog-content .blog-table tbody tr:nth-child(even) > * { background: #FAFCFF; }
.blog-content .blog-table tbody td:first-child,
.blog-content .blog-table tbody th:first-child { font-weight: 800; color: var(--bw-ink); }
.blog-content .blog-table tbody td { color: var(--bw-ink-soft); }
.blog-content .blog-table td:first-child { color: var(--bw-ink); }

@media (max-width: 640px) {
	/* telefon: każdy wiersz jako karta „etykieta – wartość” */
	.blog-content .blog-table-wrap { border: 0; background: none; box-shadow: none; overflow: visible; }
	.blog-content .blog-table, .blog-content .blog-table tbody, .blog-content .blog-table tr { display: block; width: 100%; }
	.blog-content .blog-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.blog-content .blog-table tr {
		margin: 0 0 12px; background: #fff; border: 1px solid var(--bw-line); border-radius: var(--bw-radius);
		overflow: hidden; box-shadow: 0 1px 2px rgba(7, 27, 77, .04);
	}
	.blog-content .blog-table tbody tr:nth-child(even) > * { background: none; }
	.blog-content .blog-table td { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; padding: 10px 16px; text-align: right; border-bottom: 1px solid var(--bw-line); }
	.blog-content .blog-table td:last-child { border-bottom: 0; }
	.blog-content .blog-table td::before {
		content: attr(data-label); flex: 0 0 38%; text-align: left; font-size: 12px; font-weight: 800;
		text-transform: uppercase; letter-spacing: .04em; color: var(--bw-ink-soft);
	}
	.blog-content .blog-table td:first-child {
		display: block; text-align: left; font-size: 16.5px; background: var(--bw-note-bg) !important; color: var(--bw-ink);
	}
	.blog-content .blog-table td:first-child::before { content: none; }
}

/* ---------- ramki: Tip / Uwaga / Przykład ---------- */
.blog-content blockquote.blog-callout {
	position: relative; margin: 0 0 var(--bw-gap); padding: 16px 18px 16px 62px;
	border: 1px solid; border-left-width: 4px; border-radius: var(--bw-radius);
	font-size: 16.5px; line-height: 1.65; font-style: normal; color: var(--bw-ink);
}
.blog-content blockquote.blog-callout::before {
	content: ''; position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; border-radius: 50%;
	display: grid; place-items: center; font-weight: 800; font-size: 17px; font-style: normal; line-height: 32px; text-align: center; color: #fff;
}
.blog-content blockquote.blog-callout p { margin: 0 0 .6em; }
.blog-content blockquote.blog-callout p:last-child { margin-bottom: 0; }
.blog-content blockquote.blog-callout > p:first-child > strong:first-child {
	display: block; margin-bottom: 2px; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.blog-content blockquote.blog-callout--tip { background: var(--bw-tip-bg); border-color: var(--bw-tip-edge); }
.blog-content blockquote.blog-callout--tip::before { content: '★'; background: #071B4D; color: #F9ED00; }
.blog-content blockquote.blog-callout--tip > p:first-child > strong:first-child { color: var(--bw-tip-ink); }
.blog-content blockquote.blog-callout--note { background: var(--bw-note-bg); border-color: var(--bw-note-edge); }
.blog-content blockquote.blog-callout--note::before { content: 'i'; background: var(--bw-note-edge); font-family: Georgia, serif; }
.blog-content blockquote.blog-callout--note > p:first-child > strong:first-child { color: var(--bw-note-ink); }
.blog-content blockquote.blog-callout--example { background: var(--bw-ex-bg); border-color: var(--bw-ex-edge); }
.blog-content blockquote.blog-callout--example::before { content: '◆'; background: var(--bw-ex-edge); font-size: 14px; }
.blog-content blockquote.blog-callout--example > p:first-child > strong:first-child { color: var(--bw-ex-ink); }

.blog-content blockquote.blog-callout--know { background: var(--bw-know-bg); border-color: var(--bw-know-edge); }
.blog-content blockquote.blog-callout--know::before { content: '§'; background: var(--bw-know-edge); font-family: Georgia, serif; font-size: 17px; }
.blog-content blockquote.blog-callout--know > p:first-child > strong:first-child { color: var(--bw-know-ink); }
.blog-content blockquote.blog-callout--know > p { font-size: 16px; }

/* ---------- wzór wiadomości (zwykły cytat) ---------- */
.blog-content blockquote.blog-quote {
	position: relative; margin: 0 0 var(--bw-gap); padding: 34px 18px 14px; background: #fff;
	border: 1px solid var(--bw-line); border-radius: var(--bw-radius) var(--bw-radius) var(--bw-radius) 4px;
	box-shadow: 0 1px 2px rgba(7, 27, 77, .04); font-size: 16.5px; line-height: 1.65; font-style: normal; color: var(--bw-ink);
}
.blog-content blockquote.blog-quote::before {
	content: 'Wzór wiadomości'; position: absolute; left: 18px; top: 10px; font-size: 11.5px; font-weight: 800;
	letter-spacing: .06em; text-transform: uppercase; color: var(--cm-primary-dark, #1D4ED8);
}
.blog-content blockquote.blog-quote p:last-child { margin-bottom: 0; }

/* ---------- „Czego nie robimy” ---------- */
.blog-content p.blog-limits {
	margin: 0 0 var(--bw-gap); padding: 14px 18px; background: var(--bw-warn-bg);
	border: 1px solid var(--bw-warn-edge); border-left-width: 4px; border-radius: var(--bw-radius-sm);
	font-size: 16.5px; line-height: 1.65;
}
.blog-content p.blog-limits > strong:first-child { color: var(--bw-warn-ink); text-transform: uppercase; font-size: 12.5px; letter-spacing: .06em; }

/* ---------- sekcje: „Jak rozwiązaliśmy …” i „… w skrócie” ---------- */
.blog-content section.blog-section { margin: 2em 0; padding: 22px 24px 8px; border-radius: 20px; }
.blog-content section.blog-section > h2 { margin-top: 0; }
.blog-content section.blog-section > *:last-child { margin-bottom: 1.1em; }
.blog-content section.blog-product { background: linear-gradient(180deg, var(--bw-note-bg) 0%, #fff 70%); border: 1px solid #CFE0FF; }
.blog-content section.blog-product > h2::before {
	content: 'W MyClass'; display: inline-block; margin: 0 0 10px; padding: 4px 12px; border-radius: 999px;
	background: #071B4D; color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.blog-content section.blog-product > h2 { display: flex; flex-direction: column; align-items: flex-start; }
.blog-content section.blog-summary { background: var(--cm-dark, #071B4D); color: #E6EDFF; border: 0; }
.blog-content section.blog-summary > h2 { color: #fff; font-size: 24px; }
.blog-content section.blog-summary > h2::before {
	content: ''; display: block; width: 44px; height: 4px; margin: 0 0 12px; border-radius: 4px; background: var(--cm-yellow, #F9ED00);
}
.blog-content section.blog-summary a { color: #fff; }
.blog-content section.blog-summary strong { color: #fff; }

/* ---------- schematy i wykresy (blok ```) ---------- */
.blog-content pre {
	background: var(--bw-soft); color: var(--bw-ink); border: 1px solid var(--bw-line); border-left: 4px solid var(--cm-primary, #3485FF);
	border-radius: var(--bw-radius); padding: 16px 18px; margin: 0 0 var(--bw-gap); overflow-x: auto; -webkit-overflow-scrolling: touch;
	font-size: clamp(11px, 2.9vw, 14.5px); line-height: 1.6;
}
.blog-content pre code { font-size: inherit; white-space: pre; }

/* ---------- listy ---------- */
.blog-content ul li::marker { color: var(--cm-primary, #3485FF); }
.blog-content ol { list-style: none; counter-reset: bw-step; padding-left: 0; }
.blog-content ol > li { position: relative; counter-increment: bw-step; padding-left: 44px; min-height: 32px; margin-bottom: .7em; }
.blog-content ol > li::before {
	content: counter(bw-step); position: absolute; left: 0; top: .1em; width: 30px; height: 30px; border-radius: 50%;
	background: var(--cm-primary-soft, #E6F0FF); color: var(--cm-primary-dark, #1D4ED8); font-weight: 800; font-size: 14.5px;
	display: grid; place-items: center; line-height: 1;
}

/* ---------- separator ---------- */
.blog-content hr { border: 0; text-align: center; height: auto; overflow: visible; line-height: 1.2; margin: 2.2em 0; }
.blog-content hr::before { content: '• • •'; letter-spacing: .6em; color: var(--cm-muted, #94A3B8); }

@media (max-width: 520px) {
	.blog-content blockquote.blog-callout { padding: 14px 14px 14px 54px; }
	.blog-content blockquote.blog-callout::before { left: 12px; top: 14px; width: 30px; height: 30px; line-height: 30px; font-size: 15px; }
	.blog-content section.blog-section { padding: 18px 16px 4px; border-radius: 16px; }
	.blog-content section.blog-summary > h2 { font-size: 22px; }
}
