main {
    margin: 1em 2em;
}

main div {
    font-size: 100%;
}

main h2 {
    font-size: 200%;
}

main h2 p {
    font-size: 70%;
    font-style: italic;
}

main h3 {
    position: relative;
    margin-bottom: 1rem;
    margin-top: 1rem;
    font-size: 175%;
}

main h3 div {
    display: flex;
    position: relative;
}

main h3 div div::after {
    content: "";
    display: block;
    position: absolute;
    background: linear-gradient(90deg, var(--accent-color), rgba(0, 0, 0, 0) 50%);
    width: 200%;
    bottom: 0;
    height: .1rem;
}

main h4 {
    font-size: 150%;
    font-style: italic;
    margin: 1rem 0rem;
}

main h5 {
    display: flex;
    text-align: center;
    font-size: 125%;
    white-space: nowrap;
    margin: 0.5em;
}

main h5::before {
    content: "";
    display: block; 
    width: 100%; 
    align-self: center;
    height: .1em; 
    margin-right: .5em;
    background-color: var(--secondary-color);
}

main h5::after {
    content: "";
    display: block; 
    width: 100%; 
    align-self: center;
    height: .1em; 
    margin-left: .5em;
    background-color: var(--secondary-color);
}

/* RECIPE HEADER CONTENT */

main .recipe-header-content div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

main .recipe-header-content div div {
    white-space: nowrap;
}

.recipe-amount {
    position: relative;
    font-size: 120%;
    padding: 0rem 1rem;
}

.recipe-amount::before {
    content: "";
    position: absolute;
    display: block;
    height: .1rem;
    width: 100%;
    background-color: var(--primary-color);
    left: 0;
    bottom: 0;

    transition: 0.2s;
}

.recipe-amount:focus::before {
    background-color: var(--accent-color);
}

/* INGREDIENT CONTENT */

.recipe-ingredient-grid {
    overflow-x: scroll;
    display: grid;
    grid-template-columns: repeat(3, max-content);
    padding: 0.2rem;
}

.recipe-ingredient-grid div {
    display: flex;
    margin-bottom: .4em;
    align-self: center;
}

.recipe-ingredient-grid div div {
    position: relative;
    font-size: 105%;
    margin: 0;
}

.recipe-ingredient-grid input{
    margin-right: 1em;
}

.recipe-ingredient-grid div:nth-child(3n+2) {
    justify-content: end;
}

.recipe-ingredient-grid div:nth-child(3n+2) div {
    padding-right: 1em;
}

a {
    transition: 0.5s;
}

.recipe-ingredients-strike-backwards a {
    color: var(--primary-color);
    text-decoration: none;
}

.recipe-ingredients-strike::before {
    content: "";
    position: absolute;
    top: calc(50% - 0.1em);
    right: 0;
    width: 100%;
    height: 0.2em;
    background-color: var(--accent-color);

    animation: table-strike-amimation .5s ease; 
}

.recipe-ingredients-strike-backwards::before {
    content: "";
    position: absolute;
    top: calc(50% - 0.1em);
    left: 0;
    width: 100%;
    height: 0.2em;
    background-color: var(--accent-color);

    animation: table-strike-amimation .5s ease; 
}

.undo-recipe-ingredients-strike::before {
    content: "";
    position: absolute;
    top: calc(50% - 0.1em);
    right: 0;
    width: 0%;
    height: 0.2em;
    background-color: var(--accent-color);

    animation: table-strike-amimation-2 .5s ease; 
    animation-direction: reverse;
}

.undo-recipe-ingredients-strike-backwards::before {
    content: "";
    position: absolute;
    top: calc(50% - 0.1em);
    left: 0;
    width: 0%;
    height: 0.2em;
    background-color: var(--accent-color);

    animation: table-strike-amimation-2 .5s ease; 
    animation-direction: reverse;
}

@keyframes table-strike-amimation {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes table-strike-amimation-2 {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* NUTRIENT TABLE */
.recipe-nutrient-content table {
    border-collapse: collapse;
    border: 1px solid var(--primary-color);
    width: 100%;
}

.recipe-nutrient-content table tr {
    border-bottom: 1px solid var(--primary-color);
}

.recipe-nutrient-content table tr th {
    font-size: 120%;
}

.recipe-nutrient-content table tr td {
    padding: 0.25rem 0.25em;
}

.recipe-ingredient-nutrient-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));;
}

/* STEPS CONTENT */
.recipe-steps-content > div {
    position: relative;
    display: grid;
    grid-template-columns: 50% 50%;

    text-align: justify;
}

.recipe-steps-content .recipe-steps-content-empty-step {
    display: flex;
}

.recipe-steps-content > .recipe-steps-content-empty-step > div:nth-child(n) {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.recipe-steps-content > .recipe-steps-content-empty-step::before {
    display: none;
}


.recipe-steps-content > div > div:nth-child(2n + 1) {
    margin-right: 0.5rem;
}

.recipe-steps-content > div > div:nth-child(2n) {
    margin-left: 0.5rem;
}

.recipe-steps-content > div::before {
    content: "";
    position: absolute;
    left: calc(50% - 0.3rem/2);
    border-left-style: dashed;
    border-left-color: var(--accent-color); 
    width: 0.3rem;
    height: 100%;
}

.bubble-container > div {
    display: grid;
    grid-template-columns: min-content 1fr;
}

.bubble-container > div > div {
    display: flex;
    align-self: center;
    margin-bottom: .4em;
}

.bubble-container div div div {
    position: relative;

}

.bubble-container input{
    margin-right: 1em;
}


@media (max-width: 600px) {
    .recipe-steps-content > div::before {
        display: none;
    }

    .recipe-steps-content > div {
        position: relative;
        display: flex;
        flex-direction: column;
    }

    
    .recipe-steps-content > div > div:nth-child(2n + 1) {
        margin-right: 0rem;
    }

    .recipe-steps-content > div > div:nth-child(2n) {
        margin-left: 0rem;
    }

    .bubble-container {
        border: 0.2rem dotted var(--accent-color);
        padding: 0.4rem;
        padding-bottom: 0rem;
        margin-bottom: 0.4rem;
    }
}

main {
    display: flex;
    flex-direction: column;
    max-width: 1000px;
    /*width: 100%*/;
    margin: auto;

    min-width: min(75%, 1000px);
}

main .recipe-content {
    margin: 1em 2em;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}