/* ===================================================================
   Shared GT section and Gutenberg alignment system
   =================================================================== */

:root {
    --gt-section-max: 1400px;
    --gt-section-gutter: clamp(28px, 5cqi, 72px);
}

/*
 * Use the width of .gt-main (the area beside the desktop sidebar), not the
 * browser viewport, for full-width calculations.
 */
.gt-main {
    container-type: inline-size;
}

/*
 * Inner-page blocks are children of article.gt-page-article. Homepage blocks
 * are direct children of .gt-front-page-content.
 */
.gt-page-content > .gt-page-article > .alignfull,
.gt-front-page-content > .alignfull,
.gt-page-content .gt-page-article > .alignfull {
    position: relative;
    width: 100cqi;
    max-width: 100cqi;
    margin-inline: calc(50% - 50cqi);
    box-sizing: border-box;
}

/* Shared constrained content area used inside full-width GT sections. */
.gt-section-inner {
    width: min(100%, var(--gt-section-max));
    margin-inline: auto;
    padding-inline: var(--gt-section-gutter);
    box-sizing: border-box;
}

/* Optional common outer section class for future full-width GT components. */
.gt-section {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    box-sizing: border-box;
}

/*
 * Defensive reset: older testimonial content may have gt-section-inner saved
 * as an Additional CSS class on the outer block. Only the real inner wrapper
 * should be constrained.
 */
.wp-block-gt-testimonial.gt-section-inner,
.wp-block-gt-cta.gt-section-inner,
.wp-block-gt-accordion.gt-section-inner,
.wp-block-gt-cards.gt-section-inner,
.wp-block-gt-stats.gt-section-inner,
.wp-block-gt-timeline.gt-section-inner,
.wp-block-gt-logo-grid.gt-section-inner {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
}

.wp-block-gt-testimonial .gt-testimonial__inner.gt-section-inner {
    width: min(100%, var(--gt-section-max));
    margin-inline: auto;
    padding-inline: var(--gt-section-gutter);
}

/* Avoid horizontal scroll from fractional container-unit rounding. */
html,
body {
    overflow-x: clip;
}

@supports not (overflow: clip) {
    html,
    body {
        overflow-x: hidden;
    }
}

/* Graceful fallback for browsers without container query units. */
@supports not (width: 100cqi) {
    :root {
        --gt-section-gutter: clamp(28px, 5vw, 72px);
    }

    .gt-page-content > .gt-page-article > .alignfull,
    .gt-front-page-content > .alignfull,
    .gt-page-content .gt-page-article > .alignfull {
        width: 100%;
        max-width: none;
        margin-inline: 0;
    }
}
