/* 予約状況ページ専用スタイル (archive-reservation.php のインライン<style>から外部化) */
/* 注: .reservation-notice 系は TOP でも使うため top-responsive.css に集約済み。 */
.reservation-list-wrap { max-width: 1200px; margin: 0 auto; }
.reservation-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.8125rem;
  color: var(--color-text-light, #64748b);
  margin: 6px 0 12px;
}
.reservation-meta-row__updated,
.reservation-meta-row__period {
  color: var(--color-text-light, #64748b);
}
.reservation-meta-row a {
  color: var(--color-primary, #1565c0);
  text-decoration: none;
}
.reservation-meta-row a:hover { text-decoration: underline; }
.reservation-month-lead {
  font-size: 0.875rem;
  color: var(--color-text-light, #64748b);
  margin: 0 0 8px;
}

/* 日付別の行（PC: 横 2 列、SP: 縦 1 列） */
.reservation-day-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0;
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.reservation-day-row__head {
  padding: 16px 20px;
  border-right: 1px solid var(--color-border, #e2e8f0);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  background: #fff;
}
.reservation-day-row__date-num {
  font-size: 1.0625rem;
  font-weight: 800;
  color: #1a1a1a;
}
.reservation-day-row__date-num small {
  font-size: 1rem;
  margin: 0 1px;
  font-weight: 800;
}
.reservation-day-row__dow {
  font-size: 0.8125rem;
  color: #1a1a1a;
}
/* 土曜/日曜/祝日は曜日 + 日付ナンバーを色分け */
.reservation-day-row.is-sat .reservation-day-row__date-num,
.reservation-day-row.is-sat .reservation-day-row__dow { color: #2563eb; }
.reservation-day-row.is-sun .reservation-day-row__date-num,
.reservation-day-row.is-sun .reservation-day-row__dow,
.reservation-day-row.is-holiday .reservation-day-row__date-num,
.reservation-day-row.is-holiday .reservation-day-row__dow { color: #dc2626; }
.reservation-day-row__body {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.reservation-venue-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  background: #fff;
}
.reservation-venue-group + .reservation-venue-group {
  margin-top: 0;
}
.reservation-venue-group__head {
  margin: 0 0 2px;
}
.reservation-venue-group__badge {
  display: inline-block;
  padding: 5px 22px;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}
.reservation-venue-group__badge--arena { background: #1565c0; }
.reservation-venue-group__badge--room  { background: #c8763e; }
.reservation-venue-group__badge--other { background: #6b7280; }

/* 1 件 = 1 行 */
.reservation-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9375rem;
  color: inherit;
  padding: 12px 6px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
}
.reservation-row:last-of-type { border-bottom: 0; }
.reservation-row__line {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.reservation-row__room {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #c8763e;
  line-height: 1.2;
}
/* 会場グループ共通タイル (アリーナ / 諸室) */
.reservation-arena-group,
.reservation-room-group {
  padding: 10px 14px;
}
/* アリーナタイル */
.reservation-arena-group {
  background: #eff5fb;
}
.reservation-arena-group .reservation-row {
  border-bottom: 1px solid #c5d8ea;
  padding: 6px 0;
}
.reservation-arena-group .reservation-row:last-of-type { border-bottom: 0; }

/* サブ会場タイル (諸室のみ) */
.reservation-room-group {
  background: #fff8ee;
}
.reservation-room-group:last-child { margin-bottom: 0; }
.reservation-room-group__label {
  color: #c8763e;
  font-weight: 700;
  font-size: 0.8125rem;
}
.reservation-room-group .reservation-row {
  border-bottom: 1px solid #e7d5bc;
  padding: 6px 0;
}
.reservation-room-group .reservation-row:last-of-type { border-bottom: 0; }

/* 休館日: __body 内のフル幅塗りつぶし。余白を消して body 全体を灰色に。 */
.reservation-day-row__body:has(.reservation-closed-banner) {
  padding: 0;
  background: #d8d8d8;
}
.reservation-closed-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 100%;
  width: 100%;
  background: #d8d8d8;
  padding: 18px 16px;
  color: #1a1a1a;
}
.reservation-closed-banner__label {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}
.reservation-closed-banner__reason {
  font-size: 0.9375rem;
  color: #444;
  font-weight: 600;
}
.reservation-row__time {
  color: var(--color-text, #1e293b);
  font-weight: 700;
  white-space: nowrap;
  min-width: 120px;
}
.reservation-row__time svg { display: none; }
.reservation-row__title {
  font-weight: 500;
  color: var(--color-text, #1e293b);
  flex: 1;
}
.reservation-row__org {
  color: var(--color-text-light, #64748b);
  font-size: 0.875rem;
  white-space: nowrap;
}
.reservation-row__venue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
}
.reservation-row__venue--arena { background: #e3f2fd; color: #1565c0; }
.reservation-row__venue--room { background: #fff0d6; color: #c8763e; }
.reservation-row__venue--other { background: #f0f0f0; color: #555; }
/* 予約なし */
.reservation-empty-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-light, #64748b);
  font-size: 0.875rem;
}
.reservation-empty-inline svg {
  width: 18px;
  height: 18px;
  fill: var(--color-text-muted, #94a3b8);
}

/* ─────────────────────────────────────────
 * 月別ビュー: カレンダーグリッド + 日別パネル
 * ───────────────────────────────────────── */
.rmv { transition: opacity 0.15s ease; }
.rmv.is-loading { opacity: 0.55; pointer-events: none; }
.rmv__main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}
.rmv-cal {
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0;
  padding: 18px;
}
.rmv-cal__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.rmv-cal__nav-btn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text, #1e293b);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.rmv-cal__nav-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
/* 当月では「前月」を非アクティブ化（過去月は閲覧不可） */
.rmv-cal__nav-btn.is-disabled {
  color: #cbd5e1;
  background: #f8fafc;
  border-color: #eef2f7;
  cursor: default;
  pointer-events: none;
  opacity: 0.7;
}
.rmv-cal__nav-title {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--color-text, #1e293b);
}
.rmv-cal__dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-light, #64748b);
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  padding-bottom: 6px;
}
.rmv-cal__dow--sun { color: #dc2626; }
.rmv-cal__dow--sat { color: #2563eb; }
.rmv-cal__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-top: 4px;
}
.rmv-cal__day {
  position: relative;
  aspect-ratio: 1;
  background: #fff;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text, #1e293b);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}
.rmv-cal__day:hover:not(:disabled):not(.is-selected) { background: #f1f5f9; }
.rmv-cal__day.is-other-month { color: #cbd5e1; cursor: default; }
/* 予約受付期間外の日: 空き(○)を出さず、淡くして予約可能と誤解させない */
.rmv-cal__day.is-out-of-window:not(.is-selected) { color: #b0b8c4; background: #f1f3f6; }
.rmv-cal__day.is-out-of-window .dot { display: none; }
.rmv-cal__day.is-sun { color: #dc2626; }
.rmv-cal__day.is-sat { color: #2563eb; }
.rmv-cal__day.is-other-month.is-sun,
.rmv-cal__day.is-other-month.is-sat { color: #cbd5e1; }
.rmv-cal__day.is-today { font-weight: 800; }
.rmv-cal__day.is-selected {
  background: var(--color-primary, #1565c0);
  color: #fff;
}
.rmv-cal__day.is-selected .dot { display: none; }
.rmv-cal__day .num { line-height: 1; }
.rmv-cal__day .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
}
.dot.dot--available    { background: #22c55e; }
.dot.dot--partial      { background: #f59e0b; }
.dot.dot--busy         { background: #ef4444; }
.dot.dot--unavailable  { background: #94a3b8; }

.rmv-cal__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.8125rem;
  color: var(--color-text-light, #64748b);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border, #e2e8f0);
}
.rmv-cal__legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* 右ペイン: 日別パネル */
.rmv__right { display: flex; flex-direction: column; }
.rmv-day-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0;
  padding: 16px 18px;
}
.rmv-day-panel.is-active { display: block; }
.rmv-day-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.rmv-day-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text, #1e293b);
}
/* 日付部分の曜日色: 土=青 / 日・祝=赤 */
.rmv-day-panel__date--sat { color: #1565c0; }
.rmv-day-panel__date--sun { color: #d32f2f; }
.rmv-day-panel__count {
  display: inline-block;
  background: #e3f2fd;
  color: #1565c0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.rmv-day-panel__count--closed { background: #e5e7eb; color: #4b5563; }
.rmv-day-panel__count--arena { background: #e3f2fd; color: #1565c0; }
.rmv-day-panel__count--room  { background: #fff0d6; color: #c8763e; }
.rmv-day-panel__counts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rmv-day-panel__empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: var(--color-text-light, #64748b);
  font-size: 0.875rem;
  padding: 16px 4px;
}
.rmv-day-panel__empty svg {
  width: 18px;
  height: 18px;
  fill: var(--color-text-muted, #94a3b8);
  flex-shrink: 0;
}
/* 予約受付期間外: 空き表示と区別できるよう色を変える */
.rmv-day-panel__empty--out {
  color: #b45309;
  font-weight: 700;
}
.rmv-day-panel__empty--out svg { fill: #d97706; }
.rmv-day-panel__closed {
  background: #d8d8d8;
  color: #1a1a1a;
  padding: 24px 16px;
  text-align: center;
  border-radius: 6px;
}
.rmv-day-panel__closed-label {
  display: block;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}
.rmv-day-panel__closed-reason {
  display: block;
  margin-top: 6px;
  font-size: 0.9375rem;
  color: #444;
}

.rmv-venue {
  background: #f8fafc;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.rmv-venue--arena { background: #eff5fb; }
.rmv-venue--room  { background: #fff8ee; }
.rmv-venue:last-of-type { margin-bottom: 0; }
.rmv-venue__badge {
  display: inline-block;
  padding: 3px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.rmv-venue__badge--arena { background: #1565c0; }
.rmv-venue__badge--room  { background: #c8763e; }
.rmv-venue__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.875rem;
}
/* 諸室サブ会場 ([全諸室]/[多目的室1]…) ごとの区切り */
.rmv-subroom + .rmv-subroom {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e7d5bc;
}
.rmv-subroom__label {
  color: #c8763e;
  font-weight: 700;
  font-size: 0.8125rem;
  margin-bottom: 2px;
}
.rmv-venue__item + .rmv-venue__item {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  padding-top: 6px;
  margin-top: 2px;
}
.rmv-venue__time {
  color: var(--color-text, #1e293b);
  font-weight: 700;
  white-space: nowrap;
  min-width: 110px;
}
.rmv-venue__title {
  flex: 1;
  color: var(--color-text, #1e293b);
}
.rmv-venue__org {
  flex-basis: 100%;
  width: 100%;
  font-size: 0.8125rem;
  color: var(--color-text-light, #64748b);
  margin-top: 2px;
}

.rmv__help {
  background: #eff5fb;
  border-left: 3px solid var(--color-primary, #1565c0);
  padding: 14px 18px;
  border-radius: 0 6px 6px 0;
}
.rmv__help-title {
  margin: 0 0 8px;
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--color-primary, #1565c0);
}
.rmv__help-list {
  margin: 0;
  padding-left: 1.4em;
  font-size: 0.8125rem;
  color: var(--color-text, #1e293b);
}
.rmv__help-list li + li { margin-top: 4px; }

@media (max-width: 768px) {
  .rmv__main { grid-template-columns: 1fr; gap: 16px; }
  .rmv-cal { padding: 12px; }
  .rmv-cal__nav-title { font-size: 1rem; }
  .rmv-cal__day { font-size: 0.875rem; }
  .rmv-day-panel { padding: 14px 14px; }
  /* 予約項目を 時間 → 利用団体名 → 備考 の縦並びに (直近7日含む共通: 768px 以下) */
  .rmv-venue__item { flex-direction: column; align-items: stretch; gap: 2px; }
  .rmv-venue__time { min-width: 0; }
  .rmv-venue__title { flex: none; }
  .rmv-venue__org { margin-top: 0; }
}
/* 月別カレンダー日別パネルは 1024px 以下で縦積みに (直近7日には適用しない) */
@media (max-width: 1024px) {
  .rmv-day-panel .rmv-venue__item { flex-direction: column; align-items: stretch; gap: 2px; }
  .rmv-day-panel .rmv-venue__time { min-width: 0; }
  .rmv-day-panel .rmv-venue__title { flex: none; }
  .rmv-day-panel .rmv-venue__org { margin-top: 0; }
}

/* 日付セレクタ (SP のみ表示): 7 タイルが画面幅に均等配置、横スクロール無し */
.reservation-date-picker { display: none; }
.reservation-date-picker__list {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 4px 0;
}
.reservation-date-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 62px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 22px 4px 6px;
  font-family: inherit;
  color: var(--color-text, #1e293b);
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.reservation-date-tile__num {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  line-height: 1;
  color: inherit;
}
.reservation-date-tile__dow {
  font-size: 0.6875rem;
  font-weight: 400;
  text-align: center;
  color: #94a3b8;
}
/* 月ラベル: タイル上部中央に常時表示。色・大きさは曜日と同じ */
.reservation-date-tile__month {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1;
}
/* 休館日のときは月ラベルを非表示（休館日ストリップが上端を占める） */
.reservation-date-tile.is-closed .reservation-date-tile__month { display: none; }
/* 休館日ラベル: タイル上端をフル幅で覆うグレーストリップ
   （タイル自体の白枠は維持し、ラベル背景はタイル内側の白枠幅いっぱい） */
.reservation-date-tile__badge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #9ca3af;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 0;
  text-align: center;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* 土・日・祝: テキスト色のみ変更（背景は白のまま）
   - 土: 青
   - 日 / 祝: 赤 */
.reservation-date-tile.is-sat { color: #2563eb; }
.reservation-date-tile.is-sat .reservation-date-tile__num,
.reservation-date-tile.is-sat .reservation-date-tile__dow { color: #2563eb; }
.reservation-date-tile.is-sun,
.reservation-date-tile.is-holiday { color: #dc2626; }
.reservation-date-tile.is-sun .reservation-date-tile__num,
.reservation-date-tile.is-sun .reservation-date-tile__dow,
.reservation-date-tile.is-holiday .reservation-date-tile__num,
.reservation-date-tile.is-holiday .reservation-date-tile__dow { color: #dc2626; }

/* 休館日: 背景は白のまま、ラベルストリップで識別。押下不可 */
.reservation-date-tile.is-closed {
  background: #fff;
  border-color: #e5e7eb;
  cursor: not-allowed;
}
.reservation-date-tile.is-closed .reservation-date-tile__num,
.reservation-date-tile.is-closed .reservation-date-tile__dow { color: #9ca3af; }

/* アクティブ（選択中）: 薄いスカイブルー枠 + 軽い shadow */
.reservation-date-tile.is-active {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.4);
}

/* SP: 縦アコーディオン */
@media (max-width: 768px) {
  .reservation-date-picker { display: block; }
  /* SP では選択中の day-row のみ表示 (display: none/grid で切り替え) */
  .reservation-day-row { display: none; grid-template-columns: 1fr; }
  .reservation-day-row.is-active {
    display: grid;
    animation: jukaidome-day-fade-in 0.22s ease-out;
  }
  /* 日付 + 曜日 を 1 行に並べて表示 */
  .reservation-day-row__head > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
  }
  .reservation-day-row__dow {
    font-size: 0.875rem;
  }
  .reservation-day-row__head {
    border-right: 0;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    flex-direction: row;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 14px 18px;
  }
  .reservation-day-row__body {
    padding: 12px 18px 16px;
  }
  .reservation-row {
    padding: 10px 12px;
  }
  .reservation-row__line {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .reservation-row__time {
    min-width: 0;
  }
  .reservation-row__title {
    flex: none;
    width: 100%;
  }
  .reservation-row__org { white-space: normal; }
}

/* ── 月別カレンダーセクション (既存維持) ── */
.cal-section { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.cal-year-title { font-size: 1.25rem; font-weight: 800; color: var(--color-text); margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.cal-year-title::before { content: ''; display: inline-block; width: 4px; height: 24px; background: var(--color-primary); border-radius: 2px; }
.cal-month-grid { display: grid; grid-template-columns: repeat(6, auto); gap: 8px 24px; justify-content: start; }
.cal-month { display: inline-block; padding: 6px 4px; text-decoration: none; color: #4a9bab; font-size: 0.875rem; font-weight: 500; transition: color 0.2s ease; cursor: pointer; }
.cal-month:hover { color: var(--color-primary); text-decoration: underline; }
.cal-month.is-current { color: var(--color-primary); font-weight: 700; text-decoration: underline; }
@media (max-width: 768px) {
  .cal-section { padding-left: 16px; padding-right: 16px; }
  .cal-month-grid { grid-template-columns: repeat(4, auto); }
}
@media (max-width: 480px) {
  .cal-month-grid { grid-template-columns: repeat(3, auto); }
}
@keyframes jukaidome-day-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reservation-day-row.is-active { animation: none; }
}
