* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-weight: normal;
  list-style: none;
}
/* スマホサイズの場合のスタイルをついか */
/* htmkにfont-size: 0.9rem; */
html {
  width: 100%;
  height: 100%;
}

body {
  font-family: "メイリオ", Meiryo, "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", "ＭＳ Ｐゴシック", "MS PGothic", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  width: 100%;
  height: 100%;
}

.navbar-text  {
  font-size: 1.5rem !important;
  color: #fff !important;
}

main.index {
  padding: 2rem 0;
}

main.kanji-page {
  width: 100%;
  /* height: calc(100svh - 60px); */
  height: 100%;
  padding: 0.5rem 0 0.5rem 0.5rem;
  writing-mode: vertical-rl;
  
  overflow-x: scroll;

  .char {
    border-left: solid 1px #aaa;
    margin-left: 2em;
    padding: 0 0.5em 0 2em;

    .char-header {
      display: flex;
      flex-direction: row;
      background-color: white;
      padding-right: 0.5rem;
      z-index: 2;
      margin-left: 1em;

      h2 {
        font-size: 64px;
        font-weight: bold;
        background-color: beige;
        padding: 10px 0;
      }

      .char-yomi {
        margin-top: 0.5rem;
        margin-bottom: 1rem;
        height: 8em; /* これくらい？ */

        .line {
          text-decoration: underline;
        }
      }

      .char-meaning {
        display: flex;
        flex-direction: row;
        margin-bottom: 1rem;

        h3 {
          writing-mode: horizontal-tb;
          text-align: center;
          background-color: beige;
          padding: 5px 0;
          font-weight: bold;
          font-family: "Shin Go Medium", sans-serif;
        }

        ol {
          li {
            padding: 5px 2px;
          }
        }
      }

      table.char-info {
        /* writing-mode: horizontal-tb; */

        th {
          background-color: beige;
          font-weight: bold;
          font-family: "Shin Go Medium", sans-serif;
        }

        th, td {
          padding: 5px;
        }
      }
    }

    .kun-yomi-sentence {
      background-color: #eee;
    }
  }

  .char:last-child {
    margin-left: 150px;
    border-left: none;
  }

  .sentences {
    margin-right: 0.5em;

    .kun {
      margin: 0 0 0.5em 0;
    }

    h4 {
      display: inline-block;
      height: 4em;
      background-color: lightgray;
      margin-left: 0.25rem;
      margin-right: 1.5rem;
      padding: 1em 0;
      font-family: "Shin Go Medium", sans-serif;
      font-weight: bold;
    }
    h5 {
      display: inline-block;
      margin-right: 0.5rem;
      margin-left: 0.5rem;
      padding: 1em 0;
      font-family: "Shin Go Medium", sans-serif;
      font-weight: bold;
    }

    .sentence {
      height: 100%;
      padding: 0 0.5em;
      display: flex;
      flex-direction: row;
      font-size: 1.5rem;
      align-items: center;

      .sentence-check {
        margin-bottom: 0.5em;
        padding-top: 0.2em;
      }

      .sentence-num {
        font-size: 80%;
        margin-bottom: 0.4em;
      }
      p {
        flex: 0 0 auto;
      }
      strong {
        position: relative;
        font-family: "Shin Go Medium", sans-serif;
        display: inline-block;

        .meaning {
          font-family: "Shin Go Regular", sans-serif;
          color: crimson;
          font-size: 0.8rem;
          display: block;
          position: absolute;
          right: 2.1rem;
          /* height: 30em; */
        }
      }

      .imi {
        font-size: 1rem; 
        margin: 1em 0;
      }

      .yomi {
          font-family: "Shin Go Regular", sans-serif;
          color: crimson;
          font-size: 0.8rem;
          display: block;
          position: absolute;
          height: max-content;
          top: 0;
          right: -1.3rem;
      }

      .yomi-mondai {
        position: relative;
        border-right: solid 1px black;
          
          .meaning {
          font-family: "Shin Go Regular", sans-serif;
          color: crimson;
          font-size: 0.8rem;
          display: block;
          position: absolute;
          top: 0;
          right: 2rem;
          /* height: 30em; */
        }
      }

      ruby {
        rt {
          font-family: "Shin Go Regular", sans-serif;
        }
      }

      .answer-box {
        display: flex;
        flex-direction: row;
        justify-content: center;
        /* height: 11em; */
        border: solid 1px gray;
        position: relative;
        cursor: pointer;

        .answer {
          color: crimson;
          text-wrap: nowrap;
        }
      }

      .height-yomi {
        height: 11em;
      }
      .height-write {
        height: 8em;
      }

      .answer-box:has(.answer.hidden) {
        border: solid 1px transparent;
      }

      .answer-box:has(.answer.hidden)::before, .answer-box:has(.answer.hidden)::after {
        content: "";
        position: absolute;
      }

      .answer-box:has(.answer.hidden)::before {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #cedfff;
        clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
      }

      .answer-box:has(.answer.hidden)::after {
        top: 0%;
        right: 0%;
        height: 14px;
        width: 14px;
        background-color: rgba(0, 0, 0, 0.2);
        clip-path: polygon(0 0, 0% 100%, 100% 100%);
      }
    }
  }

  .hinshutsu-box {
    border: solid 1em #cae4ff;
    border-radius: 0.5em;
    padding: 0.5em 1em;

    h3 {
      font-size: 1.3em;
      font-weight: bold;
      border-left: solid 2px #e96388;
      padding-left: 0;
      font-family: "Shin Go Medium", sans-serif;

      .nyushi-hinshutsu {
        display: inline-block;
        background-color: #e96388;
        color: white;
        padding: 0.4em 0.1em;
        border-radius: 0 0.4em 0.4em 0;
        margin-bottom: 1em;
        font-family: "Shin Go Regular", sans-serif;
      }
    }
  }
}

.kun {
  display: inline-block;
  color: #ff5050;
  background-color: white;
  border: solid 1px #ff5050;
  border-radius: 4px;
  padding: 0.1rem;
  font-size: 80%;
  font-family: "Gothic Medium BBB", sans-serif;
}

.kyokasho-tai {
  font-family: "GJ Kyoukasho ICA Regular", sans-serif;
}

.kyokasho-tai.bold {
  font-family: "GJ Kyoukasho ICA Medium", sans-serif;
}

.hidden {
  visibility: hidden;
}

.mode-htb {
  writing-mode: horizontal-tb;
  text-align: center;
}

.num-decoration {
  writing-mode: horizontal-tb;
  border : solid 1px black;
  font-family: monospace;
  font-size: 0.8em;
  height: 1.5em; /* typesqareの影響でline-heightが1.5になる */
  width: 1.5em;
  text-align: center;
  border-radius: 3px;

}

.selections {
  margin-top: 0.5rem;
}
.selection-item {
  margin: 0 0.1rem;
}

/* 調整用 */
.flex-00 {
  flex: 0 0 auto;
}
.flex-11 {
  flex: 1 1 auto;
  min-height: 0;
}
.marx5 {
  margin: 0 5px;
}
.mar-b1rem {
  margin-bottom: 1rem;
}
.kakomi {
  flex: 0 0 auto;
  border: 2px solid black; 
  height: 10px; 
  border-bottom: none !important;
}
.box {
  height: 2rem; 
  width: 2rem; 
  border: 1px solid black;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3px;
  flex: 0 0 auto;
  position: relative;
  /* margin: 3px 0; */
}
div:has(.box) {
  min-height: fit-content;
}
.box2 {
  display: block;
  height: 2rem; 
  width: 2rem; 
  border: 1px solid black;
  margin-bottom: 3px;
  flex: 0 0 auto;
}
.taigi {
  vertical-align: text-top; 
  line-height: 1;
}
.height-5 {
  height: 5em;
}
.height-7 {
  height: 7em;
}
.height-9 {
  height: 9em;
}
.height-11 {
  height: 11em;
}
.height-13 {
  height: 13em;
}
.height-free {
  height: auto !important;
}
.bg-red {
  background-color: #FBDEDA !important;
}
.hirogeru {
  color: crimson;
  text-shadow: 1px 1px 1px #f9b3c0;
  border: solid 2px crimson;
    display: inline-block;
    margin-right: 1rem;
    margin-left: 0.5rem;
    padding: 1em 0;
    font-family: "Shin Go Medium", sans-serif;
    font-weight: bold;
}

@media (max-height: 800px) {
  .answer-box {
    padding: 0.8rem 0 !important;
  }
}