/* customer_voice.css の既存のスタイルに以下の変更・追加を加えてください */

/* ページネーションのスタイルはそのまま使用 */
.pagination {
    margin-top: 40px;
    text-align: center;
}
.pagination a,
.pagination .page-numbers.current {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    border: 1px solid #0056b3;
    border-radius: 5px;
    text-decoration: none;
    color: #0056b3;
    background-color: #fff;
    transition: all 0.3s ease;
}
.pagination a:hover {
    background-color: #0056b3;
    color: #fff;
}
.pagination .page-numbers.current {
    background-color: #0056b3;
    color: #fff;
    cursor: default;
}
@media (max-width: 768px) {
    .pagination a,
    .pagination .page-numbers.current {
        padding: 6px 10px;
        margin: 0 3px;
        font-size: 14px;
    }
}


/* ここから、お客様の声カードの全体のスタイル */
body {
    font-family: 'メイリオ', Meiryo, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', Osaka, Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; 
}

.customer-voices-section {
    padding: 60px 20px;
    max-width: 1200px; /* PCで2列を維持しやすいように調整 */
    margin: 0 auto;
    text-align: center;
}

.customer-voices-section h2 {
    font-size: 32px;
    color: #0056b3;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.customer-voices-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #0056b3;
    margin: 10px auto 0;
}

.voice-list {
    display: grid;
    /* !important を追加して、他の場所で上書きされないようにします */
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)) !important; /* カードの最小幅を増やし、2列になりやすくする */
    gap: 30px;
    margin-top: 40px;
}

.voice-card {
    background-color: #f8fcfd;
    border: 1px solid #e0eaf4;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ヘッダー部分 */
.voice-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px; /* 少し余白を増やす */
}

/* アイコン（性別で色分け） */
.voice-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: 24px 24px;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
    margin-right: 10px;
    flex-shrink: 0;
    transform: translateY(0px);
}
.voice-icon.gender-male {
    background-image: url('https://your-site-url/wp-content/uploads/2024/07/male_icon.svg'); /* 男性アイコンのURL */
    background-color: #cce0f5;
}
.voice-icon.gender-female {
    background-image: url('https://your-site-url/wp-content/uploads/2024/07/female_icon.svg'); /* 女性アイコンのURL */
    background-color: #ffe0eb;
}

/* 年代タグ */
.voice-age {
    font-size: 14px;
    background-color: #e6f2ff;
    color: #0056b3;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    line-height: 1; /* 行の高さを調整して中央揃えを維持 */
}

/* 日付 */
.voice-details {
    margin-bottom: 10px;
    display: flex; /* 日付とクリニック・評価グループを横並びにする */
    justify-content: space-between; /* 左右に配置 */
    align-items: flex-end; /* 下揃え */
    flex-wrap: wrap; /* 必要に応じて折り返す */
}
.voice-date {
    font-size: 12px;
    color: #777;
    margin-bottom: 0; /* 親要素の flex-end に合わせる */
    text-align: left; /* 左寄せ */
    flex-shrink: 0;
    margin-right: 15px; /* 右側に少し余白 */
    white-space: nowrap; /* 日付を折り返さない */
}

/* クリニック名と総合評価のグループ */
.clinic-rating-group {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end; /* 右寄せ */
    flex-grow: 1; /* 残りのスペースを埋める */
    flex-wrap: wrap; /* 必要に応じて折り返す */
}
.voice-clinic {
    font-size: 18px;
    color: #555;
    margin-bottom: 0;
    font-weight: bold;
    line-height: 1;
    flex-shrink: 1; /* 必要に応じて縮小 */
    min-width: 0; /* 縮小時に中身がはみ出さないように */
    margin-right: 10px; /* 評価との間に余白 */
}
.voice-rating {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    flex-shrink: 0;
}
.stars {
    --percent: calc(var(--rating) / 5 * 100%);
    display: inline-block;
    font-size: 18px;
    font-family: Times;
    line-height: 1;
    letter-spacing: 2px;
    margin-right: 5px;
}
.stars::before {
    content: '★★★★★';
    background: linear-gradient(90deg, #ffc107 var(--percent), #c4c4c4 var(--percent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.average-score {
    font-size: 16px;
    font-weight: bold;
    color: #0056b3;
    line-height: 1;
}

/* 満足度スコアのリスト */
.satisfaction-scores {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    border-top: 1px dashed #e0eaf4;
    border-bottom: 1px dashed #e0eaf4;
    padding-top: 15px;
    padding-bottom: 15px;
    background-color: #fcfdff;
    border-radius: 4px;
    display: grid; /* グリッドレイアウトで2列に */
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}
.satisfaction-scores li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0; /* リスト項目のデフォルトマージンをリセット */
    font-size: 12px;
    color: #555;
}
.score-item {
    font-weight: normal;
    color: #333;
    flex-grow: 1; 
    flex-shrink: 1; 
    text-align: left;
    padding-right: 5px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}
.score-rating-single {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    margin-left: auto; /* 右端に寄せる */
    min-width: 35px; /* 点数が収まる最小幅 */
}
.star-single {
    font-size: 15px;
    color: #ffc107;
    margin-right: 2px;
    flex-shrink: 0;
}
.score-value-text {
    font-weight: bold;
    color: #0056b3;
    font-size: 12px;
    min-width: 20px;
    text-align: right;
    flex-shrink: 0;
}

/* 患者様の声の本文と画像 */
.voice-feedback {
    margin-top: 15px;
    border-top: 1px solid #eee; /* feedbackの区切り線 */
    padding-top: 15px;
}
.voice-question-title { /* 質問タイトル */
    font-size: 18px;
    color: #333;
    font-weight: bold;
    margin: 0 0 5px;
    line-height: 1.4;
}
.voice-feedback .question-date { /* 質問日 */
    font-size: 12px;
    color: #777;
    text-align: left;
    margin-bottom: 15px;
}

.voice-feedback .voice-answer-content {
    font-size: 15px;
    color: #444;
    font-style: italic; /* 斜体 */
    margin-bottom: 15px; /* 下に余白 */
}
.voice-feedback .voice-answer-content p { /* wpautopで追加されるpタグへの対応 */
    margin-bottom: 0; /* デフォルトマージンをリセット */
}

/* 改善前後の画像コンテナ */
.before_after {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 15px; /* 画像間の隙間 */
    margin: 20px 0;
    flex-wrap: wrap; /* スマホで折り返す */
}
.before_after figure {
    flex: 1 1 45%; /* 幅を調整（スマホでは100%になるように） */
    text-align: center;
    margin: 0;
    min-width: 150px; /* 小さくなりすぎないように */
}
.before_after figure span {
    display: block;
    width: 100%;
    height: auto;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 5px;
}
.before_after figure img {
    max-width: 100%;
    height: auto;
    display: block;
}
.before_after figcaption {
    font-size: 14px;
    font-weight: bold;
    color: #555;
}
.voice-answer-date { /* 回答日 */
    font-size: 12px;
    color: #777;
    text-align: right;
    margin-top: 15px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .customer-voices-section {
        padding: 40px 15px; /* スマホの左右パディングを少し減らす */
    }

    .customer-voices-section h2 {
        font-size: 28px;
    }

    .voice-list {
        grid-template-columns: 1fr !important; /* スマホでは1列表示を強制 */
        gap: 20px; /* スマホでのカード間ギャップを少し減らす */
    }

    .voice-details {
        flex-direction: column; /* スマホでは縦に並べる */
        align-items: flex-start; /* 左寄せ */
    }
    .voice-date {
        text-align: left; /* スマホでは左寄せ */
        margin-bottom: 5px; /* 下に余白 */
    }
    .clinic-rating-group {
        justify-content: flex-start; /* 左寄せ */
        width: 100%; /* 全幅 */
    }
    .voice-clinic {
        margin-right: 15px; /* 評価との間に余白 */
    }

    .voice-question-title {
        font-size: 17px;
    }

    .voice-feedback .voice-answer-content {
        font-size: 14px;
    }

    .before_after {
        flex-direction: column; /* スマホでは縦に並べる */
        gap: 20px;
    }
    .before_after figure {
        flex: 1 1 100%; /* スマホでは全幅 */
    }

    .satisfaction-scores {
        grid-template-columns: 1fr; /* スマホでは1列に */
        gap: 8px 0;
        padding-left: 10px;
        padding-right: 10px;
    }
    .satisfaction-scores li {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    .score-item {
        flex-basis: auto;
        padding-right: 5px;
        max-width: calc(100% - 50px);
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    .score-rating-single {
        flex-basis: auto;
        justify-content: flex-end;
        min-width: 40px;
    }
    .score-value-text {
        font-size: 13px;
    }
}