/*
 * 関連コンテンツ表示機能
 * PowerCMS出力先: /files/css/kp-related-content.css
 */

#tm-detail__data .tm-detail-toggle {
  margin-top: 25px;
  text-align: center;
}

#tm-detail__data .tm-detail-toggle button {
  min-width: 280px;
  min-height: 52px;
  padding: 12px 45px 12px 25px;
  border: 1px solid #707070;
  border-radius: 5px;
  background: #fff url(/files/img/icon_arrow-b05.svg) no-repeat right 20px center;
  background-size: 14px auto;
  color: #3f3f3f;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 18px;
  font-weight: bold;
  line-height: 1.4;
  cursor: pointer;
}

#tm-detail__data .tm-detail-toggle button[aria-expanded="true"] {
  background-image: url(/files/img/icon_arrow-u05.svg);
}

#tm-related-content {
  padding: 50px 0 60px;
  background-color: #fef48f;
}

#tm-related-content[hidden],
.related-panel__body[hidden],
.related-panel__navigation[hidden],
.related-panel__page-button[hidden],
.related-panel__page-indicator[hidden],
.js-tm-detail-more[hidden],
.js-tm-detail-toggle[hidden] {
  display: none !important;
}

.tm-related-content__title {
  margin-bottom: 25px;
  color: #3f3f3f;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 26px;
  line-height: 1.4;
}

.related-panel + .related-panel {
  margin-top: 12px;
}

.related-panel__header {
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 2px solid #007f92;
  border-radius: 7px;
  background-color: #fff;
}

.related-panel__heading {
  flex: 1 1 auto;
  min-width: 0;
}

.related-panel__toggle {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 8px 16px 8px 48px;
  border: 0;
  background: transparent;
  color: #3f3f3f;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 18px;
  font-weight: bold;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.related-panel__toggle::before {
  position: absolute;
  top: 50%;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #007f92;
  color: #fff;
  content: "+";
  font-size: 20px;
  font-weight: normal;
  line-height: 1;
  transform: translateY(-50%);
  box-sizing: border-box;
  padding-bottom: 2px;
}

.related-panel__toggle[aria-expanded="true"]::before {
  content: "\2212";
}

.related-panel__navigation {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}

.related-panel__page-button {
  min-width: 62px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #007f92;
  border-radius: 4px;
  background-color: #fff;
  color: #006b7c;
  font-size: 15px;
  font-weight: bold;
  line-height: 1.2;
  cursor: pointer;
}

.related-panel__page-button:hover,
.related-panel__page-button:focus-visible,
.related-panel__toggle:hover,
.related-panel__toggle:focus-visible,
#tm-detail__data .tm-detail-toggle button:hover,
#tm-detail__data .tm-detail-toggle button:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}

.related-panel__page-indicator {
  min-width: 42px;
  color: #3f3f3f;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
}

.related-panel__body {
  padding: 24px;
  border-right: 1px solid #b3d2f5;
  border-bottom: 1px solid #b3d2f5;
  border-left: 1px solid #b3d2f5;
  background-color: #ecf1f4;
}

.related-panel__results .list-item__tm > .item:last-child,
.related-panel__results .list-item__cs .item,
.related-panel__results .list-item__fl .item {
  margin-bottom: 0;
}

.related-direct-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 3px;
  background-color: #007f92;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.3;
}

@media screen and (max-width: 767.98px) {
  #tm-detail__data .tm-detail-toggle button {
    width: 100%;
    min-width: 0;
    font-size: 16px;
  }

  #tm-related-content {
    padding: 35px 0 40px;
  }

  .tm-related-content__title {
    margin-bottom: 18px;
    font-size: 22px;
  }

  .related-panel__header {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .related-panel__heading {
    width: 100%;
  }

  .related-panel__toggle {
    padding-right: 12px;
    font-size: 16px;
  }

  .related-panel__navigation {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0;
  }

  .related-panel__body {
    padding: 15px;
  }

  .related-panel__results .list-item__cs .item,
  .related-panel__results .list-item__fl .item {
    margin-right: 0;
    margin-bottom: 20px;
    margin-left: 0;
  }

  .related-panel__results .list-item__cs .item:last-child,
  .related-panel__results .list-item__fl .item:last-child {
    margin-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tm-related-content *,
  #tm-detail__data .tm-detail-toggle button {
    transition: none !important;
  }
}
