:root {
  --brand-blue: #005781;
  --short-green: #2e7d32;
  --closed-gray: #a0a0a0;

  /* ヘッダー用 */
  --brand: #005781;
  --brand2: #0b6ea1;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Rounded M+", "YuGothic", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #333;
}

.page {
  padding: 16px;
}

h1 {
  font-size: 24px;
  margin: 0 0 8px;
  text-align: center;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 12px;
}

.brand-title {
  font-size: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.btn-ghost {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}

.btn-arrow {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
}

.notice-line {
  text-align: center;
  font-size: 13px;
  color: #555;
  margin: 4px 0 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.notice-icon {
  color: #d32f2f;
  font-weight: 700;
  font-size: 14px;
}

.last-updated {
  max-width: 960px;
  margin: 0 auto 6px;
  padding-right: 4px;
  text-align: right;
  font-size: 15px;
  color: #555;
}

.calendar-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  padding: 16px 16px 20px;
}

.calendar-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.calendar-month {
  border-radius: 10px;
  border: 1px solid #ddd;
  overflow: hidden;
  background: #fafafa;
}

.month-header {
  background: var(--brand-blue);
  color: #fff;
  text-align: center;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 16px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid #ddd;
  font-size: 15px;
}

.weekday {
  text-align: center;
  padding: 6px 4px;
  background: #f1f1f1;
  font-weight: 600;
  border-bottom: 1px solid #ddd;
}

.weekday:nth-child(7n+1) {
  color: #d32f2f;
}

.weekday:nth-child(7n) {
  color: #1976d2;
}

.day-cell {
  height: 85px;
  border-bottom: 1px solid #eee;
  border-right: 1px solid #eee;
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  text-align: center;
  font-size: 14px;
  background: #fff;
}

.day-cell.empty {
  background: #f7f7f7;
}

.day-cell.status-custom {
  background: rgba(255, 193, 7, 0.15);
  border: 2px dashed #fbfafc;
}

.calendar-grid .day-cell.status-custom .day-number {
  background-color: #07b9ff !important;
  color: #222 !important;
}

.calendar-grid .day-cell.status-custom .day-label {
  color: #07b9ff !important;
  font-weight: 800;
}

.day-number {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.day-label {
  width: 100%;
  padding: 1px 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  background: #ffffff;
}

.status-normal .day-number {
  background-color: var(--brand-blue);
  color: #ffffff;
}

.status-normal .day-label {
  background-color: #ffffff;
  color: var(--brand-blue);
}

.status-short .day-number {
  background-color: var(--short-green);
  color: #ffffff;
}

.status-short .day-label {
  background-color: #ffffff;
  color: var(--short-green);
}

.status-closed {
  background-color: var(--closed-gray);
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.status-closed .day-number {
  background: transparent;
  color: #333;
  font-weight: 700;
  font-size: 20px;
  padding: 8px 0 4px;
}

.status-closed .day-label {
  display: block !important;
  background: transparent;
  color: #333;
  font-size: 14px;
  font-weight: 700;
  padding: 2px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

#calendar-memo {
  margin-top: 24px;
  padding: 12px 16px;
  background: #f7f7f7;
  border-radius: 12px;
}

.memo-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.memo-list {
  margin: 0;
  padding-left: 1.2em;
}

.memo-list li {
  line-height: 1.6;
}

.day-cell.today {
  outline: 4px solid #ffd500;
  box-shadow:
    0 0 10px rgba(255, 215, 0, 0.55),
    inset 0 0 0 3px #ffffff;
  border-radius: 8px;
  position: relative;
  z-index: 3;
}

.past-day {
  opacity: 0.45;
}

.day-memo {
  font-size: 10px;
  font-weight: 600;
  color: #333;
  line-height: 1.2;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  margin-top: 12px;
  margin-bottom: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0f4f8;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-color.normal {
  background: var(--brand-blue);
}

.legend-color.short {
  background: var(--short-green);
}

.legend-color.closed {
  background: var(--closed-gray);
}

.link-buttons {
  max-width: 960px;
  margin: 16px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background: var(--brand-blue);
  color: #fff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.08s ease;
  cursor: pointer;
  min-width: 210px;
  text-align: center;
}

.link-button span {
  margin-left: 4px;
  font-size: 12px;
}

.link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  opacity: 0.95;
}

.link-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 0.9;
}

/* =========================
   Tablet
========================= */
@media (max-width: 920px) {
  .page {
    padding: 14px;
  }

  .container {
    width: 94vw;
  }

  .calendar-container {
    grid-template-columns: 1fr;
  }

  .calendar-wrapper {
    padding: 14px;
  }
}

/* =========================
   Mobile
========================= */
@media (max-width: 520px) {
  .page {
    padding: 10px;
  }

  h1 {
    font-size: 20px;
  }

  .container {
    width: 96vw;
  }

  .header-inner {
    gap: 8px;
    padding: 10px 0;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    flex: 0 0 auto;
  }

  .brand-title {
    font-size: 14px;
    line-height: 1.2;
  }

  .header-actions {
    gap: 4px;
    flex-shrink: 0;
  }

  .btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .btn-arrow {
    font-size: 16px;
  }

  .notice-line {
    font-size: 12px;
    margin: 4px 0 12px;
    line-height: 1.5;
  }

  .last-updated {
    font-size: 13px;
  }

  .calendar-wrapper {
    padding: 10px;
    border-radius: 10px;
    overflow: hidden;
  }

  .calendar-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .calendar-month {
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .month-header {
    font-size: 14px;
    padding: 7px 10px;
    position: sticky;
    left: 0;
  }

  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    min-width: 308px; /* 44px × 7 */
    font-size: 12px;
  }

  .weekday {
    padding: 5px 2px;
    font-size: 10px;
    white-space: nowrap;
  }

  .day-cell {
    height: 74px;
    min-height: 74px;
    padding: 2px;
    font-size: 11px;
  }

  .day-number {
    height: 22px;
    font-size: 13px;
    line-height: 1;
  }

  .day-label {
    padding: 1px 0 0;
    font-size: 10px;
    line-height: 1.1;
    white-space: normal;
    word-break: break-word;
  }

  .day-memo {
    display: none;
  }

  .status-closed .day-number {
    font-size: 13px;
    padding: 4px 0 2px;
  }

  .status-closed .day-label {
    font-size: 0;
    padding: 0 0 3px;
    letter-spacing: 0;
  }

  .status-closed .day-label::before {
    content: "休館";
    font-size: 10px;
    font-weight: 700;
    color: #333;
    line-height: 1;
  }

  .day-cell.today {
    outline: 2px solid #ffd500;
    box-shadow:
      0 0 6px rgba(255, 215, 0, 0.45),
      inset 0 0 0 2px #ffffff;
  }

  .legend {
    gap: 8px;
    font-size: 11px;
    padding: 8px;
  }

  .legend-color {
    width: 12px;
    height: 12px;
  }

  .link-buttons {
    gap: 8px;
  }

  .link-button {
    width: 100%;
    min-width: 0;
    font-size: 13px;
    padding: 10px 12px;
  }

  .link-button span {
    font-size: 11px;
  }

  #calendar-memo {
    margin-top: 18px;
    padding: 10px 12px;
  }

  .memo-title {
    font-size: 14px;
  }

  .memo-list li {
    line-height: 1.5;
    font-size: 13px;
  }
}