@font-face {
    font-family: Literata;
    src: url("/static/fonts/literata/Literata-VariableFont_opsz,wght.ttf");
}

@font-face {
    font-family: Literata;
    font-style: italic;
    src: url("/static/fonts/literata/Literata-Italic-VariableFont_opsz,wght.ttf");
}

:root {
    --color-error-bg: hsl(0 90% 85%);
    --color-error-border: hsl(0 80% 60%);

    --color-background: hsl(45 20% 97%);
    --color-text: hsl(0 0% 0%);
    --color-border: hsl(45 10% 85%);
    --color-focus-outline: hsl(45 10% 10%);

    --font-sans: Inter, sans-serif;
    --font-serif: Literata, serif;

    --h1-font-size: 2rem;
    --h1-line-height: 1.25;

    --button-height: 2.5rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    border: none;
    outline: none;
    background: none;
}

body {
    font-family: sans-serif;
    line-height: 1.5;

    font-family: var(--font-serif);

    background-color: var(--color-background);
}


img {
    display: block;
    max-inline-size: 100%;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 4rem;
    padding-inline: 1rem;
    gap: 1rem;
}

.top-bar__logo {
    flex-shrink: 0;
}

.top-bar__right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.logo-link {
    font-size: 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: flex-end;
    height: 1.25rem;
}

.logo-link__tomato {
    width: 1.25rem;
}

.logo-link__text {
    line-height: 1;
    color: hsl(0 85% 55%);
    font-weight: 700;
}

.wrapper {
    max-width: 48rem;
    margin-inline: auto;
    padding-inline: 1rem;
    box-sizing: content-box;
    margin-block: 2rem;
}

.form-error {
    background-color: var(--color-error-bg);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-error-border);
    border-radius: 4px;
}


.auth-menu {
    position: relative;
    user-select: none;
}

.auth-menu__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background-color: white;
    z-index: 1000;
    font-size: 0.875rem;
}

.auth-menu__dropdown.open {
    display: block;
}

.auth-menu [role="menuitem"] {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    column-gap: 0.25em;

    border: 0;
    background-color: transparent;
    text-align: left;
    text-decoration: none;
    color: currentColor;
    cursor: pointer;
    width: 100%;
    font: inherit;

    &:hover {
        background-color: hsl(0 0% 0% / 0.05);
    }
}

.auth-menu__dropdown>*+* {
    border-top: 2px solid var(--color-border);
}

.time-slider {
    position: relative;
    display: flex;
    flex-direction: column-reverse;
}

.time-slider__ticks {
    position: relative;

    div {
        position: absolute;
        top: 0;
        transform: translateX(-50%);
        white-space: nowrap;
        --thumb-w: 14px;
        --pct: calc(var(--m) / 120);
        left: calc(var(--thumb-w) / 2 + var(--pct) * (100% - var(--thumb-w)));
        /* &::before { */
        /*     content: ''; */
        /*     z-index: -1; */
        /*     width: 2px; */
        /*     height: 8px; */
        /*     background-color: var(--color-text); */
        /*     position: absolute; */
        /*     left: 50%; */
        /*     transform: translate(-50%, 50%); */
        /*     bottom: calc(100% + 1px); */
        /* } */
    }
}

.time-slider__input {
    width: 100%;
}

h1 {
    font-size: var(--h1-font-size);
    line-height: var(--h1-line-height);
}

h2 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

h3 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

p,
ul {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

button:has(.icon),
a.button:has(.icon) {
    display: flex;
    align-items: center;
    column-gap: 0.25em;
}

button:not(.nobutton),
a.button {
    text-wrap: nowrap;
    font: inherit;
    border: none;
    outline: none;
    color: currentColor;
    text-decoration: none;
    line-height: 1;
    background-color: transparent;

    cursor: pointer;
    user-select: none;

    font-size: 0.875rem;
    display: flex;
    align-items: center;
    position: relative;
    padding-inline: 0.75rem;

    height: var(--button-height);
    padding-bottom: 2px;

    /* border-radius: 8px; */
}

button:not(.nobutton)::before,
a.button::before {
    content: "";
    inset: 0;
    background-color: white;
    position: absolute;
    z-index: -1;
    bottom: 2px;
    border: 2px solid var(--color-border);
    box-shadow: 0 2px 0 var(--color-border);
    border-radius: 8px;
}

button:not(.nobutton):active,
a.button:active {
    padding-bottom: 0;
    padding-top: 2px;
}

button:not(.nobutton):active::before,
a.button:active::before {
    box-shadow: none;
    bottom: 0;
    top: 2px;
}

:where(input[type="text"]),
:where(input[type="password"]),
:where(input[type="number"]) {
    font: inherit;
    background-color: white;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    height: var(--button-height);
    padding-inline: 0.5rem;
    font-size: 0.875rem;
}

textarea {
    font: inherit;
    display: block;
    width: 100%;
    background-color: white;
    border-radius: 8px;
    border: 2px solid var(--color-border);
    resize: vertical;
    padding: 0.25rem 0.5rem;
}

button:not(.nobutton):focus-visible,
a.button:focus-visible,
:where(input[type="text"]:focus-visible),
:where(input[type="number"]:focus-visible),
:where(input[type="password"]:focus-visible),
textarea:focus-visible {
    --color-border: var(--color-focus-outline);
}

.icon {
    display: inline-block;
    flex-shrink: 0;

    width: 1.25em;
    height: 1.25em;

    --icon-stroke-width: 2;
}

.icon--sm {
    width: 1em;
    height: 1em;
}

.icon--lg {
    width: 1.5em;
    height: 1.5em;
}

.icon--xl {
    width: 2em;
    height: 2em;
}

.icon--thin {
    --icon-stroke-width: 1.5;
}

.icon--bold {
    --icon-stroke-width: 2.5;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.chip {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.ingredients-section-heading {
    display: flex;
    gap: 0.5rem;
}

.ingredients-section-heading__label {
    position: relative;
}

.ingredients-section-heading__label-text {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.ingredients-section-heading__input {
    padding-left: 5rem;
}

.ingredient {
    display: flex;
    gap: 0.5rem;
}

.new-ingredients-section-button {
    display: block;
    margin-top: 2rem;
}


.spacing>*+* {
    margin-top: 1rem;
}

.spacing-small>*+* {
    margin-top: 0.5rem;
}

.spacing-large>*+* {
    margin-top: 2rem;
}

.mt-large {
    margin-top: 2rem;
}

.keep-line-breaks {
    white-space: pre-wrap;
}

.shadow {
    box-shadow: 0 1px 4px hsl(0 0% 0% / 0.2);
}

.shadow-lg {
    box-shadow: 0 2px 8px hsl(0 0% 0% / 0.1);
}
