body {
    font-family: sans-serif;
}
a {
    text-decoration: none;
}
h3 {
    font-size: 13pt;
    margin-bottom: 0.5em;
    margin-right: 5em;
}
#selector {
    width: 600px;
    margin: 5px auto;
    text-align: center;
}
#calendar, #instructions, #site-link {
    max-width: 750px;
    margin: 0 auto;
    text-align: center;
}
#site-link {
    margin-top: 0.75em;
}
.calendar {
    border: solid 1px #ccc;
    margin: 2px;
    padding: 0;
    display: inline-block;
    height: 11em;
    background-color: #fafafa;
    box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.3);
}

.month_header {
    text-align: right;
    font-size: 8px;
    margin-top: 3px;
    padding: 3px 5px;
}

.day {
    text-align: center;
    font-size: 8px;
    padding: 0;
    margin: 0 1px 1px 0;
    width: 15px;
    height: 15px;
    color: #aaa;
    position: relative;
}
.day > a, .day > div {
    display: inline-block;
    width: 1.8em;
    height: 2em;
    margin: 0;
    padding: 1em 0.5em 0 0.5em;
}
.day > a {
    background-color: #a3d2f2;
    color: #000;
}
.day > a:hover {
    background-color: #9ce;
}
.day > div.dots {
    display: block;
    height: auto;
    position: absolute;
    bottom: 0;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}
.dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: #4194ca;
    border-radius: 5px;
    margin: 0 1px;
}

#popup-underlay {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #000;
    opacity: 0.6;
    display: none;
}
#popup {
    position: fixed;
    overflow: auto;    
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
}
.popup-wrapper {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: auto;
    max-width: 95%;
    max-height: 95%;
    text-align: center;
    align-content: center;
}
#popup-content {
    text-align: left;
    width: auto;
    min-width: 380px;
    display: inline-block;
    background-color: #ccc;
    padding: 1em 3em;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    border-radius: 15pt;
    position: relative;
}
#popup-content h3 a, #popup-content p a {
    text-decoration: underline;
    color: #fff;
}
#popup-content p {
    font-size: 10pt;
    max-width: 500px;
}
.popup-image {
    display: flex;
}
.popup-video {
    text-align: center;
}
.popup-audio {
    width: 600px;
}
.popup-audio > audio {
    width: 100%;
}
#popup > .popup-prev {
    position: absolute;
    width: 50%;
}
#popup > .popup-next {
    position: absolute;
    width: 50%;
    left: 50%;
}
iframe {
    border: solid 1px #666;
}
.popup-image > img {
    image-rendering: pixelated;
    margin: auto;
}
/* render, photo, other hi-res stuff */
.popup-image > img.lg {
    width: 80vw;
}
.tools ul {
    display: inline-block;
    padding: 0;
    margin: 0 0 0.5em 0;
}
.tools li {
    list-style: none;
    display: inline-block;
    margin: 0 0.3em 0 0;
}
.tools li>img {
    width: 3em;
}

ul.ui-buttons {
    padding: 0;
    list-style: none;
    position: absolute;
    top: 1em;
    right: 3em;
}
ul.ui-buttons li {
    display: inline-block;
    margin: 0 0.2em 0.2em 0;
    padding: 0;
}
a.btn {
    display: block;
    width: 16px;
    height: 16px;
    text-align: center;
    border: solid 2px #fff;
}

@media (max-width: 600px) {
    #instructions {
        display: none;
    }
    #selector {
        width: auto;
    }
    .calendar {
        height: auto;
    }
    .month_header {
        font-size: 13px;
    }
    .day {
        font-size: 13px;
        width: 40px;
        height: 40px;
    }
    .day > a, .day > div {
        width: 40px;
        height: 40px;
        padding: 10px 0 0;
        box-sizing: border-box;
    }
    .popup-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        margin: 0;
        overflow: auto;
        align-content: start;
    }
    #popup-content {
        min-width: 100%;
        width: fit-content;
        box-sizing: border-box;
        padding: 1em 1em 70px;
        border-radius: 0;
        box-shadow: none;
    }
    #popup-content h3,
    #popup-content p,
    #popup-content .tools {
        max-width: calc(100vw - 2em);
        box-sizing: border-box;
    }
    ul.ui-buttons {
        position: fixed;
        top: 0.5em;
        right: 0.5em;
    }
    .popup-audio {
        width: 100%;
    }
    iframe {
        width: 90vw;
        height: 56vw;
    }
    .popup-wrapper .popup-prev,
    .popup-wrapper .popup-next {
        position: fixed;
        bottom: 0;
        height: 50px;
        width: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        z-index: 100;
        cursor: pointer;
        user-select: none;
    }
    .popup-wrapper .popup-prev { left: 0; }
    .popup-wrapper .popup-prev::after { content: '◀ prev'; }
    .popup-wrapper .popup-next { left: 50%; }
    .popup-wrapper .popup-next::after { content: 'next ▶'; }
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: #333;
        color: #ddd;
    }
    a {
        color: #ddd;
    }
    .calendar {
        border: solid 1px #666;
        background-color: #1f1f1f;
    }
    #popup-content {
        background-color: #222;
    }
    .day > a {
        background-color: #065386;
        color: #fff;
    }
    .day > a:hover {
        background-color: #0972b8;
    }
    .calendar {
        box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.75);
    }
}