/***********************************************************
 * グローバル変数 (CSSカスタムプロパティ)
 ***********************************************************/
 :root {
  --color-bg-dark: #242422;
  --color-text-dark: #242422;
  --color-text-light: #f5f5f5;
  --color-blue: #007bff;
  --color-blue-hover: #0056b3;
  --color-red: #ff2020;
  --color-red-hover: #850000;
  --gradient-dark: linear-gradient(to right, #242422, #4d4d52);
  --border-radius: 10px;
  --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --box-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
  --transition-duration: 0.3s;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: #fafafa;
  color: #333;
  box-sizing: border-box;
}

body {
  padding-top: 90px; 
}

@media (max-width: 768px) {
  body {
    max-width: 360px;  /* 横幅を固定(もしくは320pxなどお好みで) */
    margin: 0 auto;    /* 画面中央寄せ */
  }
}
/* ヘッダー */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--gradient-dark);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-text-light);
}
.navbar-left {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
  background: transparent;
  border: none;
}
.header-icon {
  height: 70px; width: auto;
  cursor: pointer;
  transition: transform 0.2s ease;
  object-fit: contain;
  margin: 5px 12px;
  background: transparent;
  border: none;
}
.header-icon:hover {
  transform: scale(1.1);
}
.navbar-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  margin-left: 10px;
  background: transparent;
  border: none;
}
.subtitle {
  font-family: 'Roboto', sans-serif;
  font-size: 0.7rem;
  color: var(--color-text-light);
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.5),
               0 0 5px rgba(0, 0, 0, 0.3);
  margin: 5px 0;
}
.title {
  font-family: 'Merriweather', serif;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--color-text-light);
  margin: -5px 0 0 0;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .navbar { height: 80px; }
  .header-icon { height: 70px; }
  .title { font-size: 1.5rem; }
  .subtitle { font-size: 0.8rem; }
}

/* ハンバーガーメニュー */
.hamburger-menu-container {
  position: fixed;
  top: 0; right: 0;
  z-index: 9999;
  padding: 10px;
}
.menu-icon {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 10px;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 50px;
  right: 0;
  background: #333;
  border: 1px solid #999;
  border-radius: 5px;
  width: 150px;
}
.dropdown-menu a {
  display: block;
  padding: 10px 15px;
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 14px;
}
.dropdown-menu a:hover {
  background: var(--color-blue);
  color: var(--color-text-light);
}
.hamburger-menu-container.open .dropdown-menu {
  display: block;
}

/* フッター */
footer {
  text-align: center;
  font-size: 0.8rem;
  padding: 1rem;
  background: #e0e0e0;
  margin-top: 1rem;
}

/* カレンダー周辺 */
.calendar-page {
  display: flex;
  flex-wrap: wrap;
}
.main-calendar-section {
  flex: 2;
  padding: 1rem;
}
.side-calendar-section {
  flex: 1;
  padding: 1rem;
}
.main-calendar-header {
  position: relative;
  height: 2rem;
  margin-bottom: 1rem;
}
.calendar-title {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  font-weight: bold;
}
.prev-button {
  position: absolute;
  top: 50%; left: 0.5rem;
  transform: translateY(-50%);
}
.next-button {
  position: absolute;
  top: 50%; right: 0.5rem;
  transform: translateY(-50%);
}
.nav-button {
  background: #ddd;
  border: 1px solid #aaa;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}
.nav-button:hover {
  background: #ccc;
}

.big-calendar {
  width: 100%;
  height: 100%; 
  table-layout: fixed; 
  border-collapse: collapse; 
  margin-bottom: 1rem;
}
.big-calendar th {
  background: #ddd;
  font-size: 0.8rem;
  padding: 0.5rem;
  text-align: center;
  font-weight: bold;
}
.big-calendar td {
  font-size: 0.8rem;
  border: 1px solid #ccc;
  position: relative;
}
@media (max-width: 768px) {
  .big-calendar td, .big-calendar th {
    font-size: 0.5rem;
  }
}
.calendar-date {
  font-weight: bold;
  font-size: 0.8rem;
  position: absolute;
  top: 2px; right: 4px;
}
.event-item {
  font-size: 0.7rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  box-sizing: border-box;
}
.event-circle {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 4px;
}

/* 色区分 */
.circle-completed { background: green; }
.circle-pending   { background: yellow; }
.circle-warning   {
  animation: blink-red 1s infinite alternate;
}
.circle-overdue   {
  background-color: red;
}
@keyframes blink-red {
  0% { background-color: red; }
  100% { background-color: pink; }
}
.mini-calendar {
  margin-bottom: 1rem;
  text-align: center;
  border: 1px solid #ccc;
}
.mini-calendar-header {
  background: #ddd;
  padding: 0.5rem;
  font-weight: bold;
}
.mini-calendar-table {
  width: 100%;
  border-collapse: collapse;
}
.mini-calendar-table th, .mini-calendar-table td {
  border: 1px solid #ccc;
  font-size: 0.7rem;
  height: 40px;
  vertical-align: middle;
  position: relative;
}
.sunday .calendar-date { color: red; }
.saturday .calendar-date { color: blue; }
.holiday .calendar-date { color: red !important; }
.today { background-color: #fff9cc; }

/* 当月の予定一覧 */
.monthly-schedule {
  border: 1px solid #ccc;
  padding: 0.5rem;
  box-sizing: border-box;
  margin-bottom: 1rem;
}

/* カレンダーセル hover */
.big-calendar td:hover {
  background-color: #f0f0f0;
}
.big-calendar td.has-event {
  cursor: pointer;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .side-calendar-section {
    display: none;
  }
  .main-calendar-section {
    flex: 1 1 100%;
    width: 100%;
  }
}

/***********************************************************
 * モーダル (中央表示・内容スクロール)
 ***********************************************************/
/*
  align-items: flex-start; → 縦方向は上から並べる。
  内容が長い場合に画面内でスクロール可能にする。
*/
.modal {
  display: none; 
  position: fixed;
  z-index: 9999;
  left: 0; 
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);

  display: flex; 
  align-items: flex-start; /* ←ポイント: 上揃えで出す */
  justify-content: center;
  padding: 1rem; /* 余白 */
}
.modal-content {
  background-color: #fff;
  width: 80%;
  max-width: 600px;

  /* 画面に収まらない場合、内部スクロール */
  max-height: 80vh;
  overflow-y: auto;

  position: relative;
  border-radius: 8px;
  padding: 1rem;
}
.close-button {
  position: absolute;
  top: 8px; 
  right: 16px;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10; /* ボタンが隠れないように */
}

/***********************************************************
 * schedule
 ***********************************************************/
 .b {
  font-weight: bold;}