:root {
    --accent-colour: #ff8800;
    --accent-colour-dark: #cd6d00;
    --recipe-box-background: #fff0e6;
    --light-box-background: #fffaf0;
    --dark-box-background: #ffdcb8;
}

* {
    box-sizing: border-box;
    font-family: Georgia, serif;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: normal;
}

body {
    margin: 0px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
}

.site-header {
    position: sticky;
    display: block;
    top: 0;
    z-index: 1000;
    background-color: rgb(230, 230, 230);
    font-size: 1.6rem;
    border-top: 2px solid var(--accent-colour);
    border-bottom: 1px solid rgb(228, 228, 228);
}

.header-wide-grouping {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

/* To ensure height is consistent with site-title-block */
.header-wide-nav {
    display: flex;
}

.header-small-grouping {
    display: none;
}

.header-small-heading {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    padding-right: 15px;
}

.header-small-nav {
    width: 100%;
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    text-align: right;
    font-size: 1.5rem;
    border-top: 2px solid var(--accent-colour);
}

.header-small-nav-active {
    display: flex;
}

.site-title-block {
    padding: 10px 30px;
    margin-right: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

.site-title-block div {
    margin: 0;
    padding: 0;
    font-size: 1.6rem;
}

.site-title-block img {
    margin-right: 10px;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.top-level-links {
    padding: 10px 30px;
}

.top-level-links,
.site-title-block {
    text-decoration: none;
    color: black;
}

.site-header a:hover,
.site-header .search-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    cursor: pointer;
}

.burger-container {
    margin: auto 0px;
    display: inline-block;
    cursor: pointer;
}

.burger-container .bar1,
.burger-container .bar2,
.burger-container .bar3 {
    width: 32px;
    height: 5px;
    background-color: black;
    margin: 6px 0;
    transition: 0.4s;
}

.burger-select .bar1 {
    transform: translate(0, 11px) rotate(45deg);
}

.burger-select .bar2 {
    opacity: 0;
}

.burger-select .bar3 {
    transform: translate(0, -11px) rotate(-45deg);
}

.search-button {
    border: none;
    text-align: right;
    font: inherit;
    color: inherit;
    background-color: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Display small height dialog, height expands as content fills */
.search-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 800px;
    max-height: 75vh;
    overflow: auto;
    margin-top: 8vh;
    margin-bottom: auto;
    background-color: rgba(255, 255, 255, 0.98);
    border: 1px solid grey;
    border-radius: 4px;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1), 0 4px 10px 0 rgba(0, 0, 0, 0.08);
}

.search-dialog::backdrop {
    background-color: rgba(255, 255, 255, 0.90);
}

dialog.search-dialog[open] {
    opacity: 1;
    transform: translateY(0);
}

/* Closed state */
dialog.search-dialog {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.2s ease-out,
        transform 0.2s ease-out,
        overlay 0.2s ease-out allow-discrete,
        display 0.2s ease-out allow-discrete;
}

@starting-style {
    dialog.search-dialog[open] {
        opacity: 0;
        transform: translateY(20px);
    }
}

.search-container {
    display: flex;
    flex-direction: column;
    padding: 5px;
    margin: auto;
    height: 100%;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
}

.search-input {
    display: block;
    margin: auto;
    width: 90%;
    padding: 8px;
    border: 1px solid var(--accent-colour);
    border-radius: 8px;
    font-size: 16px;
    background-color: #f9f9f9;
    color: #333;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-colour-dark);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex-grow: 1;
    padding: 10px 25px;
}

.search-result {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid black;
    border-radius: 10px;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1), 0 4px 10px 0 rgba(0, 0, 0, 0.08);

    /* Remove link styling */
    text-decoration: none;
    color: black;

    /* Slide up animation, delay added in js */
    opacity: 0;
    animation: slideUpFadeIn 0.4s ease-out forwards;
}

.search-result-message {
    padding-left: 5px;
    margin: 0;
}

mark {
    background-color: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}

.search-result:hover {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.2);
}

.search-result img {
    width: 180px;
    height: 135px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.search-result .text-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.text-container .result-title {
    line-height: inherit;
    font-size: 1.2rem;
    margin: 0 5px;
    font-weight: bold;
    overflow: hidden;
}

.text-container .result-description {
    line-height: inherit;
    font-size: 1rem;
    margin: 0 5px;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-search {
    margin: auto 0px;
    display: inline-block;
    cursor: pointer;
}

.close-search .bar1,
.close-search .bar2 {
    width: 32px;
    height: 5px;
    background-color: black;
    margin: 6px 0;
}

.close-search .bar1 {
    transform: translateY(5.5px) rotate(45deg);
}

.close-search .bar2 {
    transform: translateY(-5.5px) rotate(-45deg);
}

.page-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.page-intro-image {
    width: 100%;
    height: 20vw;
    max-width: 1800px;
}

.page-intro-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-intro-text-container {
    width: 75%;
    text-align: center;
}

.page-intro-title {
    margin-top: 25px;
    margin-bottom: 25px;
    font-size: 2.5rem;
    font-weight: normal;
}

.page-intro-secondary-title {
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.page-intro p {
    margin: 15px;
}

.toplevel-page-image {
    text-align: center;
    padding-bottom: 20px;
}

.toplevel-page-image img {
    width: 40px;
}

.post-thumbnail-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 40px 4%;
    padding-bottom: 20px;
}

.post-thumbnail-container a {
    display: block;
    text-decoration: none;
    color: black;
    width: 100%;
    max-width: 350px;
}

.post-thumbnail {
    height: 100%;
    height: 340px;
    text-align: center;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.post-thumbnail:hover {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.5), 0 6px 20px 0 rgba(0, 0, 0, 0.3);
}

.type-icon {
    position: absolute;
    margin: 8px;
    padding: 5px;
    background: white;
    border-radius: 5px;
    right: 0;
}

.post-thumbnail img {
    width: 100%;
    height: 60%;
    object-fit: cover;
}

.post-thumbnail-title {
    font-size: 1.5rem;
    line-height: 1.4;
    margin: 0px 20px;
    padding-bottom: 5px;
}

.post-thumbnail-description {
    margin: 0px 10px;
}

.footer-content-page-container {
    max-width: 1200px;
    width: clamp(600px, 65%, 952px);
    margin: auto;
    font-size: 1.2rem;
}

.footer-item-container {
    padding-left: 20px;
    padding-bottom: 10px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
}

.footer-item-container a {
    margin: 10px 15px;
    text-decoration: none;
    color: black;
    font-size: 1.2rem;
}

.break-word {
    overflow-wrap: break-word;
}

/* Small device */
@media (max-width: 767px) {
    .header-small-grouping {
        display: block;
    }

    .header-wide-grouping {
        display: none;
    }

    .search-button {
        justify-content: right;
    }

    /* Display almost full screen dialog with fixed height */
    .search-dialog {
        padding: 10px;
        margin: auto;
        max-height: revert;
        max-width: 92%;
        width: 100%;
        height: 90vh;
    }

    .search-container {
        padding: 0;
    }

    .search-header {
        gap: 5px;
    }

    .search-input {
        font-size: 15px;
    }

    .search-results {
        padding: 0 5px;
    }

    .search-result .text-container {
        line-height: 1.3;
    }

    .text-container .result-title {
        font-size: 1rem;
        margin: 0;
    }

    .text-container .result-description {
        font-size: 0.8rem;
        margin: 0;
    }

    .search-result {
        flex-direction: column;
        justify-content: center;
    }

    .search-result img {
        width: 100%;
    }

    .site-title-block {
        padding: 10px 10px;
        margin-right: 0;
    }

    .site-title-block div {
        font-size: clamp(1rem, 6.5vw, 1.5rem);
    }

    .site-title-block img {
        margin-right: clamp(1px, 2.5vw, 10px);
        height: clamp(18px, 8.5vw, 32px);
    }

    .header-small-links {
        font-size: 1.4rem;
    }

    .page-intro {
        margin-bottom: 15px;
    }

    .page-intro-image {
        height: 40vw;
    }

    .page-intro-text-container {
        width: 95%;
    }

    .page-intro-title {
        line-height: 1.4;
    }

    .page-intro-secondary-title {
        line-height: 1.4;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .post-thumbnail-container {
        margin: 0 20px;
    }

    .post-thumbnail-title {
        margin: 0 5px;
        line-height: 1.3;
    }

    .post-thumbnail-description {
        line-height: 1.3;
    }

    .footer-content-page-container {
        width: 95%;
    }

    .footer-item-container {
        padding-left: 5px;
    }
}

/* Medium device */
@media (min-width: 768px) and (max-width: 991px) {
    .header-small-grouping {
        display: none;
    }

    .header-wide-grouping {
        display: flex;
    }

    .page-intro-image {
        height: 25vw;
    }

    .page-intro-text-container {
        width: 85%;
    }

    .footer-content-page-container {
        width: 80%;
    }

}