.wlbg-page,.wlbg-gallery {
    --wlbg-ink:#1b3027;
    --wlbg-accent:#214d39;
    --wlbg-line:#dce6df;
    --wlbg-paper:#f4f5ed;
    color:var(--wlbg-ink);
    font-family:inherit;
}
.wlbg-page {max-width:76rem;margin:2rem auto;padding-inline:clamp(1rem,4vw,3rem);}
.wlbg-page :is(h1,h2),.wlbg-card h3 {color:inherit;line-height:1.18;}
.wlbg-page h1 {font-size:clamp(1.9rem,5vw,3.2rem);margin:0 0 .6em;}
.wlbg-heading {margin-block-end:1.5rem;}
.wlbg-search {display:flex;flex-wrap:wrap;gap:.8rem;align-items:end;background:var(--wlbg-paper);border:1px solid var(--wlbg-line);border-radius:1rem;padding:1rem;margin-block-end:1.25rem;}
.wlbg-search label {flex:1 1 9rem;min-width:0;font-size:.9rem;font-weight:600;}
.wlbg-search label:first-child {flex-basis:12rem;}
.wlbg-search label span {display:block;margin-block-end:.3rem;}
.wlbg-search :is(input,select),.wlbg-reviews select {width:100%;box-sizing:border-box;min-height:44px;border:1px solid #afc2b5;border-radius:.45rem;background:#fff;color:var(--wlbg-ink);padding:.5rem;}
.wlbg-search-actions,.wlbg-actions {display:flex;flex-wrap:wrap;align-items:center;gap:.65rem;}
.wlbg-cards {display:grid;grid-template-columns:repeat(var(--wlbg-columns,4),minmax(0,1fr));gap:1rem;}
.wlbg-cards.wlbg-rail {grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:calc((100% + 1rem) / var(--wlbg-columns,4) - 1rem);overflow-x:auto;scroll-snap-type:x mandatory;padding-block-end:.6rem;}
.wlbg-rail > * {scroll-snap-align:start;}
.wlbg-card {min-width:0;border:1px solid var(--wlbg-line);background:#fff;border-radius:.9rem;overflow:hidden;display:flex;flex-direction:column;}
.wlbg-cover {background:var(--wlbg-paper);padding:clamp(.5rem,2vw,1.3rem);display:grid;place-items:center;min-width:0;}
.wlbg-card .wlbg-cover a {display:block;width:100%;}
.wlbg-card .wlbg-cover :is(img,.wlbg-cover-placeholder) {width:100%;aspect-ratio:2 / 3;object-fit:contain;}
.wlbg-cover img {display:block;max-width:100%;height:auto;max-height:36rem;}
.wlbg-cover-placeholder {width:100%;min-height:10rem;background:linear-gradient(135deg,#e6ede5,#d6e3d9);}
.wlbg-card-body {padding:1rem;display:flex;flex-direction:column;flex:1;overflow-wrap:anywhere;}
.wlbg-card h3 {margin:0 0 .4rem;font-size:1.05rem;}
.wlbg-card h3 a {color:inherit;text-decoration:none;}
.wlbg-byline,.wlbg-subtitle {color:#4e6459;margin:.35em 0 .75em;}
.wlbg-card .wlbg-actions {margin-block-start:auto;padding-block-start:.7rem;}
.wlbg-page .wlbg-primary,.wlbg-gallery .wlbg-primary {display:inline-flex;align-items:center;justify-content:center;padding:.55rem .8rem;min-height:44px;box-sizing:border-box;border:0;border-radius:.5rem;background:var(--wlbg-accent);color:#fff;text-decoration:none;cursor:pointer;}
.wlbg-actions a,.wlbg-slider-controls button,.wlbg-actions button {font:inherit;}
.wlbg-actions button,.wlbg-slider-controls button {color:var(--wlbg-ink);background:#fff;border:1px solid var(--wlbg-line);border-radius:.45rem;padding:.35rem .6rem;cursor:pointer;min-height:44px;}
.wlbg-slider-controls {margin-block-end:.55rem;text-align:end;}
.wlbg-slider-controls button {min-width:44px;font-size:1.25rem;}
.wlbg-book {display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:clamp(1rem,5vw,3rem);align-items:start;}
.wlbg-book>.wlbg-cover {border-radius:1rem;}
.wlbg-book-copy {min-width:0;overflow-wrap:anywhere;}
.wlbg-specs>div {display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:.5rem;padding:.55rem;border-block-end:1px solid var(--wlbg-line);}
.wlbg-specs dt {font-weight:650;}
.wlbg-specs dd {margin:0;}
.wlbg-price,.wlbg-rating {font-weight:650;}
.wlbg-price del {opacity:.7;}
.wlbg-content,.wlbg-author-bio,.wlbg-related,.wlbg-reviews {margin-block:2rem;}
.wlbg-author-bio {border:1px solid var(--wlbg-line);border-radius:.8rem;padding:1rem;}
.wlbg-author-bio h2 {margin:0 0 .4rem;}
.wlbg-pagination {margin-block-start:1rem;}
.wlbg-pagination .page-numbers {display:inline-block;padding:.45rem .7rem;}
.wlbg-dialog {width:min(90vw,32rem);box-sizing:border-box;max-height:85vh;padding:1.35rem;border:1px solid var(--wlbg-line);border-radius:1rem;color:var(--wlbg-ink);background:#fff;}
.wlbg-dialog::backdrop {background:#101d18b3;}
.wlbg-dialog form {text-align:end;}
.wlbg-dialog form button {min-width:44px;min-height:44px;}
.wlbg-card [hidden],.wlbg-slider-controls[hidden] {display:none;}
.wlbg-page :is(a,button,input,select):focus-visible,.wlbg-gallery :is(a,button,input,select):focus-visible {outline:2px solid #2a7154;outline-offset:2px;}
@media(max-width:840px) {
    .wlbg-cards {grid-template-columns:repeat(min(var(--wlbg-columns,4),2),minmax(0,1fr));}
    .wlbg-cards.wlbg-rail {grid-auto-columns:calc((100% + 1rem) / min(var(--wlbg-columns,4),2) - 1rem);}
    .wlbg-book {grid-template-columns:1fr;}
}
@media(max-width:460px) {
    .wlbg-cards {grid-template-columns:minmax(0,1fr);}
    .wlbg-cards.wlbg-rail {grid-auto-columns:88%;}
}

/* Keep the theme's product templates and WooCommerce controls. */
:is(.wlbg-woo-gallery,.wlbg-style-shop) :is(ul.products li.product, .wp-block-woocommerce-product-template .wc-block-product) {
    box-sizing: border-box;
    min-width: 0;
    padding: clamp(.7rem, 1.6vw, 1.15rem);
    background: #fff;
    border: 1px solid #dce6df;
    border-radius: .9rem;
    overflow-wrap: anywhere;
}

:is(.wlbg-woo-gallery,.wlbg-style-shop) :is(ul.products li.product a img, .wp-block-woocommerce-product-template .wc-block-components-product-image img) {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    height: auto;
    object-fit: contain;
    background: #f4f5ed;
    border-radius: .45rem;
}

:is(.wlbg-woo-gallery,.wlbg-style-shop) ul.products li.product :is(.woocommerce-loop-product__title, .price) {
    color: #1b3027;
}

:is(.wlbg-woo-gallery,.wlbg-style-shop) :is(ul.products li.product .button, .wp-block-woocommerce-product-template .wp-block-button__link) {
    color: #fff;
    background: #214d39;
    border-radius: .5rem;
    white-space: normal;
}

:is(.wlbg-woo-gallery,.wlbg-style-shop) :is(ul.products li.product, .wp-block-woocommerce-product-template .wc-block-product) a:focus-visible {
    outline: 2px solid #2a7154;
    outline-offset: 2px;
}

/* The shortcode owns its grid. Override WooCommerce column widths, floats
   and clearfix rules that otherwise compete with CSS Grid. */
.wlbg-woo-gallery {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: clamp(.75rem, 2vw, 1.5rem);
    background: #f4f5ed;
    border-radius: .9rem;
}
.wlbg-woo-gallery .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(var(--wlbg-woo-columns, 4), minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: 0;
}
.wlbg-woo-gallery .woocommerce ul.products::before,
.wlbg-woo-gallery .woocommerce ul.products::after {
    content: none !important;
    display: none !important;
}
.wlbg-woo-gallery .woocommerce ul.products > li.product {
    float: none !important;
    clear: none !important;
    grid-column: auto;
    justify-self: stretch;
    width: 100% !important;
    min-width: 0;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(.65rem, 1.4vw, 1rem);
    word-break: normal;
}
.wlbg-woo-gallery .woocommerce ul.products > li.product .woocommerce-loop-product__title {
    margin: .65rem 0 .35rem;
    font-size: clamp(.95rem, 1.4vw, 1.15rem);
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: break-word;
}
.wlbg-woo-gallery .woocommerce ul.products > li.product .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 44px;
    max-width: 100%;
    padding: .55rem .75rem;
    line-height: 1.25;
    text-align: center;
    word-break: normal;
    overflow-wrap: normal;
}
.wlbg-woo-gallery .woocommerce ul.products > li.product .onsale {
    top: .65rem;
    right: auto;
    left: auto;
    inset-inline-end: .65rem;
    margin: 0;
}
.wlbg-woo-gallery.wlbg-woo-slider .woocommerce ul.products {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% + 1rem) / var(--wlbg-woo-columns, 4) - 1rem);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-block-end: .6rem;
}
.wlbg-woo-slider .woocommerce ul.products > li.product {
    scroll-snap-align: start;
}
@media (max-width: 840px) {
    .wlbg-woo-gallery .woocommerce ul.products {
        grid-template-columns: repeat(min(var(--wlbg-woo-columns, 4), 2), minmax(0, 1fr));
    }
    .wlbg-woo-gallery.wlbg-woo-slider .woocommerce ul.products {
        grid-auto-columns: calc((100% + 1rem) / min(var(--wlbg-woo-columns, 4), 2) - 1rem);
    }
}
@media (max-width: 460px) {
    .wlbg-woo-gallery .woocommerce ul.products { grid-template-columns: minmax(0, 1fr); }
    .wlbg-woo-gallery.wlbg-woo-slider .woocommerce ul.products { grid-auto-columns: 88%; }
}
