/* Geometry only. Fonts, text colours and editorial blocks remain owned by the theme. */
.easy-blog-content-layout {
    --easy-blog-layout-gap: var(--wp--preset--spacing--50, 2rem);
    --easy-blog-layout-text: var(--wp--style--global--content-size, 70ch);
    container: easy-blog-article / inline-size;
    min-width: 0;
    max-width: 100%;
    display: flow-root;
    overflow-wrap: anywhere;
}
.easy-blog-content-layout--compact { --easy-blog-layout-gap: var(--wp--preset--spacing--30, 1rem); }
.easy-blog-content-layout--generous { --easy-blog-layout-gap: var(--wp--preset--spacing--70, 4rem); }
.easy-blog-content-layout--reportage { --easy-blog-layout-text: 62ch; }
.easy-blog-content-layout--editorial { --easy-blog-layout-text: 76ch; }
.easy-blog-content-layout:not(.easy-blog-content-layout--classic) > :where(p, h2, h3, h4, ul, ol, blockquote),
.easy-blog-content-layout .easy-blog-layout-text {
    max-width: min(100%, var(--easy-blog-layout-text));
    margin-inline: auto;
}
.easy-blog-content-layout .easy-blog-layout-section {
    display: grid;
    gap: var(--easy-blog-layout-gap);
    margin-block: var(--easy-blog-layout-gap);
    min-width: 0;
    clear: both;
}
.easy-blog-content-layout .easy-blog-layout-text,
.easy-blog-content-layout .easy-blog-layout-media { min-width: 0; width: 100%; }
.easy-blog-content-layout .easy-blog-layout-text > :first-child { margin-block-start: 0; }
.easy-blog-content-layout .easy-blog-layout-text > :last-child { margin-block-end: 0; }
.easy-blog-content-layout .easy-blog-layout-media { align-self: start; }
.easy-blog-content-layout .easy-blog-layout-media .easy-blog-auto-image { margin-block: 0; min-width: 0; }
.easy-blog-content-layout .easy-blog-layout-media .easy-blog-auto-image__img { width: 100%; height: auto; max-width: 100%; }
.easy-blog-content-layout .easy-blog-auto-image__caption { line-height: 1.5; margin-block-start: .5em; }
.easy-blog-content-layout .easy-blog-layout-section--standard .easy-blog-layout-media { max-width: min(100%, var(--easy-blog-layout-text)); margin-inline: auto; }
.easy-blog-content-layout .easy-blog-layout-media--pair { display: grid; gap: var(--easy-blog-layout-gap); }
.easy-blog-content-layout .easy-blog-auto-gallery { margin-block: var(--easy-blog-layout-gap); }
.easy-blog-content-layout--classic:not(.easy-blog-content-layout--normal) > :where(p, h2, h3, h4, ul, ol, blockquote, figure, section) { margin-block-end: var(--easy-blog-layout-gap); }
@container easy-blog-article (min-width: 38rem) {
    .easy-blog-content-layout .easy-blog-layout-media--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .easy-blog-content-layout .easy-blog-layout-section--aside-left,
    .easy-blog-content-layout .easy-blog-layout-section--aside-right { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; }
    .easy-blog-content-layout .easy-blog-layout-section--aside-left { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
    .easy-blog-content-layout .easy-blog-layout-section--aside-left > .easy-blog-layout-text { grid-column: 2; grid-row: 1; }
    .easy-blog-content-layout .easy-blog-layout-section--aside-left > .easy-blog-layout-media { grid-column: 1; grid-row: 1; }
    .easy-blog-content-layout--editorial .easy-blog-layout-section--aside-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
}

/* Reading layouts: headings are structural siblings, never grid children. */
.easy-blog-content-layout.easy-blog-content-layout--magazine > h2,
.easy-blog-content-layout.easy-blog-content-layout--editorial > h2 { max-width: 100%; width: 100%; margin-block: var(--easy-blog-layout-gap) 1em; }
@container easy-blog-article (max-width: 59.999rem) {
    .easy-blog-content-layout--magazine .easy-blog-layout-section,
    .easy-blog-content-layout--editorial .easy-blog-layout-section { grid-template-columns: minmax(0, 1fr); }
    .easy-blog-content-layout--magazine .easy-blog-layout-section > :is(.easy-blog-layout-text, .easy-blog-layout-media),
    .easy-blog-content-layout--editorial .easy-blog-layout-section > :is(.easy-blog-layout-text, .easy-blog-layout-media) { grid-column: auto; grid-row: auto; }
}
@container easy-blog-article (min-width: 60rem) {
    .easy-blog-content-layout--magazine .easy-blog-layout-section--aside-right,
    .easy-blog-content-layout--editorial .easy-blog-layout-section--aside-right { grid-template-columns: minmax(28rem, 1.65fr) minmax(0, 1fr); align-items: start; }
    .easy-blog-content-layout--magazine .easy-blog-layout-section--aside-left,
    .easy-blog-content-layout--editorial .easy-blog-layout-section--aside-left { grid-template-columns: minmax(0, 1fr) minmax(28rem, 1.65fr); align-items: start; }
}
