/* -------------------------------- 

File#: _1_morphing-background
Title: Morphing Background
Descr: A morphing background item that transitions from one element's position to another's
Usage: codyhouse.co/license

-------------------------------- */

/* reset */
*,
*::after,
*::before {
    box-sizing: border-box;
}

* {
    font: inherit;
    margin: 0;
    padding: 0;
    border: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: hsl(0, 0%, 100%);
    font-family: system-ui, sans-serif;
    color: hsl(230, 7%, 23%);
    font-size: 1.125rem;
    /* 18px */
    line-height: 1.4;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    color: hsl(230, 13%, 9%);
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    /* 40px */
}

h2 {
    font-size: 2.125rem;
    /* 34px */
}

h3 {
    font-size: 1.75rem;
    /* 28px */
}

h4 {
    font-size: 1.375rem;
    /* 22px */
}

ol,
ul,
menu {
    list-style: none;
}

button,
input,
textarea,
select {
    background-color: transparent;
    border-radius: 0;
    color: inherit;
    line-height: inherit;
    -webkit-appearance: none;
    appearance: none;
}

textarea {
    resize: vertical;
    overflow: auto;
    vertical-align: top;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

img,
video,
svg {
    display: block;
    max-width: 100%;
}

/* --------------------------------

Component 

-------------------------------- */

.morph-bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 1px;
    width: 1px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    transform-origin: left top;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.morph-bg--visible {
    opacity: 1;
}

.morph-bg--has-transition {
    transition: 0.3s;
    will-change: transform, border-radius, height, width;
}

/* -------------------------------- 

Demo style 

-------------------------------- */

.demo-morph-bg-paragraph {
    font-size: 0.9375rem;
    color: hsl(240, 4%, 65%);
}

.demo-morph-bg-list {
    display: inline-flex;
    flex-wrap: wrap;
}

.demo-morph-bg-link {
    display: block;
    padding: 0.75rem 1rem;
    color: hsl(230, 13%, 9%);
    text-decoration: none;
    font-weight: medium;
}

.demo-morph-bg-target {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.demo-morph-bg-button {
    border-radius: 50em;
    font-size: var(--text-size-100);
    cursor: pointer;
    color: grey;
    /* Default color for inactive buttons */
    padding: 0.75rem 1rem;
    transition: color 0.3s;
    /* Smooth transition for color changes */
}

.demo-morph-bg-button.active_morph {
    color: #4279bc;
    /* Color for the active button */
}

/* You may need to adjust other styles to ensure proper visibility */
.demo-morph-bg-2 {
    background-color: white;
    box-shadow: 0px 9px 9px -6px rgba(206, 217, 232, 0.5);
    -webkit-box-shadow: 0px 9px 9px -6px rgba(206, 217, 232, 0.5);
    -moz-box-shadow: 0px 9px 9px -6px rgba(206, 217, 232, 0.5);
}

/* -------------------------------- 

Utilities 

-------------------------------- */

.cd-block {
    display: block;
}

.cd-position-relative {
    position: relative;
}

.cd-z-index-1 {
    z-index: 1;
}

.cd-z-index-2 {
    z-index: 2;
}

.cd-margin-bottom-sm {
    margin-bottom: 1.5rem;
}

.cd-margin-bottom-xl {
    margin-bottom: 4.5rem;
}

.cd-text-center {
    text-align: center;
}

.cd-bg {
    background-color: #ededed;
    padding: var(--sp-ss);
    border-radius: 50em;
}

.add_test_morph {
    display: flex;
    gap: var(--sp-ss);
    text-decoration: none;
    align-items: center; /* Align items vertically */
}

.add_text_svg_morph_active,
.add_text_svg_morph_inactive {
    height: 1em; /* Set height to match text size */
    width: auto; /* Maintain aspect ratio */
    vertical-align: middle; /* Align with text */
}

.add_text_svg_morph_active {
    fill: #4279bc;
}

.add_text_svg_morph_inactive {
    fill: grey;
}

.morph_flex {
    display: flex;
    justify-content: flex-start;
    margin-bottom: var(--sp-m);
}

.pill_morph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-size-90);
    width: 1.5em;
    height: 1.5em;
    border-radius: 50%;
    translate: 5px -5px;
}

.sm-m-txt {
    font-size: var(--text-size-95);
}

.morph_welc_div {
    display: flex;
    margin-bottom: var(--sp-x);
}

.morph_pd_e {
    padding: 1rem 2rem;
}

@media (max-width: 767px) {
    .demo-morph-bg-button {
        font-size: var(--text-size-95);
    }

    .morph_pd_e {
        padding: 0.75rem 1rem;
    }

    .cd-bg {
        background-color: #ededed;
    }
    .cd-bg_3 {
        background-color: #ededed00;
    }
    .morph_welc_div {
    justify-content: center;
}
}
