* { margin: 0; padding: 0; box-sizing: border-box;
  
  /* Color scheme */
  
  --textcolor: #ebdbb2;
  --bgcolor: #282828;
  --highlight: #83a598;
  --headercolor: #8ec07c;

}

@media (prefers-color-scheme: dark) {
  * {
    --textcolor: #ebdbb2;
    --bgcolor: #282828;
    --highlight: #83a598;
    --headercolor: #8ec07c;
  }
}

body {
  font-size: 18px;
  font-family: system-ui, sans-serif;
  line-height: 1.4;
  color: var(--textcolor);
  background: var(--bgcolor);
  position: relative;
  max-width: 48em;  /* remove for full horizontal fill */
  margin: 8vh auto;  /* centers the layout */
  /* TODO: this sucks for vertical centering. better way? */
}

/* ------- Header --------- */

header {
  padding: 1em 5vw 0 5vw;
  /*
  display: flex;
  flex-wrap: wrap;
  */
  position: absolute;
  text-align: center;
  width: 100%;
  z-index: 2;
}


header h1 {
  font-size: 1em;
  flex: 1; /* pushes nav to the right */
  white-space: nowrap;
}

nav a:not(:last-of-type) { margin-right: 1.5vw; }
main { /* TMP */
	display: table;
	height: 100%;
	vertical-align: middle;
}

/* ------- General ------- */

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

a:hover {
  /*border-bottom: 1px solid;*/
}

section h1 {
  font-size: 1em;
  margin: 0 0 1em 0;
}

h2, h3, h4 {
  font-size: 1em;
  color: var(--headercolor);
  font-weight: 600;
  margin: 1.6em 0 .6em 0;
}

/* list */
p, ul, ol, article {
  max-width: 60ch; /* Limit line-length to 60 characters */
  margin-bottom: .1em;
}

ul {
  list-style: none;
}


/* ------- Sections ------- */

 
section {
  /*padding: calc(6em + 5vw) 5vw 8vw 5vw;*/
	/* u   r   d   l*/
  padding: 5em 1em 8em 1em;
  display: none;
  position: absolute;
  top: 0;
  /*min-height: 100vh;*/
  vertical-align: middle;
  width: 100%;
  background: var(--bgcolor);
}

section:target { /* Show section */
  display: block;
}

section#local{ /* Show #home by default */
  display: block;
}

/* ------ External links ------ */

a[href*="//"]:after { 
  font-weight: 300;
  font-size: .85em;
  /* content: "\2197"; ###top right arrow: â†— */
  color: var(--textcolor);
  opacity: .25;
}

a[href*="//"]:hover:after {
  color: var(--highlight);
  opacity: 1;
}

/* File links */

a:before { 
  font-size: .7em;
  margin-right: .4em;
}

/* ------- News ------- */

article + article {
  margin-top: 4.5em;
}

article h2 {
  font-weight: 700;
  margin: 0 0 1em 0;
}

article time {
  margin-left: .6em;
  font-size: .8em;
  font-weight: 400;
  opacity: .7;
}

/* ------ NEW -------- */
.container {
        width: 100%;
        height: 100%;
    /* webkit compat */
        display: -webkit-flex;
        -webkit-flex-direction: column;
        -webkit-align-items: center;
        -webkit-justify-content: center;
}

.favorites {
        display: flex;
	flex-wrap: wrap;
        flex-direction: row; /* from row*/
        justify-content: center;
	/*border: 1px solid #b5b5a4;*/
    /* webkit compat */
        display: -webkit-flex;
        -webkit-flex-direction: row;
}

.favorites-list {
	flex-grow: 1;
        text-align: center;
        width: 12rem;
        margin: 1rem;
}

.search {
        width: 20rem; /* search box forms width */
        padding: 0.5rem;
        margin-bottom: 1rem;
        border: 1px solid #b5b5a4;
}

.search-box {
        font-family: -apple-system, BlinkMacSystemFont,
                "Ubuntu Mono", "Segoe UI", "Roboto", "Oxygen",
                "Ubuntu", "Cantarell", "Fira Sans",
                "Droid Sans", "Helvetica Neue", sans-serif;
        font-size: 20px;
        width: 100%;
        margin: auto;
        padding: 0;
        background-color: rgba(0, 0, 0, 0);
        color: #b5b5a4;
        border: none;
}

.search-box:focus {
        outline: none;
}

ul {
        list-style: none;
        padding: 0;
}

ul > li > p { /* list title line */
        font-weight: bold;
		color: var(--headercolor);
        text-align: left;
        border-bottom: 1px solid #b5b5a4;
        padding-right: 100%;
        font-size: 26px;
}

ul > li > a { /* list items */
        color: var(--highlight);
        outline: none;

        display: block;
        text-decoration: none;
        text-align: left;
        padding: 0.5rem;
        font-size: 20px;
	/*border: 1px solid #b5b5a4; /* TMP */
}

ul > li > a:hover {
        color: var(--bgcolor);
        background-color: var(--textcolor);
}


/* ------- Smaller screens ------- */

@media only screen and (max-width: 800px) {
  body { 
  	font-size: 24px;
	margin: 0 auto; /* remove vertical padding */

  }   

  /*section { padding: calc(6em + 5vw) 5vw 8vw 5vw; }*/
  section { padding: 5em 0.5em 0.5em 0.5em; }
  .container { flex-direction: column; }
  .favorites { align:center; }
  .favorites-list { flex-grow 1; margin: 1rem; }
  .search { width: 95%; }
  ul > li > p { font-size: 28px; }
  ul > li > a { font-size: 20px; }
}

@media only screen and (max-width: 540px) {
  nav { width: 100%; } /* Fix for older webkit versions */
}
