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

  お問い合わせ（/souzoku/contact/）

*************************************************/
/* 下層ページ見出し（副題なし。h1 の下に短い線） */
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);
    }
  }
}

#contents > article {
  /* 見出し */
  & > h2,
  & section.contact-form h2 {
    margin: var(--space-section) 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: "";
      display: block;
      margin: 18px auto 0;
      width: 56px;
      height: 2px;
      background: var(--color-heading-line);
    }
  }

  & .contact-intro {
    margin: 40px auto 0;
    width: 805px;
    max-width: 100%;

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

  /* 小さいボタン */
  & .contact-privacy .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;
      }
    }
  }

  & .widget-contact {
    margin-bottom: 88px;
  }

  /*----------------------------------
    お問い合わせフォーム
  ----------------------------------*/
  & section.contact-form {
    padding: 88px 0;
    background: #f5f9f4;

    & h2 {
      margin-top: 0;
      margin-bottom: 36px;
    }

    & > .lead {
      margin: 0 0 40px;
      text-align: center;
      letter-spacing: 0.08em;
    }

    & .mw_wp_form,
    & .contactform7,
    & > .att {
      margin: 0 auto;
      width: 880px;
      max-width: calc(100% - 20px);
    }

    & > .att {
      margin-top: 18px;
      color: var(--color-note);
      font-size: var(--font-size-note);
      line-height: var(--line-height-note);
      text-align: center;
      text-indent: 0;
      letter-spacing: 0.05em;

      & > span:first-child {
        color: inherit;
      }
    }

    /* テーブル */
    & table.mailform {
      overflow: hidden;
      margin: 0;
      border: solid 1px #e3e9e2;
      border-collapse: separate;
      border-spacing: 0;
      border-radius: 12px;
      width: 100%;
      background: #fff;

      & tr:not(:last-child) {
        & th,
        & td {
          border-bottom: solid 1px #e8ede7;
        }
      }

      & th {
        box-sizing: border-box;
        /* 上は入力欄（高さ48px）の文字と揃える */
        padding: 25px 22px 16px;
        width: 280px;
        background: #f3f8f2 !important;
        text-align: left;
        vertical-align: top;
      }

      & td {
        padding: 16px 22px;
        background: #fff;
        vertical-align: top;
      }
    }

    /* 項目名 + 必須/任意バッジ */
    & th label {
      display: flex;
      flex-wrap: nowrap;
      justify-content: space-between;
      align-items: flex-start;
      gap: 0 12px;
      font-family: var(--font-b);
      font-size: var(--font-size-article);
      font-weight: 700;
      line-height: var(--line-height-table);
      letter-spacing: 0.08em;
    }

    & span.require,
    & span.any {
      flex-shrink: 0;
      display: inline-block;
      /* 項目名（行の高さ約30px）の1行目と中央を揃える */
      margin: 5px 0 0;
      border-radius: 2px;
      padding: 1px 6px;
      background: #a63a2e;
      color: #fff;
      font-family: var(--font-b);
      font-size: 12px;
      font-weight: bold;
      line-height: 1.6;
      letter-spacing: 0.05em;
    }

    & span.any {
      background: #e2e2e2;
      color: #555;
    }

    /* 入力欄 */
    & input[type="text"],
    & input[type="email"],
    & input[type="tel"],
    & textarea,
    & select {
      box-sizing: border-box;
      border: solid 1px #ccc;
      border-radius: 3px;
      padding: 0 14px;
      width: 100%;
      height: 48px;
      background-color: #fff;
      color: var(--color-text);
      font-family: inherit;
      font-size: var(--font-size-article);
      font-weight: normal;
      letter-spacing: 0.05em;

      &::placeholder {
        color: #888;
      }

      &:focus {
        outline: none;
        border-color: var(--color-green);
        background-color: #fff;
        box-shadow: 0 0 0 3px rgb(116 171 77 / 20%);
      }
    }

    & textarea {
      display: block;
      padding: 12px 14px;
      height: 88px;
      line-height: 1.7;
    }

    & #mf-text {
      height: 172px;
    }

    & select {
      padding: 0 16px;
      width: 420px;
      max-width: 100%;
    }

    & td .note {
      display: block;
      margin-top: 10px;
      color: var(--color-note);
      font-size: var(--font-size-note);
      line-height: var(--line-height-note);
      letter-spacing: 0.08em;
    }

    /* ラジオボタン（縦並び） */
    & .mwform-radio-field {
      display: block;
      margin: 10px 0 0;

      &:first-child {
        margin-top: 4px;
      }

      & + .mwform-radio-field {
        margin-left: 0;
      }

      & label {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 0 12px;
        padding: 4px 0;
        min-height: 40px;
        box-sizing: border-box;
        font-weight: normal;
        cursor: pointer;
      }
    }

    & .mwform-radio-field-text {
      font-size: var(--font-size-article);
      line-height: var(--line-height-table);
      letter-spacing: 0.05em;
    }

    & input[type="radio"],
    & input[type="checkbox"] {
      flex-shrink: 0;
      appearance: none;
      box-sizing: border-box;
      /* 選択肢の文字（行の高さ約30px）の1行目と中央を揃える */
      margin: 6px 0 0;
      border: solid 1px #666;
      border-radius: 50%;
      width: 18px;
      height: 18px;
      background: #fff;
      cursor: pointer;

      &:checked {
        border-color: var(--color-green-dark);
        background: radial-gradient(
          circle,
          var(--color-green-dark) 4px,
          transparent 4.5px
        );
      }

      &:focus-visible {
        outline: solid 2px var(--color-green);
        outline-offset: 2px;
      }
    }

    & input[type="checkbox"] {
      margin: 0;
      border-color: #888;
      border-radius: 3px;
      width: 20px;
      height: 20px;

      &:checked {
        border-color: var(--color-green-dark);
        background: var(--color-green-dark)
          url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E")
          no-repeat center / 100% 100%;
      }
    }

    /* reCAPTCHA 設置位置（ローカル確認用の枠） */
    & .recaptcha {
      display: flex;
      justify-content: center;
      align-items: center;
      box-sizing: border-box;
      margin: 32px auto 0;
      border: dashed 1px #bbb;
      border-radius: 3px;
      width: 304px;
      height: 78px;
      background: #fff;
      color: #555;
      font-size: 12px;
      letter-spacing: 0.05em;

      & span {
        display: flex;
        align-items: center;
        gap: 0 8px;

        /* 盾アイコン */
        &::before {
          content: "";
          display: block;
          width: 16px;
          height: 18px;
          background: currentColor;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 18'%3E%3Cpath d='M8 1L2 3.4v4.8c0 3.7 2.6 7.1 6 8 3.4-.9 6-4.3 6-8V3.4z' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M5.2 8.8l2 2 3.8-3.8' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E")
            no-repeat center / contain;
        }
      }
    }

    /* プライバシーポリシーへの同意 */
    & p.privacy {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 0 10px;
      margin: 32px 0 0;
      font-size: var(--font-size-article);
      letter-spacing: 0.05em;

      & .mwform-checkbox-field label {
        display: flex;
      }

      /* チェックボックスの文言は右側のラベルで表示 */
      & .mwform-checkbox-field-text {
        position: absolute;
        overflow: hidden;
        clip-path: inset(50%);
        width: 1px;
        height: 1px;
        white-space: nowrap;
      }

      & > label {
        display: block;
        font-weight: normal;
        cursor: pointer;

        & .require {
          margin-top: 0;
          margin-right: 10px;
          vertical-align: 1px;
        }
      }

      & a {
        color: var(--color-green-dark);
        text-underline-offset: 4px;
      }
    }

    /* ボタン */
    & .mw_wp_form p.submit {
      flex-wrap: wrap;
      gap: 16px;
      margin: 32px 0 0;

      & button[type="submit"] {
        position: relative;
        margin: 0;
        border: none;
        border-radius: 4px;
        padding: 0 40px;
        width: 360px;
        max-width: 100%;
        height: 66px;
        background: var(--color-yellow);
        box-shadow: 0 4px 0 #8a6d00;
        color: #fff;
        font-family: var(--font-b);
        font-size: 20px;
        font-weight: bold;
        letter-spacing: 0.08em;
        cursor: pointer;
        transition: opacity 0.3s;

        &::after {
          content: "";
          display: inline-block;
          margin-left: 24px;
          width: 16px;
          height: 13px;
          background: currentColor;
          mask: url(../arrow.min.svg) no-repeat center / contain;
        }

        &:hover {
          opacity: 0.85;
        }

        &:active {
          box-shadow: 0 2px 0 #8a6d00;
          transform: translateY(2px);
        }

        /* 戻る */
        &[name="submitBack"] {
          border: solid 1px #aaa;
          width: 200px;
          background: #fff;
          box-shadow: none;
          color: var(--color-text);

          &::after {
            content: none;
          }
        }
      }
    }
  }

  /*----------------------------------
    お問い合わせ後の流れ
  ----------------------------------*/
  & .contact-after {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 0 auto;
    width: 872px;
    max-width: 100%;

    & .item {
      box-sizing: border-box;
      border-radius: 16px;
      padding: 28px 32px;
      background: var(--color-bg-green);

      &.tel {
        --icon: url(tel_icon.min.svg);
        --icon-color: var(--color-green-dark);
      }

      &.form {
        --icon: url(mail_icon.min.svg);
        --icon-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) + 12px);
      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: var(--letter-spacing-article);

      /* 円 + アイコン */
      &::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(--icon-color);
      }

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

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

  & > .contact-note {
    box-sizing: border-box;
    margin: 18px auto 0;
    border-radius: 6px;
    padding: 14px 20px;
    width: 872px;
    max-width: 100%;
    background: var(--color-bg-cream);
    color: var(--color-note);
    font-size: var(--font-size-note);
    line-height: var(--line-height-note);
    letter-spacing: 0.05em;
  }

  /*----------------------------------
    個人情報の取扱いについて
  ----------------------------------*/
  & .contact-privacy {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: center;
    gap: 0 24px;
    box-sizing: border-box;
    margin: 0 auto;
    border: solid 1px #ddd;
    border-radius: 12px;
    padding: 22px 28px;
    width: 832px;
    max-width: 100%;
    background: #fff;

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

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

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

    & .more {
      margin: 0;

      /* 白地 + 緑枠のボタン */
      & a {
        border: solid 1.5px var(--color-green);
        padding: 0 48px 0 20px;
        min-width: 0;
        height: 48px;
        background: #fff;
        color: var(--color-green-dark);
        font-size: 16px;
        font-weight: 700;

        &::after {
          right: 20px;
        }
      }
    }
  }

  /*----------------------------------
    事務所情報
  ----------------------------------*/
  & .contact-office {
    margin: 0 auto 80px;
    width: 832px;
    max-width: 100%;

    & table {
      overflow: hidden;
      margin: 0;
      border: solid 1px #e0e8df;
      border-collapse: separate;
      border-spacing: 0;
      border-radius: 10px;
      width: 100%;
    }

    & th,
    & td {
      border: none;
      padding: 16px 22px;
      font-size: var(--font-size-article);
      line-height: var(--line-height-table);
      letter-spacing: 0.05em;
      vertical-align: top;
    }

    & tr:not(:last-child) {
      & th,
      & td {
        border-bottom: solid 1px #e0e8df;
      }
    }

    & th {
      box-sizing: border-box;
      border-right: solid 1px #e0e8df;
      width: 250px;
      background: #f3f8f2 !important;
      font-family: var(--font-b);
      font-weight: 700;
      text-align: left;
    }

    & a.tel {
      color: var(--color-green-dark);
      font-family: var(--font-tel);
      font-size: var(--font-size-article);
      font-weight: bold;
      text-decoration: none;
    }
  }

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

    & .content {
      column-gap: 40px;
    }

    & .mail a.mail-btn {
      gap: 24px;
    }

    & .att {
      margin-top: 20px;
      padding: 0 30px;

      & p {
        margin: 0;
      }

      & p > span:first-child {
        color: inherit;
      }
    }
  }
}

@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.contact-form h2 {
      margin: var(--space-section) auto 24px;
      font-size: var(--font-size-h2);
    }

    & .contact-intro {
      margin-top: 20px;
    }

    & .widget-contact {
      margin-bottom: 56px;
    }

    & section.contact-form {
      padding: 48px 0 48px;

      & h2 {
        margin-top: 0;
      }

      & > .lead {
        margin-bottom: 24px;
        padding: 0 10px;
        text-align: left;
      }

      & > .att {
        text-align: left;
        text-indent: -1em;
        padding-left: 1em;
      }

      & table.mailform {
        border-radius: 8px;

        & tr:not(:last-child) th {
          border-bottom: none;
        }

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

        & td {
          padding: 12px 14px 16px;
        }
      }

      & th label {
        justify-content: flex-start;
      }

      & span.require,
      & span.any {
        margin-top: 4px;
      }

      & input[type="radio"] {
        margin-top: 5px;
      }

      & select {
        width: 100%;
      }

      & .recaptcha {
        margin-top: 24px;
      }

      & p.privacy {
        flex-wrap: wrap;
        margin-top: 24px;
      }

      & .mw_wp_form p.submit {
        margin-top: 24px;

        & button[type="submit"] {
          width: 300px;
          height: 58px;
          font-size: 16px;
        }
      }
    }

    & .contact-after {
      grid-template-columns: 1fr;
      gap: 16px;

      & .item {
        border-radius: 10px;
        padding: 18px 16px 20px;
      }

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

    & > .contact-note {
      padding: 12px 14px;
    }

    & .contact-privacy {
      grid-template-columns: 44px 1fr;
      gap: 16px 14px;
      padding: 18px 16px 20px;

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

      & .more {
        grid-column: 1 / -1;
      }
    }

    & .contact-office {
      margin-bottom: 48px;

      & table {
        border-radius: 8px;
      }

      & th,
      & td {
        padding: 10px 14px;
      }

      & th {
        border-right: none;
        width: 100%;
      }

      & tr:not(:last-child) th {
        border-bottom: none;
      }
    }

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