html, body {
  margin: 0;
  padding: 0;
  width: 100%;
}

body {
  font-family: "Noto Sans", sans-serif;
  font-size: 20px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

strong .toa {
  white-space: nowrap;
}

.content {
  margin: 0 auto 25px;
  padding: 50px;
  padding-top: 62px;
  width: 700px;
  text-align: justify;
  background-image: url("/asset?u=https%3A%2F%2Ftoaq.net%2FTwE%2Fassets%2Flinedpaper.png");
  color: black;
  border: 1px solid green;
  border-radius: 25px;
}

audio {
  float: right;
  height: 50px;
  position: relative;
  z-index: 99;
  margin-left: 25px;
}

body audio { display: none; }
body.lesson-00 audio { display: inherit; }
body audio#mainaudio { display: inherit; }
/* Lesson 01 has audio files, but the tones are outdated. */

p {
  margin: 25px 0;
}

audio + p {
  margin-top: 0;
}

.logo img {
  padding: 25px;
  width: 400px;
  display: block;
  margin: 0 auto;
}

.logo {
  text-align: center;
  margin-bottom: 25px;
}

footer.navigation {
  text-align: center;
}

.content a[href].continue {
  background-color: #00802b;
  color: white;
  padding: 25px;
  margin: 12.5px;
  text-decoration: none;
  display: inline-block;
}

.content a[href].continue:hover {
  background-color: #00902b;
  color: white;
}

.content a.continue.but-dont {
  background-color: gray;
}

.nav-lessons {
  text-align: center;
  font-size: 16px;
}

.content a[href], .nav-lessons a[href], table a[href] {
  color: #00802b;
}

.nav-lessons a[href]:hover,  table a[href]:hover,
.nav-lessons a[href]:active, table a[href]:active,
.nav-lessons a[href]:focus,  table a[href]:focus {
  color: inherit;
}

.content a[href]:hover {
  color: purple;
}

table a[href] {
  font-weight: normal;
  text-decoration: none;
}

.spoiler {
  color: rgba(0,0,0,0);
  background-color: #d0e0d0;
  font-style: italic;
  border-bottom: 1px solid black;
  padding: 0 0.5em;
}

.spoiler:hover {
  cursor: pointer;
  background-color: #e0e8e0;
}

.spoiler:focus {
  background-color: #e0e8e0;
  color: rgba(0,0,0,0.8);
}

table {
  margin: 25px auto;
  border-spacing: 0;
  border-collapse: collapse;
  text-align: start;
}

table.sentences {
  margin: 0 auto;
  width: 100%;
  counter-reset: sentence;
}

table:not(.sentences) td, table:not(.sentences) th {
  height: 75px;
  padding: 12.5px 25px;
  box-sizing: border-box;
}

.sentences td {
  width: 50%;
  vertical-align: top;
  padding: 0 0.5em 0 2em;
}


.sentences td::before {
  content: counter(sentence) ". ";
  font-weight: normal;
  position: relative;
  display: block;
  height: 0px;
  overflow: visible;
  right: calc(100% + 0.25em);
  text-align: end;
}

.sentences tr {
  counter-increment: sentence;
}

.sentences td + td {
  border-left: 1px dotted gray;
}

div.fancy {
  display: block;
  width: 90%;
  border-radius: 25px;
  padding: 2px;
  margin: 0 auto;
  background-color: green;
}

.fancy > table {
  table-layout: fixed;
  text-align: center;
  margin: 0;
  width: 100%;
}

th {
  font-weight: inherit;
}

.fancy th {
  font-weight: bold;
  color: white;
  background-color: green;
}

.fancy td {
  background-color: white;
}

.fancy td:first-child { padding-left: 23px; }
.fancy td:last-child { padding-right: 23px; }

.fancy table:first-child tr:first-child td,
.fancy table:first-child tr:first-child th {
  padding-top: 10.5px;
  height: 73px;
}
.fancy table:last-child tr:last-child td,
.fancy table:last-child tr:last-child th {
  padding-bottom: 10.5px;
  height: 73px;
}

.fancy tr:not(:last-child) td {
  border-bottom: 1px solid green;
  padding-bottom: 11.5px;
}

.fancy tr:first-child td:first-child, .fancy tr:first-child th:first-child  { border-top-left-radius: 23px; }
.fancy tr:first-child td:last-child,  .fancy tr:first-child th:last-child  { border-top-right-radius: 23px; }
.fancy table:last-child tr:last-child td:first-child  { border-bottom-left-radius: 23px; }
.fancy table:last-child tr:last-child td:last-child  { border-bottom-right-radius: 23px; }

h1, h2, h3 {
  margin: 0;
  font-weight: inherit;
}

h1 {
  display: inline-block;
  line-height: 50px;
}

h2, h3 {
  font-family: Sofia;
  line-height: 100%;
}

/* Don't use h4 for now */
h4 {
  font-size: 400px;
  color: red;
}

h1, #mainaudio { margin-bottom: 25px; }
h1 { font-size: 40px; height: 40px; padding-bottom: 10px; }
h2 { font-size: 30px; margin-bottom: -5px; }
h3 { font-size: 20px; padding-top: 5px; margin-top: 25px; }

hr {
  border: 0;
  margin: 25px 0;
  font-family: Sofia, sans-serif;
}

h2::before, hr::before {
  content: '* * *';
  display: block;
  font-size: 20px;
  margin-top: 25px;
  text-align: center;
  line-height: 25px;
  color: gray;
}

hr::before {
  margin: 0;
}

main img:not([src*="/tones/"]) {
  width: calc(100% - 50px);
  margin: 25px;
  display: block;
}

img[src*="/tones/"] {
  display: inline;
  vertical-align: text-bottom;
  height: 1em;
}

.t {
  position: relative;
  display: inline-block;
}

.t:before {
  content: attr(data-content);
  position: absolute;
  left: 0;
  top: 0;
  height: 0.2em;
  overflow: hidden;
}

.t1:before { color: red;    }
.t2:before { color: orange; }
.t3:before { color: gold;   }
.t4:before { color: green;  }
.t5:before { color: cyan;   }
.t6:before { color: blue;   }
.t7:before { color: purple; }

.spoiler:not(:focus):not(:hover) .t:before {
  color: transparent !important;
}

ul, ol {
  list-style-type: none;
  counter-reset: item;
  margin: 25px 0;
  padding: 0;
}

li {
  margin-left: 2em;
  position: relative;
}

li::before {
  counter-increment: item;
  position: absolute;
  left: -2em;
}

ul li::before {
  content: counter(item) "— ";
}

ol li:nth-child(1)::before  { content: '①'; }
ol li:nth-child(2)::before  { content: '②'; }
ol li:nth-child(3)::before  { content: '③'; }
ol li:nth-child(4)::before  { content: '④'; }
ol li:nth-child(5)::before  { content: '⑤'; }
ol li:nth-child(6)::before  { content: '⑥'; }
ol li:nth-child(7)::before  { content: '⑦'; }
ol li:nth-child(8)::before  { content: '⑧'; }
ol li:nth-child(9)::before  { content: '⑨'; }
ol li:nth-child(10)::before { content: '⑩'; }

@media screen and (max-width: 800px) {
  body {
    font-size: 16px;
  }
  .content {
    width: calc(100% - 50px);
    border-width: 0;
    border-top-width: 1px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin: 0;
    padding: 25px;
    padding-top: 37px;
  }
  .logo img {
    width: 50%;
  }
}

@media screen and (min-width: 800px) {
  header img {
    position: absolute;
    left: 50px;
    top: 5px;
  }
}

header {
  min-height: 80px;
  border-bottom: 1px solid #e7e7e7;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

header img {
  height: 70px;
}

@media (prefers-color-scheme: dark) {
  body {
    color: #eee;
    background-color: #333;
  }
  .content {
    color: #eee;
    background-image: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.75)), url("/asset?u=https%3A%2F%2Ftoaq.net%2FTwE%2Fassets%2Flinedpaper.png");
  }
  .nav-lessons a[href], table a[href], .content a {
    color: #80f08b;
  }
  .content a:hover {
    color: #d080ff;
  }
  .fancy td {
    background-color: #4d4d4d;
  }
}

.lesson-vocab table td, .lesson-vocab table th {
  padding: 4px 1em;
  height: unset;
}

.lesson-vocab table th {
  font-weight: bold;
  text-align: left
}
