/* =========================================================================
   Blog (v2.6): lista wpisów z doładowywaniem, wpis na całą szerokość.
   Ładowany tylko na liście, kategoriach, tagach i we wpisie (inc/setup.php).
   ====================================================================== */

/* ---------- Lista ---------- */
.pd-blog { padding-top: 0; }
.pd-blog__cats { display: flex; gap: 8px; margin: 0 0 clamp(26px, 3vw, 44px); overflow-x: auto; scrollbar-width: none; }
.pd-blog__cats::-webkit-scrollbar { display: none; }
.pd-blog__cat { display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid var(--pd-line-2); border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--pd-ink); transition: background-color .3s var(--pd-ease), color .3s var(--pd-ease), border-color .3s var(--pd-ease); }
.pd-blog__cat small { font-size: 12px; color: var(--pd-muted); transition: color .3s var(--pd-ease); }
.pd-blog__cat:hover { border-color: var(--pd-ink); color: var(--pd-ink); }
.pd-blog__cat.is-active { background: var(--pd-ink); border-color: var(--pd-ink); color: #fff; }
.pd-blog__cat.is-active small { color: rgba(255, 255, 255, .6); }

.pd-blog__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(36px, 3.4vw, 56px) clamp(18px, 1.8vw, 30px); }

/* Karta */
.pd-bcard { display: flex; flex-direction: column; min-width: 0; }
.pd-bcard__img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: var(--pd-cream); }
.pd-bcard__img img, .pd-bcard__ph { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--pd-ease); }
.pd-bcard__ph { background: linear-gradient(135deg, var(--pd-cream), #DCD5C8); }
.pd-bcard:hover .pd-bcard__img img { transform: scale(1.045); }
.pd-bcard__body { display: flex; flex: 1; flex-direction: column; padding-top: 20px; }
.pd-bcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; font-size: 13px; color: var(--pd-muted); }
.pd-bcard__meta > span { display: inline-flex; align-items: center; gap: 6px; }
.pd-bcard__cat { display: inline-flex; align-items: center; gap: 8px; color: var(--pd-ink); font-weight: 500; }
.pd-bcard__cat::before { content: ""; width: 7px; height: 7px; background: var(--pd-green); }
.pd-bcard__title { margin: 0 0 10px; font-family: var(--pd-display); font-size: clamp(21px, 1.6vw, 26px); font-weight: 400; line-height: 1.18; letter-spacing: -.02em; }
.pd-bcard__title a { color: inherit; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--pd-ease); }
.pd-bcard:hover .pd-bcard__title a { background-size: 100% 1px; }
.pd-bcard__ex { margin: 0 0 18px; font-size: 15px; line-height: 1.6; color: var(--pd-muted); }
.pd-bcard__more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; font-size: 14px; font-weight: 600; color: var(--pd-ink); }
.pd-bcard__more .pd-icon { color: var(--pd-green-d); transition: transform .35s var(--pd-ease); }
.pd-bcard:hover .pd-bcard__more .pd-icon { transform: translateX(4px); }

/* Pierwszy wpis: duży, zdjęcie + tekst obok, na całą szerokość siatki. */
.pd-bcard--lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: stretch; background: #fff; border: 1px solid var(--pd-line); border-radius: 12px; overflow: hidden; }
.pd-bcard--lead .pd-bcard__img { aspect-ratio: auto; min-height: clamp(340px, 36vw, 560px); border-radius: 0; }
.pd-bcard--lead .pd-bcard__img img { position: absolute; inset: 0; }
.pd-bcard--lead .pd-bcard__body { justify-content: center; padding: clamp(28px, 4vw, 64px); }
.pd-bcard--lead .pd-bcard__title { font-size: clamp(30px, 3vw, 48px); line-height: 1.06; margin-bottom: 18px; }
.pd-bcard--lead .pd-bcard__ex { font-size: 16.5px; margin-bottom: 28px; }
.pd-bcard--lead .pd-bcard__more { margin-top: 0; }

/* Nowe karty z doładowania */
.pd-bcard.is-new { animation: pd-bcard-in .8s var(--pd-ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes pd-bcard-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* Dół listy: przycisk zapasowy + wskaźnik wczytywania */
.pd-blog__foot { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: clamp(40px, 4vw, 64px); }
.pd-blog__foot[hidden] { display: none; }
.pd-blog__loading { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; color: var(--pd-muted); }
.pd-blog__loading[hidden] { display: none; }
.pd-blog__loading i { width: 18px; height: 18px; border: 2px solid var(--pd-line-2); border-top-color: var(--pd-green); border-radius: 50%; animation: pd-spin .8s linear infinite; }
@keyframes pd-spin { to { transform: rotate(360deg); } }
.pd-blog.is-loading [data-blog-more] { display: none; }

/* ---------- Wpis ---------- */
.pd-art__progress { position: fixed; top: 0; left: 0; right: 0; z-index: 200; height: 3px; pointer-events: none; }
.pd-art__progress i { display: block; height: 100%; width: 100%; background: var(--pd-green); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
.admin-bar .pd-art__progress { top: 32px; }

/* Zdjęcie na całą szerokość z tytułem na dole */
.pd-art__hero { position: relative; display: flex; align-items: flex-end; min-height: clamp(460px, 78vh, 860px); color: #fff; background: var(--pd-ink); overflow: hidden; isolation: isolate; }
.pd-art__bg { position: absolute; inset: 0; z-index: -2; margin: 0; }
.pd-art__bg img { width: 100%; height: 100%; object-fit: cover; animation: pd-art-zoom 2.4s var(--pd-ease) both; }
@keyframes pd-art-zoom { from { transform: scale(1.08); } to { transform: none; } }
.pd-art__hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 9, 8, .38) 0%, rgba(8, 9, 8, .05) 30%, rgba(8, 9, 8, .25) 55%, rgba(8, 9, 8, .82) 100%); }
.pd-art__head { padding-top: clamp(40px, 5vw, 80px); padding-bottom: clamp(36px, 4.4vw, 72px); }
.pd-art__hero .pd-crumbs, .pd-art__hero .pd-crumbs a { color: rgba(255, 255, 255, .78); }
.pd-art__hero .pd-crumbs a:hover { color: #fff; }
.pd-art__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 18px 0 18px; font-size: 14px; color: rgba(255, 255, 255, .82); }
.pd-art__meta > span { display: inline-flex; align-items: center; gap: 7px; }
.pd-art__cat { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 999px; background: var(--pd-green); color: #fff; font-weight: 600; font-size: 13px; transition: background-color .3s var(--pd-ease); }
.pd-art__cat:hover { background: var(--pd-green-d); color: #fff; }
.pd-art__title { max-width: 20ch; margin: 0; font-family: var(--pd-display); font-size: clamp(40px, 5.6vw, 96px); font-weight: 300; line-height: 1; letter-spacing: -.035em; color: #fff; }
/* Bez zdjęcia: jasny nagłówek */
.pd-art__hero--plain { min-height: 0; background: var(--pd-paper); color: var(--pd-ink); }
.pd-art__hero--plain::after { display: none; }
.pd-art__hero--plain .pd-art__title { color: var(--pd-ink); }
.pd-art__hero--plain .pd-art__meta, .pd-art__hero--plain .pd-crumbs, .pd-art__hero--plain .pd-crumbs a { color: var(--pd-muted); }

/* Treść: spis treści z boku, tekst szeroką kolumną */
.pd-art__layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: clamp(40px, 6vw, 120px); padding-top: clamp(48px, 5.4vw, 96px); padding-bottom: clamp(56px, 6vw, 110px); }
.pd-art__side { min-width: 0; }
.pd-art__sticky { position: sticky; top: calc(var(--pd-hfix, 80px) + 28px); display: grid; gap: 34px; }
.pd-art__side-h { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--pd-muted); }
.pd-art__toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--pd-line); }
.pd-art__toc a { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); padding: 9px 0 9px 18px; font-size: 14.5px; line-height: 1.4; color: var(--pd-muted); transition: color .3s var(--pd-ease); }
.pd-art__toc a span { font-size: 12px; padding-top: 2px; color: var(--pd-line-2); transition: color .3s var(--pd-ease); }
.pd-art__toc a::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px; background: var(--pd-green); transform: scaleY(0); transition: transform .4s var(--pd-ease); }
.pd-art__toc a:hover, .pd-art__toc a.is-active { color: var(--pd-ink); }
.pd-art__toc a.is-active span { color: var(--pd-green-d); }
.pd-art__toc a.is-active::before { transform: scaleY(1); }
.pd-art__share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-art__sh { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--pd-line-2); border-radius: 999px; background: transparent; font: 600 14px/1 var(--pd-sans); color: var(--pd-ink); cursor: pointer; transition: background-color .3s var(--pd-ease), color .3s var(--pd-ease), border-color .3s var(--pd-ease); }
.pd-art__sh:hover { background: var(--pd-ink); border-color: var(--pd-ink); color: #fff; }
.pd-art__copy.is-done { background: var(--pd-green); border-color: var(--pd-green); color: #fff; }

.pd-art__main { min-width: 0; }
.pd-art__lead { max-width: 900px; margin: 0 0 clamp(32px, 3.4vw, 52px); font-family: var(--pd-display); font-size: clamp(22px, 2vw, 30px); font-weight: 300; line-height: 1.38; letter-spacing: -.015em; color: var(--pd-ink); }
.pd-art__body { font-size: 18px; line-height: 1.75; }
.pd-art__body > * { max-width: 900px; }
.pd-art__body > :first-child { margin-top: 0; }
.pd-art__body p { margin: 0 0 1.2em; }
.pd-art__body h2 { scroll-margin-top: calc(var(--pd-hfix, 80px) + 24px); margin: 1.9em 0 .6em; font-size: clamp(28px, 2.4vw, 40px); font-weight: 400; line-height: 1.12; letter-spacing: -.025em; color: var(--pd-ink); }
.pd-art__body h3 { margin: 1.6em 0 .5em; font-size: 22px; font-weight: 500; letter-spacing: -.01em; color: var(--pd-ink); }
.pd-art__body ul, .pd-art__body ol { margin: 0 0 1.4em; padding-left: 1.2em; }
.pd-art__body li::marker { color: var(--pd-green-d); }
.pd-art__body blockquote { margin: 1.8em 0; padding: clamp(24px, 2.6vw, 40px); border: 0; border-radius: 12px; background: var(--pd-cream); font-family: var(--pd-display); font-size: clamp(22px, 1.9vw, 28px); font-style: normal; font-weight: 300; line-height: 1.35; color: var(--pd-ink); }
.pd-art__body blockquote p:last-child { margin: 0; }
.pd-art__body figure { margin: 2em 0; }
.pd-art__body img { display: block; width: 100%; height: auto; border-radius: 10px; }
.pd-art__body figcaption { margin-top: 10px; font-size: 13.5px; color: var(--pd-muted); }
/* Zdjęcia szersze niż tekst: do prawej krawędzi kolumny */
.pd-art__body > .alignwide, .pd-art__body > .alignfull { max-width: none; }
.pd-art__body .pd-art__duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pd-art__body .pd-art__duo figure { margin: 0; }
.pd-art__body .pd-art__duo img { aspect-ratio: 4 / 5; object-fit: cover; }

/* Karta kontaktu pod treścią */
.pd-art__cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px 40px; max-width: 900px; margin-top: clamp(40px, 4vw, 64px); padding: clamp(26px, 3vw, 44px); border-radius: 12px; background: var(--pd-ink); color: rgba(237, 235, 230, .72); }
.pd-art__cta-h { margin: 0 0 8px; font-family: var(--pd-display); font-size: clamp(24px, 2vw, 32px); font-weight: 300; letter-spacing: -.02em; color: #fff; }
.pd-art__cta p:last-child { margin: 0; font-size: 15.5px; }
.pd-art__cta-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-art__cta .pd-btn:not(.pd-btn--light) { background: var(--pd-green); border-color: var(--pd-green); color: #fff; }
.pd-art__cta .pd-btn:not(.pd-btn--light):hover { background: var(--pd-green-d); border-color: var(--pd-green-d); }
.pd-art__back { display: inline-flex; align-items: center; gap: 10px; margin-top: 32px; font-size: 14.5px; font-weight: 600; color: var(--pd-ink); }
.pd-art__back .pd-icon { transform: rotate(180deg); color: var(--pd-green-d); transition: transform .35s var(--pd-ease); }
.pd-art__back:hover .pd-icon { transform: rotate(180deg) translateX(4px); }

.pd-art__related { background: #fff; border-top: 1px solid var(--pd-line); }

/* ---------- Szerokości ---------- */
@media (max-width: 1279px) {
	.pd-art__layout { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: 48px; }
	.pd-art__cta { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
	.pd-blog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pd-bcard--lead { grid-template-columns: minmax(0, 1fr); }
	.pd-bcard--lead .pd-bcard__img { min-height: 0; aspect-ratio: 16 / 10; }
	.pd-art__layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.pd-art__side { order: 2; }
	.pd-art__sticky { position: static; gap: 26px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--pd-line); }
	.pd-art__toc { display: none; }
	.pd-art__hero { min-height: clamp(420px, 70vh, 640px); }
}
@media (max-width: 599px) {
	.pd-blog__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
	.pd-bcard--lead { margin: 0 calc(var(--pd-gutter) * -1); border-radius: 0; border-left: 0; border-right: 0; }
	.pd-bcard--lead .pd-bcard__body { padding: 24px var(--pd-gutter) 28px; }
	.pd-art__hero { min-height: min(72vh, 620px); }
	.pd-art__title { font-size: clamp(32px, 10vw, 46px); }
	.pd-art__body { font-size: 16.5px; }
	.pd-art__body .pd-art__duo { grid-template-columns: minmax(0, 1fr); }
	.pd-art__cta { margin-left: calc(var(--pd-gutter) * -1); margin-right: calc(var(--pd-gutter) * -1); border-radius: 0; padding: 28px var(--pd-gutter); }
	.pd-art__cta-btns .pd-btn { width: 100%; }
}

/* ---------- v2.8 (wymóg 31.10): spis treści po prawej, treść na całą szerokość kolumny, nowe „Czytaj także” ---------- */
.pd-art__layout { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: clamp(40px, 5vw, 96px); }
.pd-art__lead, .pd-art__body > *, .pd-art__cta { max-width: none; }
.pd-art__side { border-left: 1px solid var(--pd-line); padding-left: clamp(24px, 2.4vw, 40px); }
.pd-art__body strong { font-weight: 650; color: var(--pd-ink); }
.pd-art__body a:not(.pd-btn) { color: var(--pd-green-d); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pd-art__body a:not(.pd-btn):hover { color: var(--pd-ink); }
.pd-art__body h2 + p { margin-top: 0; }
.pd-art__body ul li, .pd-art__body ol li { margin-bottom: .45em; }
/* Zwijany spis treści (tylko < 1024) */
.pd-art__mtoc { display: none; margin: 0 0 clamp(28px, 3vw, 40px); border: 1px solid var(--pd-line-2); border-radius: 12px; background: #fff; }
.pd-art__mtoc summary { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 18px; font-weight: 600; cursor: pointer; list-style: none; }
.pd-art__mtoc summary::-webkit-details-marker { display: none; }
.pd-art__mtoc summary small { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; background: var(--pd-paper); font-size: 12px; color: var(--pd-muted); }
.pd-art__mtoc summary .pd-icon { margin-left: auto; transition: transform .3s var(--pd-ease); }
.pd-art__mtoc[open] summary .pd-icon { transform: rotate(180deg); }
.pd-art__mtoc ol { margin: 0; padding: 0 18px 12px; list-style: none; border-top: 1px solid var(--pd-line); }
.pd-art__mtoc a { display: grid; grid-template-columns: 28px minmax(0, 1fr); padding: 10px 0; font-size: 15px; line-height: 1.4; color: var(--pd-ink); border-bottom: 1px solid var(--pd-line); }
.pd-art__mtoc li:last-child a { border-bottom: 0; }
.pd-art__mtoc a span { font-size: 12px; padding-top: 2px; color: var(--pd-green-d); }

/* Czytaj także: karty poziome, 2 kolumny */
.pd-rel { background: #fff; border-top: 1px solid var(--pd-line); }
.pd-rel .pd-head-row { align-items: flex-end; }
.pd-rel .pd-head { margin: 0; }
.pd-rel__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 1.6vw, 26px); }
.pd-rel__grid.is-one { grid-template-columns: minmax(0, 1fr); }
.pd-rel__card { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); min-width: 0; overflow: hidden; border: 1px solid var(--pd-line); border-radius: 12px; background: var(--pd-paper); transition: border-color .4s var(--pd-ease), box-shadow .5s var(--pd-ease), transform .5s var(--pd-ease); }
.pd-rel__card:hover { border-color: var(--pd-line-2); box-shadow: 0 22px 50px -24px rgba(14, 15, 14, .28); transform: translateY(-3px); }
.pd-rel__img { position: relative; display: block; min-height: 260px; overflow: hidden; background: var(--pd-cream); }
.pd-rel__img img, .pd-rel__img .pd-bcard__ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--pd-ease); }
.pd-rel__card:hover .pd-rel__img img { transform: scale(1.05); }
.pd-rel__num { position: absolute; left: 14px; top: 14px; display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 20px; background: rgba(255, 255, 255, .94); font-size: 13px; font-weight: 700; color: var(--pd-ink); }
.pd-rel__body { display: flex; flex-direction: column; padding: clamp(22px, 2.2vw, 34px); }
.pd-rel__title { margin: 0 0 12px; font-family: var(--pd-display); font-size: clamp(22px, 1.7vw, 28px); font-weight: 400; line-height: 1.16; letter-spacing: -.02em; }
.pd-rel__title a { color: inherit; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--pd-ease); }
.pd-rel__card:hover .pd-rel__title a { background-size: 100% 1px; }
.pd-rel__ex { margin: 0 0 20px; font-size: 15px; line-height: 1.6; color: var(--pd-muted); }
.pd-rel__card:hover .pd-bcard__more .pd-icon { transform: translateX(4px); }
@media (max-width: 1279px) {
	.pd-art__layout { grid-template-columns: minmax(0, 1fr) minmax(210px, 260px); gap: 44px; }
	.pd-rel__grid { grid-template-columns: minmax(0, 1fr); }
	.pd-rel__card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
}
@media (max-width: 1023px) {
	.pd-art__layout { grid-template-columns: minmax(0, 1fr); }
	.pd-art__side { order: 2; border-left: 0; padding-left: 0; }
	.pd-art__mtoc { display: block; }
}
@media (max-width: 599px) {
	.pd-rel .pd-head-row { flex-direction: column; align-items: flex-start; gap: 18px; }
	.pd-rel__card { grid-template-columns: minmax(0, 1fr); }
	.pd-rel__img { min-height: 0; aspect-ratio: 16 / 10; }
}

/* =========================================================================
   v2.9 (wymóg 31.10): lista bloga bliżej nagłówka, kategorie na telefonie
   ====================================================================== */
/* Mniejszy odstęp między nagłówkiem strony a kategoriami. */
.pd-page-head:has(+ .pd-blog) { padding-bottom: clamp(22px, 2.4vw, 38px); }
.pd-page-head:has(+ .pd-blog) .pd-page-head__text p:last-child { margin-bottom: 0; }
@media (max-width: 1023px) {
	/* Kategorie w jednym rzędzie przewijanym palcem od krawędzi do krawędzi, z przyciąganiem do pigułki. */
	.pd-blog__cats { margin: 0 calc(var(--pd-gutter) * -1) 28px; padding: 0 var(--pd-gutter); scroll-snap-type: x proximity; scroll-padding: 0 var(--pd-gutter); }
	.pd-blog__cat { scroll-snap-align: start; }
	.pd-blog__cats::after { content: ""; flex: none; width: 1px; }
}
@media (max-width: 599px) {
	.pd-page-head:has(+ .pd-blog) { padding-bottom: 20px; }
	.pd-blog__cats { gap: 6px; margin-bottom: 22px; }
	.pd-blog__cat { min-height: 38px; padding: 0 14px; font-size: 14px; gap: 6px; }
}
