
/* ===== Simple Flex Header (v3 - Balanced Design) ===== */

/* Kill legacy caption & nav blocks */
.monthly-calendar caption { display: none !important; }
.monthly-prev, .monthly-next, .nav-left, .nav-right,
.monthly-prev-next, .monthly-nav-header { display: none !important; }

/* Header row: flex; title center; nav right */
.mtssb-cal-header { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  margin: 8px 0 32px; /* 下マージンを22px→32pxに変更（+10px） */
  flex-wrap: nowrap; 
}

.calendar-header { 
  margin: 0; 
  border: 0; 
  flex: 1 1 auto; 
}

/* 年月を適切なサイズで表示（修正：半分に縮小） */
.calendar-title-text { 
  font-size: clamp(18px, 2.5vw, 24px); /* 32-48px → 18-24px に縮小 */
  line-height: 1.3; 
  font-weight: 700; 
  text-align: center; 
  border: 0; 
  text-decoration: none; 
  margin: 0; 
}

/* 前月・翌月のリンクを右寄せ */
.mtssb-cal-nav { 
  margin-left: auto; /* 自動的に右寄せ */
  white-space: nowrap; 
  text-align: right; 
  font-size: 0.95em; 
  position: static !important; 
  right: auto !important; 
  top: auto !important; 
  transform: none !important; 
}

.mtssb-cal-nav .calendar-nav-link { 
  text-decoration: underline; 
}

.mtssb-cal-nav .sep { 
  margin: 0 0.75em; 
  display: inline-block; 
}

/* Fallback: if nav is not a child of header, still align right */
.calendar-header + .mtssb-cal-nav,
.calendar-header ~ .mtssb-cal-nav,
.monthly-calendar + .mtssb-cal-nav,
.monthly-calendar ~ .mtssb-cal-nav {
  display: block;
  text-align: right !important;
  white-space: nowrap;
  margin-top: 6px;
}

/* カレンダー内の「予約可」リンクに下線を追加 */
.monthly-calendar a,
.monthly-calendar .calendar-daylink,
.day-box a {
  text-decoration: underline;
}

/* ===== カレンダーテーブルのセル幅を均一に ===== */
.monthly-calendar table {
  width: 100%;
  table-layout: fixed; /* セル幅を均等に */
  border-collapse: collapse;
}

.monthly-calendar th,
.monthly-calendar td {
  width: 14.28%; /* 100% ÷ 7 = 14.28% */
  text-align: center;
  vertical-align: top;
  padding: 8px;
  box-sizing: border-box;
}

.monthly-calendar th.week-title {
  font-weight: bold;
}

/* ===== ランチ／ディナー切替トグル ===== */
.mtssb-switcher {
  display: flex;
  justify-content: center;
  margin: 0 0 28px;
}

.mtssb-switcher__inner {
  display: inline-flex;
  background: #ececec;
  border-radius: 999px;
  padding: 5px;
  gap: 4px;
}

.mtssb-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none !important;
  color: #777;
  transition: background .15s, color .15s, box-shadow .15s;
  line-height: 1;
}

.mtssb-switcher__btn:hover {
  color: #444;
  text-decoration: none !important;
}

.mtssb-switcher__btn--lunch.is-active {
  background: #e8a33d;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(232,163,61,.40);
}

.mtssb-switcher__btn--dinner.is-active {
  background: #3f5b8b;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(63,91,139,.40);
}

@media (max-width:480px) {
  .mtssb-switcher__btn {
    padding: 11px 20px;
    font-size: 15px;
    gap: 5px;
  }
}

/* Mobile */
@media (max-width:640px){
  .mtssb-cal-header { flex-wrap: wrap; }
  .mtssb-cal-nav { width: 100%; margin-left: 0; text-align: center; margin-top: 6px; }
  
  /* モバイルでも年月はバランスの取れたサイズ */
  .calendar-title-text { 
    font-size: clamp(16px, 4vw, 20px); 
  }
  
  /* モバイルではセル内のパディングを小さく */
  .monthly-calendar th,
  .monthly-calendar td {
    padding: 4px;
  }
}
