:root {
  color-scheme: light dark;
  --text: CanvasText;
  --background: Canvas;
  --background-fade: rgba(0,0,0,0.5);
  --faded: GrayText;
  --list-row: CanvasText;
  --max-width: 60ch;
}

/* iOS temp fix */
@supports (background-color: -apple-system-control-background) and (color: text) {
  :root {
    --text: text;
    --background: -apple-system-control-background;
  }
}


/* ------ */
/* Global */
/* ------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  overflow-y: scroll;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
}

img,
picture {
  max-width: 100%;
  display: block;
}

input,
button,
textarea,
select {
  font: inherit;
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
   scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

::selection {
  background-color: GrayText;
  color: Canvas;
}

body {
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  background: var(--background);
  color: var(--text);
}

h1, h2, h3 {
  position: relative;
  margin-top: 0;
  margin-bottom: 0.5em;
}

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

svg {
  fill: currentColor;
}

a {
  color: var(--text);
  text-decoration: underline;
}

a span{
  display: inline-block;
}

a svg {
  display: inline-block;
  fill: currentColor;
}

a:hover {
  text-decoration: underline;
}

a.export {
  display: inline-block;
  padding: 0.5em;
  background: none;
  border: 2px solid var(--text);
  color: var(--text);
  transition: all .25s;
  text-decoration: none;
}

a.export:hover,
a.export:focus {
  background-color: var(--text);
  color: var(--background);
  cursor: pointer;
}

a.export::after {
  content: "◹";
  padding-left: 5px;
  font-size: .8em;
  vertical-align: bottom;
}

p {
  line-height: 1.5rem;
}

hr {
  border: 0;
  border-top: 2px solid var(--text);
  margin-top: 0;
}

button {
  background: none;
  border: 2px solid var(--text);
  color: var(--text);
  transition: all .25s;
}

button:focus, button:hover {
  background-color: var(--text);
  color: var(--background);
  cursor: pointer;
}

a {
  text-decoration: none;
}

header {
  display: flex;
  align-items: center;
  position: sticky;
  transform: translate3d(0,0,0);
  padding: 0.3rem 1rem;
  background-color: var(--background);
  top: 0px;
  border-color: black;
  border-bottom: 3px solid var(--text);
  z-index: 2;
  margin: 0 auto;
  overflow: hidden;
}

header h1 {
  margin: 0;
}

header h1 a:hover {
  text-decoration: none;
}

header nav {
  display: flex;
  margin-left: auto;
}

header nav a {
  border-radius: 50%;
  border: 2px solid var(--text);
  width: 40px;
  height: 40px;
  color: var(--text);
  display: flex;
  transition: all .25s;
  margin-left: 0.5rem;
}

header nav a svg {
  margin: auto;
  width: 20px;
}

header nav a:hover, header a:focus {
  background-color: var(--list-row);
  color: var(--background);
}

header nav a.active {
  background-color: var(--text);
  color: var(--background);
}

main {
  margin: 0 auto;
  padding: 0.5rem 0.5rem 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="url"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  border: 2px solid var(--text);
  padding: 0.5em;
  border-radius: 0;
  border-color: var(--text);
  margin-bottom: 0.5rem;
}

input[type="text"]:focus,
input[type="url"]:focus {
  border-radius: 0;
  outline: none;
  border-color: var(--faded);
}

/* ---------- */
/* Components */
/* ---------- */

.details {
  margin-top: 0;
  color: var(--faded);
}

.details a {
  color: var(--faded);
  text-decoration: none;
}

.details a:hover {
  text-decoration: underline;
}

.offline-notification {
  position: relative;
  background-color: var(--background);
  border: 2px solid var(--text);
  border-top: none;
  z-index: 1;
  padding: 1rem;
  margin: 0 auto;
  max-width: 70ch;
  position: sticky;
  top: 60px;
  display: none;
}

.offline-notification.show {
  display: flex;
}

.offline-notification::before {
  content: "";
  flex-shrink: 0;
  width: 36px;
  background: var(--text);
  mask-repeat: no-repeat;
  mask-image: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="24" height="24" viewBox="0 0 24 24"><path d="M12 16.32c.843 0 1.65.257 2.345.735l-2.345 2.487-2.345-2.487c.695-.478 1.502-.735 2.345-.735zm0-1c-1.479 0-2.817.636-3.787 1.664l3.787 4.016 3.787-4.016c-.97-1.028-2.308-1.664-3.787-1.664zm0-5.116c2.387 0 4.648.876 6.461 2.485l-.969 1.028c-1.556-1.308-3.472-2.018-5.492-2.018-2.021 0-3.937.71-5.492 2.018l-.969-1.028c1.813-1.609 4.074-2.485 6.461-2.485zm0-1c-3.071 0-5.852 1.32-7.864 3.455l2.33 2.472c1.417-1.502 3.373-2.431 5.534-2.431s4.117.929 5.534 2.431l2.33-2.472c-2.012-2.135-4.793-3.455-7.864-3.455zm0-5.204c3.949 0 7.682 1.517 10.607 4.291l-1.021 1.083c-2.656-2.452-6.023-3.791-9.586-3.791s-6.93 1.339-9.586 3.791l-1.021-1.083c2.925-2.774 6.658-4.291 10.607-4.291zm0-1c-4.687 0-8.929 2.015-12 5.272l2.389 2.533c2.459-2.609 5.857-4.222 9.611-4.222s7.152 1.613 9.611 4.222l2.389-2.533c-3.071-3.257-7.313-5.272-12-5.272z"/></svg>');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-image: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="24" height="24" viewBox="0 0 24 24"><path d="M12 16.32c.843 0 1.65.257 2.345.735l-2.345 2.487-2.345-2.487c.695-.478 1.502-.735 2.345-.735zm0-1c-1.479 0-2.817.636-3.787 1.664l3.787 4.016 3.787-4.016c-.97-1.028-2.308-1.664-3.787-1.664zm0-5.116c2.387 0 4.648.876 6.461 2.485l-.969 1.028c-1.556-1.308-3.472-2.018-5.492-2.018-2.021 0-3.937.71-5.492 2.018l-.969-1.028c1.813-1.609 4.074-2.485 6.461-2.485zm0-1c-3.071 0-5.852 1.32-7.864 3.455l2.33 2.472c1.417-1.502 3.373-2.431 5.534-2.431s4.117.929 5.534 2.431l2.33-2.472c-2.012-2.135-4.793-3.455-7.864-3.455zm0-5.204c3.949 0 7.682 1.517 10.607 4.291l-1.021 1.083c-2.656-2.452-6.023-3.791-9.586-3.791s-6.93 1.339-9.586 3.791l-1.021-1.083c2.925-2.774 6.658-4.291 10.607-4.291zm0-1c-4.687 0-8.929 2.015-12 5.272l2.389 2.533c2.459-2.609 5.857-4.222 9.611-4.222s7.152 1.613 9.611 4.222l2.389-2.533c-3.071-3.257-7.313-5.272-12-5.272z"/></svg>');
}

.feed {
  position: relative;
  padding: 1rem;
  margin: 0 auto;
  max-width: 70ch;
}

article {
  --space: 0.5rem;
  margin-bottom: 1.5rem;
  contain: layout style paint;
  content-visibility: auto;
  contain-intrinsic-size: auto 60px;
}

article h2 {
  line-height: 1.3;
  font-size: 1.3rem;
}

article a {
  text-decoration: none;
}

article p {
  overflow-wrap: break-word;
  word-wrap: break-word;
  -ms-word-break: break-all;
  word-break: break-word;
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

article a:hover,
article a:focus {
  text-decoration: underline;
}

article a:visited{
  color: var(--faded);
}



ul.source-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  width: 100%;
  max-width: var(--max-width);
}

ul.source-list li {
  display: flex;
  align-items: center;
  overflow-wrap: break-word;
  word-wrap: break-word;
  -ms-word-break: break-all;
  word-break: break-word;
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
  padding: 0.5rem;
  justify-content: space-between;
}

ul.source-list > li + li {
  border-top: 1px solid var(--faded);
}

ul.source-list li button {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.5rem;
  border: none;
  color: var(--faded);
}

ul.source-list li button.removeBtn:hover,
ul.source-list li button.removeBtn:focus {
  background: none;
  color: var(--text);
}

ul.source-list li button.removeBtn {
  padding: 0.5rem;
  padding-right: 0;
  margin-left: 1rem;
}

ul.source-list li > span {
  padding-right: 1rem;
}



.add-source {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--text);
  padding: 0.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.add-source div {
  width: 100%;
}

.add-source button {
  width: 150px;
}

.add-source button {
  margin-left: 0.5rem;
}




button.toggle {
  position: relative;
  border-radius: 34px;
  display: inline-block;
  width: 45px;
  height: 26px;
  background-color: var(--faded);
  transition: background-color .25s;
}

button.toggle:focus {
  outline-color: var(--text);
}

button.toggle.on:focus {
  outline-color: var(--faded);
}

button.toggle::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--background);
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
  transition: left .25s;
}

button.toggle.on {
  background-color: var(--text);
}

button.toggle.on::before {
  left: 22px;
}



@keyframes dotty {
  0%   { content: '...'; }
  25%  { content: ''; }
  50%  { content: '.'; }
  75%  { content: '..'; }
  100% { content: '...'; }
}

.loading:after {
  display: inline-block;
  animation: dotty steps(1,end) 1s infinite;
  content: '...';
}



.notification {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: var(--background-fade)
}

.notification-content {
  background-color: var(--background);
  margin: 15% auto;
  padding: 20px;
  border: 1px solid var(--faded);
  width: var(--max-width);
}

.notification.show {
  display: block;
}

.section-content {
  max-width: 80ch;
}

.section-content section h1 {
  font-size: 2.5rem;
  line-height: 1.1;
  margin-top: 0.5em;
}

.section-content section h2 {
  font-size: 2rem;
  margin-bottom: 1.5em;
}

.section-content section {
  font-size: 1.5rem;
  line-height: 1.8;
}

.section-content section p {
  line-height: 1.7;
  margin-bottom: 1.7em;
}

.section-content section figcaption {
  font-size: 1rem;
  padding: 1em 0;
}


/* --------- */
/* Utilities */
/* --------- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hidden {
  visibility: hidden !important;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.stack > * {
  margin-top: 0;
  margin-bottom: 0;
}

.stack > * + *{
  margin-top: var(--space, 1em);
}
