.otech-home-rail {
    box-sizing: border-box;
    width: min(
        var(--otech-home-content-width, var(--otech-home-default-width)),
        calc(100% - 2 * min(25%, var(--otech-home-side-gutter, var(--otech-home-default-gutter))))
    );
    min-width: 0;
    margin-inline: auto;
    container: otech-home-rail / inline-size;
}

body.otech-home-header-grid .ocst-header .ocst-inner {
    width: min(var(--otech-home-header-width), calc(100% - 2 * min(25%, var(--otech-home-default-gutter))));
    max-width: none;
    padding-inline: 0;
}

body.otech-home-footer-grid footer.otech-footer .of-wrap {
    --of-max: var(--otech-home-footer-width);
    --of-pad-x: min(25%, var(--otech-home-default-gutter));
    --of-mobile-x: max(var(--of-pad-x), calc((100% - var(--of-max)) / 2));
}

.otech-home-label-left {
    --otech-home-label-before: block;
    --otech-home-label-after: none;
}

.otech-home-label-right {
    --otech-home-label-before: none;
    --otech-home-label-after: block;
}

.otech-home-label-none,
.otech-home-kicker[data-lines="no"] {
    --otech-home-label-before: none;
    --otech-home-label-after: none;
}

.otech-home-kicker {
    gap: var(--otech-home-label-gap);
}

.otech-home-kicker::before,
.otech-home-kicker::after,
body.otech-home-footer-labels footer.otech-footer .of-section-label::before {
    content: "";
    flex: 0 0 var(--otech-home-label-width);
    width: var(--otech-home-label-width);
    height: var(--otech-home-label-height);
    border-radius: var(--otech-home-label-radius);
    background: var(--otech-home-label-color);
}

.otech-home-kicker::before {
    display: var(--otech-home-label-before);
}

.otech-home-kicker::after {
    display: var(--otech-home-label-after);
}

body.otech-home-footer-labels footer.otech-footer .of-section-label {
    padding-inline-start: var(--otech-home-footer-label-padding-start);
    padding-inline-end: var(--otech-home-footer-label-padding-end);
}

body.otech-home-footer-labels footer.otech-footer .of-section-label::before {
    display: var(--otech-home-footer-label-display);
    position: absolute;
    top: .65em;
    inset-inline-start: var(--otech-home-footer-label-start);
    inset-inline-end: var(--otech-home-footer-label-end);
    transform: translateY(-50%);
}

body.otech-home-footer-labels footer.otech-footer .of-section-label::after {
    visibility: hidden;
}

/* A manually narrowed rail needs the same column behavior as a small screen. */
@container otech-home-rail (max-width: 980px) {
    .ots-grid,
    .otc-process-editorial__grid {
        --otech-home-columns: 2;
    }

    .otc-process-editorial__header {
        --otech-home-process-header-columns: minmax(0, 1fr);
    }
}

@container otech-home-rail (max-width: 860px) {
    .otc-creative-zero__content,
    .otc-creative-zero__visual {
        grid-column: 1 / -1;
    }

    .otc-creative-zero__content {
        --otech-home-hero-white-space: normal;
        --otech-home-hero-wrap: wrap;
    }
}

@container otech-home-rail (max-width: 588px) {
    .ots-grid,
    .otc-process-editorial__grid,
    .otc-contact__actions {
        --otech-home-columns: 1;
    }
}
