/* カレンダー全体を最前面に出して透明な壁を防ぐ（強制突破版） */
.clinic-calendar-wrapper {
    position: relative;
    z-index: 10; /* テーマの壁より圧倒的に高い数値にする */
    pointer-events: auto;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 30px;
    font-family: sans-serif;
    font-family: "Alata", sans-serif;
}

/* ヘッダー（月切り替え）部分 */
.clinic-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.clinic-month-title {
    font-size: 24px;
    margin: 0;
    letter-spacing: 2px;
}

/* ボタンをさらに最前面にして確実にクリックできるようにする */
.clinic-nav {
    position: relative;
    z-index: 20;
    background: #fff;
    border: 1px solid #333;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 14px;
    font-family: "Alata", sans-serif;
}
.clinic-nav:hover {
    background: #f5f5f5;
}

/* カレンダーテーブル本体 */
.clinic-cal-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* セルの幅を均等にする */
    background: #fff;
}

/* 曜日ヘッダー（紫の背景） */
.clinic-cal-table th {
    background-color: #3c2d69; /* 添付画像に近い濃い紫 */
    color: #fff; /* 薄いピンクの文字 */
    text-align: center;
    padding: 10px 0;
    border: 1px solid #fff;
    font-weight: normal;
}

/* 各日付のセル */
.clinic-cal-table td {
    border: 1px solid #e0e0e0;
    vertical-align: top;
    height: 100px; /* セルの高さを確保 */
    padding: 0px;
    text-align: center;
    position: relative;
}

/* 空のセル（薄いグレー） */
.clinic-cal-table td.empty-cell {
    background-color: #f9f9f9;
}

/* 日付の数字 */
.clinic-date-num {
    position: relative;
    z-index: 2; /* ★の背景に埋もれないように手前に出す */
    font-size: 16px;
    margin-bottom: 5px;
    background: #f2f2f3;
}
/* 日曜・休日の日付色（ピンク） */
.clinic-cal-table th:nth-child(7),
.clinic-cal-table td:nth-child(7) .clinic-date-num,
.is-holiday-text {
    color: #e65c87; 
}
/* 土曜の日付色（青） */
.clinic-cal-table th:nth-child(6),
.clinic-cal-table td:nth-child(6) .clinic-date-num {
    color: #6C9BD2; 
}

/* 休診日マーク（斜め線） */
.clinic-holiday-mark {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e65c87;
    font-size: 24px; /* もっと大きくしたい場合は 28px などに変更してください */
    margin: 0;
    z-index: 1; /* 日付より後ろに配置 */
    padding-top: 1em; 
}

/* 営業時間表示 */
.clinic-hours {
    font-size: 13px;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

/* 基本イベント（薄紫の背景） */
.clinic-basic-event {
    background-color: #eae5f2;
    color: #3b2f5b;
    font-size: 11px;
    padding: 3px;
    margin-bottom: 3px;
    border-radius: 2px;
    display: inline-block;
    width: 90%;
}

.clinic-basic-event em{
    font-size: 90%;
}

.clinic-events-list{
    margin-bottom: 1em;
}

/* （※ td.is-special-event の背景色設定は削除しました） */
.clinic-cal-table td.is-special-event {
    background-color: transparent;
}

/* 特別イベントの★マーク（独立したピンクの枠にする） */
.clinic-special-star {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: #f3b4c9; /* ピンク背景 */
    color: #3b2f5b;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1; /* 日付より後ろに配置 */
    margin: 0;
    border-radius: 0; /* セルにぴったり合わせる */
    /* ⬇️ この1行を追加して、少しだけ下にずらす */
    padding-top: 1em;
}

.clinic-special-star:hover {
    opacity: 0.7;
}

/* --- ポップアップ（モーダル）のスタイル --- */
.clinic-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10; /* 最前面へ */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 黒い半透明の背景 */
.clinic-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

/* 白いコンテンツ枠 */
.clinic-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10;
}

/* 閉じるボタン（×） */
.clinic-modal-close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 28px;
    background: none; border: none;
    cursor: pointer; color: #999;
    line-height: 1; padding: 0;
}
.clinic-modal-close:hover { color: #e65c87; }

/* タイトルと本文 */
#clinic-modal-title {
    margin-top: 0;
    color: #3b2f5b;
    border-bottom: 2px solid #eae5f2;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 20px;
}
#clinic-modal-body {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}
#clinic-modal-body img {
    max-width: 100%;
    height: auto;
}

/* --- スマホ用のレスポンシブ（週間表示＆アコーディオン） --- */

@media (min-width: 769px) {
    /* PC表示時：スマホ用のテキストを隠す */
    .clinic-text-sp { display: none !important; }
    .clinic-sp-guide { display: none !important; } /* ★ここを追加 */
}

@media (max-width: 768px) {
    /* スマホ表示時：PC用のテキストを隠す */
    .clinic-text-pc { display: none !important; }
    .clinic-text-sp { display: inline !important; }
    
    /* ★ここを追加：スマホ用案内メッセージのデザイン */
    .clinic-sp-guide {
        display: block;
        text-align: center;
        font-size: 13px;
        color: #e65c87; /* カレンダーの休診日と同じピンクで少し目立たせる */
        font-weight: bold;
        margin-bottom: 10px;
        padding: 5px;
        background-color: #fcf4f6; /* うっすらピンクの背景色 */
        border-radius: 4px;
    }

    /* 週間表示のための行制御（アクティブな週だけ表示） */
    .clinic-cal-table tbody tr.clinic-week-row {
        display: none;
    }
    .clinic-cal-table tbody tr.clinic-week-row.is-active-week {
        display: table-row;
    }

    /* アコーディオンカラムの設定 */
    .clinic-cal-table {
        table-layout: fixed;
        width: 100%;
    }
    
    /* 基本のセル（縮小状態） */
    .clinic-cal-table th,
    .clinic-cal-table td {
        width: 12%; /* 全体の72%を6日で分ける */
        transition: width 0.3s ease;
        overflow: hidden;
        padding: 5px 2px;
    }
    
    /* 展開されたセル */
    .clinic-cal-table th.is-expanded,
    .clinic-cal-table td.is-expanded {
        width: 28%; /* クリックされた列だけ広くする */
    }

    /* 見切れ表示（省略記号）の処理 */
    .clinic-cal-table td:not(.is-expanded) .clinic-hours,
    .clinic-cal-table td:not(.is-expanded) .clinic-basic-event {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 9px; /* スマホ縮小時用に小さく */
        padding: 2px 1px;
    }
    
    /* 展開時は通常表示 */
    .clinic-cal-table td.is-expanded .clinic-hours,
    .clinic-cal-table td.is-expanded .clinic-basic-event {
        white-space: normal;
        font-size: 11px;
    }

    .clinic-date-num {
        font-size: 14px;
    }
}