/*
Theme Name: JIN Child
Template: jin
Version: 1.0
*/

/****** コメントモーダル ******/

html.modal-open,
body.modal-open {
    overflow: hidden !important;
    position: relative !important;
}

/* -----------------------------------------------
wpadminbar 最優先表示 + 強制復活
----------------------------------------------- */
body.modal-open .comment-modal-top {
    position: fixed !important;
    display: block !important;
    top: 0px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    background-color: rgba(0,0,0,1) !important;
    pointer-events: auto !important;
    z-index: 99999 !important; /* wpadminbarの下 */
}

/* -----------------------------------------------
モーダル背景は通常時は絶対に非表示
（modal-openクラスでのみ有効）
----------------------------------------------- */
body:not(.modal-open) .comment-modal {
    display: none !important;
}

/* モーダル背景は管理バー以外の部分を覆う */
body.modal-open .comment-modal {
    position: fixed !important;
    top: 32px !important; /* 管理バー部分を避ける */
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    background-color: rgba(0,0,0,0.5) !important;
    pointer-events: auto !important;
    z-index: 99998 !important; /* wpadminbarの下 */
}

/* モーダル本体（吹き出し） */
.comment-modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: #fff !important;
    padding: 15px 20px !important;
    max-width: 600px !important;
    width: 95% !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
    z-index: 99999 !important; /* wpadminbarと同じ層 */
    min-height: 400px !important;
    height: auto !important;
}


/* 閉じるボタン */
.comment-close {
    color: #aaa !important;
    position: absolute !important;
    top: 10px !important;
    right: 15px !important;
    font-size: 28px !important;
    font-weight: bold !important;
    cursor: pointer !important;
}

.comment-close:hover,
.comment-close:focus {
    color: #000 !important;
}

/* コメントボタン */
.comment-buttons a.comment-popup-btn {
    text-decoration: none !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: inherit !important;
    display: inline-block !important;
    padding: 10px 20px !important;
    background-color: #223a70 !important;
    color: white !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    margin-top: 20px !important;
    text-align: center !important;
    line-height: 1 !important;
}

.comment-buttons a.comment-popup-btn:hover {
    background-color: #18294e !important;
}


/* ★ 横並びバグ対策：flex無効化 */
.comment-modal .comment-flexbox,
.comment-modal .comment-child-flex {
    display: block !important;
}

/* ★ 名前欄・コメント欄・送信ボタンを全て同じ幅に */
.comment-modal textarea,
.comment-modal input[type="text"],
.comment-modal input[type="submit"] {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 14px !important;
}

.comment-modal .comment-form-comment {
    max-width: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* コメント欄 */
.comment-modal .comment-form-comment textarea {
    min-height: 300px !important;
    padding: 10px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 14px !important;
}

/* 入力欄全般 */
.comment-modal input[type="text"],
.comment-modal input[type="email"] {
    padding: 10px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 14px !important;
}

/* 送信ボタン */
.comment-modal input[type="submit"] {
    background-color: #223a70 !important;
    color: #fff !important;
    padding: 12px 20px !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    margin-top: 20px !important;
}

/* 送信ボタン hover */
.comment-modal input[type="submit"]:hover {
    background-color: #18294e !important;
}

/* ラベル等の不要な空白除去 */
.comment-modal label {
    display: none !important;
}

/* コメントフォーム間隔調整 */
.comment-modal .comment-form p {
    margin: 0 !important;
}

/* モーダル時にJINのSNSボタンや固定要素を非表示 */
body.modal-open .sns-floating-btn,
body.modal-open [style*="position:fixed"] {
    display: none !important;
}

/* ★ JIN対策：名前欄の横並び崩れ防止 */
.comment-modal .comment-child-flex {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ★ 名前欄inputも強制フル幅 */
.comment-modal input[name="author"] {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* スマホ調整 */
@media screen and (max-width: 480px) {
    .comment-modal-content {
        width: 95% !important;
        padding: 15px !important;
        height: auto !important;
    }
}





/* 通常の下部WordPressコメントフォームを非表示 */
.wpd-form-wrapper {
    display: none !important;
}
body:not(.modal-open) #respond,
body:not(.modal-open) .comment-respond,
body:not(.modal-open) .comments-area form {
    display: none !important;
}
/* コメントボックスの背景色を白に、内側に余白を追加 */
#comment-box {
    background-color: #ffffff !important;
    padding: 4px;
    border-radius: 2px;
}

/* コメント番号 + ユーザー名 */
.comment-author {
}

/* コメント日付 */
.comment-metadata {
    display: block;
    text-align: right;
}

/* コメント本文 */
.comment-content {
    line-height: 1.5;
}

/* コメントリンク (>>リンク) */
.comment-content a {
    font-weight: bold;
    color: #1f09c8 !important;
}

/* コメント一覧の背景と区切り線 + パディング縮小 */
.comment-body {
    background: #fff;
    box-sizing: border-box;
}

/* コメント ul リストの余計な左余白を削除 */
.comment-list {
    list-style: none;
    padding-left: 0;
}

/* --- 番号+名前をgreenに --- */
.comment-author {
    font-weight: bold;
    font-size: 12px;
    color: green;
}

/* 返信ボタン（comment_reply_link）の配置 */
.reply-button-wrapper {
    display: flex;
    justify-content: flex-end;   /* 右寄せ */
    align-items: center;
    min-height: 30px;            /* 最低高さ指定（好みで調整） */
    margin-top: 5px;
}
.reply-button-wrapper a.comment-reply-link {
    text-decoration: none;
}
a.comment-reply-link::after {
    content: none !important;
}
/* 親も子も全comment-body共通 */
.comment-body {
    position: relative;
}

/* 子コメントのみに縦棒追加 */
.depth-2 .comment-body::before,
.depth-3 .comment-body::before,
.depth-4 .comment-body::before,
.depth-5 .comment-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: -10px;                      /* ★leftを0に */
    width: 1px;
    height: 100%;
    background: #eee;
}
