/* ========================================
   コメントセクションブロック - スタイル
   ======================================== */

/* CSS変数定義 */
:root {
    --comments-section-border-color: #B1B3B5;
    --comments-section-border-width: 2px;
    --comments-section-border-radius: 8px;
    --comments-section-avatar-size: 80px;
    --comments-section-avatar-size-mobile: 60px;
    --comments-section-bubble-tail-size: 12px;
    --comments-section-bubble-tail-offset: 3px;
}

/* メインコンテナ */
.comments-section,
section.comments-section {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin: 40px 0;
    padding: 0;
    background: transparent;
    max-width: 1200px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* 吹き出しの配置 */
.comments-section-left,
section.comments-section-left {
    flex-direction: row;
}

.comments-section-right,
section.comments-section-right {
    flex-direction: row-reverse;
}

/* 医師プロフィール */
.doctor-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 120px;
}

.doctor-avatar {
    width: var(--comments-section-avatar-size) !important;
    height: var(--comments-section-avatar-size) !important;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f5f5f5;
}

.doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.doctor-name {
    margin-top: 4px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.doctor-title {
    font-size: 0.875rem;
    text-align: center;
}

/* 吹き出しコンテンツ */
.comment-content {
    flex: 1;
    border: var(--comments-section-border-width) solid var(--comments-section-border-color);
    background: #FFF;
    padding: 20px;
    border-radius: var(--comments-section-border-radius);
    position: relative;
}

/* 三角形のしっぽ - 共通スタイル */
.comment-content::before,
.comment-content::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    z-index: 1;
}

.comment-content::after {
    z-index: 2;
}

/* 左側の三角形のしっぽ */
.comments-section-left .comment-content::before,
section.comments-section-left .comment-content::before {
    left: calc(-1 * var(--comments-section-bubble-tail-size));
    top: 30px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: var(--comments-section-bubble-tail-size) solid var(--comments-section-border-color);
}

.comments-section-left .comment-content::after,
section.comments-section-left .comment-content::after {
    left: calc(-1 * var(--comments-section-bubble-tail-size) + var(--comments-section-bubble-tail-offset));
    top: 31px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-right: 10px solid #FFF;
}

/* 右側の三角形のしっぽ */
.comments-section-right .comment-content::before,
section.comments-section-right .comment-content::before {
    right: calc(-1 * var(--comments-section-bubble-tail-size));
    top: 30px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: var(--comments-section-bubble-tail-size) solid var(--comments-section-border-color);
}

.comments-section-right .comment-content::after,
section.comments-section-right .comment-content::after {
    right: calc(-1 * var(--comments-section-bubble-tail-size) + var(--comments-section-bubble-tail-offset));
    top: 31px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 10px solid #FFF;
}

/* コメントヘッダー */
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

.comment-title {
    font-size: 1rem !important;
    font-weight: 600;
}

.comment-text {
    line-height: 1.8;
    font-size: 1rem !important;
}

/* 太字スタイル - strongタグ */
.comments-section strong,
.comments-section .doctor-name strong,
.comments-section .doctor-title strong,
.comments-section .comment-title strong,
.comments-section .comment-text strong,
.comments-section .comment-text p strong,
.comments-section .comment-text div strong,
.comments-section .comment-text span strong,
section.comments-section strong,
section.comments-section .doctor-name strong,
section.comments-section .doctor-title strong,
section.comments-section .comment-title strong,
section.comments-section .comment-text strong,
section.comments-section .comment-text p strong,
section.comments-section .comment-text div strong,
section.comments-section .comment-text span strong {
    font-weight: 700 !important;
}

/* 太字スタイル - .bold-textクラス */
.comments-section .bold-text,
.comments-section .doctor-name .bold-text,
.comments-section .doctor-title .bold-text,
.comments-section .comment-title .bold-text,
.comments-section .comment-text .bold-text,
.comments-section .comment-text p .bold-text,
.comments-section .comment-text div .bold-text,
.comments-section .comment-text span .bold-text,
section.comments-section .bold-text,
section.comments-section .doctor-name .bold-text,
section.comments-section .doctor-title .bold-text,
section.comments-section .comment-title .bold-text,
section.comments-section .comment-text .bold-text,
section.comments-section .comment-text p .bold-text,
section.comments-section .comment-text div .bold-text,
section.comments-section .comment-text span .bold-text {
    font-weight: 700 !important;
}

/* マーカーのスタイル */
.comments-section mark.medical-marker {
    background-color: rgba(122, 154, 158, 0.3);
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .comments-section,
    section.comments-section {
        margin: 20px 0;
    }

    .doctor-avatar {
        width: var(--comments-section-avatar-size-mobile) !important;
        height: var(--comments-section-avatar-size-mobile) !important;
        border-radius: 50% !important;
    }

    .doctor-name {
        font-size: 1rem;
    }
    
    .doctor-title {
        font-size: 0.75rem;
    }
}
