/*
Theme Name: Zawiniątko
Theme URI: https://qbanamama.pl
Author: Zawiniątko
Description: Poradnik o śnie, kąpieli i wyprawce niemowlęcia: co kupić, jak używać, czego unikać
Version: 1.7
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: zawiniatko
*/

/* 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; }
.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 { 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--heading, inherit); 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; } }

/* Zawiniatko: warstwa redakcyjna */
:root { --zw-stitch: 2px dashed var(--wp--preset--color--primary); }
body { text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* linki: cienkie podkreslenie, grubsze przy najechaniu */
.wpm-main a:where(:not(.wp-element-button)), .entry-content a:where(:not(.wp-element-button)) {
  text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.wpm-main a:where(:not(.wp-element-button)):hover, .entry-content a:where(:not(.wp-element-button)):hover { text-decoration-thickness: 2px; text-decoration-color: currentColor; }
.wp-block-post-title a, .wpm-section-title a { text-decoration: none !important; color: var(--wp--preset--color--contrast); }
.wp-block-post-title a:hover { color: var(--wp--preset--color--primary); text-decoration: underline !important; text-decoration-thickness: 1px !important; text-underline-offset: 0.18em; }

/* fokus klawiatury */
:where(a, button, input, .wp-element-button, summary):focus-visible {
  outline: 2px solid var(--wp--preset--color--accent); outline-offset: 3px; border-radius: 2px;
}

/* naglowek: wordmark jako logo, nazwa zostaje w kodzie */
.wpm-header { border-bottom: 1px solid var(--wp--preset--color--secondary); background: var(--wp--preset--color--base); }
.wpm-masthead-lewy { padding-block: 1rem; gap: 1.25rem 2rem; align-items: center; }
.wpm-brand .wp-block-site-logo + .wp-block-site-title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.wpm-brand .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--contrast); font-size: 1.75rem; }
.wpm-header .wp-block-navigation { font-weight: 600; font-size: 0.95rem; gap: 0.4rem 1.5rem; }
.wpm-header .wp-block-navigation a { text-decoration: none; padding-block: 0.3rem; border-bottom: 2px solid transparent; }
.wpm-header .wp-block-navigation a:hover, .wpm-header .wp-block-navigation .current-menu-item > a { border-bottom: var(--zw-stitch); }
.wpm-header .wp-block-search__input { border: 1px solid var(--wp--preset--color--secondary); border-radius: 6px; background: var(--wp--preset--color--surface); }

/* hero split: duzy serifowy H1 jako glos serwisu */
.wpm-hero-split { margin-block: clamp(2rem, 5vw, 4rem) 1rem; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.wpm-hero-split .wpm-kicker { margin-block: 0 1.5rem; }
.wpm-home-h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.5rem); line-height: 1.06; font-weight: 400; letter-spacing: -0.02em; max-width: 15ch;
}
.wpm-home-lead { color: var(--wp--preset--color--muted); max-width: 46ch; line-height: 1.55; }
.wpm-hero-photo { margin: 0; }
.wpm-hero-photo img { display: block; width: 100%; height: auto; }
.wpm-hero-split .wp-block-button__link { padding: 0.85rem 1.4rem; }

/* pasek zaufania: jedna cicha linia pod hero */
.wpm-trust { border-block: 0; border-top: 1px solid var(--wp--preset--color--secondary); padding-block: 0.9rem 0; margin-block: 1.5rem 3rem; }

/* odwazna decyzja: linia szwu otwiera kazdy dzial */
.wpm-section { margin-block: 0 3.5rem; }
.wpm-section-head { border-bottom: 0; border-top: var(--zw-stitch); padding-top: 0.9rem; padding-bottom: 0; margin-bottom: 1.5rem; }
.wpm-section-title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 500; }
.wpm-section-more { margin: 0; }
.wpm-section .wp-block-post-featured-image img { border-radius: 6px; }
.wpm-section .wp-block-post-title { margin-block: 0.7rem 0.4rem; line-height: 1.2; }
.wpm-row { padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--wp--preset--color--secondary); }
.wpm-section .wp-block-post:last-child .wpm-row { border-bottom: 0; }
.wpm-textrow, .wpm-prevnext { border-color: var(--wp--preset--color--secondary); }

/* sidebar */
.wpm-aside-title { border-bottom: 0; border-top: var(--zw-stitch); padding-top: 0.7rem; padding-bottom: 0; font-weight: 500; }
.wpm-most-read .wp-block-post { border-bottom-color: var(--wp--preset--color--secondary); }
.wpm-most-read .wp-block-post::before { color: var(--wp--preset--color--accent); font-style: italic; }
.wpm-sidebar { background: var(--wp--preset--color--secondary); padding: 1.25rem 1.4rem 1rem; border-radius: 6px; }

/* wpis */
.wpm-single-head .wp-block-post-title { font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.1; font-weight: 400; }
.wpm-toc { background: var(--wp--preset--color--secondary); border: 0; border-top: var(--zw-stitch); border-radius: 0 0 6px 6px; }
.wpm-author-box { background: var(--wp--preset--color--secondary); padding: 1.5rem; }
.wpm-bluf, .tldr { background: var(--wp--preset--color--surface); }
.wpm-bluf .wpm-bluf-label { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: 1; color: var(--wp--preset--color--primary); }
.entry-content h2 { margin-top: 2.6rem; }
.entry-content blockquote, .wp-block-quote {
  border-left: 0; margin-inline: 0; padding: 0.4rem 0 0.4rem 1.5rem;
  border-left: var(--zw-stitch); font-family: var(--wp--preset--font-family--newsreader); font-size: 1.3rem; line-height: 1.45; font-style: italic;
}
.wp-block-quote cite { font-family: var(--wp--preset--font-family--manrope); font-style: normal; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
figure.wp-block-image img { border-radius: 6px; }
figure figcaption, .wp-element-caption { margin-top: 0.6rem; text-align: left; }
.entry-content table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--wp--preset--color--secondary); padding: 0.55rem 0.6rem; text-align: left; vertical-align: top; }
.entry-content th { border-bottom: var(--zw-stitch); font-weight: 600; }

/* stopka: duzy wordmark na tle szalwii */
.wpm-footer-pasek_gruby { border-top: var(--zw-stitch); }
.wpm-footer-wordmark { font-size: clamp(3rem, 9vw, 6.5rem) !important; line-height: 1; letter-spacing: -0.03em; font-weight: 400; margin-bottom: 1.5rem; }
.wpm-footer-wordmark a { text-decoration: none; color: var(--wp--preset--color--primary); }
.wpm-footer-silos { display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; font-weight: 600; }
.wpm-footer a { color: var(--wp--preset--color--contrast); }
.wpm-footer .wpm-footer-wordmark a, .wpm-footer .wpm-footer-wordmark { color: var(--wp--preset--color--primary); }
.wpm-footer .wpm-footer-wordmark a:hover { color: var(--wp--preset--color--contrast); }
.wp-site-blocks > footer { margin-block-start: 0; }

@media (max-width: 781px) {
  .wpm-hero-split { margin-top: 1.5rem; }
  .wpm-home-h1 { max-width: none; }
  .wpm-sidebar { margin-top: 1rem; }
  .wpm-header .wp-block-search { flex-basis: 100%; }
  .wpm-brand .wp-block-site-logo img { height: 36px; }
}
/* v1.7: szeroki uklad, staly hero, karty bez pustych torow */
figure.wp-block-image.wpm-hero-photo img { border-radius: 6px 6px 6px 48px; }
@media (max-width: 781px) { figure.wp-block-image.wpm-hero-photo img { border-radius: 6px 6px 6px 32px; } }
.wpm-brand .wp-block-site-logo img { height: 44px; width: auto; max-width: none; }
@media (min-width: 960px) {
  .wpm-masthead-lewy { flex-wrap: nowrap !important; }
  .wpm-header .wp-block-navigation { margin-left: auto; }
  .wpm-header .wp-block-search { flex: 0 0 13.5rem; }
}
.wpm-section-karty-elastyczne .wp-block-post-template.is-layout-grid,
.wpm-related-wrap .wp-block-post-template.is-layout-grid,
.wpm-hub-list .wp-block-post-template.is-layout-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
}
.wpm-hub-list .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); }
.wpm-meta .wp-block-post-author-name, .wpm-meta .wp-block-post-date { white-space: nowrap; }
.wpm-with-sidebar { gap: clamp(1.5rem, 4vw, 3.5rem); }
.wpm-hub-h1 { max-width: 24ch; }
.wpm-hub-lead { max-width: 62ch; color: var(--wp--preset--color--muted); }
.wpm-related-wrap { margin-block: 3rem 2rem; }
.wpm-related-wrap .wpm-section-title { border-top: var(--zw-stitch); padding-top: 0.9rem; margin-bottom: 1.5rem; }

/* sidebar: kto pisze */
.wpm-authors { margin-top: 2rem; }
.wpm-author-line { margin: 0; padding-block: 0.6rem; border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 18%, transparent); font-size: 0.95rem; line-height: 1.45; color: var(--wp--preset--color--muted); }
.wpm-author-line strong { font-family: var(--wp--preset--font-family--newsreader); font-weight: 500; font-size: 1.12rem; color: var(--wp--preset--color--contrast); }
.wpm-authors-more { margin-top: 0.9rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* Zawiniatko: runda QA 2 */
.page .wp-block-image img[src*="monogram"] { width: 96px; height: 96px; max-width: 96px; border-radius: 6px; }
.page .wp-block-image:has(img[src*="monogram"]) { margin-bottom: 0.5rem; }
.wpm-hub-list .wp-block-post-excerpt { font-size: var(--wp--preset--font-size--small); line-height: 1.55; }
.wpm-hub-list .wp-block-post-title { font-size: 1.25rem; line-height: 1.3; }
.wpm-hero-split .wpm-home-h1,
.wpm-hero-split .wp-block-heading + p,
.wpm-hero-split .wp-block-buttons { margin-left: 0; padding-left: 0; }
