* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
	color: #000;
	text-decoration: none;
}

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

header {
	position: fixed;
	top: 4px;
	left: 8px;
	font-size: 1.3em;
}

header a:hover {
	text-decoration: underline;
}

header img {
  max-height: 1.5em;
}

/* ------------
       Nav 
   ------------ */

nav {
  position: fixed;
  top: 2em;
  left: 8px;
  bottom: 5em;
  width: 14em;
  overflow-y: auto;
  overflow-x: hidden;

  scroll-behavior: smooth;
}

nav::-webkit-scrollbar {
  width: 0.25em;
  background-color: rgba(0,0,0,.05);
}
nav::-webkit-scrollbar-thumb {
    background: #000;
}

nav li {
  white-space: nowrap;
  width: 11.5em;
  overflow-x: hidden;
  text-overflow: ellipsis;
}

nav a.active {
  text-decoration: underline;
}

nav a:hover {
  background-color: #fff;
  color: #000;
  text-decoration: underline;
}

nav .nav-active {
  text-decoration: underline;
}

nav ul {
  list-style-type: none;
}

nav ul ul {
  margin-left: 0.75em;
}

/* ------------
     Content
   ------------ */

main {
  margin-left: 15em;
  width: 50vw;
  margin-bottom: 25vh;
}

main video, main iframe {
  width: 100%;
}

main > * {
  margin-top: 1em;
}

main > blockquote > p {
  margin-bottom: 0.3em;
  font-style: italic;
}

main > blockquote > p:last-child {
  margin-bottom: 0;
  font-style: normal;
}

main ul, main ol {
  margin-left: 1.2em;
}

main ul.tag-list li {
  display: inline;
  margin-left: 5px;
}

main ul.tag-list li:not(:last-child):after {
  content: ",";
}

main ul.grouped-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  list-style-type: none;
}

main ul.grouped-list > li {
  padding-right: 1em;
  padding-bottom: 0.2em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

main ul.grouped-list li:before {
  content: "/";
}

main ul.grouped-list a {
  text-decoration: none;
}

main ul.grouped-list a:hover {
  text-decoration: underline;
}

main table th {
  text-align: left;
}

main table td, main table th {
  padding: 2px 10px 0px 0px;
}

main a {
	text-decoration: underline;
}

main a:hover {
	text-decoration: none;
}

main a.external:before {
  content: ">>";
}

main table th:nth-child(1), main table td:nth-child(1) {
  word-break: keep-all;
  white-space: nowrap;
}

main code {
  font-family: monospace;
  background-color: #eee;
  border: 1px solid #999;
}

main pre {
  font-family: monospace;
  
  overflow: auto;

  display: block;
  background-color: #eee;
  border: 1px solid #999;
  padding: 5px;
  margin: 2px 2px;
}

/* ------------
      Footer
   ------------ */

footer {
  position: fixed;
  left: 4px;
  bottom: 8px;
  height: 3em;
}

footer span {
  display: block;
}

footer img {
  width: 2em;
  height: 2em;
}

/* ------------
      Phones
   ------------ */

@media only screen and (min-device-width: 320px) and (max-device-width: 480px), 
	only screen and (min-device-width: 320px) and (max-device-width: 640px) and (orientation: landscape) {
	header {
		position: static;
		font-size: 51pt;
		text-align: center;
	}

	nav {
		position: static;
		width: auto;
		margin: 0 0 0 1em;
		font-size: 40pt;
	}

	nav ul {
		display: flex;
	  flex-direction: row;
	  flex-wrap: wrap;
	  justify-content: flex-start;
	  flex: 100%;
	}

	nav ul.notes-index-nav {
		display: none;
	}

	nav li  {
		display: block;
		width: auto;
		padding-right: 1em;
	}

	nav li:before {
		content: "/";
	}

	main {
		width: auto;
		margin: 0 auto 1em auto;
		padding: 0 3em 0 3em;
		font-size: 28pt;
	}

	main ul.grouped-list {
		font-size: 36pt;
	}

	pre {
		font-size: 1.2em;
	}

	main table th:nth-child(1), main table td:nth-child(1) {
	  font-size: 1.3em;
	}

	tr {
		display: block;
		margin-bottom: 1em;
	}

	thead {
		display: none;
	}

	td {
		display: block;
	}

	footer {
		position: static;
		text-align: center;
		font-size: 28pt;
	}
}
