
html, body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden; /* 全体スクロールを無効化 */
  font-family: sans-serif;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color:#333;
  color: white;
  padding-left: 20px;
  padding-right: 20px;
  z-index: 1;
}
header a{
 color: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border: 1px solid #ccc;
  font-size: 16px;
  text-align: center;
  height: 20px;
}
article {
  margin-right: 2em;
  margin-left: 2em;
}
section {
  margin-bottom: 2em;
}
section::before {
  content: "";
  display: block;
  height: 90px; /* タイトルの高さ分 */
  visibility: hidden;
} 
.container {
  display: flex;
  height: 100vh;
}
.nav-buttons {
  display:flex;
  justify-content: space-between;
  margin-top: 20px;
}
.nav-buttons a {
  padding: 8px 12px;
  background-color: #ddd;
  text-decoration: none;
  color: #000;
  border-radius: 4px;
}
.nav-buttons a:hover {
  background-color: #bbb;
  color: #000;
}
.calendar-area {
  margin-top: 90px; /* タイトルの高さ分調整 */
  width: 30%;
  height: 100vh; /* または他の明示的な高さ */
  overflow-y: auto;
  padding: 10px;
  background-color: #f0f0f0;
  border-right: 1px solid #ccc;
}
.calendar {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  overflow-x: auto; /* これで切れるのを防げる場合あり */
  display: none;
}

.calendar.active {
  display:block
}
.calendar a {
  color: red;
  text-decoration: none;
  padding: 4px;
}
.calendar a:hover {
  color: green;
}
.calendar h2 {
  background-color: #ddd;
  padding: 0.5em;
  border-radius: 4px;
}
#month-menu {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}
.diary-area {
  width: 70%;
  overflow-y: auto;
  padding: 20px;
  position: relative;
}
.diary {
  padding: 1em;
}
.diary img {
  width: 100%;
  height: auto;
  max-width: 720px;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto !important;
  }

  .calendar-area,
  .diary-area {
    width: 100%;
    max-height: none;
    overflow: visible;
    margin-top: 0;
    padding-top: 80px; /* タイトルの高さ分 */
  }

  .calendar {
    margin-bottom: 1em;
  }

  .calendar table {
    font-size: 0.6em;
    table-layout: fixed;
    width: 100%;
  }

  .calendar th,
  .calendar td {
    height: 30px;
    padding: 2px;
  }

  h2 {
    font-size: 1em;
    margin: 0.5em 0;
  }
}
