/* Shared layout for the existing JavaScript album viewers. */
html, body {
    margin: 0;
}

.header {
    box-sizing: border-box;
    z-index: 20;
    padding: 8px 12px;
}

.header form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin: 0;
}

.album-option {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.header label, .header select, .header button, .header input {
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.25;
    margin: 0;
}

.header select, .header button, .header input {
    min-height: 44px;
    max-width: 100%;
    padding: 6px 8px;
}

.header input {
    width: 3.5em;
}

.header button, .header select {
    cursor: pointer;
}

.header :focus-visible, .footer :focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.nav {
    pointer-events: none;
}

.nav label {
    pointer-events: auto;
    width: min(15%, 160px);
}

#overlay > div {
    box-sizing: border-box;
    max-width: calc(100% - 24px);
}

@media (max-width: 700px) {
    .header {
        padding: 8px;
    }

    .header form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .album-option {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        text-align: left;
    }

    .header select, .header input, .header button {
        width: 100%;
        min-width: 0;
    }

    .header form > button:only-of-type {
        grid-column: 1 / -1;
    }

    .nav label {
        width: 44px;
        opacity: .55;
    }

    #footerNav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        height: 44px !important;
        bottom: 0;
    }

    #footerNav label {
        position: static;
        height: 44px !important;
        font-size: 18px;
        line-height: 20px;
        opacity: .8;
    }

    #prev100 { order: 1; }
    #prev10 { order: 2; }
    #next10 { order: 3; }
    #next100 { order: 4; }

    #thumbnails {
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 62px !important;
    }

    #thumbnails table {
        width: 100%;
        table-layout: fixed;
        border-spacing: 2px;
    }

    #thumbnails td {
        padding: 0;
    }

    #thumbnails td img {
        display: block;
        width: 100%;
        height: 54px;
        object-fit: contain;
        margin: 0;
    }
}

/* Links remain part of the measured header and hide with slideshow controls. */
.album-site-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 8px; }
.album-site-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid #bbb; border-radius: 5px; color: #fff; font: 16px/1.25 Arial, Helvetica, sans-serif; text-decoration: none; }
.album-site-nav a:visited { color: #fff; }
.album-site-nav a:hover { background: #444; }
