#site-header {
    display: grid;
}

#site-header-marks a {
    display: flex;
    height: 100%;
    max-width: 12em;
}

#site-header-wordmark {
    // Note that the wordmark's underline is drawn here, and is not a part of the SVG file.
    border-bottom: 3px solid var(--black);
    width: 100%;
}

.searchButton {
    position: absolute;
    right: var(--space);
    top: 50%;
    transform: translate(0, -50%);
    background: none;
    border-left: 1px solid var(--white);
    cursor: pointer;
    padding: var(--space);
}

#site-header-search-bar {
    padding: var(--space);
    height: 100%;
    font-size: calc(var(--space) * 2);
    border-bottom: 3px solid var(--black);
    width: 100%;
}

#site-header-search-bar::placeholder {
    color: white;
    font-weight: bold;
    font-family: 'Libre Caslon';
}

#site-header-search-bar:focus::placeholder {
    color: var(--blue-4);
}

#site-header-search-bar:hover {
    box-shadow: inset 0 0 6px 1px var(--blue-6), 0 0 3px .1px var(--blue-7);
    border-top: 2px solid var(--blue-6);
}

#site-header-search-bar:focus {
    outline: 3px solid var(--blue-6);
    background-color: var(--white);
    background-image: linear-gradient(90deg, var(--white), var(--blue-1) 80%);
    border-top: 2px solid var(--blue-7);
    box-shadow: none;
}

#site-header-search-bar:focus:hover {
    box-shadow: inset 0 0 6px 1px var(--blue-5);
}

#site-header-user {
    position: relative;
    margin-left: auto;
}

#site-header-user button {
    display: block;
    height: calc(100% - 3px);
    text-wrap: nowrap;
    padding-left: var(--space);
    padding-right: var(--space);
    border-bottom: 3px solid var(--black);
}

#site-header-user button:hover {
    box-shadow: inset 0 0 3px 3px var(--blue-5);
}

#site-header-user:focus-within button {
    background-image: none;
    background-color: var(--blue-4);
    box-shadow: 0 0 2px .5px var(--blue-7);
}

#site-header-user-links ul > .mw-list-item a {
    color: var(--blue-7);
}

@media (min-width: 1081px) {

    #site-header {
        grid-column: navstart / -1;
        grid-row: topstart;
        grid-template-columns: subgrid;
        grid-template-rows: subgrid;
        margin-top: var(--space);
    }

    #site-header-search form {
        height: 100%;
    }

    #site-header-marks {
        grid-column: 1;
        grid-row: 1;
        align-items: flex-start;
    }


    #site-header-marks {
        grid-row: 1;
    }

    #site-header-search, #site-header-search-bar {
        grid-column: pagestart / menustart;
        width: 100%;
        position: relative;
        overflow: visible;
    }

    #site-header-user {
        // margin-left: calc(var(--space) * 3);
        grid-column: menustart / pageend;
    }

}

@media (max-width: 1080px) {

    #site-header {
        grid-column: 1;
        grid-row: topstart / -1;
        grid-template-columns:
            [marks] auto
            [menu] 1fr
        ;
        grid-template-rows: 3em auto;
        row-gap: var(--space);
        column-gap: var(--space);
        margin: var(--space);
    }


    #site-header-search {
        grid-column: marks / -1;
    }

    #site-header-search form {
        position: sticky;
        align-self: flex-start;
        top: var(--space);
        z-index: 6;
    }

    #site-header-search {
        top: var(--space);
        grid-row: 2;
    }

}