/* =========================================
   既存のスタイル（回答・ベストアンサー）
   ========================================= */

/* 専門家の回答 */
.expert-answer {
    background-color: #eef7ff;
    border-left: 5px solid #0073aa;
    padding: 15px;
}

/* ベストアンサー */
.best-answer {
    background-color: #dff0d8;
    border-color: #3c763d;
    position: relative; /* ラベルの位置の基準 */
}

/* ベストアンサーのラベル */
.best-answer-label {
    font-weight: bold;
    color: #3c763d;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #c8e6c9;
}

/* =========================================
   デザイン調整（新規追加分）
   ========================================= */

/* 1. 質問部分の背景色を変更 */
/* 質問詳細ページの質問記事部分（回答エリアを除く）のみを対象にします */
body.single-user_question article.user_question {
    background-color: #CAE0CD; /* 指定色: 薄い緑 */
    padding: 30px;             /* 文字が端にくっつかないように内側に余白 */
    margin-bottom: 40px;       /* 下の回答エリアとの間に隙間を空ける */
    border-radius: 5px;        /* 角を少し丸くする */
}

/* 2. 登録案内（Register as...）のスタイル調整 */
/* PHP側のインラインスタイル(center)を上書きするために !important を使用します */
.rtp-bqa-register-notice {
    text-align: left !important; /* 左寄せにする */
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    margin-top: 20px;
}

/* Registerボタンの見た目 */
.rtp-bqa-register-notice a.button {
    display: inline-block;
    text-decoration: none;
    background: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border-radius: 3px;
    margin-top: 10px; /* テキストとの間隔 */
}
.rtp-bqa-register-notice a.button:hover {
    background: #005177;
}

/* 3. ページ全体の余白（両端3%ずつ空ける） */
/* 質問詳細ページ、質問アーカイブ、ブログ詳細、ブログアーカイブに適用 */
body.single-user_question #primary,
body.post-type-archive-user_question #primary,
body.single-professional_blog #primary,
body.post-type-archive-professional_blog #primary {
    width: 94%;           /* 100% - 3% - 3% = 94% */
    margin-left: auto;    /* 中央寄せ（左右均等に余白ができる） */
    margin-right: auto;
    box-sizing: border-box;
}

/* モバイル対応：画面が狭いときは余白を少し狭める */
@media (max-width: 600px) {
    body.single-user_question #primary,
    body.post-type-archive-user_question #primary,
    body.single-professional_blog #primary,
    body.post-type-archive-professional_blog #primary {
        width: 96%; /* スマホでは2%ずつに狭める */
    }
    
    body.single-user_question article.user_question {
        padding: 15px; /* スマホではパディングも少し減らす */
    }
}

/* =========================================
   Blog/Question Submission Form Styles
   ========================================= */

.rtp-bqa-form {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.rtp-bqa-form .form-row {
    margin-bottom: 25px;
}

.rtp-bqa-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.rtp-bqa-form input[type="text"],
.rtp-bqa-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.rtp-bqa-form input[type="text"]:focus,
.rtp-bqa-form textarea:focus {
    border-color: #0073aa;
    outline: none;
}

/* WordPress Editor Styles */
.rtp-bqa-form .wp-editor-wrap {
    border: 1px solid #ccc;
    border-radius: 4px;
}

.rtp-bqa-form .wp-editor-tools {
    border-bottom: 1px solid #ccc;
    background-color: #f9f9f9;
}

.rtp-bqa-form .wp-editor-container {
    padding: 0;
}

.rtp-bqa-form textarea#blog_content,
.rtp-bqa-form textarea#question_content {
    border: none !important; /* Override inline styles */
    box-shadow: none !important;
}

.rtp-bqa-form input[type="submit"] {
    display: inline-block;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: #0073aa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.rtp-bqa-form input[type="submit"]:hover {
    background-color: #005177;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rtp-bqa-form {
        margin: 20px auto;
        padding: 20px;
    }
}
