body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5em;
  background-color: #fff;
  color: #222;
}

.calendar {
  width: 100%;
  max-width: 912px;
  margin: 0 auto;
  border-collapse: collapse;
  background-color: white;
}

.container h1 {
  margin: 0;
  font-size: 1.2rem;
  text-decoration: none;
  color: inherit;
}

#calendar {
  margin: 2em 0;
}

.controls {
  margin: 1em 0;
}

.controls a,
.controls button {
  display: inline-block;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  margin-right: 10px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.controls .btn-prev,
.controls .btn-next {
  background-color: #007bff;
  color: white;
}

.controls .btn-prev:hover,
.controls .btn-next:hover {
  background-color: #0056b3;
}

.controls .btn-submit {
  background-color: #28a745;
  color: white;
  margin-left: 10px;
}

.controls .btn-submit:hover {
  background-color: #218838;
}

.controls .btn-today {
  background-color: #6c757d;
  color: white;
  margin-left: 10px;
}

.controls .btn-today:hover {
  background-color: #5a6268;
}

.controls form {
  display: inline-block;
}

.controls input[type="number"] {
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.controls input[name="year"] {
  width: 80px;
}

.controls input[name="month"] {
  width: 60px;
}

.calendar th {
  background-color: #b9b9b9;
  color: white;
  padding: 12px;
  text-align: center;
  font-weight: bold;
  width: calc(100% / 7);
}

.calendar th:first-child {
  background-color: #c00;
}

.calendar th:last-child {
  background-color: #08c;
}

.calendar tr:first-child th {
  background-color: #fff;
  color: #000;
}

.calendar td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
  vertical-align: top;
  min-height: 80px;
  width: calc(100% / 7);
}

.calendar .clear {
  background-color: #eee;
}

.calendar td h3 {
  margin-top: 0;
  margin-bottom: 5px;
}

.calendar td h3.red {
  color: #c00;
}

/* 今日の日付の背景色 */
.calendar td.today:not(.clear) {
  background-color: #ffeecc;
}

/* 日曜日の背景色（空白セルは除外） */
.calendar td.sunday:not(.clear) {
  background-color: #fff5f4;
}

/* 祝日・振替休日の背景色（空白セルは除外） */
.calendar td.holiday:not(.clear) {
  background-color: #fff5f4;
}

/* 土曜日の背景色（空白セルは除外） */
.calendar td.saturday:not(.clear) {
  background-color: #eaf0fe;
}

/* 沖縄の年中行事の色 */
.okinawa-event {
  color: #e74c3c;
}

/* 都道府県の記念日の色 */
.prefecture-memorial {
  color: #8b008b;
  font-weight: bold;
}

.calendar td .narrow {
  font-size: 14px;
  line-height: 1.5em;
}

.calendar td .small {
  display: inline-block;
}

.calendar td .roku {
  font-size: 11px;
  display: block;
  background-color: #999;
  color: #fff;
  padding: 2px 4px;
  border-radius: 4px;
}

.calendar td:empty {
  background-color: #f9f9f9;
}

.holiday {
  margin-bottom: 4px;
}

.holiday small {
  color: #e74c3c;
  font-weight: bold;
  font-size: 11px;
  display: block;
}

.okinawa-event {
  margin-bottom: 4px;
}

.okinawa-event small {
  color: #8b4513;
  font-weight: bold;
  font-size: 11px;
  display: block;
}

.lunar {
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
}

.solar-term {
  font-size: 11px;
  color: #e74c3c;
  font-weight: bold;
  margin-bottom: 2px;
}

.solar-term-link {
  cursor: pointer;
  text-decoration: underline;
  color: #e74c3c;
  transition: color 0.2s;
}

.solar-term-link:hover {
  color: #c0392b;
}

/* 二十四節気のライトボックス（モーダル）のスタイル */
.solar-term-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.solar-term-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.solar-term-modal-content {
  position: relative;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  animation: slideUp 0.3s ease;
}

.solar-term-modal-content h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: #333;
}

.solar-term-info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.solar-term-info-table th,
.solar-term-info-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.solar-term-info-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  width: 30%;
  color: #555;
}

.solar-term-info-table td {
  color: #333;
}

.solar-term-modal-content p {
  margin: 0.5rem 0;
  line-height: 1.6;
  color: #555;
}

.solar-term-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.solar-term-modal-close:hover {
  color: #333;
}

/* 日付詳細モーダル（ライトボックス）のスタイル */
.date-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.date-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.date-modal-content {
  position: relative;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  animation: slideUp 0.3s ease;
}

.date-modal-content h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: #333;
}

.date-modal-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
  color: #555;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.date-info-section {
  margin-bottom: 1.5rem;
}

.date-info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.date-info-table th,
.date-info-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.date-info-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  width: 30%;
  color: #555;
}

.date-info-table td {
  color: #333;
}

.date-info-table td small {
  display: block;
  margin-top: 0.25rem;
  color: #666;
  font-size: 0.9em;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.event-list li {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #e74c3c;
}

.event-list li strong {
  color: #e74c3c;
  display: block;
  margin-bottom: 0.5rem;
}

.event-link {
  display: inline-block;
  margin-right: 0.75rem;
  margin-top: 0.25rem;
  padding: 0.25rem 0.75rem;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.event-link:hover {
  background-color: #0056b3;
}

.holiday-info-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  background-color: #e74c3c;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.holiday-info-link:hover {
  background-color: #c0392b;
}

.date-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.date-modal-close:hover {
  color: #333;
}

/* 日付セルにホバー効果を追加 */
.calendar .calendar-day-cell {
  transition: background-color 0.2s, transform 0.1s;
}

.calendar .calendar-day-cell:hover:not(.clear) {
  background-color: #f0f8ff !important;
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navigation-section {
  margin: 2rem 0;
}

.topGridBox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.nav-card {
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.nav-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

.nav-card .info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-card .info-list li {
  margin-bottom: 0.5rem;
}

.nav-card .info-list li a {
  text-decoration: none;
  color: #0066cc;
}

.nav-card .info-list li a:hover {
  color: #004499;
}

/* events/index.html用のスタイル */
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.nav-card-link {
  text-decoration: none;
  color: inherit;
}

.nav-card-link h3 {
  margin-top: 0;
  font-size: 1rem;
}

.nav-card-link p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .solar-term-modal-content {
    padding: 1.5rem;
    width: 95%;
  }

  .solar-term-modal-content h2 {
    font-size: 1.2rem;
  }

  .solar-term-info-table th,
  .solar-term-info-table td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .date-modal-content {
    padding: 1.5rem;
    width: 95%;
  }

  .date-modal-content h2 {
    font-size: 1.2rem;
  }

  .date-modal-content h3 {
    font-size: 1.1rem;
  }

  .date-info-table th,
  .date-info-table td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .event-link {
    display: block;
    margin-top: 0.5rem;
    margin-right: 0;
  }
}

.today-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f9f9f9;
  border-radius: 8px;
}

.today {
  background-color: #fff3cd !important;
  border: 2px solid #ffc107 !important;
}

.rokuyo {
  font-size: 11px;
  color: #888;
  font-weight: bold;
}

.rokuyo-link {
  cursor: pointer;
  text-decoration: underline;
  color: #0066cc;
  transition: color 0.2s;
}

.rokuyo-link:hover {
  color: #004499;
}

/* ライトボックス（モーダル）のスタイル */
.rokuyo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.rokuyo-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.rokuyo-modal-content {
  position: relative;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  animation: slideUp 0.3s ease;
}

.rokuyo-modal-content h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: #333;
}

.rokuyo-modal-content p {
  margin: 0.5rem 0;
  line-height: 1.6;
  color: #555;
}

.rokuyo-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.rokuyo-modal-close:hover {
  color: #333;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .rokuyo-modal-content {
    padding: 1.5rem;
    width: 95%;
  }

  .rokuyo-modal-content h2 {
    font-size: 1.2rem;
  }
}

.controls {
  text-align: center;
  margin: 20px 0;
}

.controls button {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

.controls button:hover {
  background-color: #45a049;
}

.controls input {
  padding: 8px;
  margin: 0 5px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 16px;
}

.about-section {
  margin: 2rem 0;
  padding: 1.5rem;
}

/* 各記事のスタイル
-------------------------------- */
.site-header,
.site-footer {
  background-color: #f5f5f5;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}

.site-header a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-title {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.subsection-title {
  font-size: 1.1rem;
  color: #333;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #4caf50;
  padding-bottom: 0.5rem;
}

.section-title {
  font-size: 1.1rem;
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
}

.info-list {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.info-list li {
  margin-bottom: 0.25rem;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.calendar-table th,
.calendar-table td {
  border: 1px solid #dddddd;
  padding: 0.5rem;
  text-align: left;
}

.calendar-table th {
  background-color: #fafafa;
  white-space: nowrap;
}

.note {
  font-size: 0.85rem;
  color: #555555;
}

.related-links ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.95rem;
}

@media (max-width: 600px) {

  .container {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.2rem;
  }

}

