/* --------------------------------------------------------------------- */
/* ------------- PAGES CUSTOM BUTTONS AND HEADINGS START --------------- */
/* --------------------------------------------------------------------- */
/*
   Custom Colors
   Add one of these as a custom class on a page builder Heading or Button:
   navy | medium-blue | accent-blue | logo-blue | sky | black | charcoal | light-gray | cream | gold | teal | red
   white is for Headings only.
*/
#page .pb-main {
    --navy: #1c3586;
    --navy-hover: #14286a;
    --medium-blue: #3d5ba9;
    --accent-blue: #799bce;
    --logo-blue: #becfe3;
    --sky: #eef3fa;
    --black: #000000;
    --charcoal: #404040;
    --light-gray: #d6d6d6;
    --white: #ffffff;
    --cream: #fbf7ef;
    --gold: #e8a33d;
    --teal: #2e8b7a;
    --red: #c0392b;
    --black-text: #000000;
    --white-text: #ffffff;

    /* ---------- Class -> color (shared by headings and buttons) ---------- */
    :is(.pb-heading, .pb-button) {
        &.navy { --custom-color: var(--navy); }
        &.medium-blue { --custom-color: var(--medium-blue); }
        &.accent-blue { --custom-color: var(--accent-blue); }
        &.logo-blue { --custom-color: var(--logo-blue); }
        &.sky { --custom-color: var(--sky); }
        &.black { --custom-color: var(--black); }
        &.charcoal { --custom-color: var(--charcoal); }
        &.light-gray { --custom-color: var(--light-gray); }
        &.white { --custom-color: var(--white); }
        &.cream { --custom-color: var(--cream); }
        &.gold { --custom-color: var(--gold); }
        &.teal { --custom-color: var(--teal); }
        &.red { --custom-color: var(--red); }
    }

    /* ---------- Headings ---------- */
    .pb-heading:is(.navy, .medium-blue, .accent-blue, .logo-blue, .sky, .black, .charcoal, .light-gray, .white, .cream, .gold, .teal, .red) * {
        color: var(--custom-color) !important;
    }

    /* ---------- Buttons ----------
       --btn-on:     text & icons sitting on the solid fill (dark theme, outline hover)
       --btn-accent: text & icons where the page shows through (light & outline themes)
       --btn-hover:  dark-theme hover fill. Pale colors lighten instead of darken so their black text keeps its contrast.
    */
    .pb-button {
        &:is(.navy, .medium-blue, .black, .charcoal, .red) {
            --btn-on: var(--white-text);
            --btn-accent: var(--custom-color);
            --btn-hover: color-mix(in srgb, var(--custom-color), black 10%);
        }

        &:is(.accent-blue, .logo-blue, .sky, .light-gray, .cream, .gold, .teal) {
            --btn-on: var(--black-text);
            --btn-accent: var(--black-text);
            --btn-hover: color-mix(in srgb, var(--custom-color), white 15%);
        }

        &.navy {
            --btn-hover: var(--navy-hover);
        }

        &.red {
            --btn-accent: color-mix(in srgb, var(--red), black 15%);
        }

        /* The palest colors need a stronger light-theme tint to show on white */
        &:is(.light-gray, .logo-blue) {
            --light-mix: 26%;
            --light-hover-mix: 39%;
        }

        &:is(.sky, .cream) {
            --light-mix: 36%;
            --light-hover-mix: 49%;
        }

        &:is(.navy, .medium-blue, .accent-blue, .logo-blue, .sky, .black, .charcoal, .light-gray, .cream, .gold, .teal, .red) .button {
            --light-button: color-mix(in srgb, var(--custom-color) var(--light-mix, 6%), transparent);
            --light-button-hover: color-mix(in srgb, var(--custom-color) var(--light-hover-mix, 19%), transparent);
            --dark-button: var(--custom-color);
            --dark-button-hover: linear-gradient(var(--btn-hover), var(--btn-hover));

            &:not(.button-type-square.button-style-2) .title-text {
                font-weight: 500;
            }

            &.button-theme-dark {
                .title-text {
                    color: var(--btn-on);
                }

                .custom-icon > svg {
                    fill: var(--btn-on);
                }

                .style-2-bar {
                    border-color: var(--btn-on);
                }
            }

            &:is(.button-theme-light, .button-theme-outline) {
                .title-text {
                    color: var(--btn-accent);
                }

                &.button-type-square {
                    border-radius: 4px;
                    
                    .custom-icon > svg {
                        fill: var(--btn-accent);
                    }

                    .style-2-bar {
                        border-color: var(--btn-accent);
                    }
                }
            }

            &.button-theme-outline:not(.button-type-link):hover {
                .title-text {
                    color: var(--btn-on);
                }

                &.button-type-square {
                    .custom-icon > svg {
                        fill: var(--btn-on);
                    }

                    .style-2-bar {
                        border-color: var(--btn-on);
                    }
                }
            }

            /* Style-2 arrow */
            .arrow-button {
                circle {
                    fill: var(--white);
                    stroke: var(--btn-accent);
                }

                path {
                    stroke: var(--btn-accent);
                }

                rect {
                    fill: var(--btn-accent);
                }
            }
        }
    }
}
/* --------------------------------------------------------------------- */
/* -------------- PAGES CUSTOM BUTTONS AND HEADINGS END ---------------- */
/* --------------------------------------------------------------------- */
