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

  弁護士費用（/souzoku/fee/）

*************************************************/
/* 下層ページ見出し */
main > header {
  & h1 {
    color: var(--color-green-dark);
    font-size: var(--font-size-h1);
    line-height: 1.4;
    letter-spacing: 0.08em;

    &::after {
      content: "";
      display: block;
      margin-top: 18px;
      width: 56px;
      height: 3px;
      background: var(--color-green);
    }
  }

  & .lead {
    font-size: var(--font-size-h1-sub);
  }
}

#contents > article {
  /* 見出し */
  & > h2,
  & section.fee-services h2 {
    margin: var(--space-section) auto 36px;
    width: fit-content;
    color: var(--color-base);
    font-size: var(--font-size-h2);
    font-weight: 700;
    line-height: var(--line-height-heading);
    text-align: center;
    letter-spacing: 0.08em;

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

  & .fee-intro {
    margin: 30px auto 56px;
    width: 832px;
    max-width: 100%;

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

    & p.box {
      margin-top: 22px;
      border-radius: 12px;
      padding: 28px 32px;
      background: var(--color-bg-green);
    }
  }

  & .fee-lead {
    margin: 0 0 44px;
    line-height: var(--line-height-article);
    text-align: center;
    letter-spacing: 0.05em;
  }

  /* 注記（グレーの※） */
  & .fee-note {
    margin: 12px 0 0;
    color: var(--color-note);
    font-size: var(--font-size-note);
    line-height: var(--line-height-note);
    letter-spacing: 0.05em;
  }

  /* 問い合わせバナー（文字サイズ・ボタンサイズは style.css の共通指定） */
  & .widget-inquiry2 {
    width: 832px;
  }

  /* 小さいボタン（白地・緑枠） */
  & .fee-service .more {
    margin-top: 22px;
    text-align: right;

    & a {
      border: solid 1.5px var(--color-green);
      border-radius: 24px;
      padding: 0 50px 0 24px;
      min-width: 0;
      height: 48px;
      background: #fff;
      color: var(--color-green-dark);
      font-size: 16px;
      font-weight: 700;
      transition: background 0.2s;

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

      &:hover {
        background: var(--color-bg-green);
      }
    }
  }

  /*----------------------------------
    料金表
  ----------------------------------*/
  & .fee-table-wrap {
    margin: 0 auto;
    width: 832px;
    max-width: 100%;
  }

  & .fee-table {
    overflow: hidden;
    margin: 0;
    border: solid 1px #dde8da;
    border-spacing: 0;
    border-collapse: separate;
    border-radius: 10px;
    width: 100%;
    background: #fff;

    & th,
    & td {
      border: none;
      border-top: solid 1px #dde8da;
      padding: 16px 22px;
      font-size: var(--font-size-article);
      line-height: var(--line-height-table);
      text-align: left;
      vertical-align: top;
    }

    & thead th {
      border-top: none;
      padding: 12px 22px;
      background: var(--color-green-dark);
      color: #fff;
      font-weight: 700;
      letter-spacing: 0.05em;

      & + th {
        border-left: solid 1px rgba(255, 255, 255, 0.15);
      }
    }

    & tbody th {
      width: 34%;
      background: #f3f8f2;
      font-family: var(--font-b);
      font-weight: 700;
      letter-spacing: 0.05em;
    }

    & tbody td {
      border-left: solid 1px #dde8da;
      letter-spacing: 0.05em;
    }

    & .price {
      & strong {
        color: var(--color-green-dark);
        font-family: var(--font-b);
        font-size: var(--font-size-h3);
        font-weight: 700;
        line-height: 1.5;
      }
    }

    & .badge {
      display: inline-block;
      margin-right: 8px;
      vertical-align: 4px;
      border-radius: 2px;
      padding: 1px 10px;
      background: #fde27e;
      color: var(--color-green-dark);
      font-family: var(--font-b);
      font-size: 12px;
      font-weight: bold;
    }

    & .note {
      margin-top: 4px;
      color: var(--color-note);
      font-size: var(--font-size-note);
      line-height: var(--line-height-note);
    }
  }

  /*----------------------------------
    費用の基本方針
    （3列で狭いため、幅を広げ見出しは20px）
  ----------------------------------*/
  & .fee-policy {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 0 auto;
    width: 1040px;
    max-width: 100%;

    & .item {
      box-sizing: border-box;
      border: solid 1px #ddd;
      border-top: solid 4px var(--color-green-dark);
      border-radius: 12px;
      padding: 28px 28px 32px;
      background: #fff;

      &.p1 {
        --icon: url(feature_icon01.min.svg);
      }
      &.p2 {
        --icon: url(feature_icon02.min.svg);
      }
      &.p3 {
        --icon: url(feature_icon03.min.svg);
        border-top-color: var(--color-green);
      }
    }

    & .head {
      --circle-size: 48px;
      position: relative;
      display: flex;
      align-items: center;
      margin: 0 0 20px;
      border: none;
      padding: 0 0 0 calc(var(--circle-size) + 14px);
      /* 2行分の高さを確保し、本文の開始位置を揃える */
      min-height: 64px;
      color: var(--color-green-dark);
      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%;
      }
    }

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

  /*----------------------------------
    サービス別の弁護士費用
  ----------------------------------*/
  & section.fee-services {
    margin-top: var(--space-section);
    padding: 88px 0;
    background: #f5f9f4;

    & .wrapper {
      margin: 0 auto;
      width: 880px;
      max-width: 100%;
    }

    & h2 {
      margin-top: 0;
    }
  }

  & .fee-service {
    margin-top: 24px;
    border: solid 1px #dde8da;
    border-radius: 16px;
    padding: 28px 32px;
    background: #fff;

    &.sv1 {
      --icon: url(service_icon01.min.svg);
    }
    &.sv2 {
      --icon: url(service_icon02.min.svg);
    }
    &.sv3 {
      --icon: url(service_icon03.min.svg);
    }
    &.sv4 {
      --icon: url(service_icon04.min.svg);
    }
    &.sv5 {
      --icon: url(service_icon05.min.svg);
    }
    &.sv6 {
      --icon: url(service_icon06.min.svg);
    }
    &.sv7 {
      --icon: url(service_icon07.min.svg);
    }

    & .head {
      --circle-size: 50px;
      position: relative;
      display: flex;
      align-items: center;
      margin: 0 0 20px;
      border: none;
      padding: 0 0 0 calc(var(--circle-size) + 14px);
      min-height: var(--circle-size);
      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,
      &::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-green-dark);
      }

      &::after {
        background: #fff;
        mask: var(--icon) no-repeat center / 40% 40%;
      }
    }

    /* 表の見出し（h4相当） */
    & .caption {
      margin: 0 0 12px;
      color: var(--color-green-dark);
      font-family: var(--font-b);
      font-size: var(--font-size-h4);
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: 0.05em;
    }

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

    & > p.fee-note {
      margin-top: 12px;
      font-size: var(--font-size-note);
      line-height: var(--line-height-note);
    }
  }

  /*----------------------------------
    ワンストップ対応
  ----------------------------------*/
  & .fee-onestop {
    display: grid;
    grid-template-columns: 436px 1fr;
    align-items: center;
    gap: 0 32px;
    box-sizing: border-box;
    margin: 0 auto;
    border: solid 1px #ddd;
    border-radius: 16px;
    padding: 28px 32px;
    width: 952px;
    max-width: 100%;
    background: #fff;

    & ul {
      display: flex;
      justify-content: center;
      gap: 0 40px;
      margin: 0;
      border-radius: 12px;
      padding: 20px 10px 18px;
      background: var(--color-bg-green);
      list-style: none;
    }

    & li {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100px;
      font-family: var(--font-b);
      line-height: 1.5;
      text-align: center;

      &.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;
        margin-bottom: 8px;
        border: solid 1px var(--color-green);
        border-radius: 50%;
        width: 56px;
        height: 56px;
        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;
        }
      }

      & .name {
        font-size: var(--font-size-h4);
        font-weight: 700;
      }

      /* 図中のラベル（横幅が狭いため小さめのまま） */
      & .sub {
        color: var(--color-note);
        font-size: 12px;
        white-space: nowrap;
      }

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

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

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

  /*----------------------------------
    お見積りとお支払いの流れ
  ----------------------------------*/
  & .fee-steps {
    margin: 0 auto;
    width: 832px;
    max-width: 100%;

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

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

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

      &.s1 {
        --icon: url(flow_icon01.min.svg);
      }
      &.s2 {
        --icon: url(flow_icon02.min.svg);
      }
      &.s3 {
        --icon: url(flow_icon03.min.svg);
      }
      &.s4 {
        --icon: url(flow_icon04.min.svg);
      }
      &.s5 {
        --icon: url(flow_icon05.min.svg);
      }
      &.s6 {
        --icon: url(flow_icon06.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 / 40% 40%;
      }
    }

    & .box {
      border-radius: 14px;
      padding: 22px 32px 24px;
      background: var(--color-bg-green);
    }

    & .head {
      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;
      }
    }

    & .body {
      margin-top: 16px;

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

  /*----------------------------------
    よくあるご質問
  ----------------------------------*/
  & .fee-faq {
    margin: 0 auto;
    width: 784px;
    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: 16px 64px;
      color: var(--color-text);
      font-size: var(--font-size-article);
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: 0.08em;
      cursor: pointer;

      &::before {
        content: "Q.";
        position: absolute;
        top: 16px;
        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: 14px 0 18px;
      font-size: var(--font-size-article);
      line-height: var(--line-height-article);
      letter-spacing: 0.05em;

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

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

  /*----------------------------------
    費用に関するご相談（締め）
  ----------------------------------*/
  & .fee-cta {
    box-sizing: border-box;
    margin: var(--space-section) auto 72px;
    border-radius: 16px;
    padding: 48px 48px 48px;
    width: 832px;
    max-width: 100%;
    background: var(--color-bg-green);

    & .icon {
      position: relative;
      margin: 0 auto 18px;
      border-radius: 50%;
      width: 60px;
      height: 60px;
      background: #fff;

      &::before {
        content: "";
        position: absolute;
        inset: 0;
        background: var(--color-green-dark);
        mask: url(cta_icon.min.svg) no-repeat center / 40% 40%;
      }
    }

    & h2 {
      margin: 0 auto 24px;
      color: var(--color-green-dark);
      font-size: var(--font-size-h2);
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: 0.08em;

      &::after {
        content: none;
      }
    }

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

    & h2 + p {
      margin-top: 0;
    }
  }
}

@media screen and (max-width: 768px) {
  main > header {
    & h1 {
      font-size: var(--font-size-h1);

      &::after {
        margin-top: 12px;
        width: 40px;
      }
    }

    & .lead {
      font-size: var(--font-size-h1-sub);
    }
  }

  #contents > article {
    & > h2,
    & section.fee-services h2 {
      margin: var(--space-section) auto 24px;
      font-size: var(--font-size-h2);
    }

    & .fee-intro {
      margin: 20px 0 32px;

      & p {
        padding: 0;
      }

      & p.box {
        padding: 18px 16px;
      }
    }

    & .fee-lead {
      margin-bottom: 24px;
      text-align: left;
    }

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

    & .fee-service .more {
      text-align: center;
    }

    /* 料金表は縦積み */
    & .fee-table {
      & thead {
        display: none;
      }

      & tbody,
      & tr,
      & th,
      & td {
        display: block;
        box-sizing: border-box;
        width: 100%;
      }

      & tr:first-child th {
        border-top: none;
      }

      & tbody th {
        width: 100%;
        padding: 10px 14px;
      }

      & tbody td {
        border-left: none;
        padding: 12px 14px 14px;
      }
    }

    & .fee-policy {
      grid-template-columns: 1fr;
      gap: 16px;

      & .item {
        padding: 20px 18px 22px;
      }

      & .head {
        --circle-size: 42px;
        padding-left: calc(var(--circle-size) + 12px);
        min-height: var(--circle-size);
        font-size: var(--font-size-h3);
      }
    }

    & section.fee-services {
      margin-top: var(--space-section);
      padding: 56px 10px;
    }

    & .fee-service {
      margin-top: 16px;
      border-radius: 12px;
      padding: 20px 16px 22px;

      & .head {
        --circle-size: 40px;
        margin-bottom: 16px;
        padding-left: calc(var(--circle-size) + 12px);
        font-size: var(--font-size-h3);
      }
    }

    & .fee-onestop {
      grid-template-columns: 1fr;
      gap: 20px 0;
      padding: 16px 14px 20px;

      & ul {
        gap: 0 24px;
        padding: 16px 6px;
      }

      & li {
        width: 80px;

        &:not(:last-child)::after {
          right: -22px;
          font-size: 22px;
          top: 14px;
        }

        & .sub {
          font-size: 12px;
          white-space: normal;
        }
      }
    }

    & .fee-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 {
        border-radius: 10px;
        padding: 16px 16px 18px;
      }

      & .head {
        gap: 0 10px;
        font-size: var(--font-size-h3);
      }

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

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

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

    & .fee-faq {
      & .qa .head {
        padding: 12px 40px 12px 36px;
        font-size: var(--font-size-article);

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

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

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

    & .fee-cta {
      margin: var(--space-section) 0 40px;
      padding: 28px 16px 30px;

      & .icon {
        width: 50px;
        height: 50px;
      }

      & h2 {
        font-size: var(--font-size-h2);
      }
    }
  }
}
