/*
メディアクエリを使用したレスポンシブデザイン
- PCファーストで設計しているので、部分的に@media (max-width: 500px)などで指定する
*/

/* ユーザーページ用のスタイル */
body.page-template-page-user .main-visual-image {
  display: none;
}

.login,
.register {
  margin-bottom: 3em;
  h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 1em;
  }
}

/*記事ヘッダー*/

article.gray_box {
  margin-top: 100px;
  .header {
    padding: 1em 0;
    border-bottom: 1px solid #ddd;

    .category {
      padding: 0.2em 1em;
      border-radius: 5px;
      background: #ff7f30;
      color: #fff;
      font-size: 12px;
      text-decoration: none;
      display: inline-block;
      margin-right: 1em;
      margin-bottom: 1em;
    }

    h1 {
      font-size: 1.4em;
      color: #634529;
      line-height: 1.5;
    }

    .meta {
      font-size: 12px;
      color: #999;
      text-align: right;
      margin-top: 1em;
    }
  }

  /*gutenbergの中身*/
  #the_content {
    padding: 2em 0;
  }
}

/*吹き出し関連*/

/*共通*/

.wp-block-word-balloon-word-balloon-block {
  margin-bottom: 2em;
  div:has(> .w_b_ava_img) {
    border: 2px solid;
  }

  .w_b_box {
    margin: unset;
    padding: unset;
  }
  .w_b_wrap {
    display: grid;
    grid-template: "ava bal" auto / 80px 1fr;
    gap: 1em;
    width: 100%;
    /*アバター*/
    .w_b_ava_box {
      grid-area: ava;
      .w_b_icon_wrap {
        .w_b_ava_wrap {
          .w_b_ava_effect {
            width: 100% !important;
            height: auto !important;
            aspect-ratio: 1/1;
            z-index: 0;
            img {
            }
          }
        }
      }
      .w_b_name {
        font-weight: bold;
        font-size: 18px;
        text-shadow: 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff,
          -1px -1px 0 #fff;
        transform: translateY(-10px);
        z-index: 1;
        position: relative;
      }

      &[data-character="ぽか子"] {
        color: #739247;

        div:has(> .w_b_ava_img) {
          border-color: #739247;
        }
      }

      &[data-character="おふ老師"] {
        color: #837bbc;

        div:has(> .w_b_ava_img) {
          border-color: #837bbc;
        }
      }

      &[data-character="ゆっこ"] {
        color: #e5a2c6;

        div:has(> .w_b_ava_img) {
          border-color: #e5a2c6;
        }
      }
    }
    /*吹き出し*/
    .w_b_bal_box {
      grid-area: bal;
      .w_b_space {
        display: none;
      }
      .w_b_bal_outer {
        .w_b_bal_wrap {
          .w_b_bal {
            padding: unset;
            border: unset;
            background: unset;
            box-shadow: unset;
            margin: unset;
            &::before {
              display: none;
            }
            &::after {
              display: none;
            }
          }
        }
      }
    }
  }
}

/*the_content関連*/
/*アイキャッチ画像*/

article.gray_box #the_content .post_thumbnail {
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 2em;

  img {
    width: 100%;
    height: auto;

    /*aspect-ratio: 16 / 9;*/
    object-fit: cover;
  }
}

/*本文*/

#the_content_insert_point {
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 1em;
  text-align: justify;

  figure {
    width: 100%;
    height: auto;
    max-height: 300px;
    all: unset;
  }

  ul,
  ol,
  li,
  dl,
  dt,
  dd,
  table,
  tr,
  th,
  td,
  a {
    all: unset;
  }

  ul,
  ol {
    padding-left: 1em;
  }

  ul li {
    list-style: disc;
    display: list-item;
  }

  ol li {
    list-style: decimal;
    display: list-item;
  }

  a {
    color: #0073aa;
    text-decoration: underline;

    &:hover {
      color: #005a8c;
    }

    &:active {
      color: #0073aa;
    }

    &:visited {
      color: #4c2c92;
    }

    &:focus {
      outline: 1px dotted #0073aa;
    }
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-weight: bold;
    margin: 1em 0;
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.3em;
  }

  h3 {
    font-size: 1.2em;
  }

  h4 {
    font-size: 1em;
  }

  h5 {
    font-size: 0.8em;
  }

  h6 {
    font-size: 0.6em;
  }

  br {
    display: block;
  }

  @media (min-width: 768px) {
    /* PC表示の場合 */
    .content-wrapper {
      display: flex;
      gap: 2em;
      margin-top: 100px;
    }

    article.gray_box.article {
      flex: 2;
      margin-top: 0; /* 親要素でマージンを調整するためリセット */
    }

    .related-podcast {
      flex: 1;
      margin-top: 0; /* 親要素でマージンを調整するためリセット */
    }
  }
}

/* 関連ポッドキャスト（姉妹記事） */
.related-podcast {
  margin-top: 2em;
  padding: 1.5em;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: #fcfcfc;

  h2 {
    font-size: 1.6em;
    color: #333;
    margin-bottom: 0.8em;
    text-align: center;
    border-bottom: 2px solid #ff7f30;
    padding-bottom: 0.5em;
    font-weight: bold;
  }

  p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 1.5em;
  }

  .podcast-list {
    list-style: none;
    li {
      a {
        display: block;
        text-decoration: none;
        color: #333;
        padding: 0.5em 0;
        border-bottom: 1px solid #ddd;
        &:hover {
          color: #0073aa;
          text-decoration: underline;
        }
      }
      &:last-child a {
        border-bottom: none;
      }
      .podcast-title {
        font-weight: bold;
        line-height: 1.4;
        margin-bottom: 0.3em;
        font-size: 1em;
      }
      .podcast-date {
        font-size: 0.75em;
        color: #888;
      }
    }
  }
  .podcast-archive-link {
    text-align: center;
    margin-top: 2.5em;
    a {
      display: inline-block;
      background-color: #ff7f30;
      color: #fff;
      padding: 0.8em 1.5em;
      border-radius: 5px;
      text-decoration: none;
      font-weight: bold;
      transition: background-color 0.3s ease;
      &:hover {
        background-color: #e66a22;
        text-decoration: none;
      }
    }
  }
}

/*コメントエリア*/
.comment-area {
  margin-bottom: 4em;
  padding: 2em 1em;

  h2 {
    font-size: 1.5em;
    text-align: center;
    margin-bottom: 1.5em;
  }

  textarea,
  input[type="text"],
  input[type="email"],
  input[type="url"] {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1em;
    box-sizing: border-box;
    margin-bottom: 1em;
  }

  /* WordPressのcomments_template()のデザイン
	見やすい様にいい感じに
	*/
  #comments {
    display: none;
  }
  .navigation {
  }
  .logged-in-as {
    display: none;
  }
  /*コメントの一覧*/
  ol.commentlist {
    margin-bottom: 2em;
    li {
      padding-block: 1em;
      border-bottom: 1px solid #ddd;
      display: block;
      &:last-child {
        border-bottom: none;
      }
      article {
        .comment-meta {
          display: grid;
          grid-template-columns: auto 1fr;
          gap: 1em;
          align-items: center;
          .comment-author {
            img {
            }
            b {
            }
            .says {
            }
          }
          .comment-metadata {
            margin-left: auto;
            a {
              font-size: 0.5em;
              color: #999;
              text-decoration: none;
            }
          }
        }
        .comment-content {
          padding-block: 0.5em;
        }
        .reply {
          text-align: right;
          a {
            color: #ff7f30;
            text-decoration: none;
          }
        }
      }
    }
  }
  /*返信ボタンエリア*/
  .comment-respond {
    h3 {
      /*display: none;*/
    }
    p.must-log-in {
      /*display: block;*/
      border-radius: 100px;
      background-color: #ff7f30;
      box-sizing: border-box;
      padding: 0.5em 2em;
      color: white;
      a {
        color: white;
        text-decoration: none;
      }
    }
  }
  label {
    display: block;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 0.25em;
  }
  h3#reply-title {
    margin-bottom: 1em;
    color: #ff7f30;
  }
  p.comment-notes {
    margin-bottom: 1em;
  }
  .comment-form-url {
    display: none;
  }
  .form-submit {
    text-align: center;
    input[type="submit"] {
      background-color: #ff7f30;
      color: white;
      border: none;
      border-radius: 10px;
      padding: 1em 2em;
      font-size: 1.2em;
      cursor: pointer;
    }
  }
}

/*今日の体操スタンプ*/
.stamp_area {
  button {
    background: #ff7f30;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 1em 2em;
    font-size: 1.2em;
    cursor: pointer;
    &.pushed {
      background: #ff7f30;
    }
  }
}

/*ページネーション*/
.prev_next {
  margin-bottom: 4em;
  padding: 1em;

  h2 {
    text-align: center;
    margin-bottom: 1em;
    font-size: 1.5em;
  }

  .prev_next_inner {
    display: grid;
    gap: 1em;
    grid-template: "prev next" 1fr / 1fr 1fr;

    .prev,
    .next {
      background: white;
      padding: 2em;
      border-radius: 10px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      box-sizing: border-box;
    }

    .prev {
      grid-area: prev;
    }

    .next {
      grid-area: next;
      text-align: right;
    }

    .prev {
      .guide_msg {
        font-size: 0.9em;
        color: #999;
        margin-bottom: 0.5em;
      }

      a {
        display: flex;
        flex-direction: column;
        gap: 0em;
        text-decoration: none;
        color: #634529;
        margin-top: 1em;
      }
    }

    .next a {
      display: flex;
      flex-direction: column;
      gap: 0em;
      text-decoration: none;
      color: #634529;
      margin-top: 1em;
    }

    .prev a:hover,
    .next a:hover {
      text-decoration: underline;
    }

    .prev a p:first-child,
    .next a p:first-child {
      font-size: 0.9em;
      font-weight: bold;
    }

    .prev a p:last-child,
    .next a p:last-child {
      font-size: 0.8em;
      color: #999;
    }
  }
}
