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

  解決事例（/souzoku/case/）

*************************************************/
/* 下層ページ見出し（副題なし。h1の下に線） */
main > header {
  & h1 {
    color: var(--color-green-dark);
    font-size: var(--font-size-h1);
    letter-spacing: 0.08em;

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

#contents > article {
  /* 見出し */
  & > h2,
  & section.case-cat > h2 {
    margin: var(--space-section) auto 36px;
    width: fit-content;
    color: var(--color-green-dark);
    font-size: var(--font-size-h2);
    font-weight: 700;
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-article);

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

  & section.case-cat > h2 {
    margin-top: 0;
  }

  & .case-intro {
    /* CTA の上の導入文 → CTA の枠 32px */
    margin: 40px auto 32px;
    width: 832px;
    max-width: 100%;

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

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

  & .case-lead {
    margin: 0 auto 36px;
    width: 760px;
    max-width: 100%;
    line-height: var(--line-height-article);
  }

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

  /*----------------------------------
    事例カテゴリ（全幅の帯）
  ----------------------------------*/
  & section.case-cat {
    padding: 88px 16px 88px;

    &.bg {
      background: #f5f9f4;
    }

    /* 帯の padding 88px + 8px = セクション間 96px */
    & + h2 {
      margin-top: 8px;
    }

    & > .widget-inquiry2 {
      margin-top: 88px;
    }
  }

  /*----------------------------------
    事例カード
  ----------------------------------*/
  & .case-item {
    overflow: hidden;
    margin: 30px auto 0;
    border: solid 1px #dfe8dc;
    border-radius: 16px;
    width: 920px;
    max-width: 100%;
    background: #fff;

    &:first-of-type {
      margin-top: 0;
    }

    & > .head {
      display: flex;
      align-items: center;
      gap: 0 16px;
      margin: 0;
      border: none;
      padding: 18px 32px;
      min-height: 54px;
      background: var(--color-green-dark);
      color: #fff;
      font-size: var(--font-size-h3);
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: var(--letter-spacing-article);

      &::before {
        content: none;
      }
    }

    /* CASE番号 */
    & .num {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      border-radius: 3px;
      width: 54px;
      height: 54px;
      background: #fde27e;
      color: var(--color-green-dark);
      font-size: 21px;
      line-height: 1;

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

    /* カードの内側 28px 32px */
    & > .body {
      padding: 28px 32px;
    }

    & .case-note {
      margin: 0 0 22px;
      line-height: var(--line-height-article);
    }
  }

  /* ご相談内容 → 対応内容 → 結果 */
  & .case-steps {
    margin: 0;

    & .row {
      --icon-size: 36px;
      position: relative;
      display: grid;
      grid-template-columns: var(--icon-size) 114px 1fr;
      column-gap: 10px;
      border-radius: 10px;
      padding: 0 20px;

      &:not(:first-child) {
        margin-top: 41px;
      }

      /* 下向き三角 */
      &:not(:last-child)::after {
        content: "";
        position: absolute;
        bottom: -26px;
        left: calc(20px + var(--icon-size) / 2 - 9px);
        width: 18px;
        height: 9px;
        background: #c3dab7;
        clip-path: polygon(0 0, 100% 0, 50% 100%);
      }

      &.soudan {
        --icon: url(case_soudan.min.svg);
      }
      &.taiou {
        --icon: url(case_taiou.min.svg);
      }
      &.kekka {
        --icon: url(case_kekka.min.svg);
        margin-top: 31px;
        padding-top: 16px;
        padding-bottom: 16px;
        background: var(--color-bg-cream);

        /* 事例カードの「結果」 18px・700・行間 1.9 */
        & dd {
          font-family: var(--font-b);
          font-weight: 700;
          line-height: 1.9;
        }
      }
      /* 結果の上の三角は帯の外に出す */
      &:has(+ .kekka)::after {
        bottom: -22px;
      }
    }

    & dt {
      position: relative;
      grid-column: 1 / 3;
      display: flex;
      align-items: center;
      align-self: start;
      padding-left: calc(var(--icon-size) + 10px);
      min-height: var(--icon-size);
      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: var(--letter-spacing-article);

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

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

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

    & .kekka dt {
      &::before {
        background: var(--color-green);
      }

      &::after {
        background: #fff;
        mask-size: 50% 50%;
      }
    }

    & dd {
      margin: 0;
      padding-top: 2px;
      line-height: var(--line-height-article);
    }
  }

  /* ケース①② */
  & .case-sub {
    overflow: hidden;
    margin-top: 20px;
    border: solid 1px #dfe8dc;
    border-radius: 12px;

    & > .head {
      display: flex;
      align-items: center;
      gap: 0 10px;
      margin: 0;
      padding: 14px 20px;
      background: var(--color-bg-green);
      color: var(--color-green-dark);
      font-size: var(--font-size-h4);
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: var(--letter-spacing-article);

      &::before {
        content: none;
      }

      & .label {
        flex-shrink: 0;
        border-radius: 2px;
        padding: 2px 10px;
        background: var(--color-green-dark);
        color: #fff;
        font-size: var(--font-size-note);
      }
    }

    & .case-steps {
      padding: 24px 4px 4px;
    }
  }

  /* 関連するサービスページ */
  & .case-related {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 20px;
    border-top: dashed 1px #ccc;
    padding-top: 18px;

    & .label {
      color: #555;
      font-family: var(--font-b);
      font-size: var(--font-size-note);
      font-weight: 700;
      letter-spacing: var(--letter-spacing-article);
    }

    & ul {
      display: contents;
      list-style: none;
    }

    & li {
      margin: 0;
    }

    & a {
      display: inline-flex;
      align-items: center;
      gap: 0 14px;
      box-sizing: border-box;
      border: solid 1.5px var(--color-green);
      border-radius: 24px;
      padding: 0 20px;
      height: 48px;
      background: #fff;
      color: var(--color-green-dark);
      font-family: var(--font-b);
      font-size: 16px;
      font-weight: 700;
      letter-spacing: var(--letter-spacing-article);
      text-decoration: none;
      transition: background 0.2s;

      &::after {
        content: "";
        flex-shrink: 0;
        width: 13px;
        height: 11px;
        background: currentColor;
        mask: url(../arrow.min.svg) no-repeat center / contain;
      }

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

  /*----------------------------------
    事例のご紹介にあたって
  ----------------------------------*/
  & .case-notice {
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
    border: solid 1px #ddd;
    border-radius: 12px;
    padding: 28px 32px 28px 102px;
    width: 872px;
    max-width: 100%;

    /* 円 + アイコン */
    &::before,
    &::after {
      content: "";
      position: absolute;
      top: 20px;
      left: 30px;
      width: 52px;
      height: 52px;
    }

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

    &::after {
      background: var(--color-green-dark);
      mask: url(case_info.min.svg) no-repeat center / 40% 40%;
    }

    & p {
      margin: 0;
      line-height: var(--line-height-article);
    }

    & p + p {
      margin-top: 22px;
    }
  }

  /*----------------------------------
    あなたのケースもご相談ください
  ----------------------------------*/
  & .case-consult {
    box-sizing: border-box;
    margin: 88px auto 72px;
    border-radius: 20px;
    padding: 40px 54px 40px;
    width: 832px;
    max-width: 100%;
    background: var(--color-bg-green);

    /* 円 + アイコン */
    &::before {
      content: "";
      display: block;
      margin: 0 auto 18px;
      border-radius: 50%;
      width: 60px;
      height: 60px;
      background: #fff;
    }

    & h2 {
      position: relative;
      margin: 0 auto 36px;
      color: var(--color-green-dark);
      font-size: var(--font-size-h2);
      font-weight: 700;
      line-height: var(--line-height-heading);
      letter-spacing: var(--letter-spacing-article);

      &::after {
        content: none;
      }

      /* 円の中のアイコン */
      &::before {
        content: "";
        position: absolute;
        top: -78px;
        left: calc(50% - 30px);
        width: 60px;
        height: 60px;
        background: var(--color-green-dark);
        mask: url(case_soudan.min.svg) no-repeat center / 36% 36%;
      }
    }

    & p {
      margin: 0;
      line-height: var(--line-height-article);
    }

    & p + p {
      margin-top: 22px;
    }

    & strong {
      background: linear-gradient(transparent 62%, #fde27e 62%);
      color: var(--color-text);
      font-family: var(--font-b);
    }
  }
}

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

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

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

      &::after {
        margin-top: 14px;
      }
    }

    & section.case-cat > h2 {
      margin-top: 0;
    }

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

      & p {
        padding: 0;
        line-height: var(--line-height-article);
      }

      & p.box {
        padding: 12px 14px;
      }
    }

    & .case-lead {
      margin-bottom: 24px;
      line-height: var(--line-height-article);
    }

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

    & section.case-cat {
      padding: 48px 10px;

      & + h2 {
        margin-top: 0;
      }

      & > .widget-inquiry2 {
        margin-top: 40px;
      }
    }

    & .case-item {
      margin-top: 20px;
      border-radius: 10px;

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

      & .num {
        width: 44px;
        height: 44px;
        font-size: 17px;

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

      & > .body {
        padding: 22px 12px 16px;
      }

      & .case-note {
        margin: 0 0 16px;
      }
    }

    /* SP はラベルの下に本文 */
    & .case-steps {
      & .row {
        --icon-size: 32px;
        grid-template-columns: 1fr;
        row-gap: 8px;
        padding: 0 8px;

        &:not(:first-child) {
          margin-top: 34px;
        }

        &:not(:last-child)::after {
          bottom: -22px;
          left: calc(8px + var(--icon-size) / 2 - 8px);
          width: 16px;
          height: 8px;
        }

        &.kekka {
          margin-top: 28px;
          padding-top: 12px;
          padding-bottom: 12px;
        }

        &:has(+ .kekka)::after {
          bottom: -20px;
        }
      }

      & dt {
        grid-column: 1;
        padding-left: calc(var(--icon-size) + 10px);
      }

      & dd {
        padding-top: 0;
      }
    }

    & .case-sub {
      & > .head {
        flex-wrap: wrap;
        gap: 6px 8px;
        padding: 10px 12px;
      }

      & .case-steps {
        padding: 18px 2px 2px;
      }
    }

    & .case-related {
      gap: 8px;

      & .label {
        flex-basis: 100%;
      }

      /* 長いリンク名は折り返すので高さは可変 */
      & a {
        padding: 8px 16px;
        height: auto;
        min-height: 48px;
        line-height: 1.5;
      }
    }

    & .case-notice {
      padding: 80px 16px 18px;

      &::before,
      &::after {
        top: 18px;
        left: calc(50% - 24px);
        width: 48px;
        height: 48px;
      }

    }

    & .case-consult {
      margin: 48px 0 40px;
      border-radius: 12px;
      padding: 28px 16px 24px;

      &::before {
        margin-bottom: 14px;
        width: 52px;
        height: 52px;
      }

      & h2 {
        margin-bottom: 24px;
        font-size: var(--font-size-h2);

        &::before {
          top: -66px;
          left: calc(50% - 26px);
          width: 52px;
          height: 52px;
        }
      }
    }
  }
}
