/*************************************************

  ご相談の流れ（/souzoku/flow/）

*************************************************/
/* 下層ページ見出し（文字サイズ・行間は style.css の共通指定） */
main > header {
  & .lead {
    &::after {
      content: "";
      display: block;
      margin-top: 18px;
      width: 56px;
      height: 3px;
      background: var(--color-green);
    }
  }
}

#contents > article {
  /* 見出し（h2 は style.css の共通指定） */

  /* 導入文 → CTA の枠 32px */
  & .flow-intro {
    margin: 30px auto 32px;
    width: 760px;
    max-width: 100%;

    & p {
      line-height: var(--line-height-article);
      letter-spacing: 0.05em;
    }
  }

  & > .flow-lead {
    margin: 0 0 44px;
    text-align: center;
    letter-spacing: 0.05em;
  }

  /* 問い合わせバナー */
  & .widget-inquiry2 {
    width: 832px;
  }

  /* 小さいボタン（緑の丸ボタン：16px・700・高さ48px） */
  & .flow-faq .more,
  & .widget-contact .more {
    & a {
      border-radius: 24px;
      padding: 0 52px 0 34px;
      min-width: 240px;
      height: 48px;
      font-size: 16px;
      font-weight: 700;

      &::after {
        right: 22px;
        top: calc(50% - 7px);
        width: 16px;
        height: 14px;
      }
    }
  }

  /*----------------------------------
    5ステップ
  ----------------------------------*/
  & .flow-steps {
    margin: 0 auto;
    width: 870px;
    max-width: 100%;

    & .step {
      --icon-size: 60px;
      --icon-color: var(--color-green-dark);
      position: relative;
      display: grid;
      grid-template-columns: var(--icon-size) 1fr;
      column-gap: 22px;
      margin-top: 24px;

      &:first-child {
        margin-top: 0;
      }

      /* 縦線 */
      &:not(:last-child)::before {
        content: "";
        position: absolute;
        top: calc(var(--icon-size) + 8px);
        bottom: -24px;
        left: calc(var(--icon-size) / 2 - 1.5px);
        width: 3px;
        background: #c3dab7;
      }

      &.s1 {
        --icon: url(step_icon01.min.svg);
      }
      &.s2 {
        --icon: url(step_icon02.min.svg);
      }
      &.s3 {
        --icon: url(step_icon03.min.svg);
      }
      &.s4 {
        --icon: url(step_icon04.min.svg);
      }
      &.s5 {
        --icon: url(step_icon05.min.svg);
        --icon-color: var(--color-green);
      }
    }

    & .icon {
      position: relative;
      border-radius: 50%;
      width: var(--icon-size);
      height: var(--icon-size);
      background: var(--icon-color);

      &::before {
        content: "";
        position: absolute;
        inset: 0;
        background: #fff;
        mask: var(--icon) no-repeat center / 38% 38%;
      }
    }

    & .box {
      display: grid;
      grid-template-columns: 1fr auto;
      column-gap: 22px;
      border-radius: 16px;
      padding: 28px 32px;
      background: var(--color-bg-green);
    }

    & .head {
      grid-column: 1 / -1;
      display: flex;
      align-items: center;
      gap: 0 14px;
      margin: 0;
      border: none;
      padding: 0;
      color: var(--color-green-dark);
      font-size: var(--font-size-h3);
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: 0.05em;

      &::before {
        content: none;
      }
    }

    /* STEP番号 */
    & .num {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      border-radius: 2px;
      width: 40px;
      height: 40px;
      background: #fde27e;
      font-size: 16px;
      line-height: 1;

      & span {
        margin-bottom: 2px;
        color: #a3923f;
        font-size: 12px;
        font-weight: 500;
        letter-spacing: 0.05em;
      }
    }

    /* 見出し → 本文 20px */
    & .body {
      margin-top: 20px;

      & p {
        margin: 0;
        line-height: var(--line-height-article);
        letter-spacing: 0.05em;
      }
    }

    & .photo {
      grid-row: 2;
      grid-column: 2;
      margin-top: 20px;
      width: 220px;

      & img {
        display: block;
        border-radius: 8px;
        width: 100%;
        height: 146px;
        object-fit: cover;
      }
    }
  }

  /*----------------------------------
    よくあるご質問
  ----------------------------------*/
  & .flow-faq {
    margin: 0 auto;
    width: 736px;
    max-width: 100%;

    & .qa {
      margin-top: 14px;
      border: solid 1px #ccc;
      border-radius: 3px;
      background: #fff;

      &:first-child {
        margin-top: 0;
      }
    }

    & .qa .head {
      position: relative;
      margin: 0;
      border: none;
      padding: 13px 64px 13px 64px;
      color: var(--color-text);
      font-size: var(--font-size-h4);
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: 0.08em;
      cursor: pointer;

      &::before {
        content: "Q.";
        position: absolute;
        top: 13px;
        left: 32px;
        margin: 0;
        width: auto;
        height: auto;
        background: none;
        color: var(--color-green);
        font-weight: 700;
      }

      /* ＋アイコン */
      &::after {
        content: "";
        position: absolute;
        top: calc(50% - 7px);
        right: 28px;
        width: 14px;
        height: 14px;
        background:
          linear-gradient(var(--color-green-dark), var(--color-green-dark))
            no-repeat center / 100% 1.5px,
          linear-gradient(var(--color-green-dark), var(--color-green-dark))
            no-repeat center / 1.5px 100%;
      }
    }

    /* －アイコン（開いている時。1件目は初期表示で開いている） */
    & .qa:not(:first-child) .head.open::after,
    & .qa:first-child .head:not(.open)::after {
      background: linear-gradient(
          var(--color-green-dark),
          var(--color-green-dark)
        )
        no-repeat center / 100% 1.5px;
    }

    & .qa .body {
      display: none;
      margin: 0 32px;
      border-top: solid 1px #ccc;
      padding: 12px 0 14px;
      font-size: var(--font-size-article);
      line-height: var(--line-height-article);
      letter-spacing: 0.05em;

      &::before {
        content: "A.";
        margin-right: 4px;
        color: #c99a00;
        font-family: var(--font-b);
        font-weight: 700;
      }
    }

    & .qa:first-child .body {
      display: block;
    }

    & .more {
      margin-top: 36px;
    }
  }

  /*----------------------------------
    さまざまなご相談方法
  ----------------------------------*/
  & .flow-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 0 auto 88px;
    width: 1070px;
    max-width: 100%;

    & .method {
      overflow: hidden;
      border: solid 1px #ddd;
      border-radius: 12px;
      background: #fff;

      &.m1 {
        --icon: url(soudan_icon01.min.svg);
      }
      &.m2 {
        --icon: url(soudan_icon02.min.svg);
      }
      &.m3 {
        --icon: url(soudan_icon03.min.svg);
      }
    }

    & .photo img {
      display: block;
      width: 100%;
      height: 212px;
      object-fit: cover;
    }

    /* 3列で幅が狭いため左右は 24px のまま */
    & .content {
      padding: 28px 24px;
    }

    & .head {
      --circle-size: 48px;
      position: relative;
      display: flex;
      align-items: center;
      margin: 0;
      border: none;
      padding: 0 0 0 calc(var(--circle-size) + 12px);
      min-height: var(--circle-size);
      color: var(--color-green-dark);
      /* 3列カードで24pxだと折り返しが多いため20px */
      font-size: 20px;
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: 0.05em;

      /* 円 + アイコン */
      &::before,
      &::after {
        content: "";
        position: absolute;
        top: calc(50% - var(--circle-size) / 2);
        left: 0;
        margin: 0;
        width: var(--circle-size);
        height: var(--circle-size);
      }

      &::before {
        border-radius: 50%;
        background: var(--color-bg-green);
      }

      &::after {
        background: var(--color-green-dark);
        mask: var(--icon) no-repeat center / 42% 42%;
      }
    }

    & .badge {
      display: inline-block;
      margin: 14px 0 0;
      border-radius: 2px;
      padding: 3px 12px;
      background: #fde27e;
      color: var(--color-green-dark);
      font-family: var(--font-b);
      font-size: 12px;
      font-weight: bold;
      letter-spacing: 0.05em;
    }

    & dl {
      display: grid;
      grid-template-columns: 68px 1fr;
      gap: 6px 0;
      margin: 14px 0 0;
      border-top: solid 1px #ddd;
      padding-top: 16px;
      line-height: var(--line-height-table);
    }

    & dt {
      font-family: inherit;
      font-weight: 500;
      color: #666;
    }

    & dd {
      margin: 0;
      font-family: var(--font-b);
      font-weight: bold;
    }

    & p {
      margin: 22px 0 0;
      line-height: var(--line-height-article);
      letter-spacing: 0.05em;
    }
  }

  /*----------------------------------
    事務所紹介
  ----------------------------------*/
  /* 背景色付きセクション：上下 padding 88px */
  & section.flow-office {
    margin-top: var(--space-section);
    margin-bottom: 88px;
    padding: 88px 0;
    background: #f3f8f2;

    & .wrapper {
      display: grid;
      grid-template-columns: 455px 1fr;
      gap: 0 48px;
      box-sizing: border-box;
      margin: 0 auto;
      width: 1080px;
      max-width: 100%;
    }

    & .photo img {
      display: block;
      border-radius: 12px;
      width: 100%;
      height: 570px;
      object-fit: cover;
      object-position: center top;
    }

    & h2 {
      margin: 0;
      color: var(--color-green-dark);
      font-size: var(--font-size-h2);
      font-weight: 700;
      line-height: var(--line-height-heading);
      text-align: left;

      &::after {
        content: "";
        display: block;
        margin: 18px 0 0;
        width: 56px;
        height: 2px;
        background: var(--color-heading-line);
      }
    }

    /* h2（下線含む）→ 本文 36px、段落間 22px */
    & h2 + p {
      margin-top: 36px;
    }

    & p {
      margin: 22px 0 0;
      line-height: var(--line-height-article);
      letter-spacing: 0.05em;
    }

    & .onestop {
      margin-top: 22px;
      border: solid 1px #ddd;
      border-radius: 12px;
      padding: 28px 20px;
      background: #fff;

      & .lead {
        color: var(--color-green-dark);
        font-family: var(--font-b);
        font-size: var(--font-size-article);
        font-weight: bold;
        line-height: var(--line-height-article);
        text-align: center;
        letter-spacing: 0.05em;
      }

      & ul {
        display: flex;
        justify-content: center;
        gap: 0 36px;
        margin: 8px 0 0;
        list-style: none;
      }

      & li {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: 72px;
        font-family: var(--font-b);
        font-size: 16px;
        font-weight: bold;
        line-height: 1.4;

        &.o1 {
          --icon: url(onestop_icon01.min.svg);
        }
        &.o2 {
          --icon: url(onestop_icon02.min.svg);
        }
        &.o3 {
          --icon: url(onestop_icon03.min.svg);
        }

        & .icon {
          position: relative;
          box-sizing: border-box;
          border: solid 1px var(--color-green);
          border-radius: 50%;
          width: 60px;
          height: 60px;
          background: #fff;

          &::before {
            content: "";
            position: absolute;
            inset: 0;
            background: var(--color-green-dark);
            mask: var(--icon) no-repeat center / 22px 22px;
          }
        }

        &.o1 .icon {
          border-color: var(--color-green-dark);
          background: var(--color-green-dark);

          &::before {
            background: #fff;
          }
        }

        /* ＋ */
        &:not(:last-child)::after {
          content: "+";
          position: absolute;
          top: 14px;
          right: -28px;
          color: var(--color-green);
          font-size: 26px;
          font-weight: normal;
          line-height: 1;
        }
      }
    }

    /* 見出し風の行：24px・700・行間1.6 */
    & .catch {
      margin-top: 22px;
      border-top: solid 1px #ddd;
      padding-top: 22px;
      font-family: var(--font-b);
      font-size: var(--font-size-h3);
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: 0.04em;

      & em {
        background: linear-gradient(transparent 70%, #fde27e 70%);
        color: var(--color-green-dark);
        font-style: normal;
      }
    }
  }
}

@media screen and (max-width: 768px) {
  main > header {
    & .lead {
      &::after {
        margin-top: 12px;
        width: 40px;
      }
    }
  }

  #contents > article {
    & .flow-intro {
      margin: 20px 0 32px;
    }

    & > .flow-lead {
      margin-bottom: 28px;
      text-align: left;
    }

    & .widget-inquiry2 {
      & .att {
        margin-top: 18px;
        padding: 0;
      }
    }

    & .flow-steps {
      & .step {
        --icon-size: 40px;
        column-gap: 10px;
        margin-top: 16px;

        &:not(:last-child)::before {
          top: calc(var(--icon-size) + 6px);
          bottom: -16px;
          width: 2px;
        }
      }

      & .box {
        display: block;
        border-radius: 10px;
        padding: 20px 16px;
      }

      & .head {
        gap: 0 10px;
      }

      & .num {
        width: 36px;
        height: 36px;
        font-size: 14px;

        & span {
          font-size: 12px;
        }
      }

      & .body {
        margin-top: 16px;
      }

      & .photo {
        width: 100%;

        & img {
          height: auto;
          aspect-ratio: 926 / 506;
        }
      }
    }

    & .flow-faq {
      & .qa .head {
        padding: 12px 40px 12px 36px;

        &::before {
          top: 12px;
          left: 14px;
        }

        &::after {
          right: 14px;
          top: calc(50% - 6px);
          width: 12px;
          height: 12px;
        }
      }

      & .qa .body {
        margin: 0 14px;
      }
    }

    & .flow-methods {
      grid-template-columns: 1fr;
      gap: 16px;
      margin-bottom: 40px;

      & .photo img {
        height: auto;
        aspect-ratio: 3 / 2;
      }

      & .content {
        padding: 20px 16px;
      }

      & .head {
        --circle-size: 40px;
      }
    }

    & section.flow-office {
      margin-bottom: 48px;
      padding: 56px 10px;

      & .wrapper {
        grid-template-columns: 1fr;
        gap: 24px 0;
      }

      & .photo img {
        height: auto;
        aspect-ratio: 4 / 5;
      }

      & h2 + p {
        margin-top: 24px;
      }

      & .onestop {
        padding: 20px 10px;

        & ul {
          gap: 0 28px;
        }

        & li {
          &:not(:last-child)::after {
            right: -23px;
          }
        }
      }

      & .catch {
        letter-spacing: 0.03em;
      }
    }
  }
}
