@charset "utf-8";
:root {
  --color_accent: #e39;
  --color_base: #eef1fa;
  --color_border: #d7e2fc;
  --color_link: #000;
  --color_main: #0077cc;
  --color_text: #000;
  --color_text_light: #666;
  --color_bg: #678;
  --color_english: #7537b7;
  --color_math: #3775b7;
  --color_science: #27a765;
  --color_social: #b77537;
  --color_japanese: #b73737;
  --color_switchOn: limegreen;
}
body {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.75em;
  color: var(--color_text);
  text-align: justify;
  text-justify: inter-ideograph;
  transition: 0.2s;
  padding: 61px 0 61px 30px;
}

body.open {
  #globalNav {
    left: 0;
  }
}
body.close {
  #globalNav {
    left: -300px;
    .cat .tab {
      box-shadow: none !important;
    }
  }
}
body.mode_c {
  #header #mode_check::after {
    color: var(--color_switchOn);
  }
}
main strong {
  font-weight: inherit;
  color: var(--color_accent);
  transition: 0.2s;
  cursor: pointer;
  &::before {
    content: "［　";
    color: #000;
    font-feature-settings: "palt";
  }
  &::after {
    content: "　］";
    color: #000;
    font-feature-settings: "palt";
  }
  &.mode_c {
    color: transparent;
  }
  &:hover {
    font-weight: bold;
  }
}
.sectionMargin {
  margin-top: 10%;
}
.sectionBox {
  padding-top: 10%;
  padding-bottom: 10%;
}
.inner {
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 20px;
  padding-left: 20px;
}
.innerNarrow {
  max-width: 600px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 20px;
  padding-left: 20px;
}
.innerWide {
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 20px;
  padding-left: 20px;
}
a {
  color: inherit;
  text-decoration: none;
}
input,
select,
textarea {
  font-size: 16px !important;
  line-height: 1.5em;
}
p,
ul,
ol,
li,
dl,
dt,
dd,
hr {
  margin-top: 0;
}
li,
dd {
  margin-left: 1.5em;
}
.note {
  line-height: 40px;
  background-image: linear-gradient(180deg, var(--color_border) 1px, transparent 1px);
  background-size: 100% 40px;
  padding-bottom: 1px;
}
h1 {
  margin-top: 40px;
  font-weight: bold;
  line-height: 1.5em;
  text-align: left;
  font-size: 150%;
}
h2,
h3,
h4,
h5 {
  margin-top: 40px;
  font-weight: bold;
  line-height: 40px;
  text-align: left;
  font-size: 120%;
}
#header {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 10px;
  background-color: var(--color_base);
  border-bottom: solid 1px var(--color_border);
  display: flex;
  gap: 10px;
  align-items: center;
  .logo img {
    height: 40px;
    width: auto;
  }
  .searchBox {
    flex: 1;
    #searchform input[type="text"] {
      padding: 5px 1.5em;
      line-height: 30px;
      border-radius: 999px;
      border: none;
      background-color: #fff;
      width: 100%;
    }
  }
  #mode_check {
    display: flex;
    align-items: center;
    gap: 5px;
    &::after {
      content: "確認モード";
      font-size: 80%;
      color: #999;
    }
    .toggleBtn {
      display: block;
      position: relative;
      width: 40px;
      height: 20px;
      border-radius: 999px;
      border: 2px solid #999;
      box-sizing: content-box;
      cursor: pointer;
      transition: 0.2s;
      background-color: #fff;
      input {
        display: none;
      }
      &:has(:checked) {
        border-color: var(--color_switchOn);
      }
      &::after {
        position: absolute;
        top: 50%;
        left: 4px;
        transform: translateY(-50%);
        width: 16px;
        height: 16px;
        border-radius: 999px;
        background-color: #999;
        content: "";
        transition: 0.2s;
      }
      &:has(:checked)::after {
        left: 20px;
        background-color: var(--color_switchOn);
      }
    }
  }
}
#globalNav {
  font-size: 14px;
  line-height: 1.75em;
  transition: 0.2s;
  width: 330px;
  height: calc(100% - 61px);
  position: fixed;
  bottom: 0px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 1px;
  .cat {
    width: 30px;
    .tab {
      writing-mode: vertical-rl;
      font-feature-settings: normal;
      line-height: 30px;
      padding: 1em 0;
      background-color: var(--color_text);
      color: #fff;
      border-radius: 0 10px 10px 0;
      box-shadow: 5px 0 5px Rgba(0, 0, 0, 0.3) inset;
      cursor: pointer;
      letter-spacing: 0.5em;
      text-indent: 0.5em;
    }
    ul {
      margin: 0;
      padding: 5px 5px 45px 5px;
      position: absolute;
      left: 0;
      top: 0;
      width: 300px;
      height: 100%;
      overflow-y: auto;
      opacity: 0;
      transition: 0.2s;
      border-radius: 0 10px 0 0;
      li {
        margin: 0;
        padding: 0;
        list-style: none;
        a {
          display: block;
          padding: 5px 10px;
          margin-bottom: 1px;
          color: #fff;
        }
        a.current,
        a:hover {
          border-radius: 5px;
          background-color: #fff;
          color: inherit;
        }
      }
    }
  }
  .cat.active {
    .tab {
      box-shadow: none;
    }
    ul {
      opacity: 1;
      z-index: 1;
    }
  }
  .cat.english {
    .tab {
      background-color: var(--color_english);
    }
    ul {
      background-color: var(--color_english);
      a.current,
      a:hover {
        color: var(--color_english);
      }
    }
  }
  .cat.math {
    .tab {
      background-color: var(--color_math);
    }
    ul {
      background-color: var(--color_math);
      a.current,
      a:hover {
        color: var(--color_math);
      }
    }
  }
  .cat.science {
    .tab {
      background-color: var(--color_science);
    }
    ul {
      background-color: var(--color_science);
      a.current,
      a:hover {
        color: var(--color_science);
      }
    }
  }
  .cat.social {
    .tab {
      background-color: var(--color_social);
    }
    ul {
      background-color: var(--color_social);
      a.current,
      a:hover {
        color: var(--color_social);
      }
    }
  }
  .cat.japanese {
    .tab {
      background-color: var(--color_japanese);
    }
    ul {
      background-color: var(--color_japanese);
      a.current,
      a:hover {
        color: var(--color_japanese);
      }
    }
  }
  .closeBtn {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 300px;
    text-align: center;
    color: #fff;
    line-height: 40px;
    background-color: rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    cursor: pointer;
  }
  &::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 300px;
    height: 100%;
    z-index: -1;
    background-color: #fff;
    border-radius: 0 10px 0 0;
  }
}
#contentsList {
  .cat {
    .tab {
      margin: 20px auto 0;
      line-height: 32px;
      background-color: var(--color_text);
      color: #fff;
      border-radius: 10px 10px 0 0;
      letter-spacing: 0.5em;
      text-indent: 0.5em;
      width: 100px;
      text-align: center;
    }
    ul {
      margin: 0;
      padding: 10px;
      border: solid 1px #ccc;
      border-radius: 5px;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      font-feature-settings: "palt";
      line-height: 1.5em;
      li {
        margin: 0;
        padding: 0;
        list-style: none;
        a {
          display: block;
          padding: 5px 10px;
          color: inherit;
        }
        a.current,
        a:hover {
          border-radius: 5px;
          background-color: var(--color_base);
          color: inherit;
        }
      }
    }
  }
  .cat.english {
    .tab {
      background-color: var(--color_english);
    }
    ul {
      border-color: var(--color_english);
    }
  }
  .cat.math {
    .tab {
      background-color: var(--color_math);
    }
    ul {
      border-color: var(--color_math);
    }
  }
  .cat.science {
    .tab {
      background-color: var(--color_science);
    }
    ul {
      border-color: var(--color_science);
    }
  }
  .cat.social {
    .tab {
      background-color: var(--color_social);
    }
    ul {
      border-color: var(--color_social);
    }
  }
  .cat.japanese {
    .tab {
      background-color: var(--color_japanese);
    }
    ul {
      border-color: var(--color_japanese);
    }
  }
  .closeBtn {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 300px;
    text-align: center;
    color: #fff;
    line-height: 40px;
    background-color: rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    cursor: pointer;
  }
  &::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 300px;
    height: 100%;
    z-index: -1;
    background-color: #fff;
    border-radius: 0 10px 0 0;
  }
}
#postList {
  dl {
    margin-top: 2em;

    dt {
      font-size: 150%;
      display: flex;
      align-items: self-start;
      gap: 0.5em;

      a {
        flex: 1;
      }

      .cat {
        padding: 0 0.5em;
        background-color: var(--color_social);
        color: #fff;
        font-size: 60%;
        border-radius: 50%;
      }

      .cat.english {
        background-color: var(--color_english);
      }

      .cat.math {
        background-color: var(--color_math);
      }

      .cat.science {
        background-color: var(--color_science);
      }

      .cat.japanese {
        background-color: var(--color_japanese);
      }
    }

    dd {
      margin-top: 0.5em;
      color: var(--color_text_light);
    }
  }
}
#firstView {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  .logo {
    width: 200px;
  }
  h1 {
    font-size: 110%;
  }
  p {
    margin-top: 10px;
    font-size: 90%;
  }
  .searchBox {
    margin-top: 20px;
    input[type="text"] {
      width: 280px;
      padding: 5px 1.5em;
      line-height: 30px;
      border-radius: 999px;
      border: none;
      background-color: var(--color_base);
    }
  }
}
#breadcrumb {
  font-size: 70%;
  line-height: 1.5em;
  ol {
    margin: 0px;
    padding: 0px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
  }
  ol li {
    margin: 0;
    padding: 0;
    list-style-type: none;
  }
}
#pageTop {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 2;
  a {
    display: block;
    padding-top: 30px;
    height: 0px;
    width: 30px;
    overflow: hidden;
    position: relative;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 999px;
  }
  a::after {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -4px;
    margin-top: -2px;
    transform: rotate(45deg);
    border-top: solid 2px #fff;
    border-left: solid 2px #fff;
  }
  &:hover {
    cursor: pointer;
  }
}
#newer-older {
  font-size: 80%;
  line-height: 1.5em;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color_base);
  border-radius: 999px;
  li {
    margin: 0;
    padding: 10px;
    list-style: none;
    .title {
      flex: 1;
    }
    a {
      display: flex;
      gap: 10px;
      align-items: center;
      .allow {
        display: block;
        width: 30px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        background-color: #fff;
        border-radius: 999px;
      }
    }
  }
}
#footer {
  margin-top: 20px;
  text-align: center;
  address {
    font-size: 80%;
    line-height: 1.5em;
    font-style: normal;
  }
}
.navigation.pagination {
  display: flex;
  justify-content: center;
  align-items: center;

  .nav-links {
    display: flex;
    flex-wrap: wrap; /* 小さな画面で折り返す */
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px; /* 各ページリンク間のスペース */

    .page-numbers {
      display: inline-block;
      padding: 3px 10px;
      border: 1px solid var(--color_border);
      background-color: var(--color_base);
      color: var(--color_text_light);
      text-decoration: none;
      border-radius: 5px;
      transition: all 0.2s ease-in-out; /* ホバー時のアニメーション */
      font-size: 90%;

      &.current {
        background-color: var(--color_link);
        color: #fff;
        border-color: var(--color_link);
        cursor: default; /* 現在のページはクリック不可 */
      }

      &:hover:not(.current) {
        background-color: #fff;
      }

      &.dots {
        pointer-events: none; /* クリック不可 */
        background-color: transparent;
        border: none;
        color: #666;
        padding: 8px 4px; /* 他のリンクよりパディングを少なく */
      }

      &.next,
      &.prev {
        /* 「次へ」「前へ」ボタンに特有のスタイルがあればここに */
      }
    }
  }
}
.highlight {
  background-color: yellow; /* ハイライトの背景色 */
  font-weight: bold; /* ハイライトの文字を太字にする（任意） */
}
