* {
    box-sizing: border-box;
}

a {
    color: black;
    text-decoration: none;
    background-image: linear-gradient(#ffd34f, #ffd34f), linear-gradient(to right, #ff98c5, #ff9494, #ffbf00);
    background-size: 100% 0.1em, 0 0.1em;
    background-position: 100% 100%, 0 100%;
    background-repeat: no-repeat;
    transition: background-size 500ms;
    box-decoration-break: clone;
    /* `box-decoration-break: clone` is so that the "underline" background gradient continues across line breaks */
    /* If you add `display: inline-block`, the hover colour change starts from the start of the first line to the end of the first line before going to the next line. Whereas if you don't add it, all the lines of text will change colour simultaneously */
}

a:hover {
    background-size: 0 0.1em, 100% 0.1em;
}

body{
    font-family: "Figtree", sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fffbee;
}

footer {
    text-align: center;
    font-size: 0.8rem;
}

h1 {
    text-align: center;
    background-color: #fff2cc;
    padding: 0.5em;
    border-radius: 0.5em;
}

img {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    display: block;
    margin: auto;
}

img.small-img {
    max-height: 350px;
    margin-left: 0;
}

main {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 2rem;
    flex: 1;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.nav-links a {
    margin-left: 1rem;
}

.callout-block {
    background-color: #fff2cc;
    padding: 1rem;
    text-align: center;
}

.centered {
    text-align: center;
}

.horizontal-scroll {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-color: #d6cfb9 #fffbee;
    scrollbar-width: thin;
}

.horizontal-scroll img {
    margin: 0;
    max-height: 350px;
    width: auto;
    flex-shrink: 0;
}

.horizontal-scroll img.video-row {
    max-height: 400px;
}

.horizontal-scroll iframe {
    width: 225px;
    height: 400px;
    flex-shrink: 0;
    border: 0;
}

.horizontal-scroll-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.horizontal-scroll-wrapper::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 2.5rem;
    height: 100%;
    background: linear-gradient(to right, transparent, #fffbee);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
}

.horizontal-scroll-wrapper::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 100%;
    background: linear-gradient(to left, transparent, #fffbee);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
}

.horizontal-scroll-wrapper.at-start::before {
    opacity: 0;
}

.horizontal-scroll-wrapper.scrolled::before {
    opacity: 1;
}

.horizontal-scroll-wrapper.at-end::after {
    opacity: 0;
}

.horizontal-scroll-arrow {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.horizontal-scroll-arrow.left {
    left: 0.5rem;
}

.horizontal-scroll-arrow.left > .arrow {
    display: inline-block;
    transform: rotate(270deg);
}

.horizontal-scroll-arrow.right {
    right: 0.5rem;
}

.horizontal-scroll-arrow.right > .arrow {
    display: inline-block;
    transform: rotate(90deg);
}

.horizontal-scroll-wrapper.scrolled .horizontal-scroll-arrow.left {
    opacity: 1;
}

.horizontal-scroll-wrapper:not(.at-end) .horizontal-scroll-arrow.right {
    opacity: 1;
}

.horizontal-scroll-wrapper.at-start .horizontal-scroll-arrow.left {
    opacity: 0;
}

.horizontal-scroll-wrapper.at-end .horizontal-scroll-arrow.right {
    opacity: 0;
}

.horizontal-scroll-wrapper:not(.is-overflowing)::before,
.horizontal-scroll-wrapper:not(.is-overflowing)::after,
.horizontal-scroll-wrapper:not(.is-overflowing) .horizontal-scroll-arrow {
    opacity: 0;
}

.images-in-a-row {
    display: flex;
    gap: 0.5rem;
}

.images-in-a-row img {
    height: auto;
    width: auto;
    display: block;
}

.img-caption {
    color: gray;
    font-size: 0.9rem;
    text-align: center;
}

.recipe-index-list > li {
    margin-bottom: 0.5em;
}

.site-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.subtitle {
    margin-top: -0.5em;
    text-align: center;
    color: gray;
}

@media (max-width: 640px) {

    img.small-img {
        max-height: 250px;
    }

    .horizontal-scroll img {
        max-height: 250px;
    }
    .horizontal-scroll img.video-row {
        max-height: 300px;
    }

    .horizontal-scroll iframe {
        width: 170px;
        height: 300px;
    }

    .horizontal-scroll-arrow {
        font-size: 0.8rem;
    }

    .horizontal-scroll-arrow.left {
        left: 0.25rem;
    }

    .horizontal-scroll-arrow.right {
        right: 0.25rem;
    }

    .horizontal-scroll-wrapper::after,
    .horizontal-scroll-wrapper::before {
        width: 1.5rem;
    }
}