/*
Theme Name: Liść w Kieszeni
Theme URI: https://ekodzieciaki.pl
Author: Liść w Kieszeni
Description: Ekologia z dziećmi na co dzień: zabawki, ubranka, pielęgnacja, segregacja i przyroda za progiem
Version: 1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: lisc-w-kieszeni
*/

/* ramka wstepu (BLUF) i box TL;DR */
.wpm-bluf, .tldr { border-left: 4px solid var(--wp--preset--color--primary); border-radius: 0 6px 6px 0; padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.wpm-bluf > * { margin-left: 0 !important; margin-right: 0 !important; max-width: none; }
.wpm-bluf .wpm-bluf-label { margin: 0 0 0.5em; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.wpm-bluf p { line-height: 1.6; }
.wpm-bluf p:last-child, .wpm-bluf ul:last-child { margin-bottom: 0; }

/* portal kit: uklad klockow (kolory i fonty z theme.json) */
.wpm-header { border-bottom: 1px solid var(--wp--preset--color--surface); }
.wpm-masthead-kompaktowy { z-index: 20; }
.wpm-servicebar { padding-block: 0.4rem; }
.wpm-brand .wp-block-site-title { margin: 0; }
/* logo (znak albo znak z nazwa) zastepuje nazwe: site-title tylko dla czytnikow i SEO (wydawca 2026-10-08: przy rebrandingu sam znak, bez napisu) */
.wpm-brand:has(.wp-block-site-logo img) .wp-block-site-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wpm-kicker { margin-block: 1.5rem 1rem; }
.wpm-home-h1 { max-width: 22ch; }
.wpm-home-lead { max-width: 60ch; }
.wpm-trust { border-block: 1px solid var(--wp--preset--color--surface); padding-block: 0.6rem; margin-block: 1rem 2rem; }
.wpm-trust-masthead { border: 0; margin: 0; padding: 0; }
.wpm-trust-kafle > p { padding: 0.6rem 1rem; margin: 0; }
.wpm-section { margin-block: 2.5rem; }
.wpm-section-head { border-bottom: 2px solid var(--wp--preset--color--contrast); padding-bottom: 0.4rem; margin-bottom: 1rem; align-items: baseline; }
.wpm-section-title { margin: 0; }
.wpm-mini > .wp-block-column:first-child img { border-radius: 6px; }
.wpm-textrow { border-bottom: 1px solid var(--wp--preset--color--surface); padding-block: 0.5rem; }
.wpm-meta { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.wpm-meta .wp-block-avatar img { border-radius: 50%; }
.wpm-sidebar { position: sticky; top: 1rem; align-self: start; }
.wpm-aside-title { font-size: var(--wp--preset--font-size--large); border-bottom: 2px solid var(--wp--preset--color--contrast); padding-bottom: 0.3rem; margin-bottom: 0.8rem; }
.wpm-most-read .wp-block-post-template { counter-reset: wpm; list-style: none; padding: 0; }
.wpm-most-read .wp-block-post { counter-increment: wpm; display: grid; grid-template-columns: 2rem 1fr; gap: 0.5rem; padding-block: 0.5rem; border-bottom: 1px solid var(--wp--preset--color--surface); }
.wpm-most-read .wp-block-post::before { content: counter(wpm); font-family: var(--wp--preset--font-family--vollkorn); font-size: var(--wp--preset--font-size--x-large); line-height: 1; color: var(--wp--preset--color--muted); }
.wpm-silos, .wpm-footer-silos { list-style: none; padding: 0; margin: 0; }
.wpm-silos li, .wpm-footer-silos li { padding-block: 0.25rem; }
.wpm-single-head { margin-block: 1rem 1.5rem; }
.wpm-kicker-cat { font-size: var(--wp--preset--font-size--small); }
.wpm-lead { font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--muted); }
.wpm-breadcrumbs { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.wpm-breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0 0 0.8rem; }
.wpm-breadcrumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--wp--preset--color--muted); }
.wpm-toc { border: 1px solid var(--wp--preset--color--surface); background: var(--wp--preset--color--surface); padding: 1rem 1.25rem; margin: 0 0 2rem; }
.wpm-toc ol { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.wpm-author-box { margin-block: 2.5rem; border-radius: 6px; }
.wpm-author-box .wp-block-avatar img { border-radius: 50%; }
.wpm-prevnext { border-top: 1px solid var(--wp--preset--color--surface); padding-top: 1rem; }
.wpm-hub-head { margin-block: 1.5rem; }
.wpm-hub-list .wp-block-post:nth-child(-n+3) .wp-block-post-title { font-size: var(--wp--preset--font-size--large); }
.wpm-footer-title { font-size: var(--wp--preset--font-size--medium); margin-bottom: 0.6rem; }
.wpm-footer .wp-block-navigation { font-size: var(--wp--preset--font-size--small); }
.wpm-copy { margin-top: 2rem; }
@media (max-width: 781px) { .wpm-sidebar { position: static; } .wpm-hero-small .wp-block-post-template { grid-template-columns: 1fr; } }

/* ============ Liść w Kieszeni: kieszeń ze szwem (jedyna odważna rzecz) ============ */
:root {
  --lwk-seam: var(--wp--preset--color--primary);
  --lwk-pocket-r: 0 0 2.75rem 2.75rem;
}
body { text-rendering: optimizeLegibility; }
h1, h2, h3, .wp-block-post-title { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* kieszeń: sprany denim, zaokrąglone dno, przerywany szew nitki wewnątrz krawędzi */
.wpm-pocket,
.wpm-hub-head {
  position: relative;
  z-index: 1;
  background: var(--wp--preset--color--secondary);
  border-radius: var(--lwk-pocket-r);
  outline: 2px dashed var(--lwk-seam);
  outline-offset: -12px;
  padding: clamp(1.75rem, 3vw, 2.75rem) clamp(1.5rem, 3vw, 2.75rem) clamp(2.25rem, 4vw, 3.25rem);
}
/* górny obrąbek kieszeni: druga linia szwu */
.wpm-pocket::before,
.wpm-hub-head::before {
  content: "";
  position: absolute;
  left: 12px; right: 12px; top: 22px;
  border-top: 2px dashed var(--lwk-seam);
  opacity: 0.55;
  pointer-events: none;
}
.wpm-pocket > *, .wpm-hub-head > * { position: relative; }
.wpm-pocket .wpm-home-h1 {
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.08;
  font-weight: 600;
  max-width: 17ch;
  margin-top: 0.5rem;
}
.wpm-pocket .wpm-home-lead { color: var(--wp--preset--color--contrast); max-width: 46ch; }
.wpm-pocket .wp-block-buttons { margin-top: 1.5rem; }
.wpm-kicker.wpm-pocket { margin-block: 0; }

/* zdjęcie wsunięte do kieszeni: dolna część chowa się pod denimem */
.wpm-pocket-col { display: flex; flex-direction: column; }
.wpm-tucked {
  position: relative;
  z-index: 0;
  width: 52%;
  margin: 0.75rem 9% -4.5rem auto !important;
  transform: rotate(3.5deg);
  transform-origin: 50% 100%;
}
.wpm-tucked img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 6px solid var(--wp--preset--color--base);
  border-radius: 4px;
}

/* wyróżniony tekst obok kieszeni */
.wpm-hero-split { align-items: flex-end; gap: clamp(1.5rem, 3vw, 3rem); margin-top: 1.25rem; }
.wpm-hero-featured .wp-block-post-featured-image img { border-radius: 6px; }
.wpm-hero-featured .wp-block-post-title { margin-block: 0.35rem 0.6rem; line-height: 1.15; }
.wpm-hero-featured .wp-block-post-excerpt { color: var(--wp--preset--color--muted); }

/* hub: ta sama kieszeń, bez zdjęcia */
.wpm-hub-head { margin-block: 1.5rem 2.5rem; }
.wpm-hub-head .wpm-hub-h1 { font-size: clamp(1.9rem, 3vw, 2.75rem); line-height: 1.1; max-width: 24ch; margin-top: 0.4rem; }
.wpm-hub-head .wpm-hub-lead { max-width: 60ch; }
.wpm-hub-head .wpm-trust { border: 0; margin-bottom: 0; padding-bottom: 0; color: var(--wp--preset--color--muted); }
.wpm-hub-head .wpm-breadcrumbs { margin-top: 0.6rem; }

/* szew zamiast belek: nagłówki działów, sidebar, pasek zaufania */
.wpm-section-head,
.wpm-aside-title { border-bottom: 2px dashed var(--wp--preset--color--primary); }
.wpm-trust { border-block: 0; border-bottom: 2px dashed var(--wp--preset--color--secondary); padding-block: 0.9rem; margin-block: 1.75rem 2.25rem; }
.wpm-section-more a { text-underline-offset: 0.2em; }

/* linki: denim, podkreślenie nitką */
a { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
.wp-block-post-title a, .wpm-footer-silos a, .wp-block-navigation a { text-decoration: none; }
.wp-block-post-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--wp--preset--color--accent); }

/* fokus widoczny, w zieleni liścia */
:where(a, button, input, select, textarea, .wp-element-button):focus-visible {
  outline: 3px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* przycisk: jedno CTA w denimie */
.wp-element-button, .wp-block-button__link { border-radius: 999px; padding: 0.8rem 1.5rem; font-family: var(--wp--preset--font-family--fira-sans); font-weight: 500; }

/* ramka BLUF / TL;DR bez wersalików: kieszonkowa notatka */
.wpm-bluf, .tldr { background: var(--wp--preset--color--surface); border-left-color: var(--wp--preset--color--primary); }
.wpm-bluf .wpm-bluf-label { text-transform: none; letter-spacing: 0; opacity: 1; font-weight: 600; color: var(--wp--preset--color--primary); }

/* treść wpisu */
.wp-block-post-content h2 { margin-top: 2.25em; }
.wp-block-post-content blockquote, .wp-block-quote {
  border-left: 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin-inline: 0;
  border-inline-start: 2px dashed var(--wp--preset--color--accent);
  font-family: var(--wp--preset--font-family--vollkorn);
  font-size: 1.2em;
  font-style: italic;
}
.wp-block-post-content figure img { border-radius: 6px; }
.wp-block-post-content figcaption, .wp-element-caption { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); margin-top: 0.5rem; }
.wpm-toc { background: var(--wp--preset--color--surface); border: 0; border-left: 2px dashed var(--wp--preset--color--primary); border-radius: 0 6px 6px 0; }
.wpm-author-box { background: var(--wp--preset--color--surface); padding: 1.25rem 1.5rem; }
.wpm-mini .wp-block-post-title { line-height: 1.25; }

/* stopka: nota zdrowotna */
.wpm-health-note { margin-top: 1rem; padding-top: 0.75rem; border-top: 2px dashed var(--wp--preset--color--secondary); }
.wpm-footer { margin-top: 3rem; }
.wp-site-blocks > footer { margin-block-start: 0; }

/* mobile */
@media (max-width: 781px) {
  .wpm-hero-split { align-items: stretch; }
  .wpm-tucked { width: 64%; margin: 0.5rem 6% -3.5rem auto !important; transform: rotate(3deg); }
  .wpm-pocket, .wpm-hub-head { outline-offset: -9px; border-radius: 0 0 2rem 2rem; }
  .wpm-pocket::before, .wpm-hub-head::before { left: 9px; right: 9px; top: 18px; }
  .wpm-masthead-lewy .wp-block-search { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
