* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-weight: normal;
  list-style: none;
}

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

header {
  height: 60px;
  padding: 10px 15px;
  background-color: #007aff;
  color: white;

  h1 {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
  }
}

main.index {
  padding: 2rem;
}

main.kanji-page {
  width: 100%;
  height: calc(100svh - 60px);
  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-right: 0.5rem;
      padding: 1em 0;
      font-family: "Shin Go Medium", sans-serif;
      font-weight: bold;
    }

    .sentence {
      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;
      }

      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: 2rem;
          height: 30em;
        }
      }

      .yomi-mondai {
        border-right: solid 1px black;
          
          .meaning {
          font-family: "Shin Go Regular", sans-serif;
          color: crimson;
          font-size: 0.8rem;
          display: block;
          position: absolute;
          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;
        }
      }

      .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;
}