/* Empty wpautop paragraphs must not become extra card grid tracks. */
body.home .trinity-split > div > p:empty,
body.home .trinity-steps > article > p:empty { display:none; }

/* Keep paired actions equal and allow their labels to wrap at narrow widths. */
body.home .trinity-split > div > p:last-child > a {
    width:100%; max-width:100%; box-sizing:border-box; white-space:normal;
    text-align:center; justify-content:center;
}
body.home #content .trinity-three-featured .trinity-lux-product-body {
    grid-template-columns:minmax(0,1fr)!important; min-width:0!important;
}
body.home #content .trinity-three-featured .trinity-lux-product-body > * {
    min-width:0!important; max-width:100%; box-sizing:border-box;
}
body.home #content .trinity-three-featured .trinity-card-actions {
    width:100%!important; min-width:0!important; max-width:100%; box-sizing:border-box;
}
body.home #content .trinity-three-featured .trinity-card-actions > a {
    min-width:0!important; max-width:100%; box-sizing:border-box; white-space:normal;
}
body.home #content .trinity-three-featured .trinity-etsy-loop-summary > a {
    display:flex!important; flex-wrap:wrap!important; justify-content:center;
    width:100%; max-width:100%; box-sizing:border-box; white-space:normal!important;
    height:auto!important; max-height:none!important; overflow:visible!important;
    padding:5px 6px!important; gap:4px!important;
}

@supports (grid-template-rows:subgrid) {
    .trinity-rm-page:not(.trinity-pendant-landing) .woocommerce ul.products > li.product {
        display:grid!important; grid-template-columns:minmax(0,1fr)!important;
        grid-template-rows:subgrid!important; grid-row:span 6; min-width:0;
    }
    .trinity-rm-page:not(.trinity-pendant-landing) .woocommerce ul.products > li.product > .astra-shop-summary-wrap {
        display:grid!important; grid-template-columns:minmax(0,1fr)!important;
        grid-template-rows:subgrid!important; grid-row:2/span 5; row-gap:5px!important; height:auto!important;
    }
    .trinity-rm-page .trinity-rm-grid > .trinity-rm-panel {
        display:grid; grid-template-columns:minmax(0,1fr);
        grid-template-rows:subgrid; grid-row:span 3; row-gap:0;
        align-content:start;
    }
    /* Four semantic rows: eyebrow, heading, copy, action. */
    @media (min-width:921px) {
        body.home .trinity-split > div,
        body.home .trinity-family-grid > article {
            display:grid!important; grid-template-columns:minmax(0,1fr);
            grid-template-rows:subgrid; grid-row:span 4; row-gap:0;
            min-width:0; min-height:0;
        }
        body.home .trinity-split > div > p:last-child { align-self:end; margin-bottom:0; }
        body.home .trinity-family-grid .trinity-family-product-links { margin-top:0; }
        body.home .trinity-steps > article {
            display:grid; grid-template-columns:minmax(0,1fr);
            grid-template-rows:subgrid; grid-row:span 3; row-gap:0;
        }
    }
    /* Archive cards share image/eyebrow/title/excerpt/action tracks per row. */
    body .trinity-archive-grid > article.trinity-archive-card {
        display:grid!important; grid-template-columns:minmax(0,1fr);
        grid-template-rows:subgrid!important; grid-row:span 5!important; row-gap:0!important; min-width:0;
    }
    body .trinity-library-grid > article.trinity-archive-card {
        display:grid!important; grid-template-columns:minmax(0,1fr);
        grid-template-rows:subgrid!important; grid-row:span 4!important; row-gap:0!important; min-width:0;
    }
    .trinity-archive-grid > .trinity-archive-card > a:last-child,
    .trinity-library-grid > .trinity-archive-card > .trinity-card-actions {
        align-self:end; margin-top:0;
    }
    /* Astra adds two wrappers between its card and the semantic rows. */
    body:is(.blog,.archive):not(.woocommerce) #primary .ast-row > article.ast-article-post {
        display:grid!important; grid-template-columns:minmax(0,1fr);
        grid-template-rows:subgrid!important; grid-row:span 6; row-gap:0; height:auto!important;
        align-self:stretch!important;
    }
    body:is(.blog,.archive):not(.woocommerce) #primary .ast-row > article > .ast-article-inner,
    body:is(.blog,.archive):not(.woocommerce) #primary .ast-row > article .post-content {
        display:grid!important; grid-template-columns:minmax(0,1fr);
        grid-template-rows:subgrid!important; grid-row:span 6; row-gap:0; height:auto!important;
        min-width:0; align-content:normal;
    }
    body:is(.blog,.archive):not(.woocommerce) #primary .ast-row { align-items:stretch!important; }
    body:is(.blog,.archive):not(.woocommerce) #primary .ast-row article :is(.ast-taxonomy-container,h2.entry-title,.entry-header.ast-blog-meta-container,.ast-excerpt-container,.entry-content) {
        margin-inline:clamp(12px,1.5vw,18px)!important;
    }
    body:is(.blog,.archive):not(.woocommerce) #primary .ast-blog-featured-section { width:100%; align-self:start; }
    body:is(.blog,.archive):not(.woocommerce) #primary .ast-blog-featured-section .post-thumb-img-content,
    body:is(.blog,.archive):not(.woocommerce) #primary .ast-blog-featured-section a,
    body:is(.blog,.archive):not(.woocommerce) #primary .ast-blog-featured-section img {
        display:block!important; width:100%!important; height:100%!important;
        max-width:100%!important; margin:0!important; object-fit:cover;
    }
    .trinity-review-hub-grid > article.trinity-review-hub-card {
        display:grid; grid-template-columns:minmax(0,1fr);
        grid-template-rows:subgrid; grid-row:span 5; row-gap:0;
    }
    .trinity-review-hub-card > .trinity-review-hub-card-top { grid-row:1; }
    .trinity-review-hub-card > .trinity-review-hub-stars { grid-row:2; }
    .trinity-review-hub-card > .trinity-review-hub-text { grid-row:3; }
    .trinity-review-hub-card > .trinity-review-hub-photos { grid-row:4; align-self:start; }
    .trinity-review-hub-card > .trinity-review-hub-footer { grid-row:5; align-self:stretch; align-items:start; margin-top:0; }
    /* Long descriptions flow naturally inside a shared body row. */
    .trinity-pendant-landing .pendant-geometry-grid > .trinity-rm-panel {
        display:grid!important; grid-template-columns:minmax(0,1fr);
        grid-template-rows:subgrid; grid-row:span 4; row-gap:0;
    }
    .trinity-pendant-landing .pendant-geometry-grid > .trinity-rm-panel > .trinity-rm-button { align-self:end; }
}
