@font-face {
    font-family: font-chenla;
    src: url(fonts/chenla.ttf);
    font-weight: normal;
}
@font-face {
    font-family: font-battambang;
    src: url(fonts/battambang.ttf);
    font-weight: normal;
}
@font-face {
    font-family: font-content;
    src: url(fonts/content.ttf);
    font-weight: normal;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

html,
body {
    margin: 0;
    padding: 0;
}
body {
    font-family: "font-battambang";
    font-size: 1.1rem;
    line-height: 2.2;
    background-color: #fff;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
a {
    color: #DC143C;
}
img {
    filter: invert(25%)
}

header,
footer {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 2;
    background-color: rgba(255,255,255,0.8);
    border: 0 solid #eee;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}
header {
    top: 0;
    height: 60px;
    border-bottom-width: 1px;
}
main {
    max-width: 630px;
    margin: 60px auto;
    padding: 1em;
    font-size: 1.125em;
    -webkit-user-select: text;
}
footer {
    bottom: 0;
    height: 60px;
    border-top-width: 1px;
}





/* NAV ICONS */
#nav-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
#nav-wrapper > span {
    padding: 0 0.5em;
    line-height: 1;
    cursor: pointer;
}
#nav-wrapper > span > img {
    width: auto;
    height: 22px;
}
#nav-wrapper > span:nth-child(2) > img {
    height: 40px;
}




/* CHAPTER NAV */
#chapter-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 100%;
    right: calc((100% - 630px)/2);
    display: flex;
}
#chapter-nav > img {
    height: 20px;
    width: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 5px;
    cursor: pointer;
}
@media screen and (max-width: 630px) {
    #chapter-nav {
        right: 1em;
    }
}




#cover {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: rgba(255,255,255,0.8);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}
#cover > #select,
#cover > #search,
#cover > #options,
#cover > #about {
    display: none;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 4em);
    max-width: 500px;
    max-height: calc(100% - 4em);
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #eee;
    background-color: #fff;
}
#cover > #select { }
#cover > #search {
    top: 2em;
    transform: translateX(-50%);
}
#cover > #options {
    display: none;
    max-width: 400px;
    padding: 1em;
}
#cover > #about {
    max-width: 300px;
    padding: 1em;
    text-align: center;
}
#cover > #about > p {
    font-size: 0.9em;
}
#cover > #about > p:first-child {
    font-size: 1.1em;
}





/* INSIDE THE MAIN */
main p {
    text-indent: 2em;
}
main h1 {
    text-align: center;
    font-weight: normal;
}
main .verse-number {
    font-size: 0.8em;
    opacity: 0.7;
}
main .psalm-heading {
    font-size: 0.9em;
    text-align: center;
    font-weight: normal;
}





/* SELECTOR */
#select {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    text-align: center;
    overflow: auto;
}
#select span {
    width: calc(100% / 6);
    box-sizing: border-box;
    padding: 0.4em 0;
    cursor: pointer;
}
@media screen and (max-width: 450px) {
    #select span {
        width: calc(100% / 4);
    }
}




/* SEARCH */
#search {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-user-select: text;
}
#search #search-form {
    position: relative;
    border-bottom: 1px solid #eee;
}
#search  #search-form input#search-input,
#search  #search-form input#search-go {
    font-family: "font-battambang";
    font-size: 1em;
}
#search #search-form input#search-input {
    width: 100%;
    border: 0;
    padding: 0.5em;
    background-color: transparent;
}
#search #search-form input#search-go {
    position: absolute;
    right: 0;
    top: 0;
    background-color: #eee;
    border: 0;
    padding: 0.5em 1em;
    cursor: pointer;
    -webkit-appearance: none;
    border-radius: 0;
}
#search #search-results {
    padding: 1em;
    overflow-y: auto;
}
#search #search-results .result {
    margin-bottom: 1em;
}
#search #search-results .result .search-ref {
    display: block;
    text-decoration: underline;
    text-decoration-color: #DC143C;
    cursor: pointer;
}
#search #search-results .result .search-text {
    display: block;
    font-size: 0.9em;
}





/* OPTIONS */
#theme {
    text-align: center;
}
#theme > img {
    width: 30px;
    height: auto;
    padding: 10px;
    cursor: pointer;
    border-radius: 999px;
}
#font-size {
    text-align: center;
}
#font-size img {
    width: 30px;
    height: auto;
    padding: 10px;
    cursor: pointer;
}
#font-face {
    text-align: center;
}
#font-face img {
    height: 40px;
    width: auto;
    padding: 10px 0;
    cursor: pointer;
}







/* FOOTER */
footer {
    text-align: center;
}
footer > #current-chapter {
    position: relative;
    height: 60px;
    line-height: 60px;
}
footer > #nav-about {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: calc((100% - 630px)/2);
    width: 15px;
    height: auto;
    cursor: pointer;
}
@media screen and (max-width: 630px) {
    footer > #nav-about {
        right: 1em;
    }
}





/* THEMES */
body.night {
    background-color: #212124;
    color: #CCCCCC;
}
body.night img {
    filter: invert(90%);
}
body.night a {
    color: #DC143C;
}
body.night header,
body.night footer {
    background-color: rgba(33,33,36,0.8);
    border-color: #444;
}
body.night #cover {
    background-color: rgba(33,33,36,0.8);
}
body.night #cover > #select,
body.night #cover > #search,
body.night #cover > #options,
body.night #cover > #about {
    background-color: rgba(33,33,36,1);
    border-color: #444;
}
body.night .orbit-spinner {
    filter: invert(90%);
}
body.night #search #search-form {
    border-color: #444;
}
body.night #search #search-form input#search-input {
    color: #ccc;
}
body.night #search #search-form input#search-go {
    background-color: #444;
    color: #ccc;

}




/* FONTS */
body.font-chenla main {
    font-family: "font-chenla";
}
body.font-battambang main {
    font-family: "font-battambang";
}
body.font-content main {
    font-family: "font-content";
}





/* SPINNER */
.orbit-spinner, .orbit-spinner * {
      box-sizing: border-box;
    }

    .orbit-spinner {
        display: none;
      height: 30px;
      width: 30px;
      border-radius: 50%;
      perspective: 800px;
      position: absolute;
      top: 50%;
      left: calc((100% - 630px)/2);
      transform: translateY(-50%);
    }
    @media screen and (max-width: 630px) {
        .orbit-spinner {
            left: 1em;
        }
    }

    .orbit-spinner .orbit {
      position: absolute;
      box-sizing: border-box;
      width: 100%;
      height: 100%;
      border-radius: 50%;
    }

    .orbit-spinner .orbit:nth-child(1) {
      left: 0%;
      top: 0%;
      animation: orbit-spinner-orbit-one-animation 1200ms linear infinite;
      border-bottom: 3px solid #222;
    }

    .orbit-spinner .orbit:nth-child(2) {
      right: 0%;
      top: 0%;
      animation: orbit-spinner-orbit-two-animation 1200ms linear infinite;
      border-right: 3px solid #222;
    }

    .orbit-spinner .orbit:nth-child(3) {
      right: 0%;
      bottom: 0%;
      animation: orbit-spinner-orbit-three-animation 1200ms linear infinite;
      border-top: 3px solid #222;
    }

    @keyframes orbit-spinner-orbit-one-animation {
      0% {
        transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
      }
      100% {
        transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
      }
    }

    @keyframes orbit-spinner-orbit-two-animation {
      0% {
        transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
      }
      100% {
        transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
      }
    }

    @keyframes orbit-spinner-orbit-three-animation {
      0% {
        transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
      }
      100% {
        transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
      }
    }
