/* ============================================================
   Warstwowo — Blog / poradniki (design „Magazyn", ciemne hero)
   Ładowane tylko na /blog/, kategoriach wpisów i pojedynczym wpisie.
   Kolory = tokeny motywu (tokens/colors.css). Fonty self-hosted.
   ============================================================ */

/* --- Tony kategorii (kolor akcentu karty/zakładki/pill) --- */
.ws-tone-molten { --tone-text: var(--molten-700); --tone-dot: var(--molten-500); --tone-soft: var(--molten-50);  --tone-softtext: var(--molten-700); }
.ws-tone-teal   { --tone-text: var(--teal-700);   --tone-dot: var(--teal-500);   --tone-soft: var(--teal-100);   --tone-softtext: var(--teal-700); }
.ws-tone-blue   { --tone-text: var(--blue-700);   --tone-dot: var(--blue-500);   --tone-soft: var(--blue-100);   --tone-softtext: var(--blue-700); }
.ws-tone-amber  { --tone-text: var(--amber-700);  --tone-dot: var(--amber-500);  --tone-soft: var(--amber-100);  --tone-softtext: var(--amber-700); }
.ws-tone-green  { --tone-text: var(--green-700);  --tone-dot: var(--green-500);  --tone-soft: var(--green-100);  --tone-softtext: var(--green-700); }
.ws-tone-ink    { --tone-text: var(--ink-500);    --tone-dot: var(--ink-400);    --tone-soft: var(--ink-100);    --tone-softtext: var(--ink-700); }

/* --- Wrapper --- */
.ws-blog { padding: 44px 0 8px; }
.ws-blog__head { max-width: 620px; margin-bottom: 26px; }
.ws-blog__eyebrow {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
	color: var(--molten-700);
}
.ws-blog__title {
	font-family: 'Space Grotesk', sans-serif;
	font-size: clamp(30px, 4vw, 38px); font-weight: 700; letter-spacing: -0.03em;
	color: var(--ink-900); margin: 8px 0 6px;
}
.ws-blog__lead { font-size: 16px; line-height: 1.6; color: var(--ink-600); margin: 0; }

/* --- Wyróżniony wpis (ciemny baner) --- */
.ws-featured {
	display: grid; grid-template-columns: 1.05fr 0.95fr;
	background: var(--ink-900); border-radius: 20px; overflow: hidden;
	box-shadow: 0 18px 40px rgba(26, 22, 20, 0.22);
	text-decoration: none; margin-bottom: 34px;
}
.ws-featured__body { padding: 38px; display: flex; flex-direction: column; justify-content: center; position: relative; }
.ws-featured__body::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image: repeating-linear-gradient(180deg, transparent 0 15px, rgba(255, 255, 255, 0.03) 15px 16px);
}
.ws-featured__inner { position: relative; }
.ws-featured__cat {
	display: inline-flex; align-items: center; gap: 7px;
	background: color-mix(in srgb, var(--tone-dot) 18%, transparent); color: var(--molten-300);
	border-radius: 999px; padding: 6px 13px;
	font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.1em;
}
.ws-featured__title {
	font-family: 'Space Grotesk', sans-serif; font-size: clamp(24px, 3vw, 31px); line-height: 1.12;
	font-weight: 700; letter-spacing: -0.02em; color: #fff; margin: 16px 0 0;
}
.ws-featured__excerpt { font-size: 15.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.72); margin: 14px 0 0; }
.ws-featured__meta { display: flex; align-items: center; gap: 12px; margin-top: 22px; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }
.ws-featured__media { background: #231D19; display: flex; align-items: center; justify-content: center; min-height: 300px; overflow: hidden; }
.ws-featured__media img { width: 100%; height: 100%; object-fit: cover; }
.ws-featured__media .ws-postcard__ph { color: rgba(255, 255, 255, 0.16); }

.ws-avatar {
	width: 36px; height: 36px; border-radius: 50%; background: var(--molten-500); color: #fff;
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14px;
}

/* --- Zakładki kategorii --- */
.ws-blogtabs { display: flex; gap: 28px; border-bottom: 1px solid var(--ink-150); margin: 0 0 26px; overflow-x: auto; }
.ws-blogtab {
	padding: 0 0 14px; font-weight: 500; font-size: 15px; color: var(--ink-500);
	border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none;
}
.ws-blogtab:hover { color: var(--molten-600); }
.ws-blogtab.is-active { font-weight: 600; color: var(--ink-900); border-bottom-color: var(--molten-500); }

/* --- Siatka --- */
.ws-blog-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 24px; }

/* --- Karta wpisu --- */
.ws-postcard {
	display: flex; flex-direction: column; background: var(--white);
	border: 1px solid var(--ink-100); border-radius: 14px; overflow: hidden;
	box-shadow: 0 1px 2px rgba(26, 22, 20, 0.04);
	transition: transform .18s ease, box-shadow .18s ease;
}
.ws-postcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(26, 22, 20, 0.10); }
.ws-postcard__media { display: block; aspect-ratio: 16 / 10; background: var(--ink-100); overflow: hidden; }
.ws-postcard__media { display: flex; align-items: center; justify-content: center; }
.ws-postcard__img { width: 100%; height: 100%; object-fit: cover; }
.ws-postcard__ph { display: flex; align-items: center; justify-content: center; color: var(--ink-300); }
.ws-postcard__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 9px; }
.ws-postcard__cat { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.09em; color: var(--tone-text); }
.ws-postcard__title { font-family: 'Space Grotesk', sans-serif; font-size: 19px; line-height: 1.22; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.ws-postcard__title a { color: var(--ink-900); text-decoration: none; }
.ws-postcard__title a:hover { color: var(--molten-600); }
.ws-postcard__excerpt { font-size: 14px; line-height: 1.55; color: var(--ink-500); margin: 0; }
.ws-postcard__meta { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-300); margin-top: 4px; }

/* --- Paginacja --- */
.ws-blogpag { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 44px 0 0; }
.ws-blogpag .page-numbers {
	min-width: 42px; height: 42px; padding: 0 6px; border-radius: 10px;
	border: 1px solid var(--ink-150); background: var(--white); color: var(--ink-700);
	display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
	font-family: 'IBM Plex Mono', monospace; font-size: 14px;
}
.ws-blogpag .page-numbers:hover { border-color: var(--molten-300); color: var(--molten-600); }
.ws-blogpag .page-numbers.current { background: var(--ink-900); color: #fff; border-color: var(--ink-900); font-weight: 600; }
.ws-blogpag .page-numbers.dots { border: none; background: none; }

/* --- Ciemne hero (kategoria + artykuł) --- */
.ws-bloghero { background: var(--ink-900); color: #fff; position: relative; overflow: hidden; }
.ws-bloghero::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image: repeating-linear-gradient(180deg, transparent 0 16px, rgba(255, 255, 255, 0.03) 16px 17px);
}
.ws-bloghero__inner { position: relative; padding: 30px 0 42px; }
.ws-bloghero__crumbs { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: rgba(255, 255, 255, 0.5); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ws-bloghero__crumbs a { color: rgba(255, 255, 255, 0.5); text-decoration: none; }
.ws-bloghero__crumbs a:hover { color: var(--molten-300); }
.ws-bloghero__crumbs .sep { opacity: 0.6; }
.ws-bloghero__pill {
	display: inline-flex; align-items: center; gap: 7px; margin: 18px 0 0;
	background: color-mix(in srgb, var(--tone-dot, var(--molten-500)) 18%, transparent); color: var(--molten-300);
	border-radius: 999px; padding: 6px 13px;
	font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.ws-bloghero__title { font-family: 'Space Grotesk', sans-serif; font-size: clamp(30px, 5vw, 44px); line-height: 1.06; font-weight: 700; letter-spacing: -0.03em; color: #fff; margin: 15px 0 0; text-wrap: pretty; }
.ws-bloghero__lead { font-size: 17px; line-height: 1.55; color: rgba(255, 255, 255, 0.78); margin: 14px 0 0; max-width: 620px; }
.ws-bloghero__author { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.ws-bloghero__author .ws-avatar { width: 44px; height: 44px; font-size: 16px; }
.ws-bloghero__aname { font-weight: 600; font-size: 15px; color: #fff; }
.ws-bloghero__ameta { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: rgba(255, 255, 255, 0.55); }

/* --- Artykuł --- */
.ws-cover { max-width: 1000px; margin: -28px auto 0; padding: 0 var(--ws-gutter, 20px); position: relative; z-index: 2; }
.ws-cover__inner {
	aspect-ratio: 2.4 / 1; border-radius: 20px; overflow: hidden; background: #231D19;
	display: flex; align-items: center; justify-content: center; box-shadow: 0 24px 50px rgba(26, 22, 20, 0.25);
}
.ws-cover__inner img { width: 100%; height: 100%; object-fit: cover; }
.ws-cover__inner .ws-postcard__ph { color: rgba(255, 255, 255, 0.18); }

.ws-article { max-width: 1000px; margin: 0 auto; padding: 44px var(--ws-gutter, 20px) 0; }
.ws-article__grid { display: grid; grid-template-columns: 230px 1fr; gap: 48px; align-items: start; }
.ws-article__grid--notoc { grid-template-columns: 1fr; }
.ws-article__grid--notoc .ws-prose { margin: 0 auto; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.ws-toc { position: sticky; top: 96px; }
.ws-toc__label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.14em; color: var(--molten-700); margin-bottom: 14px; }
.ws-toc__nav { display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--ink-100); }
.ws-toc__nav a { font-size: 14px; line-height: 1.4; color: var(--ink-500); padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; }
.ws-toc__nav a:hover, .ws-toc__nav a.is-active { color: var(--molten-600); border-left-color: var(--molten-500); }

/* Treść (prose) */
.ws-prose { font-size: 17px; line-height: 1.72; color: var(--ink-700); max-width: 660px; }
.ws-prose > p:first-of-type { font-size: 18.5px; line-height: 1.65; color: var(--ink-800); }
.ws-prose p { margin: 0 0 16px; }
.ws-prose h2 { font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-900); margin: 38px 0 12px; scroll-margin-top: 90px; }
.ws-prose h3 { font-family: 'Space Grotesk', sans-serif; font-size: 21px; font-weight: 600; color: var(--ink-900); margin: 28px 0 10px; }
.ws-prose ul, .ws-prose ol { margin: 0 0 16px; padding-left: 22px; }
.ws-prose li { margin-bottom: 8px; }
.ws-prose a { color: var(--molten-600); text-underline-offset: 2px; }
.ws-prose img { max-width: 100%; height: auto; border-radius: 12px; }
.ws-prose blockquote, .ws-prose .ws-callout {
	background: var(--molten-50); border: 1px solid var(--molten-100); border-radius: 14px;
	padding: 18px 20px; margin: 24px 0; color: var(--molten-800); font-size: 15px; line-height: 1.6;
}
.ws-prose table { width: 100%; border-collapse: collapse; border: 1px solid var(--ink-150); border-radius: 14px; overflow: hidden; margin: 0 0 16px; display: block; overflow-x: auto; }
.ws-prose thead { background: var(--ink-900); color: #fff; font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.04em; }
.ws-prose th, .ws-prose td { padding: 12px 14px; text-align: left; border-top: 1px solid var(--ink-100); }

.ws-author { display: flex; gap: 16px; align-items: center; background: var(--white); border: 1px solid var(--ink-100); border-radius: 16px; padding: 20px; margin: 36px 0 0; }
.ws-author .ws-avatar { width: 52px; height: 52px; font-size: 18px; }
.ws-author__name { font-weight: 600; font-size: 16px; color: var(--ink-900); }
.ws-author__bio { font-size: 14px; color: var(--ink-500); margin-top: 2px; }

/* Sekcje pod artykułem */
.ws-related { padding: 64px 0 0; }
.ws-related__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.ws-related__eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.14em; color: var(--molten-500); }
.ws-related__title { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-900); margin: 6px 0 0; }
.ws-related__more { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--molten-600); font-weight: 600; font-size: 15px; white-space: nowrap; }

/* --- Responsywność --- */
@media (max-width: 900px) {
	.ws-article__grid { grid-template-columns: 1fr; gap: 24px; }
	.ws-toc { display: none; }
	.ws-featured { grid-template-columns: 1fr; }
	.ws-featured__media { min-height: 180px; order: -1; }
}
@media (max-width: 680px) {
	.ws-blog-grid { --cols: 1 !important; }
	.ws-featured__body { padding: 26px; }
}
@media (min-width: 681px) and (max-width: 960px) {
	.ws-blog-grid { --cols: 2 !important; }
}
