/* ======================================================
   イベント管理システム：エリア別＆2段・3段タブ統合パッケージ
   ====================================================== */

/* --- 全体枠 --- */
.area-calendar-wrapper {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
}

/* ラジオボタン本体（非表示） */
.area-calendar-wrapper input[type="radio"] {
  display: none;
}

/* ==========================================
   第1段：エリア切り替えタブ
   ========================================== */
.area-tab-menu {
  display: flex;
  gap: 6px;
  border-bottom: 3px solid #111;
  margin-bottom: 20px;
}

.area-label {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  background-color: #f1f5f9;
  color: #475569;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
}

.area-label:hover {
  background-color: #e2e8f0;
}

#tab-area-west:checked ~ .area-tab-menu label[for="tab-area-west"],
#tab-area-north:checked ~ .area-tab-menu label[for="tab-area-north"],
#tab-area-central:checked ~ .area-tab-menu label[for="tab-area-central"],
#tab-area-east:checked ~ .area-tab-menu label[for="tab-area-east"] {
  background-color: #111;
  color: #ffffff;
}

.area-panel {
  display: none;
}

#tab-area-west:checked ~ .area-content-container .panel-west,
#tab-area-north:checked ~ .area-content-container .panel-north,
#tab-area-central:checked ~ .area-content-container .panel-central,
#tab-area-east:checked ~ .area-content-container .panel-east {
  display: block;
}

/* --- 市町村案内表示エリア --- */
.area-cities-info {
  background-color: #f8fafc;
  border-left: 4px solid #111;
  padding: 10px 15px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #475569;
  border-radius: 0 6px 6px 0;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
}

/* ==========================================
   第2段：週間 / 月間 切り替えタブ
   ========================================== */
.view-tab-menu {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.view-label {
  padding: 8px 22px;
  background-color: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.view-label:hover {
  background-color: #f1f5f9;
}

#west-view-weekly:checked ~ .view-tab-menu label[for="west-view-weekly"],
#west-view-monthly:checked ~ .view-tab-menu label[for="west-view-monthly"],
#north-view-weekly:checked ~ .view-tab-menu label[for="north-view-weekly"],
#north-view-monthly:checked ~ .view-tab-menu label[for="north-view-monthly"],
#central-view-weekly:checked ~ .view-tab-menu label[for="central-view-weekly"],
#central-view-monthly:checked ~ .view-tab-menu label[for="central-view-monthly"],
#east-view-weekly:checked ~ .view-tab-menu label[for="east-view-weekly"],
#east-view-monthly:checked ~ .view-tab-menu label[for="east-view-monthly"] {
  background-color: #0073aa;
  color: #ffffff;
  border-color: #0073aa;
}

.view-panel {
  display: none;
}

#west-view-weekly:checked ~ .view-weekly,
#west-view-monthly:checked ~ .view-monthly,
#north-view-weekly:checked ~ .view-weekly,
#north-view-monthly:checked ~ .view-monthly,
#central-view-weekly:checked ~ .view-weekly,
#central-view-monthly:checked ~ .view-monthly,
#east-view-weekly:checked ~ .view-weekly,
#east-view-monthly:checked ~ .view-monthly {
  display: block;
}

/* ==========================================
   第3段：期間選択タブ（今週〜3週後 / 当月〜3ヶ月後）
   ========================================== */
.period-tab-menu {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #cbd5e1;
}

.period-label {
  padding: 6px 16px;
  background-color: #f1f5f9;
  color: #475569;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-label:hover {
  background-color: #e2e8f0;
}

.period-panel {
  display: none;
}

.period-title-bar {
  text-align: center;
  font-weight: bold;
  font-size: 15px;
  padding: 10px;
  background: #111;
  color: #ffffff;
  margin-bottom: 12px;
  border-radius: 6px;
}

/* --- 第3タブ選択時スタイル（週間） --- */
.area-panel [id*="-wtab-"]:nth-of-type(1):checked ~ .period-tab-menu label:nth-child(1),
.area-panel [id*="-wtab-"]:nth-of-type(2):checked ~ .period-tab-menu label:nth-child(2),
.area-panel [id*="-wtab-"]:nth-of-type(3):checked ~ .period-tab-menu label:nth-child(3),
.area-panel [id*="-wtab-"]:nth-of-type(4):checked ~ .period-tab-menu label:nth-child(4) {
  background-color: #111;
  color: #ffffff;
}

.area-panel [id*="-wtab-"]:nth-of-type(1):checked ~ .wpanel-0,
.area-panel [id*="-wtab-"]:nth-of-type(2):checked ~ .wpanel-1,
.area-panel [id*="-wtab-"]:nth-of-type(3):checked ~ .wpanel-2,
.area-panel [id*="-wtab-"]:nth-of-type(4):checked ~ .wpanel-3 {
  display: block;
}

/* --- 第3タブ選択時スタイル（月間） --- */
.area-panel [id*="-mtab-"]:nth-of-type(1):checked ~ .period-tab-menu label:nth-child(1),
.area-panel [id*="-mtab-"]:nth-of-type(2):checked ~ .period-tab-menu label:nth-child(2),
.area-panel [id*="-mtab-"]:nth-of-type(3):checked ~ .period-tab-menu label:nth-child(3),
.area-panel [id*="-mtab-"]:nth-of-type(4):checked ~ .period-tab-menu label:nth-child(4) {
  background-color: #111;
  color: #ffffff;
}

.area-panel [id*="-mtab-"]:nth-of-type(1):checked ~ .mpanel-0,
.area-panel [id*="-mtab-"]:nth-of-type(2):checked ~ .mpanel-1,
.area-panel [id*="-mtab-"]:nth-of-type(3):checked ~ .mpanel-2,
.area-panel [id*="-mtab-"]:nth-of-type(4):checked ~ .mpanel-3 {
  display: block;
}

/* ==========================================
   1. 週間カレンダー（テーブルスタイル）
   ========================================== */
.weekly-table {
  table-layout: fixed !important;
  width: 100% !important;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
}

.weekly-table th, 
.weekly-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 14px;
  box-sizing: border-box;
  word-break: break-word;
}

.weekly-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: bold;
}

.col-date {
  width: 25% !important;
  font-weight: bold;
  color: #1e293b;
  white-space: nowrap;
}

.col-city {
  width: 20% !important;
  color: #475569;
  white-space: nowrap;
}

.col-event {
  width: 55% !important;
}

.weekly-table .sat { color: #0073aa; }
.weekly-table .sun { color: #d32f2f; }

.event-link-card {
  display: block;
  background: #e3f2fd;
  color: #0d47a1;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  border-left: 4px solid #111;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.event-link-card:last-child {
  margin-bottom: 0;
}

.event-link-card:hover {
  background: #1e88e5;
  color: #ffffff;
}

.event-time {
  font-weight: bold;
  margin-right: 6px;
}

.no-event-text {
  color: #94a3b8;
  font-size: 13px;
}

/* ==========================================
   2. 月間カレンダー（グリッド＋月曜始まり）
   ========================================== */
.month-calendar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: #e2e8f0;
  gap: 1px;
}

.day-name {
  background-color: #f8fafc;
  text-align: center;
  padding: 10px 0;
  font-size: 13px;
  font-weight: bold;
  color: #475569;
}

.day-name.sat { color: #0073aa; }
.day-name.sun { color: #d32f2f; }

.day-cell {
  background-color: #ffffff;
  min-height: 95px;
  padding: 6px;
  box-sizing: border-box;
}

.day-cell.dummy {
  background-color: #f8fafc;
  opacity: 0.5;
}

.day-cell .num {
  font-size: 12px;
  font-weight: bold;
  color: #475569;
  display: block;
  margin-bottom: 4px;
}

.day-cell.sat .num { color: #0073aa; }
.day-cell.sun .num { color: #d32f2f; }

.day-cell .evt {
  display: block;
  font-size: 11px;
  background-color: #e3f2fd;
  color: #0d47a1;
  padding: 3px 6px;
  border-radius: 3px;
  margin-bottom: 3px;
  line-height: 1.3;
  font-weight: bold;
  text-decoration: none;
  border-left: 3px solid #111;
}

.day-cell .evt:hover {
  background-color: #1e88e5;
  color: #ffffff;
}

/* ==========================================
   3. レスポンシブ対応
   ========================================== */
@media screen and (max-width: 768px) {
  .area-label {
    padding: 10px 0;
    font-size: 13px;
  }

  .view-label {
    padding: 6px 16px;
    font-size: 13px;
  }

  .period-label {
    padding: 5px 12px;
    font-size: 12px;
  }

  .weekly-table th, 
  .weekly-table td {
    padding: 10px 6px;
    font-size: 12px;
  }

  .col-date { width: 30% !important; }
  .col-city { width: 25% !important; }
  .col-event { width: 45% !important; }

  .day-cell {
    min-height: 60px;
    padding: 3px;
  }

  .day-cell .num {
    font-size: 11px;
  }

  .day-cell .evt {
    font-size: 10px;
    padding: 2px 3px;
  }