/* FAQ Block Pattern Styles */
/* フロントエンドとエディタの両方で使用 */

.faq-block,
.editor-styles-wrapper .faq-block,
.wp-block-group.faq-block,
.editor-styles-wrapper .wp-block-group.faq-block {
  margin: 40px 0;
  width: 100%;
}

/* FAQ見出し */
.faq-block h2,
.editor-styles-wrapper .faq-block h2 {
  color: #C48800;
  font-size: 20px;
  font-weight: bold !important;
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 10px;
  position: relative;
}

.faq-block h2::after,
.editor-styles-wrapper .faq-block h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, #C48800 0, #C48800 150px, #CCCCCC 150px, #CCCCCC 100%);
}

/* FAQ項目 */
.faq-item,
.editor-styles-wrapper .faq-item,
.wp-block-group.faq-item,
.editor-styles-wrapper .wp-block-group.faq-item {
  margin-bottom: 10px !important;
}

/* Q（質問）ボックス */
.faq-question,
.editor-styles-wrapper .faq-question {
  position: relative;
  background-color: #F7F7F7;
  border: 1px solid #CCCCCC;
  border-radius: 15px;
  padding: 20px 60px 20px 20px;
  margin-bottom: 0 !important;
  cursor: pointer;
  transition: background-color 0.3s ease, padding-bottom 0.3s ease;
}

/* Q マーク */
.faq-question::before,
.editor-styles-wrapper .faq-question::before {
  content: 'Q';
  position: absolute;
  left: 20px;
  top: 20px;
  font-size: 20px;
  font-weight: normal !important;
  color: #5A5757;
  pointer-events: none;
}

.faq-question.active {
  padding-bottom: 20px;
}

.faq-question:hover {
  background-color: #f9f9f9;
}

.faq-question > p,
.faq-question-body,
.editor-styles-wrapper .faq-question > p,
.editor-styles-wrapper .faq-question-body {
  font-size: 20px;
  font-weight: normal !important;
  line-height: 1.5;
  margin: 0 !important;
  padding-left: 30px;
  color: #5A5757;
  pointer-events: none;
}

/* トグルボタン - 線画で表現 */
.faq-question::after,
.editor-styles-wrapper .faq-question::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 24px;
  width: 24px;
  height: 24px;
  background: 
    linear-gradient(to right, #5A5757 0, #5A5757 100%) center/100% 1px no-repeat,
    linear-gradient(to bottom, #5A5757 0, #5A5757 100%) center/1px 100% no-repeat;
  transition: background 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.faq-question.active::after,
.editor-styles-wrapper .faq-question.active::after {
  background: linear-gradient(to right, #5A5757 0, #5A5757 100%) center/100% 1px no-repeat;
  transform: rotate(180deg);
}

/* A（回答）セクション - Q枠内に配置 */
.faq-answer,
.editor-styles-wrapper .faq-answer {
  padding: 20px 0 0 30px;
  display: none;
}

.faq-answer.show,
.editor-styles-wrapper .faq-answer.show {
  display: block;
}

.faq-answer p,
.editor-styles-wrapper .faq-answer p {
  margin-bottom: 15px;
  line-height: 1.5;
  color: #5A5757 !important;
  font-size: inherit;
  font-weight: 300 !important;
}

.faq-answer p:last-child,
.editor-styles-wrapper .faq-answer p:last-child {
  margin-bottom: 0;
}
/* A本文内のリンクをクリック可能に */
.faq-answer a,
.editor-styles-wrapper .faq-answer a {
  pointer-events: auto;
  cursor: pointer;
  color: #0073aa;
  text-decoration: underline;
}

.faq-answer a:hover,
.editor-styles-wrapper .faq-answer a:hover {
  color: #005177;
}
/* エディタでは回答を常に表示 */
.editor-styles-wrapper .faq-answer {
  display: block;
  opacity: 0.7;
}

.editor-styles-wrapper .faq-answer::before {
  content: '【回答エリア - 公開時は折りたたまれます】';
  display: block;
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

/* エディタ内ではQ本文をクリック可能に */
.editor-styles-wrapper .faq-question > p,
.editor-styles-wrapper .faq-question-body {
  pointer-events: auto !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .faq-block h2 {
    font-size: 18px;
  }
  
  .faq-block h2::after {
    background: linear-gradient(to right, #C48800 0, #C48800 100px, #CCCCCC 100px, #CCCCCC 100%);
  }
  
  .faq-question {
    padding: 15px 50px 15px 15px;
  }
  
  .faq-question::before {
    left: 15px;
    top: 15px;
    font-size: 18px;
  }
  
  .faq-question > p,
  .faq-question-body {
    font-size: 18px;
    padding-left: 25px;
  }
  
  .faq-question::after {
    right: 15px;
    top: 18px;
    width: 20px;
    height: 20px;
  }
  
  .faq-answer {
    padding: 10px 0 0 25px;
    margin-top: 10px !important;
  }
}
