:root {
    --color-yellow: #e0d44b;
    --color-yellow-light: #f6f2c9;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

body {
    padding-top: 107px;
}

#header_main {
    background: var(--color-yellow);
    position: fixed;
    top: 0;
    z-index: 100 !important;
    width: 100%;

    .stanford-branding {
        background: #2e2d29;

        .container {
            padding-block: .5rem;
            height: auto;
            line-height: 1;

            svg {
                width: auto;
                height: 1.875ex;
                path {
                    fill: #fff;
                }
            }
        }
    }

    .container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-block: 0;
        height: auto;

        &:after {
            content: none;
        }

        #logo {
            img {
                height: 2ex;
                width: auto;
            }
        }

        nav {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            padding: 2rem 0;
    
            ul {
                display: flex;
                flex-direction: row;
                justify-content: flex-end;
                align-items: center;
                list-style: none;
                margin: 0;
                padding: 0;
    
                li {
                    margin: 0 10px;
                    position: relative;

                    &.current-menu-item {
                        a {
                            text-decoration: underline;
                        }
                    }

                    ul {
                        display: none;
                        position: absolute;
                        background: var(--color-yellow);
                        padding: 10px;
                        border-radius: 0 0 5px 5px;
                        z-index: 100;
                        top: calc(100% + .5px);
                        left: 0;
                        width: auto;
                        li {
                            white-space: nowrap;
                        }
                    }

                    &:hover > ul {
                        display: block;
                    }
                }

                a {
                    font-size: 16px;
                    font-weight: 400;
                    color: #000;
                    text-decoration: none;
                    transition: all 0.3s ease;
                    text-underline-offset: .3em;
                    text-decoration-thickness: 1px;


                    &:hover {
                        text-decoration: underline;
                    }
                }
    
            }
        }
    }

    .header-burger {
        display: none;
        background: none;
        border: 0;
        padding: .5rem 0;
        margin: 0;
        line-height: 0;
        color: #000;
        cursor: pointer;

        span {
            display: block;
            position: relative;
            width: 24px;
            height: 2px;
            background: currentColor;
            transition: background 0.2s ease;

            &:before,
            &:after {
                content: '';
                position: absolute;
                left: 0;
                width: 100%;
                height: 2px;
                background: currentColor;
                transition: transform 0.2s ease, top 0.2s ease;
            }

            &:before {
                top: -7px;
            }

            &:after {
                top: 7px;
            }
        }
    }

    &.is-menu-open .header-burger span {
        background: transparent;

        &:before,
        &:after {
            top: 0;
        }

        &:before {
            transform: rotate(45deg);
        }

        &:after {
            transform: rotate(-45deg);
        }
    }

    /* Below the desktop breakpoint the header goes back into the flow. A fixed
       header here costs too much vertical space, and its height changes when the
       menu opens, which no single body padding-top can track. */
    @media (max-width: 989px) {
        position: static;

        .header-burger {
            display: block;
        }

        .container {
            flex-wrap: wrap;
            row-gap: 0;
            padding-block: .5rem;

            nav {
                display: none;
                width: 100%;
                justify-content: flex-start;
                padding: .5rem 0 1rem;

                ul {
                    flex-direction: column;
                    align-items: stretch;
                    justify-content: flex-start;
                    width: 100%;

                    li {
                        margin: 0;
                        border-top: 1px solid rgba(0, 0, 0, .12);

                        /* Hover submenus are unreachable on touch, so show them inline. */
                        ul {
                            display: flex;
                            position: static;
                            width: auto;
                            padding: 0 0 .5rem 1rem;
                            background: none;
                            border-radius: 0;

                            li {
                                border-top: none;
                            }
                        }
                    }

                    a {
                        display: block;
                        padding: .6rem 0;
                    }
                }
            }
        }

        &.is-menu-open .container nav {
            display: flex;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .header-burger span,
        .header-burger span:before,
        .header-burger span:after {
            transition: none;
        }
    }
}

@media (max-width: 989px) {
    body {
        padding-top: 0;
    }
}

#hero-home {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 2rem;

    padding-right: 0;
    padding-bottom: 5rem;

    &:after {
        display: none;
    }

    hgroup {
        flex: 1 1 calc(55% - 2rem);
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-end;
        padding-bottom: 3rem;
        h1 {
            font-size: clamp(26px, 4.2vw, 40px) !important;
            font-weight: 300 !important;
            font-family: Geist, sans-serif;
            margin-bottom: 2rem;
            text-wrap: pretty;
            position: relative;

            span {
                position: relative;
                display: inline-block;
                /* bottom: 0; */
                /* right: 2ch; */
                height: 1.5ex;
                width: 5ch;
                overflow: visible;
                /* transform: translateY(50%) translateX(-10%); */
                img {
                    display: inline-block;
                    width: auto;
                    height: 3ex;
                    position: absolute;
                    top: 0;
                    left: 0;
                }
            }
        }

        p {
            max-width: 40ch;
            margin-right: 2rem;
            font-weight: 300 !important;
            text-wrap: balance;
            line-height: 1.2;
        }

        ul {
            font-weight: 300 !important;

            width: 100%;
            max-width: 40ch;
            margin: 2rem 2rem 0 0;
            padding: 0;
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            align-items: flex-start;
            gap: 1rem;
            li {
                list-style: none;
                margin: 0;
            }

            a {
                background: var(--color-yellow-light);
                padding: 10px 20px;
                border-radius: 2px;
                text-decoration: none;
                color: #000;
                font-size: 16px;
                font-weight: 400;
                font-family: Geist, sans-serif;
                transition: all 0.3s ease;

                &:hover {
                    background: var(--color-yellow);
                    color: #000;
                    text-decoration: none;
                }
            }
        }
    }

    figure {
        flex: 1 1 45%;
        aspect-ratio: 91/100;
        margin: 0;
        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }

    /* Stack, and stop bleeding the figure off the right edge. */
    @media (max-width: 989px) {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding-right: 50px;

        hgroup {
            align-items: flex-start;
            padding-bottom: 2rem;

            h1 {
                margin-bottom: 1.5rem;
            }

            p {
                max-width: none;
                margin-right: 0;
            }

            ul {
                max-width: none;
                margin: 1.5rem 0 0;
                flex-wrap: wrap;
            }
        }

        figure {
            aspect-ratio: 16/10;
        }
    }

    @media (max-width: 767px) {
        padding-inline: 25px;

        figure {
            aspect-ratio: 4/3;
        }
    }
}

#home-news {
    --news-gap: 2rem;
    --news-figure-ratio: 4 / 3;

    padding-block: 4rem;

    .news-track {
        display: flex;
        gap: var(--news-gap);
        margin: 0;
        padding: 0;
        list-style: none;

        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        scrollbar-width: none;

        &::-webkit-scrollbar {
            display: none;
        }

        &:focus-visible {
            outline: 2px solid #000;
            outline-offset: 4px;
        }
    }

    .news-slide {
        flex: 0 0 100%;
        scroll-snap-align: start;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--news-gap);
        align-items: center;
        margin: 0;
    }

    figure {
        margin: 0;

        img {
            display: block;
            width: 100%;
            height: auto;
            aspect-ratio: var(--news-figure-ratio);
            object-fit: cover;
        }

        /* Holds the slot open until artwork is supplied. */
        &:not(:has(img)) {
            aspect-ratio: var(--news-figure-ratio);
            background: var(--color-yellow-light);
        }

        figcaption {
            margin-top: .75rem;
            font-size: 14px !important;
            font-weight: 300 !important;
            line-height: 1.3;
        }
    }

    .news-body {
        max-width: 45ch;
        > span {
            font-size: 16px !important;
            font-weight: 300 !important;
            line-height: 1.4;
            text-wrap: pretty;
            margin: 0 0 1.5rem;
            display: inline-block;
            margin-bottom: 2.5rem;
        }

        h3 {
            font-size: 32px !important;
            font-weight: 300 !important;
            font-family: Geist, sans-serif;
            margin: 0 0 1rem;
            text-wrap: balance;
        }

        p {
            font-weight: 300 !important;
            line-height: 1.4;
            text-wrap: pretty;
            margin: 0 0 1.5rem;
        }
    }

    .news-cta {
        display: inline-block;
        font-size: 16px;
        font-weight: 400;
        font-family: Geist, sans-serif;
        color: #000;
        text-decoration: underline;
        text-underline-offset: .3em;
        text-decoration-thickness: 1px;
        transition: all 0.3s ease;

        &:hover,
        &:focus-visible {
            background: var(--color-yellow);
            text-decoration: none;
        }

        &.is-placeholder {
            opacity: .45;
            text-decoration-style: dashed;
        }
    }

    .news-dots {
        display: flex;
        justify-content: center;
        gap: .5rem;
        margin: 2rem 0 0;
        padding: 0;
        list-style: none;

        a {
            display: block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--color-yellow-light);
            transition: background 0.3s ease;

            &:hover,
            &:focus-visible {
                background: var(--color-yellow);
            }
        }
    }

    @media (max-width: 767px) {
        .news-slide {
            grid-template-columns: 1fr;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .news-track {
            scroll-behavior: auto;
        }
    }
}

#top #wrap_all
.home-news-list {
    --card-gap: 2rem;
    --card-thumb-ratio: 3 / 2;

    padding-block: 4rem;

    &:after {
        content: none;
    }

    > h2 {
        font-size: var(--enfold-font-size-theme-content) !important;
        text-transform: none;
        font-weight: 400;
        margin-bottom: 2rem;

        span {
            text-transform: uppercase;
        }
    }

    > ul {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--card-gap);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .news-card {
        position: relative;
        display: flex;
        flex-direction: column;
        margin: 0;
        transition: transform 0.3s ease;

        figure {
            margin: 0 0 1.25rem;

            img {
                display: block;
                width: 100%;
                height: auto;
                aspect-ratio: var(--card-thumb-ratio);
                object-fit: cover;
            }

            /* Holds the slot open when a post has no featured image. */
            &:not(:has(img)) {
                aspect-ratio: var(--card-thumb-ratio);
                background: var(--color-yellow-light);
            }
        }

        h3 {
            font-size: 22px !important;
            font-weight: 400 !important;
            font-family: Geist, sans-serif;
            line-height: 1.25;
            margin: 0 0 .75rem;
            text-wrap: pretty;

            a {
                color: #000;
                text-decoration: none;

                /* Stretches the title link over the whole card, so the card is
                   clickable but stays a single tab stop. */
                &:after {
                    content: '';
                    position: absolute;
                    inset: 0;
                }

                &:hover {
                    text-decoration: underline;
                    text-underline-offset: .2em;
                }
            }
        }

        p {
            font-size: 16px !important;
            font-weight: 300 !important;
            line-height: 1.4;
            text-wrap: pretty;
            margin: 0 0 1.25rem;
        }

        &:focus-within {
            outline: 2px solid #000;
            outline-offset: 6px;
        }
    }

    .news-card-cta {
        margin-top: auto;
        align-self: flex-start;
        background: var(--color-yellow-light);
        padding: 8px 16px;
        border-radius: 2px;
        font-size: 15px;
        font-weight: 400;
        font-family: Geist, sans-serif;
        color: #000;
        transition: background 0.3s ease;
    }

    .news-card:hover .news-card-cta,
    .news-card:focus-within .news-card-cta {
        background: var(--color-yellow);
    }

    @media (max-width: 989px) {
        > ul {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (max-width: 767px) {
        > ul {
            grid-template-columns: 1fr;
        }
    }
}


#home-sponsors {
    --sponsor-logo-height: 96px;
    --partner-logo-scale: .75;
    --logo-gap: 3rem;

    padding-block: 4rem;

    &:after {
        content: none;
    }

    ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .sponsor-logos {
        --logo-height: var(--sponsor-logo-height);

        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: var(--logo-gap);
    }

    /* Fixed columns so eight partners always land as two rows of four. */
    .partner-logos {
        --logo-height: calc(var(--sponsor-logo-height) * var(--partner-logo-scale));

        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--logo-gap);
        align-items: center;
        justify-items: center;
        max-width: 64rem;
        margin-inline: auto;
    }

    .sponsors-divider {
        font-size: 20px !important;
        font-weight: 300 !important;
        font-family: Geist, sans-serif;
        text-align: center;
        margin: 3rem 0;
    }

    /* Not .logo - Enfold owns that class for the site header logo and makes it
       position: absolute, which stacks every item on one spot. */
    .sponsors-item {
        display: flex;
        align-items: center;
        justify-content: center;
        height: var(--logo-height);
        margin: 0;

        a {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            transition: opacity 0.3s ease;

            &:hover,
            &:focus-visible {
                opacity: .6;
            }
        }

        /* Definite height, not max-height: one of the partner SVGs ships a
           viewBox with no width/height, and auto sizing that is unreliable.
           max-width plus contain lets wide wordmarks shrink without squashing. */
        img {
            display: block;
            height: var(--logo-height);
            width: auto;
            max-width: 100%;
            object-fit: contain;
        }
    }

    /* Keeps the grid legible while artwork is pending. */
    .sponsors-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        height: var(--logo-height);
        min-width: 10rem;
        padding-inline: 1rem;
        background: var(--color-yellow-light);
        border-radius: 2px;
        font-size: 14px;
        font-weight: 400;
        font-family: Geist, sans-serif;
        color: #000;
        text-align: center;
    }

    @media (max-width: 767px) {
        --logo-gap: 2rem;

        .partner-logos {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }
}

#home-ls-definition {
    padding-block: 4rem;
    background: #000;

    .container {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    img {
        width: 100%;
        max-width: 900px;
        height: auto;
    }
}


/* Other Pages */
#top .av-submenu-container .container {
    padding-inline: 50px !important;
}

#main.all_colors #sub_menu1 {
    /* position: sticky !important; */
    /* top: 51px !important; */
    display: none !important;
}

/* #top .av-submenu-container.av-sticky-submenu {
    top: 51px !important;
} */
 