/* Shared by the site and the editor. Structure selects the treatment: no page
   names, block IDs, generated markup, text matching or required custom classes. */

/* Chapter headings give ordinary heading/paragraph pages a visible rhythm.
   The original drawing stays in the reserved right margin, clear of the text. */
:is(.pluk-content,.editor-styles-wrapper) h2:not(:where(.has-background,.is-style-pluk-plain,.pluk-hero-title,.wp-block-column h2,.wp-block-kadence-column h2,form h2,.wp-block-kadence-advanced-form h2,.wpcf7 h2,.wp-block-cover h2,.wp-block-group.has-background h2,.is-style-pluk-lilac h2,.is-style-pluk-lime h2,.is-style-pluk-paper h2,.is-style-pluk-plain h2,.pluk-hero h2)){
 --pluk-section-color:var(--pluk-lime);
 --pluk-section-drawing:url('../images/sprig-wine.svg');
 position:relative;box-sizing:border-box;margin-block:clamp(3rem,6vw,5rem) 1.75rem;
 padding:clamp(1.25rem,3vw,2rem);padding-inline-end:5.5rem;
 background-color:var(--pluk-section-color);background-image:var(--pluk-section-drawing);
 background-blend-mode:normal;
 background-repeat:no-repeat;background-position:right 1.25rem center;background-size:2.5rem auto;
 border-radius:var(--pluk-radius);color:var(--pluk-wine);
 font-size:clamp(1.9rem,3.6vw,3.4rem);line-height:1.12;
 overflow-wrap:anywhere;scroll-margin-top:2rem;
}
/* Keep the drawing separate so its opacity does not fade the heading text. */
:is(.pluk-content,.editor-styles-wrapper) h2:not(:where(.has-background,.is-style-pluk-plain,.pluk-hero-title,.wp-block-column h2,.wp-block-kadence-column h2,form h2,.wp-block-kadence-advanced-form h2,.wpcf7 h2,.wp-block-cover h2,.wp-block-group.has-background h2,.is-style-pluk-lilac h2,.is-style-pluk-lime h2,.is-style-pluk-paper h2,.is-style-pluk-plain h2,.pluk-hero h2)){
 background-image:none;isolation:isolate;
}
:is(.pluk-content,.editor-styles-wrapper) h2:not(:where(.has-background,.is-style-pluk-plain,.pluk-hero-title,.wp-block-column h2,.wp-block-kadence-column h2,form h2,.wp-block-kadence-advanced-form h2,.wpcf7 h2,.wp-block-cover h2,.wp-block-group.has-background h2,.is-style-pluk-lilac h2,.is-style-pluk-lime h2,.is-style-pluk-paper h2,.is-style-pluk-plain h2,.pluk-hero h2))::after{
 content:"";position:absolute;inset:0;z-index:-1;opacity:.6;border-radius:inherit;
 background-image:var(--pluk-section-drawing);background-repeat:no-repeat;background-position:right 1.25rem center;background-size:2.5rem auto;pointer-events:none;
}
:is(.pluk-content,.editor-styles-wrapper) h2:nth-of-type(3n+2){
 --pluk-section-color:var(--pluk-orange);--pluk-section-drawing:url('../images/leaf-wine.svg');
}
:is(.pluk-content,.editor-styles-wrapper) h2:nth-of-type(3n){
 --pluk-section-color:var(--pluk-lilac);--pluk-section-drawing:url('../images/hand-wine.svg');
}
/* A heading immediately before a wide row shares that row's alignment. */
:is(.pluk-content,.editor-styles-wrapper) h2:has(+ :is(.wp-block-columns,.kb-row-layout-wrap,.alignwide)){
 max-width:var(--pluk-wide);
}
:is(.pluk-content,.editor-styles-wrapper,:where(.editor-styles-wrapper) .is-root-container)>h3{
 margin-block:2.5rem 1rem;font-family:var(--pluk-body);font-weight:800;
 font-size:clamp(1.25rem,2vw,1.6rem);line-height:1.35;letter-spacing:-.015em;
}

/* Repeating palette values live on columns, but only the card selectors below
   consume them. Filtered counts ignore style tags and editor appenders. */
:where(.pluk-content,.editor-styles-wrapper) :where(.wp-block-column,.wp-block-kadence-column){
 --pluk-card-color:var(--pluk-lime);--pluk-card-drawing:url('../images/leaf-wine.svg');
}
:where(.pluk-content,.editor-styles-wrapper) :where(.wp-block-column,.wp-block-kadence-column):nth-child(3n+2 of :is(.wp-block-column,.wp-block-kadence-column)){
 --pluk-card-color:var(--pluk-lilac);--pluk-card-drawing:url('../images/sprig-wine.svg');
}
:where(.pluk-content,.editor-styles-wrapper) :where(.wp-block-column,.wp-block-kadence-column):nth-child(3n of :is(.wp-block-column,.wp-block-kadence-column)){
 --pluk-card-color:var(--pluk-lime);--pluk-card-drawing:url('../images/leaf-wine.svg');
}

/* Automatic three-column cards in core Columns and Kadence Row Layout.
   The existing optional card style also works with two or four columns.
   Forms, the home intro and deliberately plain blocks keep their own layout. */
:is(.pluk-content,.editor-styles-wrapper) :where(
 .wp-block-columns:has(>.wp-block-column:nth-child(1 of .wp-block-column):nth-last-child(3 of .wp-block-column))>.wp-block-column,
 .wp-block-columns.is-style-pluk-cards>.wp-block-column,
 .kt-row-column-wrap.kt-has-3-columns>.wp-block-kadence-column>.kt-inside-inner-col,
 .innerblocks-wrap.kb-grid-columns-3>.wp-block-kadence-column>.kadence-inner-column-inner
):not(:where(form *,.kb-advanced-form *,.wp-block-kadence-advanced-form *,.wpcf7 *,.pluk-hero *,.is-style-pluk-plain *)){
 --pluk-heading:var(--pluk-body);
 display:block;min-width:0;flex-grow:1;box-sizing:border-box;
 position:relative;isolation:isolate;padding:clamp(1.5rem,3vw,2.5rem);border-radius:var(--pluk-radius);overflow:hidden;
 background-color:var(--pluk-card-color);color:var(--pluk-wine);
}
:is(.pluk-content,.editor-styles-wrapper) :where(
 .wp-block-columns:has(>.wp-block-column:nth-child(1 of .wp-block-column):nth-last-child(3 of .wp-block-column))>.wp-block-column,
 .wp-block-columns.is-style-pluk-cards>.wp-block-column,
 .kt-row-column-wrap.kt-has-3-columns>.wp-block-kadence-column>.kt-inside-inner-col,
 .innerblocks-wrap.kb-grid-columns-3>.wp-block-kadence-column>.kadence-inner-column-inner
):not(:where(form *,.kb-advanced-form *,.wp-block-kadence-advanced-form *,.wpcf7 *,.pluk-hero *,.is-style-pluk-plain *))::after{
 content:"";position:absolute;z-index:-1;right:1.25rem;bottom:1.25rem;width:3rem;height:5.5rem;
 background-image:var(--pluk-card-drawing);background-position:center;background-size:contain;background-repeat:no-repeat;opacity:.6;
 pointer-events:none;
}
:is(.pluk-content,.editor-styles-wrapper) :where(
 .wp-block-columns:has(>.wp-block-column:nth-child(1 of .wp-block-column):nth-last-child(3 of .wp-block-column))>.wp-block-column,
 .wp-block-columns.is-style-pluk-cards>.wp-block-column,
 .kt-row-column-wrap.kt-has-3-columns>.wp-block-kadence-column>.kt-inside-inner-col,
 .innerblocks-wrap.kb-grid-columns-3>.wp-block-kadence-column>.kadence-inner-column-inner
):not(:where(form *,.kb-advanced-form *,.wp-block-kadence-advanced-form *,.wpcf7 *,.pluk-hero *,.is-style-pluk-plain *))>:is(h2,h3,h4){
 font-family:var(--pluk-body);font-size:clamp(1.4rem,2.2vw,1.9rem);font-weight:800;
 line-height:1.2;letter-spacing:-.025em;margin-block:0 1rem;overflow-wrap:anywhere;
}
:is(.pluk-content,.editor-styles-wrapper) :where(
 .wp-block-columns:has(>.wp-block-column:nth-child(1 of .wp-block-column):nth-last-child(3 of .wp-block-column))>.wp-block-column,
 .wp-block-columns.is-style-pluk-cards>.wp-block-column,
 .kt-row-column-wrap.kt-has-3-columns>.wp-block-kadence-column>.kt-inside-inner-col,
 .innerblocks-wrap.kb-grid-columns-3>.wp-block-kadence-column>.kadence-inner-column-inner
):not(:where(form *,.kb-advanced-form *,.wp-block-kadence-advanced-form *,.wpcf7 *,.pluk-hero *,.is-style-pluk-plain *))>:last-child{
 margin-bottom:0;
}
:is(.pluk-content,.editor-styles-wrapper) .wp-block-columns:where(:has(>.wp-block-column:nth-child(1 of .wp-block-column):nth-last-child(3 of .wp-block-column)),.is-style-pluk-cards):not(:where(form *,.kb-advanced-form *,.wp-block-kadence-advanced-form *,.wpcf7 *,.pluk-hero,.is-style-pluk-plain)){
 gap:1.5rem;align-items:stretch;
}
/* Editor defaults match the public content width; nested blocks stay fluid. */
.editor-styles-wrapper :is(.wp-block-columns,.wp-block-kadence-rowlayout){max-width:var(--pluk-wide)}
.editor-styles-wrapper :is(.wp-block-column,.kt-inside-inner-col,.kadence-inner-column-inner) .wp-block{max-width:none}

@media(max-width:781px){
 :is(.pluk-content,.editor-styles-wrapper) .wp-block-columns:where(:has(>.wp-block-column:nth-child(1 of .wp-block-column):nth-last-child(3 of .wp-block-column)),.is-style-pluk-cards):not(:where(.is-not-stacked-on-mobile,form *,.kb-advanced-form *,.wp-block-kadence-advanced-form *,.wpcf7 *,.pluk-hero,.is-style-pluk-plain)){
  display:flex;flex-direction:column;gap:1.5rem;
 }
 :is(.pluk-content,.editor-styles-wrapper) .wp-block-columns:where(:has(>.wp-block-column:nth-child(1 of .wp-block-column):nth-last-child(3 of .wp-block-column)),.is-style-pluk-cards):not(:where(.is-not-stacked-on-mobile,form *,.kb-advanced-form *,.wp-block-kadence-advanced-form *,.wpcf7 *,.pluk-hero,.is-style-pluk-plain))>.wp-block-column{
  margin-block:0;flex-basis:auto!important;
 }
}
@media(max-width:480px){
 :is(.pluk-content,.editor-styles-wrapper) h2:not(:where(.has-background,.is-style-pluk-plain,.pluk-hero-title,.wp-block-column h2,.wp-block-kadence-column h2,form h2,.wp-block-kadence-advanced-form h2,.wpcf7 h2,.wp-block-cover h2,.wp-block-group.has-background h2,.is-style-pluk-lilac h2,.is-style-pluk-lime h2,.is-style-pluk-paper h2,.is-style-pluk-plain h2,.pluk-hero h2)){
  padding:1.25rem;padding-inline-end:1.25rem;
 }
}
@media print{
 :is(.pluk-content,.editor-styles-wrapper)>h2{background:none!important;padding:0!important}
 :is(.pluk-content,.editor-styles-wrapper) h2::after{display:none!important}
 :where(.pluk-content) :is(.wp-block-column,.kt-inside-inner-col)::after{display:none!important}
}
