@import "dxHelpers/reset";
@import "dxHelpers/text";

:host {
    --dx-c-section-padding-vertical: var(--dx-g-spacing-5xl);
    --dx-c-section-padding-horizontal: var(--dx-g-page-padding-horizontal);
    --dx-c-section-padding-left: var(--dx-c-section-padding-horizontal);
    --dx-c-section-padding-right: var(--dx-c-section-padding-horizontal);
    --dx-c-section-padding-top: var(--dx-c-section-padding-vertical);
    --dx-c-section-padding-bottom: var(--dx-c-section-padding-vertical);
    --dx-c-section-heading-margin-bottom: var(--dx-g-spacing-2xl);
    --dx-c-section-cta-color: var(--dx-g-blue-vibrant-50);
    --dx-c-section-cta-inline-hover-color: var(--dx-g-blue-vibrant-30);
    --dx-c-section-position: relative;
    --dx-c-section-graphic-margin-top: var(--graphic-height);
    --dx-c-section-graphic-margin-bottom: var(--graphic-height);
}

.section {
    /* internal var */
    --graphic-height: 5.563vw;
    --graphic-vertical-padding: 0.14vw;

    position: var(--dx-c-section-position);
    display: flex;
    flex-direction: column;
    background: var(--dx-c-section-background-color);
    padding: var(--dx-c-section-padding-top) var(--dx-c-section-padding-right)
        var(--dx-c-section-padding-bottom) var(--dx-c-section-padding-left);
}

.section-dark {
    --dx-g-text-heading-color: white;
    --dx-g-text-body-color: var(--dx-g-blue-vibrant-90);
    --dx-g-text-label-color: var(--dx-g-blue-vibrant-90);
}

.section.graphic-top:not(.graphic-overlap) {
    margin-top: var(--dx-c-section-graphic-margin-top);
}

.section.graphic-bottom:not(.graphic-overlap) {
    margin-bottom: var(--dx-c-section-graphic-margin-bottom);
}

.background-graphic {
    color: var(--dx-c-section-background-color);
    width: 100%;
    z-index: 1;
    position: absolute;
    left: 0;
    height: var(--graphic-height);
}

.background-graphic-top {
    top: calc(-1 * var(--graphic-height) + var(--graphic-vertical-padding));
}

.background-graphic-bottom {
    bottom: calc(-1 * var(--graphic-height) + var(--graphic-vertical-padding));
}

.heading {
    max-width: 800px;
}

.dx-text-display-custom {
    color: var(--dx-c-section-heading-font-color, --dx-g-text-heading-color);
    font-family: var(--dx-c-section-heading-font-family, --dx-g-font-display);
    font-size: var(--dx-c-section-heading-font-size, --dx-g-text-3xl);
    letter-spacing: var(--dx-c-section-heading-letter-spacing, -0.4px);
    line-height: var(--dx-c-section-heading-line-height, 40px);
}

.text {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--dx-c-section-heading-margin-bottom);
    z-index: 100;
}

.text > *:not(:last-child) {
    margin-bottom: var(--dx-g-spacing-md);
}

.text > .label:not(:last-child) {
    margin-bottom: var(--dx-g-spacing-lg);
}

.content {
    z-index: 50;
}

.cta {
    --dx-c-button-primary-color: var(--dx-c-section-cta-color);
    --dx-c-button-inline-color-hover: var(
        --dx-c-section-cta-inline-hover-color
    );
}

.cta-inline {
    display: flex;
    justify-content: space-between;
    max-width: unset;
}

/* sections with a swoop and center alignment should not left align as it encroaches on the graphic */
.section.align-center.graphic-top .text {
    text-align: center;
    align-items: center;
}

@media screen and (min-width: 1400px) {
    .background-graphic {
        --graphic-height: 80px;
        --graphic-vertical-padding: 2px;
    }
}

@media screen and (min-width: 768px) {
    .section.align-center .text {
        text-align: center;
        align-items: center;
    }
}

@media screen and (max-width: 1024px) {
    :host {
        --dx-c-section-padding-vertical: 80px;
    }

    .text {
        margin-bottom: var(--dx-g-spacing-xl);
    }

    .text > *:not(:last-child) {
        margin-bottom: 12px;
    }

    .label {
        font-size: 16px;
        letter-spacing: -0.2px;
        line-height: 20px;
    }

    .subtitle {
        font-size: 16px;
        letter-spacing: 0;
        line-height: 24px;
    }

    .heading {
        font-size: 32px;
        letter-spacing: -0.6px;
        line-height: 40px;
    }

    .heading.dx-text-display-4 {
        font-size: var(--dx-g-text-xl);
        letter-spacing: -0.6px;
        line-height: 32px;
    }
}
