/*
Theme Name: Staw po Stawie
Theme URI: https://jesienortopedyczna.pl
Author: Staw po Stawie
Description: Ortopedia dla pacjenta: urazy i złamania, stawy i kręgosłup wyjaśnione przed wizytą u ortopedy
Version: 2.1
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: staw-po-stawie
*/

/* 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; text-transform: none; font-weight: 700; color: var(--wp--preset--color--primary); }
.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: 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-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; } }


/* Staw po Stawie: szyna Kramera (drabinkowa szyna unieruchamiajaca) jako jedyna linia dzialow */
:root {
  --sps-rail: var(--wp--preset--color--secondary);
  --sps-pad: var(--wp--preset--color--accent);
  --sps-ladder-h: 12px;
  --sps-ladder-x:
    linear-gradient(var(--sps-rail), var(--sps-rail)) left bottom / 100% 2px no-repeat,
    linear-gradient(var(--sps-rail), var(--sps-rail)) left calc(100% - 10px) / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--sps-rail) 0 2px, transparent 2px 18px) left bottom / 100% var(--sps-ladder-h) no-repeat;
}

h1, h2, h3, .wp-block-post-title { text-wrap: balance; }
p, li { text-wrap: pretty; }

.wpm-header { border-bottom: 1px solid var(--wp--preset--color--secondary); }
.wpm-servicebar { padding-inline: 0.75rem; border-radius: 0 0 3px 3px; }
.wpm-servicebar .wp-block-search__input { min-width: 13rem; border-color: var(--wp--preset--color--secondary); }
.wpm-brandrow { padding-block: 0.9rem 0.8rem; align-items: center; }
.wpm-header .wp-block-navigation { font-weight: 600; gap: 1.6rem; }
.wpm-header .wp-block-navigation-item__content { padding-block: 0.3rem; text-decoration: none; border-bottom: 2px solid transparent; }
.wpm-header .wp-block-navigation-item__content:hover,
.wpm-header .current-menu-item > .wp-block-navigation-item__content,
.wpm-header .wp-block-navigation-item__content[aria-current="page"] { border-bottom-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--contrast); }

.wpm-home-h1 { max-width: 24ch; font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem); line-height: 1.08; margin-bottom: 0.6rem; }
.wpm-home-lead { color: var(--wp--preset--color--muted); }

.wpm-section-head,
.wpm-aside-title,
.wpm-related-wrap > .wpm-section-title {
  position: relative;
  border-bottom: 0;
  padding-bottom: calc(var(--sps-ladder-h) + 0.55rem);
  background: var(--sps-ladder-x);
}
.wpm-section-head::after,
.wpm-related-wrap > .wpm-section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 4.5rem; height: var(--sps-ladder-h);
  background: var(--sps-pad);
  border-radius: 2px;
}
.wpm-section-title { font-size: var(--wp--preset--font-size--xx-large); }
.wpm-section-more a { text-decoration: none; font-weight: 600; }
.wpm-section-more a:hover { text-decoration: underline; }
.wpm-aside-title { font-size: var(--wp--preset--font-size--large); }

.wpm-trust {
  border-block: 0;
  padding: calc(var(--sps-ladder-h) + 0.7rem) 0 0;
  background:
    linear-gradient(var(--sps-rail), var(--sps-rail)) left top / 100% 2px no-repeat,
    linear-gradient(var(--sps-rail), var(--sps-rail)) left 10px / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--sps-rail) 0 2px, transparent 2px 18px) left top / 100% var(--sps-ladder-h) no-repeat;
  max-width: 80ch;
}

.wpm-bluf, .tldr {
  border-left: 0;
  border-radius: 3px;
  background:
    linear-gradient(var(--sps-rail), var(--sps-rail)) 1rem top / 2px 100% no-repeat,
    linear-gradient(var(--sps-rail), var(--sps-rail)) calc(1rem + 10px) top / 2px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--sps-rail) 0 2px, transparent 2px 18px) 1rem top / 12px 100% no-repeat,
    var(--wp--preset--color--surface);
  padding: 1.25rem 1.5rem 1.25rem 2.75rem;
}

.wpm-hero-main .wp-block-post-title { margin-top: 0.8rem; font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem); }
.wpm-hero-main .wp-block-post-title a,
.wpm-section .wp-block-post-title a,
.wpm-related .wp-block-post-title a,
.wpm-hub-list .wp-block-post-title a,
.wpm-most-read .wp-block-post-title a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.wpm-hero-main .wp-block-post-title a:hover,
.wpm-section .wp-block-post-title a:hover,
.wpm-related .wp-block-post-title a:hover,
.wpm-hub-list .wp-block-post-title a:hover,
.wpm-most-read .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.wp-block-post-featured-image img { border-radius: 3px; }
.wp-block-buttons { margin-block: 1.5rem 1.25rem; }
.wp-block-button__link { padding: 0.75rem 1.4rem; text-decoration: none; }

.wpm-most-read .wp-block-post::before { color: var(--sps-pad); font-weight: 600; }
.wpm-meta a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.wpm-meta a:hover { text-decoration: underline; }

.wpm-article .wp-block-post-content a,
.wpm-ymyl-note a,
.wpm-footer p a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.wpm-article .wp-block-post-content a:hover { text-decoration-thickness: 2px; }
.wpm-article .wp-block-post-content > p,
.wpm-article .wp-block-post-content > ul,
.wpm-article .wp-block-post-content > ol { max-width: 68ch; }
.wpm-article .wp-block-post-content h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: 2.4rem; }
.wpm-article .wp-block-post-content h3 { font-size: var(--wp--preset--font-size--large); margin-top: 1.8rem; }
.wpm-article blockquote,
.wp-block-quote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.4rem;
  border-left: 3px solid var(--wp--preset--color--primary);
  font-family: var(--wp--preset--font-family--newsreader);
  font-size: var(--wp--preset--font-size--large);
  line-height: 1.45;
}
.wp-block-quote cite { display: block; margin-top: 0.6rem; font-family: var(--wp--preset--font-family--atkinson-hyperlegible-next); font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); font-style: normal; }
.wpm-article figure { margin-block: 2rem; }
.wpm-article figure img { border-radius: 3px; }
.wpm-article figcaption { margin-top: 0.5rem; text-align: left; color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }
.wpm-article table { border-collapse: collapse; width: 100%; font-size: var(--wp--preset--font-size--small); }
.wpm-article th, .wpm-article td { border-bottom: 1px solid var(--wp--preset--color--secondary); padding: 0.55rem 0.6rem; text-align: left; vertical-align: top; }
.wpm-article th { background: var(--wp--preset--color--surface); }
.wpm-toc { border: 0; border-left: 3px solid var(--wp--preset--color--primary); border-radius: 0 3px 3px 0; }
.wpm-toc a { text-decoration: none; }
.wpm-toc a:hover { text-decoration: underline; }

.wpm-ymyl-note { max-width: 68ch; margin-block: 2rem 0; padding: 0.9rem 1.1rem; border: 1px solid var(--wp--preset--color--secondary); border-radius: 3px; color: var(--wp--preset--color--contrast); }
.wpm-footer-note { max-width: 80ch; margin-top: 2rem; }
.wpm-footer { margin-top: 4rem; }
.wpm-footer a { color: var(--wp--preset--color--contrast); }
.wpm-footer .wpm-footer-silos a { text-decoration: none; }
.wpm-footer .wpm-footer-silos a:hover { text-decoration: underline; }
.wpm-copy { margin-top: 1rem; }

:where(a, button, input, select, textarea, summary, .wp-block-navigation-item__content):focus-visible {
  outline: 3px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 781px) {
  .wpm-servicebar .wp-block-search__input { min-width: 0; }
  .wpm-section-title { font-size: var(--wp--preset--font-size--x-large); }
  .wpm-section-head::after, .wpm-related-wrap > .wpm-section-title::after { width: 3rem; }
  .wpm-bluf, .tldr { padding-left: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.wpm-brand .wp-block-site-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 600px) { .wpm-brand .wp-block-site-logo img { width: 190px !important; height: auto; } }
.wpm-footer .wpm-footer-silos { font-size: var(--wp--preset--font-size--small); }
@media (max-width: 600px) { .wpm-servicebar { padding-block: 0.3rem; } }

/* poprawki po recenzji 2026-10-08 */
/* drobny tekst: minimum 15 px */
.wpm-meta, .wpm-trust, .wpm-breadcrumbs, .wpm-kicker-cat, .wpm-section-more,
.wp-block-post-date.has-small-font-size,
.wpm-footer .has-small-font-size, .wpm-footer .wp-block-navigation, .wpm-footer .wpm-footer-silos,
.wpm-sidebar .has-small-font-size, .wpm-ymyl-note, .wpm-article figcaption { font-size: max(15px, var(--wp--preset--font-size--small)) !important; }

/* CTA pod zajawka strony, z dala od zajawki materialu w hero */
.wpm-home-cta { margin-block: 1.4rem 2.2rem; }

/* szyna obok pasow: trzyma sie ekranu, kolumna nie rozciaga sie na pusto */
@media (min-width: 782px) {
  .wpm-home .wpm-with-sidebar > .wp-block-column:last-child,
  .wpm-single .wpm-with-sidebar > .wp-block-column:last-child { align-self: flex-start; position: sticky; top: 1.5rem; }
  .wpm-home .wpm-with-sidebar .wpm-sidebar,
  .wpm-single .wpm-with-sidebar .wpm-sidebar { position: static; }
  .wpm-home > .wpm-section .wpm-row > .wp-block-column:first-child { flex: 0 0 min(30%, 300px) !important; }
}

/* "Przeczytaj przed wizyta": naglowek w skali H2 tresci */
.wpm-related-wrap > .wpm-section-title { font-size: var(--wp--preset--font-size--x-large); }
.wpm-related-wrap { margin-top: 3rem; }

/* hub: szyna z wysciolka pod H1, siatka bez pustych slotow */
.wpm-hub-h1 {
  position: relative;
  padding-bottom: calc(var(--sps-ladder-h) + 0.7rem);
  background: var(--sps-ladder-x);
  max-width: 32ch;
}
.wpm-hub-h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 4.5rem; height: var(--sps-ladder-h); background: var(--sps-pad); border-radius: 2px; }
.wpm-trust-hub { background: none; border-top: 1px solid var(--wp--preset--color--secondary); padding-top: 0.6rem; }
.wpm-hub-list .wp-block-post-title { margin-block: 0.7rem 0.4rem; }
.wpm-hub-list .wp-block-post:nth-child(-n+3) .wp-block-post-title { font-size: var(--wp--preset--font-size--large); }
.wpm-hub-list .wp-block-post-excerpt { color: var(--wp--preset--color--muted); }
.wpm-hub-list .wp-block-post-excerpt p { margin-block: 0.3rem; }
@media (min-width: 782px) {
  .wpm-hub-list .wp-block-post-template.is-layout-grid > .wp-block-post:first-child:nth-last-child(3n+2) { grid-column: span 2; }
  .wpm-hub-list .wp-block-post-template.is-layout-grid > .wp-block-post:first-child:nth-last-child(3n+1) { grid-column: 1 / -1; }
  .wpm-hub-list .wp-block-post-template.is-layout-grid > .wp-block-post:first-child:is(:nth-last-child(3n+1), :nth-last-child(3n+2)) {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 1.5rem; align-content: start;
  }
  .wpm-hub-list .wp-block-post:first-child:is(:nth-last-child(3n+1), :nth-last-child(3n+2)) > .wp-block-post-featured-image { grid-row: 1 / span 4; margin: 0; }
  .wpm-hub-list .wp-block-post:first-child:is(:nth-last-child(3n+1), :nth-last-child(3n+2)) > :not(.wp-block-post-featured-image) { grid-column: 2; }
  .wpm-hub-list .wp-block-post:first-child:is(:nth-last-child(3n+1), :nth-last-child(3n+2)) .wp-block-post-title { font-size: var(--wp--preset--font-size--x-large); margin-top: 0; }
}

/* stopka: zasady jako lista pionowa */
.wpm-footer-legal { gap: 0.5rem; }
.wpm-footer-legal .wp-block-navigation__container { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

/* mobile: listy z miniatura jako siatka 96 px + tekst */
@media (max-width: 781px) {
  .wpm-mini, .wpm-row { display: grid !important; grid-template-columns: 96px minmax(0, 1fr); gap: 0.9rem; align-items: start; }
  .wpm-mini > .wp-block-column, .wpm-row > .wp-block-column { flex-basis: auto !important; width: auto; margin: 0; }
  .wpm-mini .wp-block-post-featured-image, .wpm-row .wp-block-post-featured-image { margin: 0; }
  .wpm-mini .wp-block-post-featured-image img, .wpm-row .wp-block-post-featured-image img { aspect-ratio: 1 / 1 !important; width: 96px; height: 96px !important; object-fit: cover; }
  .wpm-mini .wp-block-post-title, .wpm-row .wp-block-post-title { font-size: var(--wp--preset--font-size--medium) !important; margin-top: 0; }
  .wpm-row .wp-block-post-excerpt { display: none; }
  .wpm-hero-latest .wp-block-post, .wpm-section .wpm-mini, .wpm-section .wpm-row { padding-block: 0.4rem; }
}
@media (min-width: 782px) {
  .wpm-hub-list .wp-block-post:first-child:is(:nth-last-child(3n+1), :nth-last-child(3n+2)) > .wp-block-post-featured-image { height: 100%; min-height: 18rem; }
  .wpm-hub-list .wp-block-post:first-child:is(:nth-last-child(3n+1), :nth-last-child(3n+2)) > .wp-block-post-featured-image :is(a, img) { display: block; height: 100% !important; aspect-ratio: auto !important; }
  .wpm-hub-list .wp-block-post:first-child:is(:nth-last-child(3n+1), :nth-last-child(3n+2)) { grid-template-rows: auto auto auto 1fr; }
}

/* O serwisie: portrety redakcji jako miniatury obok opisu, nie galeria */
.page-id-17 .entry-content .wp-block-image,
.page-id-17 .wp-block-post-content .wp-block-image { float: left; width: 180px; margin: 0.25rem 1.5rem 1rem 0; }
.page-id-17 .wp-block-image img { width: 180px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.page-id-17 .wp-block-post-content h2 { clear: both; }
@media (max-width: 600px) {
  .page-id-17 .entry-content .wp-block-image,
  .page-id-17 .wp-block-post-content .wp-block-image { width: 120px; margin-right: 1rem; }
  .page-id-17 .wp-block-image img { width: 120px; }
}
.page-id-17 .wp-block-image { clear: left; margin-right: 1.5rem !important; margin-bottom: 1rem !important; }
.page-id-17 .wp-block-image + p { min-height: 15.5rem; }
@media (max-width: 600px) { .page-id-17 .wp-block-image + p { min-height: 9rem; } .page-id-17 .wp-block-image { margin-right: 1rem !important; } }
