:root {
    --qopt-content-width: 1200px;
    --qopt-content-gutter: 20px;
    --qopt-card-gap: 32px;
}

/* Home i News korzystają z tej samej, wyśrodkowanej szerokości roboczej. */
body.home main.container,
body.blog main.container {
    max-width: calc(var(--qopt-content-width) + 2 * var(--qopt-content-gutter));
}

body.home .is-style-box {
    margin-left: auto;
    margin-right: auto;
}

/* WordPress nie dołączył reguł siatki bloku Query; odtwarzamy zamierzony układ. */
.newst-posts .wp-block-post-template,
.post-list .wp-block-post-template {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--qopt-card-gap);
    padding-left: 0;
}

.newst-posts .wp-block-post-template > li,
.post-list .wp-block-post-template > li {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
}

.newst-posts .wp-block-post-template > li .wp-block-group,
.post-list .wp-block-post-template > li .wp-block-group {
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.newst-posts .wp-block-post-template figure img,
.post-list .wp-block-post-template figure img {
    image-rendering: auto;
}

@media (max-width: 992px) {
    :root {
        --qopt-card-gap: 24px;
    }

    .newst-posts .wp-block-post-template,
    .post-list .wp-block-post-template {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --qopt-content-gutter: 16px;
        --qopt-card-gap: 20px;
    }

    body.home main.container,
    body.blog main.container {
        padding-right: var(--qopt-content-gutter);
        padding-left: var(--qopt-content-gutter);
    }

    .newst-posts .wp-block-post-template,
    .post-list .wp-block-post-template {
        grid-template-columns: minmax(0, 1fr);
    }

    .newst-posts .wp-block-post-template h2,
    .post-list .wp-block-post-template h2 {
        width: 100%;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}
