/* 基本スタイルとテーマ競合対策 */
.mai-info-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    color: #333; /* テーマによる白文字化を防止 */
}
.mai-card { background-color: #fff; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.mai-card-title { font-family: 'Kosugi Maru', sans-serif; background-color: #006699; color: #fff; padding: 12px 20px; margin: 0; font-size: 1.2em; border-top-left-radius: 8px; border-top-right-radius: 8px; font-weight: 400; }
.mai-card-body { padding: 20px; }
.mai-card-body p { margin-top: 0; }

/* 感染症情報セクション */
.mai-infection-info { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.mai-infection-image { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); cursor: pointer; transition: transform 0.2s; }
.mai-infection-image:hover { transform: scale(1.03); }

/* 休日当番医セクション */
.mai-doctors-area-title { text-align: center; font-size: 1.1em; color: #006699; margin-top: 0; font-weight: bold; }
.mai-month-navigator { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 10px; background-color: #eaf4ff; border-radius: 4px; }
.mai-month-btn { text-decoration: none; color: #006699; font-weight: bold; padding: 5px 10px; border: 1px solid #006699; border-radius: 4px; transition: background-color 0.3s, color 0.3s; }
.mai-month-btn:hover { background-color: #006699; color: #fff; }
.mai-current-month { font-size: 1.2em; font-weight: bold; color: #333; }

/* アコーディオンレイアウト */
.mai-doctors-container { display: flex; flex-direction: column; gap: 1px; background-color: #ddd; border: 1px solid #ddd; border-radius: 8px; overflow: hidden;}
.mai-date-group-header { display: flex; cursor: pointer; transition: background-color 0.2s; background-color: #fff; }
.mai-date-group-header:hover { background-color: #f9f9f9; }
.mai-date-column { flex: 0 0 140px; padding: 15px; text-align: center; background-color: #f7f7f7; border-right: 1px solid #ddd; display: flex; flex-direction: column; justify-content: center; }
.mai-date-column.is-holiday { color: #d9534f; }
.mai-date-month-day { font-size: 1.4em; font-weight: bold; }
.mai-date-weekday { font-size: 1.1em; }
.mai-holiday-name { font-size: 0.9em; margin-top: 5px; }
.mai-accordion-icon { margin-left: auto; padding: 15px; font-size: 1.2em; color: #aaa; transition: transform 0.3s; }
.is-open > .mai-date-group-header .mai-accordion-icon { transform: rotate(180deg); }

.mai-date-group-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; background-color: #fff; }
.is-open > .mai-date-group-body { max-height: 1000px; /* 十分な高さを確保 */ }

.mai-doctor-entry { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-top: 1px solid #eee; }
.mai-doctor-info { display: flex; flex-direction: column; gap: 5px; }
.mai-doctor-location { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; }
.mai-doctor-city { color: white; padding: 3px 8px; border-radius: 4px; font-size: 0.85em; }
.mai-doctor-city.city-minamishimabara { background-color: #006699; }
.mai-doctor-city.city-unzen { background-color: #009966; }
.mai-doctor-town { font-size: 0.95em; }
.mai-doctor-name { font-size: 1.1em; font-weight: bold; }
.mai-doctor-links { display: flex; gap: 10px; flex-shrink: 0; margin-left: 10px; }
.mai-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 16px; transition: opacity 0.3s; line-height: 1; }
.mai-icon-btn{
	padding-left:5px;
}
.mai-icon-btn:hover { opacity: 0.8; }
.mai-map-btn { background-color: #d9534f; } .mai-home-btn { background-color: #337ab7; } .mai-tel-btn { background-color: #28a745; }

/* カレンダー */
.mai-calendar-wrapper { margin-bottom: 20px; }
.mai-calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mai-calendar th { background-color: #f7f7f7; font-weight: normal; padding: 8px 0; font-size: 0.9em; }
.mai-calendar td { border: 1px solid #e9e9e9; text-align: center; padding: 12px 0; vertical-align: middle; }
.mai-calendar th:first-child { color: #d9534f; } .mai-calendar th:last-child { color: #337ab7; }
.mai-calendar td.has-duty { background-color: #eaf4ff; font-weight: bold; color: #d9534f; cursor: pointer; transition: background-color 0.2s; }
.mai-calendar td.has-duty:hover { background-color: #d0e8ff; }

/* 画像拡大モーダル */
.mai-image-modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.85); padding: 20px; box-sizing: border-box; }
.mai-image-modal-content { margin: auto; display: block; max-width: 90%; max-height: 90%; }
.mai-image-modal-close { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; }
.mai-image-modal-close:hover, .mai-image-modal-close:focus { color: #bbb; text-decoration: none; }
.mai-date-group.highlight { box-shadow: 0 0 10px rgba(255, 215, 0, 0.7); }

/* レスポンシブ対応 */
@media (max-width: 680px) {
    .mai-date-group-header { flex-wrap: wrap; }
    .mai-date-column { flex-grow: 1; border-right: none; }
    .mai-accordion-icon { flex-basis: 100%; text-align: center; border-top: 1px solid #eee; }
    .mai-doctor-entry { flex-direction: column; align-items: flex-start; gap: 10px; }
    .mai-doctor-links { padding-top: 5px; margin-left: 0; }
}
/* === 改善案A：アコーディオンヘッダーを中央寄せにする === */
.mai-date-group-header {
    align-items: center; /* アイコンを垂直中央に */
}
.mai-date-column {
    flex: 1; /* 幅を全体に広げる */
    border-right: none; /* 右の境界線を削除 */
    background-color: transparent; /* 背景色をなくす */
    display: flex;
    flex-direction: row; /* 横並びに変更 */
    align-items: baseline; /* テキストのベースラインを揃える */
    justify-content: left; /* 中央寄せ */
    gap: 0.75em; /* 各要素の間隔 */
}

/*手作業追加*/
.mai-date-group-header{
	background-color:lightgray;
}
.date-group {
    border: solid 2px #337ab7!important;
}