/* Czytelność kodu w artykułach technicznych. Nie wpływa na stronę główną. */
body.single-post pre,
body.single-post pre.wp-block-code,
body.single-post .wp-block-code,
body.single-post .wp-block-preformatted {
    display: block !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    margin: 1.5rem 0 !important;
    padding: clamp(16px, 2.5vw, 26px) !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    border: 1px solid #314b41 !important;
    border-radius: 16px !important;
    background: #192722 !important;
    background-image: none !important;
    color: #f1fbf6 !important;
    -webkit-text-fill-color: #f1fbf6 !important;
    box-shadow: 0 8px 26px rgba(19, 36, 29, .12) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace !important;
    font-size: clamp(13px, 1.1vw, 16px) !important;
    font-weight: 500 !important;
    line-height: 1.85 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: pre !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    tab-size: 4;
    scrollbar-color: #91ad9e #192722;
    scrollbar-width: thin;
    color-scheme: dark;
}

/* W niektórych motywach element CODE dostaje jasne tło i niemal biały tekst.
   Wszystkie zagnieżdżone elementy bloku odziedziczą bezpieczny kontrast. */
body.single-post pre :where(*),
body.single-post .wp-block-code :where(*) {
    background: transparent !important;
    background-image: none !important;
    color: #f1fbf6 !important;
    -webkit-text-fill-color: #f1fbf6 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    text-decoration-color: currentColor !important;
}

body.single-post pre code,
body.single-post .wp-block-code code {
    display: block !important;
    border: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    white-space: inherit !important;
    overflow-wrap: inherit !important;
    word-break: inherit !important;
}

body.single-post pre::selection,
body.single-post pre *::selection,
body.single-post .wp-block-code::selection,
body.single-post .wp-block-code *::selection {
    background: #b9efcf !important;
    color: #132b21 !important;
    -webkit-text-fill-color: #132b21 !important;
}

/* Krótkie identyfikatory, komendy i nazwy tabel wewnątrz akapitów. */
body.single-post :is(p, li, td, th, h2, h3, h4, blockquote) code {
    display: inline !important;
    padding: .1em .36em !important;
    border: 1px solid #cdded5 !important;
    border-radius: 6px !important;
    background: #e8f0eb !important;
    color: #193e31 !important;
    -webkit-text-fill-color: #193e31 !important;
    box-shadow: none !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace !important;
    font-size: .87em !important;
    font-weight: 550 !important;
    line-height: 1.65 !important;
    overflow-wrap: anywhere;
    white-space: normal;
}

/* Obrazy wyróżniające znikają z pojedynczych wpisów i kart archiwum.
   Obrazy wstawione świadomie w treść artykułu nie są usuwane. */
body:is(.single-post, .blog, .category, .tag, .author, .date) :is(
    .post-thumbnail,
    .entry-thumbnail,
    .featured-image,
    .featured-media,
    .post-featured-image,
    .featured-image-wrap,
    .post-featured-media,
    .wp-block-post-featured-image,
    .entry-featured-image,
    .entry-featured-image-url,
    .post-card__image,
    .post-card__media,
    .post-card-image,
    .blog-card__image,
    .blog-card-image,
    .blog-post-thumbnail,
    .blog-featured-image
),
body.search .type-post :is(
    .post-thumbnail,
    .entry-thumbnail,
    .featured-image,
    .featured-media,
    .post-featured-image,
    .wp-block-post-featured-image,
    .entry-featured-image,
    .entry-featured-image-url,
    .post-card__image,
    .post-card__media,
    .blog-card__image,
    .blog-card-image
),
body:is(.single-post, .blog, .category, .tag, .author, .date) img.wp-post-image,
body.search .type-post img.wp-post-image {
    display: none !important;
}

/* Również gdy szablon tworzy własny wrapper bez klasy miniatury. */
body:is(.single-post, .blog, .category, .tag, .author, .date) :is(figure, a, div):has(> img.wp-post-image),
body.search .type-post :is(figure, a, div):has(> img.wp-post-image) {
    display: none !important;
}

@media (max-width: 600px) {
    body.single-post pre,
    body.single-post .wp-block-code,
    body.single-post .wp-block-preformatted {
        border-radius: 12px !important;
        font-size: 13px !important;
        line-height: 1.75 !important;
        -webkit-overflow-scrolling: touch;
    }
}
