@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&display=swap');

:root {
    --background-color: mintcream;
    --navbar-color: rgba(255, 255, 255, 0.815);
    --font-color: rgb(17, 54, 33);
    --level-color: #474747;
    --radical-color: rgb(130, 130, 223);
    --kanji-color: rgb(226, 91, 91);
    --vocabulary-color: rgb(168, 82, 181);
    --menu-color: rgb(43, 43, 43);
    --hr-color: rgba(132, 132, 132, 0.171);
    --context-table-buttons-color: rgb(190, 190, 190);
    --context-table-activated-button-color: #555;

    --grade-pleasant-color: rgb(35, 35, 61);
    --grade-painful-color: rgb(32, 56, 32);
    --grade-death-color: rgb(59, 37, 29);
    --grade-hell-color: rgb(59, 59, 31);
    --grade-paradise-color: rgb(72, 44, 55);
    --grade-reality-color: black;
}

* {
    margin: 0;
    padding: 0;
    border: none;
    background-color: inherit;
    color: var(--font-color);
    font-family: "Noto Sans JP", sans-serif;
    font-size: inherit;
    text-decoration: none;
    box-sizing: border-box;
    cursor: inherit;
    appearance: none;
    border-radius: 0;
}

body {
    background-color: var(--background-color);
}
html {
    width: 100%;
}

.square {
    width: 3.5rem;
    height: 3.5rem;
    line-height: 3.5rem;
    text-align: center;
    color: white;
    font-size: 2rem;
    box-shadow: 3px 3px 10px #00000082 inset;
    display: flex;
    align-items: center;
    justify-content: center;
}
.square.vocabulary-color {
    width: auto;
    padding: 0 0.75rem;
}
.square img {
    width: 2rem;
    height: 2rem;
}

a, button {
    cursor: pointer;
}



.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 2rem;
}
.logo img {
    width: 3.2rem;
    height: 3.2rem;
}

.radical-color, #radicals .radical-color {
    background-color: var(--radical-color);
}
.kanji-color {
    background-color: var(--kanji-color);
}
.vocabulary-color {
    background-color: var(--vocabulary-color);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--navbar-color);
    position: sticky;
    top: 0;
    width: 100%;
    padding: 15px 10%;
    box-shadow: 0 -5px 20px;
    z-index: 10;
}
.navbar nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 40%;
    background: none;
    font-size: 1.2rem;
}
.navbar-button:hover {
    text-decoration: underline #0000004e 2px;
}
.search {
    background: none;
    border: 2px solid var(--font-color);
    padding: 5px;
    width: 20%;
}
input:focus {
    outline: none;
}

.dropdown {
    position: relative;
}
nav .dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(46, 46, 46, 0.568);
    top: 2em;
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.468);
}
nav .dropdown-content.show {
    display: block;
}
nav .dropdown-content span {
    color: white;
    background: none;
    margin-left: 20px;
}
nav .dropdown-content div {
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
    align-items: center;
    padding: 0 20px 20px;
    background: none;
}
nav .dropdown-content div a {
    background: none;
    background-color: var(--level-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 0.3em;
}
nav .dropdown-content div a:first-child {
    font-size: 1.3rem;
}
nav .dropdown-content div a:last-child div {
    margin-right: 0;
}
#menu-container, #menu-container * {
    display: none;
}



/* CONTENTS */



#content {
    padding: 30px 0;
}
section {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
    padding: 0 2rem;
}

.heading {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    align-items: center;
}
.heading:has(#search-info) {
    display: block;
}

#level {
    background-color: var(--level-color);
    cursor: pointer;
    margin-right: 10px;
}

#character {
    margin-right: 10px;
}

hr {
    border-top: 1px solid var(--hr-color);
    margin: 10px 0;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2rem;
    margin: 10px 0;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

#radical-combination ul {
    list-style-type: none;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
}
#radical-combination ul li a {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3rem;
    margin-bottom: 15px;
}
#radical-combination .square {
    margin-right: 10px;
}
.plus {
    margin: 0 20px;
}

.hint {
    margin-left: 30px;
    margin-bottom: 20px;
    width: 70%;
    padding: 15px;
    box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.478) inset;
}
.hint p {
    color: rgba(0, 0, 0, 0.686);
    background: none;
    margin: 0;
}

.grayed-out * {
    color: rgba(0, 0, 0, 0.288);
}
.readings-container {
    display: flex;
    flex-flow: row wrap;
    justify-content: left;
}
.readings-container div {
    margin-right: 30%;
}
.readings-container div:last-child {
    margin-right: 0;
}
.readings-container div:not(.grayed-out) p, .bold {
    font-weight: bold;
    font-size: 1.5em;
}

.show {
    display: block;
    z-index: 10;
}



.foundin-ul { /* .foundin - every grid element*/
    list-style-type: none;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
}
.vocabulary-ul {
    flex-flow: column nowrap;
    justify-content: center;
}

.foundin-ul li {
    width: 8rem;
    height: 8.5rem;
    background-color: var(--kanji-color);
    box-shadow: 6px 6px 20px #00000082 inset;
    margin-right: 5px;
    margin-bottom: 5px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vocabulary-ul li {
    width: 100%;
    height: 4rem;
    background-color: var(--vocabulary-color);
    margin: 5px 0;
}

.foundin-ul a {
    background: none;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.vocabulary-ul a {
    flex-flow: row nowrap;
    justify-content: space-between;
}

.foundin-ul li a span {
    display: block;
    color: white;
    background: none;
}
.vocabulary-ul li a span {
    display: inline;
    padding: 1rem;
    flex: 1;
    white-space: nowrap;
}

.foundin-character {
    font-size: 3.4rem;
}
.vocabulary-ul .foundin-character {
    font-size: 2rem;
    text-align: left;
    flex: 1.5;
}
.foundin-ul img {
    width: 3.4rem;
    height: 3.4rem;
    margin: 0.8rem;
}
.foundin-character:has(img) {
    line-height: 3.4rem;
}

.foundin-reading {
    font-size: 0.8rem;
}
.vocabulary-ul .foundin-reading {
    font-size: 1.2rem;
    text-align: left;
}

.foundin-meaning {
    margin-bottom: 1rem;
}
.vocabulary-ul .foundin-meaning {
    font-size: 1.4rem;
    text-align: right;
    margin-bottom: 0;
}

#context-sentences p:nth-of-type(odd) {
    margin-bottom: 0;
}



#context-table {
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
}
#patterns-of-use {
    border-right: 1px solid var(--hr-color);
}
#patterns-of-use h3 {
    margin-right: 40px;
}
#patterns-of-use div {
    display: flex;
    flex-direction: column;
}
#patterns-of-use div button {
    text-align: left;
    background-color: var(--context-table-buttons-color);
    color: black;
    margin-bottom: 5px;
    padding: 5px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    font-size: 1.2rem;
    height: 2.5rem; 
    position: relative;
}
#patterns-of-use div button .triangle {
    display: none;
    width: 0;
	height: 0;
	border-top: 1.25rem solid transparent;
	border-left: 2.5rem solid var(--context-table-activated-button-color);
	border-bottom: 1.25rem solid transparent;
    position: absolute;
    background: none;
    top: 0;
    left: 100%;
    right: 0px;
    bottom: 0;
}

#common-word-combinations {
    border-left: 1px solid var(--hr-color);
    padding-left: 50px;
    box-shadow: 10px 0px 10px -10px rgba(0, 0, 0, 0.152) inset;
}
#common-word-combinations ul {
    list-style-type: none;
}
#common-word-combinations ul li {
    display: none;
}
#common-word-combinations ul li.show {
    display: block;
}
#patterns-of-use .triangle.show {
    display: block;
    z-index: 5;
}
#patterns-of-use button.activated {
    background-color: var(--context-table-activated-button-color);
    color: white;
}
#common-word-combinations p:nth-of-type(odd) {
    margin-bottom: 0;
}



/* SEARCH PAGE */

#search-results-container ul {
    list-style-type: none;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
}
#search-results-container ul li {
    width: 100%;
    height: 4rem;
    box-shadow: 6px 6px 20px #00000082 inset;
    margin: 5px 0;
    display: flex;
    align-items: center;
}
#search-results-container ul li a{
    background: none;
    width: 100%;
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: center;
}
#search-results-container ul li a span {
    display: inline;
    color: white;
    background: none;
    padding: 1rem;
    flex: 1;
    white-space: nowrap;
}
#search-results-container ul li a span:nth-child(1) {
    font-size: 2rem;
    text-align: left;
    flex: 1.5;
    display: flex;
    align-items: center;
}
#search-results-container img {
    width: 2rem;
    height: 2rem;
}
#search-results-container ul li a span:nth-child(2){
    font-size: 1.2rem;
    text-align: left;
}
#search-results-container ul li a span:nth-child(3) {
    font-size: 1.4rem;
    text-align: right;
}



#grade {
    width: 7rem;
    height: 7rem;
    box-shadow: 3px 3px 10px #00000082 inset;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-right: 2rem;
}
#grade span:nth-child(1) {
    font-size: 2.4rem;
    color: white;
    background: none;
}
#grade span:nth-child(2) {
    font-size: 1.2rem;
    color: white;
    background: none;
}
#levels div {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
}
#levels a {
    background-color: var(--level-color);
    margin-right: 12px;
    margin-bottom: 12px;
}








@media (max-width: 1200px){
    section {
        max-width: 1000px;
    }
}

@media (max-width: 1000px){
    section {
        max-width: 800px;
    }
    .navbar nav {
        width: 60%;
    }
    #context-sentences p {
        font-size: 1rem;
    }
}

@media (max-width: 800px){
    section {
        max-width: 600px;
    }
    .vocabulary-ul a .foundin-meaning {
        font-size: 1.1rem;
        white-space: wrap;
    }
    .navbar nav div, .navbar input {
        display: none;
    }
    #menu-container {
        display: block;
        background: none;
    }
    #menu-container * {
        display: block;
    }
    #menu-container button div {
        background-color: var(--font-color);
        width: 35px;
        height: 3px;
        margin: 6px 0;
    }
    #menu-container #menu-content {
        position: fixed;
        height: 100%;
        width: 0;
        top: 0;
        right: 0;
        transition: 0.5s;
        background-color: var(--menu-color);
    }
    #menu-content * {
        display: block;
    }
    #menu-heading {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 20px 25px;
    }
    #close-menu {
        font-size: 40px;
        color: white;
    }
    .search {
        width: 50%;
        font-size: 1.5rem;
        height: 2.8rem;
        line-height: 2.8rem;
        border-color: white;
        background-color: rgba(255, 255, 255, 0.042);
        color: white;
    }
    #menu-grades {
        margin: 0 25px;
        display: grid;
        gap: 10px 10px;
        grid-template-columns: 0 0;
        grid-template-rows: 130px 130px 130px;
        justify-content: center;
        transition: 0.5s;
    }
    #menu-grades a {
        width: 100%;
        height: 100%;
        box-shadow: 3px 3px 10px #00000082 inset;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    #menu-grades a:nth-child(1) { background-color: var(--grade-pleasant-color); }
    #menu-grades a:nth-child(2) { background-color: var(--grade-painful-color); }
    #menu-grades a:nth-child(3) { background-color: var(--grade-death-color); }
    #menu-grades a:nth-child(4) { background-color: var(--grade-hell-color); }
    #menu-grades a:nth-child(5) { background-color: var(--grade-paradise-color); }
    #menu-grades a:nth-child(6) { background-color: var(--grade-reality-color); }
    #menu-grades a span {
        color: white;
        font-size: 0px;
        white-space: nowrap;
        transition: 0.5s;
    }
    .hint {
        width: 90%;
        margin-right: auto;
        margin-left: auto;
    }
    #patterns-of-use div button {
        font-size: 1rem;
    }
}

@media (max-width: 650px){
    section {
        max-width: 400px;
    }
    .foundin-ul { /* values same as for .vocabulary-ul */
        flex-flow: column nowrap;
        justify-content: center;
    }
    .foundin-ul li {
        width: 100%;
        height: 4rem;
        margin: 5px 0;
    }
    .foundin-ul li a, #search-results-container ul li a {
        flex-flow: row nowrap;
        justify-content: space-between;
    }
    .foundin-ul li a span, #search-results-container ul li a span {
        display: inline;
        padding: 1rem;
        flex: 1;
    }
    .foundin-ul a .foundin-character, #search-results-container ul li a span:nth-child(1) {
        font-size: 1.8rem;
        text-align: left;
        flex: 1.5;
    }
    .foundin-ul a .foundin-reading {
        font-size: 1rem;
        text-align: left;
    }
    .foundin-ul a .foundin-meaning, #search-results-container ul li a span:nth-child(3) {
        font-size: 1.05rem;
        text-align: right;
        margin-bottom: 0;
    }
    .vocabulary-ul a .foundin-reading, #search-results-container ul li.resized-remove-reading a span:nth-child(2) {
        display: none;
    }
    .vocabulary-ul a .foundin-meaning, #search-results-container ul li.resized-remove-reading a span:nth-child(3) {
        font-size: 0.9rem;
        white-space: wrap;
    }
    .foundin-ul img {
        width: 2rem;
        height: 2rem;
        margin: 0;
    }
    .foundin-ul li a span:has(img) {
        display: flex;
        justify-content: left;
        align-items: center;
    }
    #search-results-container img {
        width: 2rem;
        height: 2rem;
    }
    .hint p {
        font-size: 1rem;
    }
    #radical-combination .square {
        width: 3rem;
        height: 3rem;
        font-size: 1.7rem;
    }
    #radical-combination .square + span {
        font-size: 0.9rem;
    }
    #patterns-of-use h3, #common-word-combinations h3 {
        margin-right: 5px;
        font-size: 0.8rem;
    }
    #common-word-combinations p:nth-of-type(even) {
        margin-bottom: 30px;
    }
    #common-word-combinations p:nth-of-type(even) {
       font-size: 0.9rem;
    }
    #context-sentences p:nth-of-type(even) {
        margin-bottom: 30px;
    }
}