/* ========================================
   Contact Page Specific Styles
   Scope: body.page-template-page-contact, body.page-template-page-contact-confirm, body.page-template-page-thanks
======================================== */

.page-template-page-contact .contactform-section,
.page-template-page-contact-confirm .contactform-section,
.page-template-page-thanks .contactform-section {
  margin: 0 auto 120px;
}

/* フォームのコンテナスタイル */

.contact-outline {
  background: #fff;
  border-radius: 24px;
  padding: 80px 120px;
  margin-top: 60px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.03);
}
.contact-note {
  text-align: center;
  font-size: 14px;
}

.page-template-page-contact .contactform-section .section-heading {
    text-align: left;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 30px;
    line-height: 1.6;
}

.page-template-page-thanks .section-heading {
    text-align: left;
    margin-bottom: 60px;
}

.page-template-page-contact-confirm .section-heading {
    text-align: left;
}

.wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.wpcf7-form p {
  margin: 0;
}

/* フォームエディタで追加した行のラッパー */
.contact-form-row {
  display: flex;
  align-items: center; /* 上下中央揃え */
  gap: 20px;
  margin-bottom: 60px;
}

/* お問い合わせ内容(textarea)の行だけ上揃えにする */
.contact-form-row:has(textarea) {
  align-items: flex-start;
}

/* ラベル */
.wpcf7-form dt {
  width: 240px;
  flex: 0 0 240px;
  font-size: 18px;
  font-weight: bold;
  text-align: left;
}

/* お問い合わせ内容(textarea)のラベルのみ上揃えにする */
.contact-form-row:has(textarea) dt {
  padding-top: 18px;
}

/* 入力欄ラッパー */
.wpcf7-form dd {
  flex: 1;
  margin: 0;
}

.wpcf7-form .wpcf7-form-control-wrap {
  display: block; /* ddの中でブロック要素として振る舞う */
}

/* 入力欄（テキスト、メール、電話） */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
  width: 100%;
  max-width: 700px;
  height: 60px;
  background-color: #EEEEEE;
  border: 1px solid #CCCCCC;
  border-radius: 20px;
  padding: 0 20px;
  font-size: 16px;
  font-family: inherit;
}

/* お問い合わせ内容 */
.wpcf7-form textarea {
  height: 240px;
  padding: 20px;
  resize: vertical; /* 縦方向のみリサイズ可能に */
}

/* ご用件（ラジオボタン） */
.wpcf7-radio .wpcf7-list-item {
  display: inline-block;
  margin: 0 10px 10px 0;
}

.wpcf7-radio input[type="radio"] {
  display: none; /* ラジオボタン本体は隠す */
}

.wpcf7-radio .wpcf7-list-item-label {
  display: inline-block;
  height: 60px;
  padding: 0 30px;
  line-height: 58px; /* border分を考慮 */
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 0;
}

/* 未選択時のスタイル */
.wpcf7-radio .wpcf7-list-item-label {
  background-color: #EEEEEE;
  border: 1px solid #11312B;
  color: #11312B;
}

/* 選択時のスタイル */
.wpcf7-radio input[type="radio"]:checked + .wpcf7-list-item-label {
  background-color: #11312B;
  border-color: #11312B;
  color: #fff;
}

/* プライバシーポリシー同意 */
.wpcf7-acceptance {
  display: block; /* pタグのgridを上書き */
  text-align: center;
}

.wpcf7-acceptance .wpcf7-list-item-label a {
  text-decoration: underline;
}

/* 同意チェックのラベル（テキスト）のスタイルをリセット */
.wpcf7-acceptance .wpcf7-list-item-label {
  display: inline-flex; width: auto; text-align: left; padding-top: 0; font-weight: 400; flex-basis: auto;
}

.wpcf7-acceptance input[type="checkbox"] {
  display: none; /* チェックボックス本体は隠す */
}

.wpcf7-acceptance .wpcf7-list-item-label {
  display: inline-flex;
  align-items: center;
  flex-direction: row; /* デフォルトの並び順を明示 */
  cursor: pointer;
}

.wpcf7-acceptance .wpcf7-list-item-label::before {
  content: '';
  display: inline-block;
  width: 30px;
  height: 30px;
  background-color: #EEEEEE;
  border: 1px solid #CCCCCC;
  border-radius: 10px;
  margin-right: 15px;
  transition: background-color 0.2s;
}

/* チェックされた時のスタイル */
.wpcf7-acceptance input[type="checkbox"]:checked + .wpcf7-list-item-label::before {
  background-color: #11312B;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 70%;
  background-position: center;
  background-repeat: no-repeat;
  border-color: #11312B;
}

/* 送信ボタンのpタグのスタイルをリセット */
.wpcf7-form p.submit-wrapper {
  text-align: center;
}

/* 送信ボタン */
.wpcf7-submit {
  display: block; /* margin: auto を効かせるためにブロック要素にする */
  width: 100%;
  max-width: 300px;
  height: 60px;
  background-color: #11312B;
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.3s;
  margin: 0 auto; /* 中央揃え */
}

.wpcf7-submit:hover {
  opacity: 0.8;
}

/* ========================================
   Confirm Page Styles
======================================== */
.contact-form-confirmation {
  margin-bottom: 60px;
}

.contact-form-confirmation .contact-form-row {
  align-items: flex-start;
}

.contact-form-confirmation dt {
  width: 240px;
  flex: 0 0 240px;
  font-size: 18px;
  font-weight: bold;
}

.contact-form-confirmation dd {
  white-space: pre-wrap; /* 改行を反映させる */
  word-break: break-all; /* 長い文字列で折り返す */
}

/* 新しいボタンのグループ */
.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 60px;
  flex-wrap: wrap; /* スマホで折り返すように */
}

/* 新しい「入力へ戻る」ボタン */
.button-back-alt {
  display: block;
  width: 300px;
  max-width: 100%;
  height: 60px;
  line-height: 58px; /* for border */
  border-radius: 30px;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: #FFFFFF;
  color: #222222;
  border: 1px solid #11312B;
  cursor: pointer;
}

.button-back-alt:hover {
  background-color: #f0f0f0;
}

/* 新しい「送信」ボタン */
.button-send {
  display: block;
  width: 300px;
  max-width: 100%;
  height: 60px;
  background-color: #11312B;
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.3s;
}

.button-send:hover {
  opacity: 0.8;
}

/* Contact Form 7が自動生成するボタンのグループを非表示にする */
.submit-button-group {
  display: none;
}

/* CF7が自動生成するpタグを無効化 */
.submit-button-group > p {
  display: contents;
}

/* ========================================
   Thanks Page Styles
======================================== */
.thanks-message p {
  text-align: left;
  line-height: 1.8;
  margin-bottom: 60px;
}

.thanks-message .button-back-to-top {
  margin: 0 auto; /* 中央揃え */
}

.button-back-to-top {
  display: block;
  width: 300px;
  max-width: 100%;
  height: 60px;
  line-height: 58px; /* for border */
  border-radius: 30px;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: #FFFFFF;
  color: #222222;
  border: 1px solid #11312B;
}


.contact-outline-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.contact-outline-row {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.contact-outline-row dt {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  font-weight: bold;
  font-size: 18px;
  color: #222;
  letter-spacing: 0.04em;
  line-height: 1.7;
  text-align: left;
  margin: 0;
  flex-shrink: 0;
}

.contact-outline-row dd {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: #222;
  line-height: 1.9;
  letter-spacing: 0.01em;
}

.contact-outline-representative {
  display: flex;
  gap: 32px;
}

.contact-rep-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.contact-rep-img {
  width: 240px;
  height: 320px;
  object-fit: cover;
  border-radius: 16px;
  background: #f0f0f0;
}

.contact-rep-title {
  font-size: 0.95em;
  color: #666;
}

.contact-map-block {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 32px;
  margin-top: 8px;
}

.contact-map-block > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.contact-map-block iframe {
  width: 480px;
  height: 360px;
  border-radius: 16px;
  border: none;
}

.contact-map-address {
  font-size: 1em;
  color: #222;
  line-height: 1.8;
  min-width: 180px;
  margin-top: 0;
}

.contact-map-block a {
  font-size: 0.97em;
  color: #222;
  text-decoration: underline;
  margin-top: 4px;
  display: inline-block;
}

@media (max-width: 900px) {
  .contact-outline {
    padding: 32px 10px 24px 10px;
  }

  .contact-outline-row {
    flex-direction: column;
    gap: 8px;
  }

  .contact-outline-representative {
    flex-direction: column;
    gap: 16px;
  }

  .contact-rep-img {
    width: 100%;
    max-width: 220px;
    height: auto;
  }

  .contact-map-block {
    flex-direction: column;
    gap: 8px;
  }

  .contact-map-block iframe {
    width: 100%;
    min-width: 0;
    height: 180px;
  }
}

@media (max-width: 600px) {
  .contact-outline {
    padding: 12px 2vw 12px 2vw;
    border-radius: 12px;
  }

  .contact-outline-list {
    gap: 18px;
  }

  .contact-outline-row dt {
    min-width: 0;
    font-size: 1em;
  }

  .contact-rep-img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .page-template-page-contact .contactform-section,
  .page-template-page-contact-confirm .contactform-section,
  .page-template-page-thanks .contactform-section {
    padding: 0 20px 0;
  }
  .confirm-actions {
    flex-direction: column;
    align-items: center;
  }
  .wpcf7-radio .wpcf7-list-item-label {
    height: 50px;
    line-height: 48px;
  }
  .contact-form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px; /* dtとddの間隔を調整 */
  }
  .wpcf7-form dt {
    display: block;
    width: auto;
    flex: none; /* flex-basisをリセット */
  }
  .wpcf7-acceptance .wpcf7-list-item-label {
    justify-content: center;
  }
  .submit-button-group {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .contact-form-confirmation dt {
    width: auto;
    flex: 0;
  }

  .contact-outline-row + .contact-outline-row {
    margin-top: 40px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .contact-outline {
    padding: 60px 80px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .contact-outline {
    padding: 60px 40px;
  }
}

@media (max-width: 480px) {
  .contact-outline {
    padding: 60px 20px;
    margin-top: 40px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .contact-outline-representative {
    display: flex;
    flex-direction: row;
    gap: 24px;
  }
}