:root {
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;

  color-scheme: light dark;
  --feed-orange: #ffa844;
  --font-color: light-dark(rgb(34 34 34), #D0D0D0);
  --font-strong-color: light-dark(rgb(0 0 0), #E0E0E0);
  --back-color: light-dark(#fff, #222);
  --footer-back-color: var(--feed-orange);

  background-color: var(--back-color);
  color: var(--font-color);
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex; /* main & footer */
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 { /* :heading */
  color: var(--font-strong-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  inline-size: fit-content;
  margin-inline: auto;
}
figcaption {
  contain: inline-size;
}

main {
  flex: 1 0 auto;
  padding: 2rem;
}

footer {
  flex-shrink: 0;
  padding: 1rem 2rem;
  background-color: var(--feed-orange);
  color: #fff;
  a {
    color: #fff;
  }
}

.sitecolumn {
  max-width: 56rem;
  margin: 0 auto;
  @media screen and (min-width: 80rem) {
    margin-left: 10rem;
  }
}

h1 {
  font-size: 1.85rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.05rem;
}

p, li {
  text-wrap: pretty;
}

a {
  color: var(--font-color);
}

a[href^='https://github.com/StigNygaard/']::after {
  content: '';
  background-image: url(./GitHub-Mark-Light-32px.png);
  background-size: .8lh .8lh;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
  width: 1lh;
  height: 1lh;
  filter: invert(1);
  opacity: 0.8;
  vertical-align: bottom;
}

ul {
  margin-inline-start: 0;
  padding-inline-start: 20px;
}

li {
  margin-bottom: .2em;
}

ul ul {
  margin-block-start: .2em;
}

ul.feeds > li {
  list-style-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient x1="0.085" y1="0.085" x2="0.915" y2="0.915" id="RSSg"><stop offset="0.0" stop-color="%23E3702D"/><stop offset="0.1071" stop-color="%23EA7D31"/><stop offset="0.3503" stop-color="%23F69537"/><stop offset="0.5" stop-color="%23FB9E3A"/><stop offset="0.7016" stop-color="%23EA7C31"/><stop offset="0.8866" stop-color="%23DE642B"/><stop offset="1.0" stop-color="%23D95B29"/></linearGradient></defs><rect width="256" height="256" rx="55" ry="55" x="0" y="0" fill="%23CC5D15"/><rect width="246" height="246" rx="50" ry="50" x="5" y="5" fill="%23F49C52"/><rect width="236" height="236" rx="47" ry="47" x="10" y="10" fill="url(%23RSSg)"/><circle cx="68" cy="189" r="24" fill="%23FFF"/><path d="M160 213h-34a82 82 0 0 0 -82 -82v-34a116 116 0 0 1 116 116z" fill="%23FFF"/><path d="M184 213A140 140 0 0 0 44 73 V 38a175 175 0 0 1 175 175z" fill="%23FFF"/></svg>');

  &::marker {
    font-size: 1.8em;
    line-height: 0.1em;
  }
}

img.logo {
  display: block;
  width: fit-content;
  float: right;
  padding: 0 0 1rem 1rem;
  margin: -5px -5px 0 0;
  &.feedicon {
    width: 128px;
  }
}

img.colorinline {
  display: inline;
  height: 1.2cap;
  width: auto;
  margin: 0;
  padding: 0.2em 0 0 0;
  background-color: var(--feed-orange);
}

.peek {
  position: relative;
  display: inline-block;

  .peek-popup {
    display: none;
    position: absolute;
    z-index: 1;
    top: 0.8lh; /* See '@media screen' later for large width screens... */
    left: -5rem;
    width: 28rem;
    min-width: 20rem;
    max-width: 80svw;
    height: 30rem;
    min-height: 20rem;
    max-height: 50svh;
    background-color: #fff;
    border: 2px solid var(--feed-orange);
    border-radius: .5rem;
    box-shadow: #777 0 0 .5rem 0;
    color: #000;
    padding: .2rem .7rem;
    font-size: 80%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain; /* prevent scroll chaining from happening */
    background-image: url("loading.gif"); /* initial load spinner */
    background-position: center;
    background-repeat: no-repeat;

    &.fetched {
      background-image: none; /* remove load spinner */
    }
    a {
      color: #000;
    }
    h3 {
      margin: .3rem 0;
    }
    .peek-item {
      padding-bottom: .3rem;
      clear: left;
      img {
        max-width: 8rem;
        max-height: 6rem;
        float: left;
        margin: 0 .6em .1em 0;

        &[src=""] {
          display: none;
        }
      }
      .byline {
        display: block;
        font-size: 85%;
      }
      h4 {
        margin: .5em 0 .25em 0;
      }
      p {
        margin: 0;
      }
      .item-categories {
        margin-top: .2em;
        font-size: 70%;
        font-style: italic;
        color: #777;
      }
    }
    .error {
      color: red;
    }
  }

  &:hover .peek-popup {
    display: block;
  }
}

@media screen and (min-width: 42rem) {
  .peek .peek-popup {
    top: -12lh;
    left: 1em;
    height: 38rem;
    max-height: 60svh;
  }
}
