﻿:root {
    --font-playfair: "Playfair Local";
    --font-garamond: "Garamond Local";
    --font-georgian: "Georgian Local";

    --color-black: rgba(0, 0, 0, 1.0);
    --color-white: rgba(255, 255, 255, 1.0);
    --color-white-90: rgba(255, 255, 255, 0.9);
    --color-brand: rgba(158, 181, 3, 1.0);
    --color-brand-10: rgba(158, 181, 3, 0.1);
    --color-brand-20: rgba(158, 181, 3, 0.2);
    --color-text: rgba(67, 67, 67, 1.0);
    --color-background: rgba(238, 238, 238, 1.0);

    --max-width: 1152px;
    --shadow: 0.25rem 0.25rem 1rem rgba(0, 0, 0, 0.5);
    --animation: 0.125s ease-in-out;
}

@font-face {
    font-family: "Garamond Local";
    font-display: swap;
    src: url("../fonts/EBGaramond-VariableFont_wght.woff") format('woff');
}

@font-face {
    font-family: "Playfair Local";
    font-display: swap;
    src: url("../fonts/PlayfairDisplay-VariableFont_wght.woff") format('woff');
}

@font-face {
    font-family: "Georgian Local";
    font-display: swap;
    src: url("../fonts/NotoSansGeorgian-VariableFont.woff") format('woff');
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

body {
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    width: 100%;
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-georgian), sans-serif;

    & > header {
        display: block;
        position: sticky;
        top: 0;
        z-index: 16;
        background-color: var(--color-white);

        & > section {
            padding: 1rem;
            max-width: var(--max-width);
            margin: 0 auto;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;

            & > brand {
                width: 6rem;
                height: auto;
                display: flex;
                border-radius: 1rem;

                & > a {
                    display: flex;
                    width: 100%;
                    height: auto;
                    -webkit-tap-highlight-color: transparent;
                    border-radius: 1rem;
                    padding: 0.5rem;
                    margin: 0 0 0 -0.5rem;

                    &:hover,
                    &:focus {
                        outline: 0.125rem solid var(--color-brand);
                    }

                    & > svg {
                        width: 100%;
                        height: auto;
                    }
                }
            }
        }
    }

    & > nav {
        display: block;
        position: fixed;
        z-index: 16;
        background-color: var(--color-white);
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        max-width: 25rem;
        box-shadow: var(--shadow);
        transition: transform var(--animation);
        transform: translateX(calc(100% + 1rem));
        overflow-x: auto;

        & > section {
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;

            & > header {
                display: flex;
                flex-direction: column-reverse;
                margin-bottom: 2.5rem;

                & > brand {
                    align-self: center;
                }

                & > button {
                    align-self: start;
                }
            }
        }
    }

    &.nav-open {
        overflow: hidden;
        & > nav {
            transform: translateX(0);
        }
    }

    & > main {
        animation: fadeIn .25s ease-in both;
        animation-iteration-count: 1;
        & > article {
            max-width: var(--max-width);
            margin: 0 auto;
            padding: 1.25rem;
        }
    }

    & > footer {

    }

    figure {
        margin: 0;
        padding: 0;
        width: 100%;
        height: auto;
        aspect-ratio: 9/16;
        max-height: 65vh;
        overflow: hidden;

        & > img {
            width: 100%;
            height: auto;
            object-fit: contain;
            object-position: top;
            display: block;
            filter: grayscale(1);
            transform: translateY(-3%);
            z-index: 0;
        }

        & > figcaption {
            display: none;
        }
    }

    h1, h2, h3, h4, h5, h6 {
        text-align: center;
        font-family: var(--font-playfair), serif;
    }

    button {
        border: none;
        background-color: transparent;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem;
        border-radius: 99rem !important;
        -webkit-tap-highlight-color: transparent;

        &:hover {
            background-color: var(--color-brand-10);
        }

        &:active {
            background-color: var(--color-brand-20);
        }
    }

    ol {
        padding-left: 1rem;

        & > li {
            margin-bottom: 1rem;
        }
    }

    menu {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        list-style: none;
        margin: 0;
        padding: 0 0 3rem 0;

        & > li {
            display: block;
            flex: 1;
            width: 100%;

            & > a {
                display: block;
                padding: 0.5rem 1.75rem;
                text-align: center;
                text-decoration: none;
                color: var(--color-text);
                border-radius: 999rem;
                outline-offset: 0.125rem;
                -webkit-tap-highlight-color: transparent;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;

                &:hover,
                &:focus {
                    outline: 0.125rem solid var(--color-brand);
                }

                &.active {
                    background-color: var(--color-brand);
                    color: var(--color-white);
                }
            }
        }
    }

    p + details {
        margin-block-start: 2rem;
    }

    details {
        display: flex;
        flex-direction: column;
        margin-block-end: 1rem;
        background-color: var(--color-white);
        border-radius: 1.75rem;
        outline: 0.125rem solid transparent;

        & > summary {
            cursor: pointer;
            list-style: none;
            border-radius: 999rem;
            background-color: var(--color-white);
            color: var(--color-text);
            padding: 1rem 1.5rem;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
            outline: none !important;
            outline-offset: 0.125rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        &[open] {
            & > summary {
                background-color: var(--color-brand);
                color: var(--color-white);
            }
        }

        & > summary::-webkit-details-marker {
            display: none;
        }

        & > *:not(summary) {
            padding: 1rem 1.5rem;
        }

        & > p:last-child {
            margin-block-end: 1.5rem;
        }

        & + p {
            margin-block-start: 2rem;
        }

        &:hover:not([open]),
        &:focus-within:not([open]) {
            outline: 0.125rem solid var(--color-brand);
        }
    }

    @media(min-width: 1152px) {

        & > header {
            position: relative;

            & > section {
                justify-content: center;

                & > brand {
                    width: 15rem;
                    margin: 2rem;

                    & > a {
                        margin: 0;
                    }
                }
                & > button {
                    display: none;
                }
            }
        }

        & > nav {
            background-color: var(--color-white);
            position: sticky;
            top: 0;
            width: 100%;
            height: auto;
            box-shadow: none;
            transition: none;
            transform: translateX(0);
            max-width: unset;
            overflow: none;

            & > section {
                max-width: var(--max-width);
                margin: 0 auto;

                & > header {
                    display: none;
                    flex-direction: column-reverse;
                }
            }
        }

        h1, h2, h3, h4, h5, h6 {
            text-align: left;
        }

        menu {
            flex-direction: row;
            justify-content: space-between;
            padding: 0;

            & > li {
                flex: 0;
                width: auto;

                & > a {
                    border-radius: 0.5rem;
                }
            }
        }

        &.nav-open {
            overflow: auto;
        }
    }
}
