/* Flow Block Pattern Styles */
/* フロントエンドとエディタの両方で使用 */

/* Flow Wrapper（複数のFlowブロックを囲む） */
.flow-wrapper,
.editor-styles-wrapper .flow-wrapper,
.wp-block-group.flow-wrapper,
.editor-styles-wrapper .wp-block-group.flow-wrapper {
  position: relative !important;
  padding-right: 70px; /* 右側の縦帯スペース */
  margin: 40px 0;
}

/* 右側の縦帯（緑） */
.flow-wrapper::after,
.editor-styles-wrapper .flow-wrapper::after,
.wp-block-group.flow-wrapper::after,
.editor-styles-wrapper .wp-block-group.flow-wrapper::after {
  content: "無料";
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: calc(100% - 25px); /* 三角形分を引く */
  background: linear-gradient(
    to bottom,
    rgba(149, 194, 129, 0) 0%,
    rgba(149, 194, 129, 0.3) 20%,
    rgba(149, 194, 129, 0.8) 80%,
    #95c281 100%
  );
  writing-mode: vertical-rl;
  text-orientation: upright;
  color: #fff;
  font-size: 24px;
  font-weight: normal;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 20px;
  letter-spacing: 0.1em;
}

/* 下部の三角形（緑） */
.flow-wrapper::before,
.editor-styles-wrapper .flow-wrapper::before,
.wp-block-group.flow-wrapper::before,
.editor-styles-wrapper .wp-block-group.flow-wrapper::before {
  content: "";
  position: absolute;
  top: calc(100% - 25px);
  right: 0;
  width: 50px;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 25px solid #95c281;
  z-index: 1;
}

/* 青バージョンのラッパー */
.flow-wrapper.blue::after,
.editor-styles-wrapper .flow-wrapper.blue::after,
.wp-block-group.flow-wrapper.blue::after,
.editor-styles-wrapper .wp-block-group.flow-wrapper.blue::after {
  content: "契約";
  background: linear-gradient(
    to bottom,
    rgba(129, 167, 194, 0) 0%,
    rgba(129, 167, 194, 0.3) 20%,
    rgba(129, 167, 194, 0.8) 80%,
    #81a7c2 100%
  );
}

.flow-wrapper.blue::before,
.editor-styles-wrapper .flow-wrapper.blue::before,
.wp-block-group.flow-wrapper.blue::before,
.editor-styles-wrapper .wp-block-group.flow-wrapper.blue::before {
  border-top-color: #81a7c2;
}

.flow-block,
.editor-styles-wrapper .flow-block,
.wp-block-group.flow-block,
.editor-styles-wrapper .wp-block-group.flow-block {
  position: relative !important;
  border: 1px solid #95c281;
  border-radius: 20px;
  padding: 40px 30px 30px;
  margin: 40px 0;
  background-color: #fff;
}

/* 青バージョン */
.flow-block.blue,
.editor-styles-wrapper .flow-block.blue,
.wp-block-group.flow-block.blue,
.editor-styles-wrapper .wp-block-group.flow-block.blue,
.flow-wrapper.blue .flow-block,
.editor-styles-wrapper .flow-wrapper.blue .flow-block,
.flow-wrapper.blue .wp-block-group.flow-block,
.editor-styles-wrapper .flow-wrapper.blue .wp-block-group.flow-block {
  border-color: #81a7c2;
}

/* エディタ内のブロックリストレイアウトのposition: relativeを無効化 */
.flow-block > .block-editor-block-list__layout {
  position: static !important;
}

.flow-block-label,
.editor-styles-wrapper .flow-block-label,
.flow-block .flow-block-label,
.editor-styles-wrapper .flow-block .flow-block-label,
.wp-block-group.flow-block .flow-block-label,
.editor-styles-wrapper .wp-block-group.flow-block .flow-block-label,
p.flow-block-label,
.editor-styles-wrapper p.flow-block-label {
  font-family:
    "A1ゴシック M", "游ゴシック Medium", YuGothic, YuGothicM,
    "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", メイリオ, Meiryo,
    sans-serif;
  position: absolute !important;
  top: -15px;
  left: 30px;
  background-color: #95c281;
  color: #fff;
  padding: 10px 20px !important;
  border-radius: 5px;
  font-size: 16px;
  /* font-weight: bold; */
  line-height: 1;
  margin: 0 !important; /* 段落のデフォルトマージンを削除 */
  z-index: 1;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* 青バージョンのラベル */
.flow-block.blue .flow-block-label,
.editor-styles-wrapper .flow-block.blue .flow-block-label,
.wp-block-group.flow-block.blue .flow-block-label,
.editor-styles-wrapper .wp-block-group.flow-block.blue .flow-block-label,
.flow-wrapper.blue .flow-block .flow-block-label,
.editor-styles-wrapper .flow-wrapper.blue .flow-block .flow-block-label,
.flow-wrapper.blue .wp-block-group.flow-block .flow-block-label,
.editor-styles-wrapper
  .flow-wrapper.blue
  .wp-block-group.flow-block
  .flow-block-label {
  background-color: #81a7c2;
}

/* ラベルの後のh2に十分なスペースを確保 */
.flow-block .flow-block-label + h2,
.flow-block .flow-block-label + .wp-block-heading,
.editor-styles-wrapper .flow-block .flow-block-label + h2,
.editor-styles-wrapper .flow-block .flow-block-label + .wp-block-heading,
.wp-block-group.flow-block .flow-block-label + h2,
.wp-block-group.flow-block .flow-block-label + .wp-block-heading,
.editor-styles-wrapper .wp-block-group.flow-block .flow-block-label + h2,
.editor-styles-wrapper
  .wp-block-group.flow-block
  .flow-block-label
  + .wp-block-heading {
  margin-top: 0 !important;
}

.flow-block h2,
.editor-styles-wrapper .flow-block h2 {
  color: #95c281;
  font-size: 20px;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 8px;
}

/* 青バージョンの見出し */
.flow-block.blue h2,
.editor-styles-wrapper .flow-block.blue h2,
.flow-wrapper.blue .flow-block h2,
.editor-styles-wrapper .flow-wrapper.blue .flow-block h2 {
  color: #81a7c2;
}

.flow-block > p:first-of-type,
.flow-block > .wp-block-paragraph:first-of-type,
.editor-styles-wrapper .flow-block > p:first-of-type,
.editor-styles-wrapper .flow-block > .wp-block-paragraph:first-of-type {
  margin-top: 0; /* ラベルの上マージンを削除 */
}

.flow-block p,
.editor-styles-wrapper .flow-block p {
  margin-bottom: 8px !important;
  line-height: 1.5;
}

.flow-block p:last-child,
.editor-styles-wrapper .flow-block p:last-child {
  margin-bottom: 0;
}

/* エディタ内のブロック選択時の調整 */
.editor-styles-wrapper .wp-block-group.flow-block.is-selected {
  outline-offset: -3px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .flow-wrapper {
    padding-right: 45px; /* スマホでは縦帯を細く */
  }

  .flow-wrapper::after,
  .editor-styles-wrapper .flow-wrapper::after {
    width: 35px;
    height: calc(100% - 17.5px);
    font-size: 16px;
    padding-bottom: 15px;
  }

  .flow-wrapper::before,
  .editor-styles-wrapper .flow-wrapper::before {
    top: calc(100% - 17.5px);
    width: 35px;
    border-left-width: 17.5px;
    border-right-width: 17.5px;
    border-top-width: 17.5px;
  }

  .flow-block {
    padding: 35px 20px 20px;
    margin: 30px 0;
  }

  .flow-block-label {
    left: 20px;
    padding: 6px 15px;
    font-size: 14px;
  }

  .flow-block h2 {
    font-size: 18px;
  }
}
.moreBtn {
  font-size: 0.8em;
  line-height: 1;
  a {
    display: inline-block;
    background-color: #f6ac00;
    padding: 0.4em 3em 0.4em 1.5em;
    color: #fff !important;
    line-height: 1;
    position: relative;
    transition: all 0.2s ease;
    &::before {
      content: "";
      position: absolute;
      display: block;
      width: 1.5em;
      top: 1.1em;
      right: 1em;
      border-top: 1px solid #fff;
      margin: 0 0 0 0.5em;
    }
    &::after {
      content: "";
      position: absolute;
      display: block;
      right: 1em;
      top: 0.9em;
      width: 0.5em;
      border-top: 1px solid #fff;
      -webkit-transform: rotate(45deg);
      transform: rotate(45deg);
    }
    &:hover {
      background-color: #ff9900;
      border-bottom-color: #444444 !important;
      &::before {
        right: 0.5em;
      }
      &::after {
        right: 0.5em;
      }
    }
  }
}
.moreBtn.L {
  font-size: 20px;
  margin: 8px 0 16px;
  a {
    background-color: #fff;
    padding: 0.6em 4em 0.6em 2.5em;
    color: #444 !important;
    border: solid 1px #444;
    border-radius: 5px !important;
    &::before {
      border-top: 1px solid #444;
      right: 2em;
    }
    &::after {
      border-top: 1px solid #444;
      right: 2em;
    }
    &:hover {
      background-color: #fff;
      &::before {
        right: 1.5em;
      }
      &::after {
        right: 1.5em;
      }
    }
  }
}
@media screen and (max-width: 781px) {
  .moreBtn.L {
    font-size: 0.8em;
  }
}
