/* Opt-in native block layouts. Existing editorial compositions stay unchanged.
 * Solutto COnsulting LLC; Gilson Rincón, gilson.rincon@soluttoconsulting.com.
 * Astra and native block controls supply colors, fonts and image focal points.
 */
:is(.editorial-band, .is-style-editorial-band, .editorial-hero--center, .is-style-editorial-hero-center, .editorial-task-header, .is-style-editorial-task-header) {
    --editorial-layout-width: var(--wp--style--global--content-size, 1200px);
    --editorial-layout-gutter: 24px;
    --editorial-layout-space: clamp(64px, 7vw, 104px);
    box-sizing: border-box;
    min-width: 0;
}

/* Full width belongs to the page template and alignfull block, not a 100vw hack. */
:is(.entry-content, .editor-styles-wrapper) .wp-block-group:is(.editorial-band, .is-style-editorial-band) {
    width: 100%;
    max-width: none;
    margin-block: 0;
    padding: var(--editorial-layout-space) var(--editorial-layout-gutter);
}
:is(.editorial-band, .is-style-editorial-band) > .wp-block-group.editorial-band__inner {
    width: 100%;
    max-width: var(--editorial-layout-width);
    margin-inline: auto;
    padding: 0;
}
:is(.editorial-band, .is-style-editorial-band) > .editorial-band__inner > :first-child { margin-block-start: 0; }
:is(.editorial-band, .is-style-editorial-band) > .editorial-band__inner > :last-child { margin-block-end: 0; }
.editorial-band__inner > .editorial-intro { max-width: 800px; margin-block-end: clamp(32px, 4vw, 56px); }
.editorial-band__inner > .editorial-intro > :last-child { margin-block-end: 0; }

:is(.entry-content, .editor-styles-wrapper) .wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) {
    width: 100%;
    max-width: none;
    min-height: clamp(620px, 72vh, 740px);
    margin-block: 0;
    padding: 96px var(--editorial-layout-gutter);
    text-align: center;
}
:is(.entry-content, .editor-styles-wrapper) .wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) > .wp-block-cover__inner-container {
    width: 100%;
    max-width: var(--editorial-layout-width);
    margin-inline: auto;
    text-align: center;
}
.wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center):not(.has-text-color) { color: var(--ast-global-color-4); }
:is(.entry-content, .editor-styles-wrapper) .wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) :is(h1, p):not(.has-text-color) { color: inherit; }
:is(.entry-content, .editor-styles-wrapper) .wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) h1 {
    max-width: 960px;
    margin: 22px auto 0;
    font-size: clamp(2.25rem, 4.8vw, 4.5rem);
    line-height: 1.1;
    text-align: center;
    text-wrap: balance;
    overflow-wrap: break-word;
}
.wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) .editorial-lead {
    max-width: 760px;
    margin: 24px auto 0;
    font-size: clamp(1.125rem, 1.6vw, 1.25rem);
    line-height: 1.6;
    text-align: center;
    text-wrap: pretty;
}
.wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) .is-style-editorial-badge { max-width: 100%; margin-inline: auto; }
:is(.entry-content, .editor-styles-wrapper) .wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) .wp-block-buttons {
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 32px auto 0;
}
.wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) .is-style-outline .wp-block-button__link:not(.has-text-color) { color: inherit; border-color: currentColor; }

/* Text stays first in the DOM. The optional desktop variant only moves media. */
:is(.editorial-band, .is-style-editorial-band) .editorial-split > .wp-block-columns {
    width: 100%;
    max-width: none;
    gap: clamp(32px, 5vw, 72px);
    margin-block: 0;
}
:is(.editorial-band, .is-style-editorial-band) .editorial-split > .wp-block-columns.are-vertically-aligned-center { align-items: center !important; }
:is(.editorial-band, .is-style-editorial-band) .editorial-split > .wp-block-columns > .wp-block-column { min-width: 0; }
:is(.editorial-band, .is-style-editorial-band) .editorial-split .wp-block-image { margin: 0; }
:is(.editorial-band, .is-style-editorial-band) .editorial-split .wp-block-image img { display: block; width: 100%; height: auto; }
.editorial-media--contain img { object-fit: contain; }
.editorial-media--contain figcaption { padding-inline: 4px; }

/* Native Groups form diagrams. Essential order, names and states remain HTML. */
:is(.entry-content, .editor-styles-wrapper) :is(.editorial-flow, .is-style-editorial-flow) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    gap: 24px;
    margin-block: 32px 0;
    padding: 0;
}
:is(.editorial-flow, .is-style-editorial-flow).editorial-flow--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:is(.editorial-flow, .is-style-editorial-flow).editorial-flow--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
:is(.editorial-flow, .is-style-editorial-flow) > * { min-width: 0; width: 100%; max-width: none; margin: 0; }
/* Native Columns retain their editor-selected widths, unlike a Group flow grid. */
.wp-block-columns:is(.editorial-flow, .is-style-editorial-flow) { display: flex; flex-wrap: nowrap; }
.wp-block-columns:is(.editorial-flow, .is-style-editorial-flow) > .wp-block-column { width: auto; min-width: 0; }
.editorial-flow-cluster { box-sizing: border-box; width: 100%; padding: clamp(20px, 2.5vw, 28px); border: 1px solid var(--ast-global-color-7); border-radius: 20px; background: var(--ast-global-color-5); }
.editorial-flow-cluster > :is(h3, h4) { margin-block: 0 20px; font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.3; }
.editorial-flow-cluster > :first-child { margin-block-start: 0; }
.editorial-flow-cluster > :last-child { margin-block-end: 0; }
.editorial-flow-cluster > .editorial-flow-step + .editorial-flow-step { margin-block-start: 16px; }
.editorial-flow-cluster :is(.editorial-flow, .is-style-editorial-flow) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.editorial-flow-approval { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 24px 16px; text-align: center; }
.editorial-flow-approval > * { max-width: 100%; margin-inline: auto; }
.editorial-flow-approval > :first-child { margin-block-start: 0; }
.editorial-flow-approval > :last-child { margin-block-end: 0; }
:is(.editorial-flow-step, .is-style-editorial-flow-step) {
    box-sizing: border-box;
    padding: 26px;
    border: 1px solid var(--ast-global-color-7);
    border-block-start: 4px solid var(--ast-global-color-0);
    border-radius: 16px;
    background: var(--ast-global-color-4);
    color: var(--ast-global-color-2);
    overflow-wrap: anywhere;
}
:is(.editorial-flow-step, .is-style-editorial-flow-step).editorial-flow-step--waiting { border-style: dashed; border-block-start-style: solid; }
:is(.editorial-flow-step, .is-style-editorial-flow-step) :is(h3, h4) { margin: 12px 0; font-size: clamp(1.15rem, 1.65vw, 1.4rem); line-height: 1.3; }
:is(.editorial-flow-step, .is-style-editorial-flow-step) p { margin-block: 12px 0; line-height: 1.6; }
:is(.editorial-flow-step, .is-style-editorial-flow-step) > :first-child { margin-block-start: 0; }
:is(.editorial-flow-step, .is-style-editorial-flow-step) > :last-child { margin-block-end: 0; }
.editorial-step-label { font-size: .8rem; font-weight: 700; letter-spacing: .06em; }
.editorial-state { display: inline-block; max-width: 100%; padding: 6px 10px; border: 1px solid currentColor; border-radius: 8px; font-size: .875rem; line-height: 1.45; }
.editorial-flow-note { max-width: 840px; margin: 24px auto 0; line-height: 1.65; }

/* Native Group card. Links retain their own targets; no stretched overlays. */
:is(.editorial-solution-card, .is-style-editorial-solution-card) {
    box-sizing: border-box;
    height: 100%;
    padding: clamp(24px, 3vw, 36px);
    border: 1px solid var(--ast-global-color-7);
    border-radius: 20px;
    background: var(--ast-global-color-4);
    box-shadow: 0 16px 40px rgb(22 24 45 / 6%);
}
:is(.editorial-solution-card, .is-style-editorial-solution-card) > .wp-block-image { margin: 0 0 24px; }
:is(.editorial-solution-card, .is-style-editorial-solution-card) > .wp-block-image img { display: block; width: 100%; height: auto; border-radius: 12px; }
:is(.editorial-solution-card, .is-style-editorial-solution-card) :is(h2, h3) { margin-block: 0 16px; }
:is(.editorial-solution-card, .is-style-editorial-solution-card) > :last-child { margin-block-end: 0; }
:is(.editorial-form-panel, .is-style-editorial-form-panel) { box-sizing: border-box; max-width: 920px; margin-inline: auto; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--ast-global-color-7); border-radius: 20px; background: var(--ast-global-color-4); }
:is(.editorial-form-panel, .is-style-editorial-form-panel).editorial-form-panel--flush { padding: 0; border: 0; border-radius: 0; background: transparent; }

:is(.entry-content, .editor-styles-wrapper) .wp-block-group:is(.editorial-task-header, .is-style-editorial-task-header) { margin-block: 0; padding: clamp(48px, 6vw, 80px) 24px clamp(32px, 4vw, 48px); text-align: center; }
:is(.editorial-task-header, .is-style-editorial-task-header) > * { max-width: 840px; margin-inline: auto; }
:is(.editorial-task-header, .is-style-editorial-task-header) h1 { margin-block: 0 20px; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.15; text-wrap: balance; }
:is(.editorial-task-header, .is-style-editorial-task-header) p { font-size: 1.125rem; line-height: 1.65; }
.editorial-reading { width: 100%; max-width: 800px; margin-inline: auto; }
.editorial-page-index { margin-block: 0; }
.editorial-page-index :is(ul, .wp-block-buttons) { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.editorial-page-index li { margin: 0; }
.editorial-page-index a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 8px; text-underline-offset: .2em; }

/* Scoped controls and anchor clearance leave other pages' behavior untouched. */
:is(.editorial-band, .is-style-editorial-band, .editorial-hero--center, .is-style-editorial-hero-center, .editorial-task-header, .is-style-editorial-task-header) .wp-block-button__link { box-sizing: border-box; min-height: 44px; white-space: normal; line-height: 1.4; }
:is(.editorial-band, .is-style-editorial-band, .editorial-hero--center, .is-style-editorial-hero-center, .editorial-task-header, .is-style-editorial-task-header)[id],
:is(.editorial-band, .is-style-editorial-band) [id] { scroll-margin-block-start: 112px; }
:is(.editorial-band, .is-style-editorial-band, .editorial-task-header, .is-style-editorial-task-header) :is(a, button):focus-visible { outline: 3px solid var(--ast-global-color-0); outline-offset: 4px; }
:is(.editorial-hero--center, .is-style-editorial-hero-center) a:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }

@media (min-width: 1025px) {
    :is(.editorial-band, .is-style-editorial-band) .editorial-split--media-first > .wp-block-columns { flex-direction: row-reverse; }
}
@media (max-width: 1024px) {
    :is(.editorial-band, .is-style-editorial-band) .editorial-split > .wp-block-columns { flex-direction: column; gap: 36px; }
    :is(.editorial-band, .is-style-editorial-band) .editorial-split > .wp-block-columns > .wp-block-column { flex-basis: auto; width: 100%; }
    :is(.editorial-band, .is-style-editorial-band) .editorial-split .wp-block-image { max-width: 800px; margin-inline: auto; }
    :is(.editorial-flow, .is-style-editorial-flow).editorial-flow--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    :is(.editorial-band, .is-style-editorial-band) { --editorial-layout-space: 56px; }
    :is(.entry-content, .editor-styles-wrapper) .wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) { min-height: 0; height: auto; padding-block: 72px; }
    :is(.entry-content, .editor-styles-wrapper) :is(.editorial-flow, .is-style-editorial-flow) { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .wp-block-columns:is(.editorial-flow, .is-style-editorial-flow) { flex-direction: column; }
    .wp-block-columns:is(.editorial-flow, .is-style-editorial-flow) > .wp-block-column { flex-basis: auto !important; width: 100%; }
    .editorial-flow-cluster { padding: 20px; border-radius: 16px; }
    :is(.editorial-flow-step, .is-style-editorial-flow-step) { padding: 24px; }
    :is(.editorial-band, .is-style-editorial-band) .editorial-split > .wp-block-columns { gap: 28px; }
    :is(.editorial-form-panel, .is-style-editorial-form-panel) { padding: 24px; border-radius: 16px; }
    :is(.editorial-task-header, .is-style-editorial-task-header) h1 { overflow-wrap: break-word; }
}
@media (max-width: 479px) {
    :is(.entry-content, .editor-styles-wrapper) .wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) .wp-block-buttons { flex-direction: column; align-items: stretch; }
    .wp-block-cover:is(.editorial-hero--center, .is-style-editorial-hero-center) :is(.wp-block-button, .wp-block-button__link) { width: 100%; }
    :is(.editorial-solution-card, .is-style-editorial-solution-card) { border-radius: 16px; }
}
