/*
Theme Name: Ulotka po Ludzku
Theme URI: https://lekio.pl
Author: Ulotka po Ludzku
Description: Ulotka, apteka i refundacja wyjaśnione zwykłym językiem
Version: 1.0.5
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: ulotka-po-ludzku
*/

/* 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: 3px; }
.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--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: 3px; }
.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-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; } }

/* ===== Ulotka po Ludzku: punkty ulotki i zakreslacz ===== */
/* Jedna odwazna decyzja: wszystko, co jest sekwencja (srodtytuly wpisu, spis tresci, trzy kroki
   "Zanim wezmiesz lek"), dostaje numer punktu jak w ulotce, podlozony zakreslaczem #F3DE6D,
   tak jak pacjent zaznacza wazny punkt w ulotce. Zakreslacz nie pojawia sie nigdzie indziej poza
   zaznaczeniem tekstu i najechaniem na link. */
:root { --upl-marker: var(--wp--preset--color--secondary); --upl-ink: var(--wp--preset--color--contrast); }

body { text-rendering: optimizeLegibility; }
h1, h2, h3, h4, .wp-block-post-title { text-wrap: balance; }
p, li { text-wrap: pretty; }
::selection { background: var(--upl-marker); color: var(--upl-ink); }

a { text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.wp-block-post-content a, .wpm-points a, .wpm-trust a, .wpm-sidebar p a, .wpm-before-note a { text-decoration-line: underline; }
.wp-block-post-content a:hover, .wpm-points a:hover, .wpm-sidebar p a:hover { background: var(--upl-marker); color: var(--upl-ink); text-decoration-color: transparent; }
.wp-block-post-title a, .wpm-section-title a { text-decoration: none; color: inherit; }
.wp-block-post-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
:where(a, button, input, .wp-element-button):focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 3px; border-radius: 2px; box-shadow: 0 0 0 6px var(--upl-marker); }

/* masthead kompaktowy: znak, szesc dzialow, szukajka */
.wpm-masthead-kompaktowy { padding-block: 0.65rem; gap: 1.5rem; border-bottom: 1px solid var(--wp--preset--color--surface); }
.wpm-header { border-bottom: 0; }
.wpm-masthead .wp-block-navigation { font-size: 0.95rem; font-weight: 500; gap: 1.25rem; }
.wpm-masthead .wp-block-navigation a { color: var(--upl-ink); text-decoration: none; padding-block: 0.3rem; border-bottom: 3px solid transparent; }
.wpm-masthead .wp-block-navigation a:hover, .wpm-masthead .wp-block-navigation .current-menu-item > a, .wpm-masthead .wp-block-navigation a[aria-current="page"] { border-bottom-color: var(--wp--preset--color--primary); }
.wpm-masthead .wp-block-search { max-width: 15rem; }
.wpm-masthead .wp-block-search__input { border: 1px solid #C9CFCC; border-radius: 3px; background: var(--wp--preset--color--base); font-size: 0.9rem; }
@media (min-width: 1000px) { .wpm-masthead .wp-block-navigation__container { flex-wrap: nowrap; white-space: nowrap; } }

/* hero split: H1 drukiem ulotki, zdjecie najnowszego tekstu z tytulem */
.wpm-hero-split { gap: clamp(1.5rem, 4vw, 3.5rem); margin-block: clamp(1.5rem, 4vw, 3rem) 0.5rem; align-items: center; }
.wpm-home-h1 { font-size: clamp(2.3rem, 4.6vw, 3.4rem); line-height: 1.08; max-width: 15ch; margin-bottom: 1rem; }
.wpm-home-lead { color: var(--wp--preset--color--muted); max-width: 46ch; line-height: 1.55; }
.wpm-hero-split .wp-block-buttons { margin-top: 1.5rem; }
.wpm-hero-photo img { border-radius: 3px; }
.wpm-hero-photo .wpm-kicker-cat { margin-top: 0.8rem; }
.wpm-hero-title { margin-top: 0.3rem; line-height: 1.2; }
.wp-element-button { padding: 0.8rem 1.4rem; }

/* pasek zaufania: drobny druk pod hero */
.wpm-trust { border-block: 1px solid #D5DAD7; padding-block: 0.75rem; line-height: 1.55; }

/* naglowki dzialow: cienka linia druku zamiast grubej belki */
.wpm-section-head { border-bottom: 1px solid var(--upl-ink); }
.wpm-section-title { font-size: var(--wp--preset--font-size--xx-large); }
.wpm-section-more a { color: var(--wp--preset--color--primary); }
.wpm-aside-title { font-family: var(--wp--preset--font-family--dm-serif-display); font-weight: 400; border-bottom-width: 1px; }
.wp-block-post-featured-image img { border-radius: 3px; }
.wpm-row { gap: 1.25rem; padding-block: 0.75rem; border-bottom: 1px solid var(--wp--preset--color--surface); }
.wpm-textrow { gap: 1rem; align-items: baseline; }
.wpm-textrow .wp-block-post-date { min-width: 8.5rem; }
.wpm-textrow .wp-block-post-title { margin: 0; }
.wpm-sidebar { top: 5.5rem; }
.wpm-most-read .wp-block-post-title { margin: 0; }

/* punkty ulotki: numer na zakreslaczu */
.wpm-points { list-style: none; counter-reset: upl; padding: 0; margin: 1.25rem 0; }
.wpm-points > li { counter-increment: upl; position: relative; padding: 0.15rem 0 1rem 3rem; }
.wpm-points > li::before,
.single-post .wp-block-post-content h2::before,
.wpm-toc li::before {
  font-family: var(--wp--preset--font-family--dm-sans); font-weight: 700; color: var(--upl-ink);
  background: var(--upl-marker); border-radius: 2px 6px 3px 5px; line-height: 1; display: inline-block; text-align: center;
}
.wpm-points > li::before { content: counter(upl); position: absolute; left: 0; top: 0.1rem; min-width: 2rem; padding: 0.35rem 0.4rem; font-size: 1.05rem; }

.single-post .wp-block-post-content { counter-reset: upl-h2; }
.single-post .wp-block-post-content h2 { counter-increment: upl-h2; scroll-margin-top: 6rem; }
.single-post .wp-block-post-content h2::before { content: counter(upl-h2) "."; font-size: 0.6em; padding: 0.3em 0.4em 0.25em; margin-right: 0.55em; vertical-align: 0.3em; }

.wpm-toc { background: transparent; border: 0; border-top: 2px solid var(--upl-ink); border-bottom: 1px solid #D5DAD7; padding: 0.9rem 0 1rem; }
.wpm-toc > strong { font-size: var(--wp--preset--font-size--small); }
.wpm-toc ol { list-style: none; counter-reset: upl-toc; padding: 0; margin-top: 0.6rem; }
.wpm-toc li { counter-increment: upl-toc; display: grid; grid-template-columns: 2.2rem 1fr; align-items: baseline; padding-block: 0.2rem; }
.wpm-toc li::before { content: counter(upl-toc) "."; font-size: 0.8rem; padding: 0.25rem 0.3rem; width: 1.6rem; }
.wpm-toc a { color: var(--upl-ink); text-decoration: none; }
.wpm-toc a:hover { text-decoration: underline; }

/* wpis: ramka wstepu, cytat, figury, tabele */
.wpm-bluf .wpm-bluf-label { text-transform: none; letter-spacing: 0; opacity: 1; font-weight: 700; }
.wpm-bluf, .tldr { border-left-width: 3px; border-radius: 0 3px 3px 0; }
.wp-block-post-content { font-size: 1.0625rem; }
.wp-block-post-content blockquote, .wp-block-quote { border-left: 2px solid var(--wp--preset--color--primary); margin-inline: 0; padding: 0.2rem 0 0.2rem 1.25rem; font-style: normal; }
.wp-block-quote p { font-family: var(--wp--preset--font-family--dm-serif-display); font-size: var(--wp--preset--font-size--large); line-height: 1.35; }
.wp-block-quote cite { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); font-style: normal; }
figure.wp-block-image img { border-radius: 3px; }
figure figcaption, .wp-element-caption { margin-top: 0.5rem; padding-top: 0.4rem; border-top: 1px solid #D5DAD7; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); text-align: left; }
.wp-block-table table { border-collapse: collapse; font-size: 0.95rem; }
.wp-block-table th, .wp-block-table td { border: 0; border-bottom: 1px solid #D5DAD7; padding: 0.55rem 0.6rem; text-align: left; vertical-align: top; }
.wp-block-table thead th { border-bottom: 2px solid var(--upl-ink); }
.wpm-author-box { border-radius: 3px; gap: 1.25rem; }
.wpm-single-head .wp-block-post-title { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.12; }

/* Zanim wezmiesz lek */
.wpm-before { margin-block: 3rem 1rem; border-radius: 3px; }
.wpm-before-cols { gap: clamp(1.5rem, 4vw, 3rem); }
.wpm-before-title { margin-top: 0; }
.wpm-before-photo img { border-radius: 3px; aspect-ratio: 3/2; object-fit: cover; }
.wpm-before-note { margin-bottom: 0; }

/* stopka na ciemnym lupku */
.wpm-footer a { color: var(--wp--preset--color--base); text-decoration: underline; text-decoration-color: rgba(246,247,246,0.45); }
.wpm-footer a:hover { text-decoration-color: var(--upl-marker); }
.wpm-footer-title { color: var(--wp--preset--color--base); }
.wpm-footer .wpm-ymyl { color: var(--wp--preset--color--surface); max-width: 38ch; }
.wpm-footer .wp-block-navigation { gap: 0.5rem 1.25rem; }
.wp-site-blocks > footer { margin-block-start: 0; }
.wpm-footer :where(a, button):focus-visible { outline-color: var(--upl-marker); box-shadow: none; }

/* strony (Zespol, Kontakt, prawne) */
.wpm-page > .wp-block-post-title { margin-top: clamp(1.5rem, 4vw, 3rem); }

@media (max-width: 781px) {
  .wpm-home-h1 { max-width: none; }
  .wpm-section-title { font-size: var(--wp--preset--font-size--x-large); }
  .wpm-textrow { flex-wrap: wrap !important; gap: 0.1rem 1rem; }
  .wpm-textrow .wp-block-post-date { min-width: 0; }
  .wpm-row > .wp-block-column:first-child { flex-basis: 34% !important; }
  .wpm-row { flex-wrap: nowrap !important; }
  .wpm-row .wp-block-post-excerpt { display: none; }
  .wpm-masthead .wp-block-search { max-width: 2.8rem; }
  .wpm-before { padding: 1.25rem !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
.wp-site-blocks > header { position: sticky; top: 0; z-index: 30; background: var(--wp--preset--color--base); }
.admin-bar .wp-site-blocks > header { top: var(--wp-admin--admin-bar--height, 32px); }
html, body { overflow-x: clip; }
.wpm-masthead .wp-block-search__inside-wrapper { border: 1px solid #C9CFCC; border-radius: 3px; padding: 3px; background: var(--wp--preset--color--base); }
.wpm-masthead .wp-block-search__input { border: 0; }
@media (max-width: 600px) { .wpm-masthead .wp-block-search { display: none; } }
/* baner zgody cookies w kolorach marki */
.cky-consent-container .cky-btn-accept, .cky-consent-container .cky-btn-reject, .cky-preference-center .cky-btn-accept, .cky-preference-center .cky-btn-reject, .cky-preference-center .cky-btn-preferences { background: var(--wp--preset--color--primary) !important; border-color: var(--wp--preset--color--primary) !important; color: var(--wp--preset--color--base) !important; }
.cky-consent-container .cky-btn-customize { color: var(--wp--preset--color--primary) !important; border-color: var(--wp--preset--color--primary) !important; background: transparent !important; }
.cky-consent-container .cky-consent-bar { border-radius: 3px; box-shadow: none !important; border: 1px solid #C9CFCC !important; }

/* ===== poprawki po recenzji 2026-10-08 ===== */
/* karty: tytul dominuje (serif 1.25rem), zajawka 1rem w kolorze muted */
.wpm-hub-list .wp-block-post-title,
.upl-czytaj .wp-block-post-title { font-family: var(--wp--preset--font-family--dm-serif-display); font-weight: 400; font-size: 1.25rem; line-height: 1.25; margin: 0.75rem 0 0.4rem; }
.wpm-mini .wp-block-post-title, .wpm-most-read .wp-block-post-title { font-family: var(--wp--preset--font-family--dm-serif-display); font-weight: 400; font-size: 1.125rem !important; line-height: 1.25; }
.wp-block-post-template .wp-block-post-excerpt { font-size: 1rem; line-height: 1.55; color: var(--wp--preset--color--muted); margin-block: 0.3rem 0.5rem; }
.wp-block-post-template .wp-block-post-excerpt__excerpt { margin: 0; }
.wp-block-post-template .wp-block-post-excerpt__more-text { display: none; }
.wpm-section .wpm-row .wp-block-post-title { margin: 0 0 0.35rem; }
.wpm-hub-list .wp-block-post-template { row-gap: clamp(1.75rem, 3vw, 2.5rem); }
.wpm-hub, .wpm-single { padding-bottom: clamp(2rem, 5vw, 4rem); }

/* naglowek huba: tytul, opis i pasek zaufania po lewej, ramka "Kto pisze" po prawej */
.wpm-hub-head { gap: clamp(1.5rem, 4vw, 3.5rem); margin-block: 0.5rem 2rem; align-items: flex-start; }
.wpm-hub-h1 { margin-top: 0; }
.wpm-hub-lead { font-size: var(--wp--preset--font-size--large); line-height: 1.5; max-width: 52ch; }
.wpm-hub-lead p { margin: 0; }
.wpm-hub-head .wpm-trust { margin-block: 1.25rem 0; }
.upl-desk { border-top: 2px solid var(--upl-ink); padding-top: 0.9rem; }
.upl-desk-title { font-family: var(--wp--preset--font-family--dm-serif-display); font-size: var(--wp--preset--font-size--large); margin: 0 0 0.6rem; }
.upl-desk-list { list-style: none; padding: 0; margin: 0; }
.upl-desk-list li { display: flex; align-items: center; gap: 0.75rem; padding-block: 0.55rem; border-bottom: 1px solid #D5DAD7; }
.upl-desk-list img { border-radius: 50%; flex: none; width: 48px; height: 48px; object-fit: cover; }
.upl-desk-list span { display: flex; flex-direction: column; line-height: 1.3; }
.upl-desk-list a { color: var(--upl-ink); font-weight: 600; text-decoration: none; }
.upl-desk-list a:hover { text-decoration: underline; }
.upl-desk-list small { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.upl-desk-more { font-size: var(--wp--preset--font-size--small); margin: 0.75rem 0 0; }
.upl-desk-more a { text-decoration: underline; }

/* wpis: sidebar przyklejony pod naglowkiem, "Czytaj dalej" z miniaturami */
@media (min-width: 782px) {
  .wpm-single .wpm-sidebar { position: sticky; top: 5.5rem; max-height: calc(100vh - 6.5rem); overflow-y: auto; scrollbar-width: thin; }
}
.wpm-single .wpm-sidebar .wpm-aside-title { margin-top: 0; }
.upl-side-more-wrap { margin-bottom: 2rem; }
.wpm-sidebar .wpm-mini { gap: 0.9rem; padding-block: 0.6rem; border-bottom: 1px solid var(--wp--preset--color--surface); margin: 0; }
.wpm-sidebar .wpm-mini .wp-block-post-title { margin: 0 0 0.25rem; }
.upl-czytaj { margin-block: 3rem 2rem; border-top: 1px solid var(--upl-ink); padding-top: 1rem; }
.upl-czytaj .wpm-section-title { margin-bottom: 1.25rem; }
.upl-czytaj .wp-block-post-template { gap: clamp(1.25rem, 3vw, 2rem); }

/* Zespol: portrety 4:5 w trzech kolumnach, imie i opis pod portretem */
@media (min-width: 782px) {
  .page-id-17 .wp-block-post-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; column-gap: 2rem; }
  .page-id-17 .wp-block-post-content > * { grid-column: 1 / -1; margin-top: 0; margin-bottom: 1.25rem; }
  .page-id-17 .wp-block-post-content > h2 { margin-top: 1.5rem; }
  .page-id-17 .wp-block-post-content > figure.wp-block-image:nth-of-type(1),
  .page-id-17 .wp-block-post-content > h3:nth-of-type(1),
  .page-id-17 .wp-block-post-content > h3:nth-of-type(1) + p { grid-column: 1; }
  .page-id-17 .wp-block-post-content > figure.wp-block-image:nth-of-type(2),
  .page-id-17 .wp-block-post-content > h3:nth-of-type(2),
  .page-id-17 .wp-block-post-content > h3:nth-of-type(2) + p { grid-column: 2; }
  .page-id-17 .wp-block-post-content > figure.wp-block-image:nth-of-type(3),
  .page-id-17 .wp-block-post-content > h3:nth-of-type(3),
  .page-id-17 .wp-block-post-content > h3:nth-of-type(3) + p { grid-column: 3; }
  .page-id-17 .wp-block-post-content > figure.wp-block-image { margin-bottom: 0.9rem; }
  .page-id-17 .wp-block-post-content > figure.wp-block-image img { width: 100%; max-width: 240px; }
  .page-id-17 .wp-block-post-content > h3 { margin-bottom: 0.4rem; }
  .page-id-17 .wp-block-post-content > h3 + p { font-size: 1rem; line-height: 1.55; color: var(--wp--preset--color--muted); }
}
.page-id-17 .wp-block-post-content > figure.wp-block-image img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: 3px; }
.page-id-17 .wp-block-post-content > h3 { font-size: var(--wp--preset--font-size--large); text-align: left; }
@media (max-width: 781px) {
  .page-id-17 .wp-block-post-content > figure.wp-block-image { margin-bottom: 0.5rem; }
  .page-id-17 .wp-block-post-content > figure.wp-block-image img { width: 112px; }
  .page-id-17 .wp-block-post-content > h3 { margin-top: 0.25rem; margin-bottom: 0.3rem; }
  .page-id-17 .wp-block-post-content > h3 + p { margin-bottom: 2rem; }
}
