:root {
    color-scheme: light dark;
    interpolate-size: allow-keywords;
}

@font-face {
  font-family: 'repeat';
  src:  url('repeat.eot?1jgf87');
  src:  url('repeat.eot?1jgf87#iefix') format('embedded-opentype'),
    url('repeat.ttf?1jgf87') format('truetype'),
    url('repeat.woff?1jgf87') format('woff'),
    url('repeat.svg?1jgf87#repeat') format('svg');
}

body {
    font-family: sans-serif;
    margin: 0 auto;
    padding: 0;
    background-color: #374757;
    color: #e7e7e7;
    max-width: 40rem;
}

h1 {
    text-align: center;
    margin: 0 0 3rem;
    font-size: 3rem;
}
h1, .weekday {
    font-variant: small-caps;
    letter-spacing: 0.4rem;
}
h1 #wtf {
    text-decoration: none;
}

h2 {
    margin: 0 0;
    position: sticky;
    top: 0;
    background-color: #374757;
    z-index: 1;
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: center;
}
.date {
    display: inline-flex;
    flex-flow: column nowrap;
    justify-content: center;
    border: 1px solid black;
    background-color: #ffffff;
    background-color: light-dark(#ffffff, #444);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    color: #444;
    color: light-dark(#444, #ffffff);
    font-weight: 900;
    text-align: center;
    width: 5.5rem;
    height: 5.5rem;
    margin: -0.5rem 0;
}
/* saturday */
.date.wd5 {
    color: #ccc;
    color: light-dark(#999, #ccc);
}
/* sunday */
.date.wd6 {
    color: #d33;
}
.date .day {
    align-self: center;
    font-size: 3rem;
    line-height: 1em;
    letter-spacing: -0.15rem;
}
.date .month {
    align-self: center;
    font-size: 0.9rem;
    font-variant-caps: small-caps;
}
.weekday {
    font-size: 2.5rem;
    align-self: center;
    flex-grow: 1;
    text-align: center;
}

.temperature {
    overflow: hidden;
    line-height: 1rem;
    font-size: 0.8rem;
    text-align: right;
    align-self: center;
    text-shadow: 0px 0px 1.5px black;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.temperature .min {
    display: inline-block;
    padding-right: 0.35rem;
    color: #8df;
}
.temperature .max {
    display: inline-block;
    padding-right: 0.35rem;
    color: #f90;
}

article {
    background-color: #f7f7f7;
    background-color: light-dark(#f7f7f7, #222);
    color: #222;
    color: light-dark(#222, #f7f7f7);
    margin: 0 0 0 2rem;
    padding: 0.8rem 1rem;
    clear: both;
    line-height: 1.3rem;
    min-height: 3.5rem;
    max-height: 9rem;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}
article:first-of-type {
    border-top-right-radius: 0.7rem;
}
article:last-of-type {
    border-bottom-right-radius: 0.7rem;
}

article.now {
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='7'><polygon points='0,0 4,6 8,0' style='fill: rgb(255, 127, 63)'/></svg>");
    background-repeat: repeat-x;
    background-position: center top;
}

.filtered-out {
    min-height: 0;
    max-height: 0;
    transition: max-height 0.3s ease-in-out;
}

.filtered-out .location {
    min-height: 0;
}

article p {
    margin: 0 0;
}

a {
    text-decoration: none;
    color: #000;
    color: light-dark(#000, #fff);
}

h3 {
    margin: 0;
}

h3 a {
    color: #222;
    color: light-dark(#222, #ddd);
}

.passed h3 a {
    color: #777;
    color: light-dark(#666, #888);
}

.time {
    position: absolute;
    transform: rotate(270deg) translate(-0.25rem, -8.54rem);
    width: 6rem;
    text-align: right;
    transform-origin: top right;
    color: #F7F7F7;
    text-shadow: 0 -1px 1px black, -1px 0 1px black, 1px 0 1px black, 0 1px 1px black;
    font-weight: 500;
    font-size: 85%;
    line-height: 1.5rem;
    white-space: nowrap;
}
.time a {
    color: #F7F7F7;
    font-weight: bold;
}
.time .dtend {
    display: none;
}
.weather-condition {
    position: absolute;
    transform: translate(-4.5rem, 0.6rem);
    font-size: 1.5rem;
    color: white;
}
.recurrence {
    color: #E7E7E7;
    font-family: 'repeat';
    display: inline-block;
    transform: rotate(90deg) scale(1.2) translate(0.15rem, 0);
    padding-right: 0.2rem;
}
.location {
    margin-top: 0.5rem;
    line-height: 1.1em;
    min-height: 1.1em;
}
.passed .location {
    color: #777;
    color: light-dark(#666, #888);
}


footer {
    margin: 4rem auto 1.5rem;
    text-align: center;
}
footer p {
    margin: 0.5rem 0;
}
footer a {
    color: #f7f7f7;
    text-decoration: underline;
    font-size: 85%;
    font-weight: 500;
}

button.filter {
    cursor: pointer;
    z-index: 1000;
    position: fixed;
    right: 3vh;
    bottom: 3vh;
    width: 3rem;
    height: 3rem;
    border-radius: 100%;
    font-family: 'repeat';
    background-color: #9F007F;
    color: #FFF;
    font-weight: bold;
    line-height: 1.5rem;
    font-size: 1.5rem;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.5);
}
button.filter.toggled:before {
    content: "";
    border-top: 3.5px solid #FFF;
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: rotate(45deg);
}

@media (width > 85rem) {
    body {
        margin-top: 7rem;
    }
    h1 {
        position: fixed;
        top: 0;
        animation: h1-animation ease-in-out both infinite;
        animation-timeline: scroll(y);
    }
    footer {
        position: fixed;
        top: 0;
        right: 0;
        margin: 1rem;
        text-align: right;
    }
}
@keyframes h1-animation {
    from {
        left: calc(50% - 6ex);
    }
    0.1% {
        left: 8px;
    }
    to {
        left: 8px;
    }
}
