/**
 * Fan Portal 統一レイアウトCSS
 * 全コンテンツの横幅とレイアウトを統一
 */

/* 全体を包むラッパーのスタイル */
.fp-after-content-wrapper {
    background: #fff !important;
    border-radius: 12px !important;
    padding: 40px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    margin-top: 40px !important;
    margin-bottom: 40px !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* 内部要素の横幅調整 */
.fp-after-content-sections,
.fp-comments-section,
.fp-comment-form,
.fp-next-section,
.fp-bottom-custom-html {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 各要素の白い背景を削除 */
.fp-comments-section {
    background: transparent !important;
    box-shadow: none !important;
    padding: 30px 0 !important;
    margin-bottom: 40px !important;
}

/* 重複する入力欄を非表示 */
.fp-comments-section .comment-form-comment + .comment-form-comment {
    display: none !important;
}

/* 既存のWordPressコメントフォームを非表示 */
.comments-area:not(.fp-comments-section) {
    display: none !important;
}

/* 関連コンテンツセクションのスタイル */
.fp-next-section {
    background: transparent !important;
    padding: 0 !important;
}

.fp-next-contents {
    background: transparent !important;
    box-shadow: none !important;
    padding: 30px 0 !important;
}

/* カスタムHTMLエリアのスタイル */
.fp-bottom-custom-html {
    background: transparent !important;
    box-shadow: none !important;
    padding: 20px 0 !important;
    margin-top: 30px !important;
}

/* モバイル対応 */
@media (max-width: 768px) {
    /* 全体ラッパーのパディングを調整 */
    .fp-after-content-wrapper {
        padding: 20px !important;
        margin-top: 20px !important;
        margin-bottom: 20px !important;
        border-radius: 8px !important;
    }
    
    /* 内部要素のパディング調整 */
    .fp-comments-section {
        padding: 20px 0 !important;
        margin-bottom: 20px !important;
    }
    
    .fp-next-section,
    .fp-bottom-custom-html {
        padding: 15px 0 !important;
    }
    
    /* コメントフォームのモバイル対応 */
    .fp-comment-form-wrapper {
        padding: 15px !important;
    }
    
    /* 個別コメントのパディング */
    .fp-comment {
        padding: 15px !important;
        margin-bottom: 10px !important;
    }
}

/* さらに小さい画面（スマートフォン）対応 */
@media (max-width: 480px) {
    .fp-after-content-wrapper {
        padding: 15px !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        border-radius: 0 !important;
    }
    
    /* 関連コンテンツのグリッドを1列に */
    .fp-next-contents > div:last-child {
        grid-template-columns: 1fr !important;
    }
}

/* コメント投稿後の自動更新表示用 */
.fp-comment-loading {
    opacity: 0.6;
    pointer-events: none;
}

.fp-comment-loading::after {
    content: "送信中...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 新しいコメントのハイライト */
.fp-comment-new {
    animation: fp-highlight 2s ease-out;
}

@keyframes fp-highlight {
    0% {
        background-color: #fff3cd;
    }
    100% {
        background-color: transparent;
    }
}