.calendar-page {
  display: flow-root;
  min-height: 100dvh;
  margin: 0;
  color: #49392d;
  font-family: system-ui, 'Microsoft YaHei', sans-serif;
}

.calendar-main { width: min(960px, calc(100% - 28px)); margin: 25px auto 42px; }
.calendar-top, .calendar-intro { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.calendar-book {
  position: relative;
  padding: clamp(10px, 2.8vw, 26px);
  border: 1px solid #bfad8d;
  border-radius: 6px 19px 19px 6px;
  background: #fffaf0;
  box-shadow: inset 5px 0 #dfceb0, 0 5px 0 #e6d7bc, 0 8px 14px #49392d1e;
}

.calendar-book::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 30px;
  width: 80px;
  height: 16px;
  background: url('./assets/washi-sage.webp') center / 100% 100% no-repeat;
  transform: rotate(-4deg);
  pointer-events: none;
}

.calendar-intro { margin: 5px 3px 14px; }
.calendar-intro h1 { margin: 0; color: #264e3b; font-size: clamp(1.35rem, 4.5vw, 2rem); }

.calendar-book button {
  min-width: 42px;
  min-height: 42px;
  padding: 4px 9px;
  border: 1px solid #caba9d;
  border-radius: 10px;
  background: #f4ebd6;
  color: #49392d;
  cursor: pointer;
  font: 700 .875rem system-ui, sans-serif;
}

.calendar-book button:hover { background: #f3d9a0; }
.calendar-book :is(a, button):focus-visible { outline: 2px solid #2f6048; outline-offset: 2px; }

.calendar-controls { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: stretch; margin-bottom: 6px; }
.calendar-controls h2 { display: grid; place-items: center; margin: 0; border-radius: 10px; background: #e6ead5; color: #36533d; font-size: 1.15rem; }
.calendar-controls button { font-size: 1.2rem; }

.birthday-calendar { width: 100%; table-layout: fixed; border-spacing: clamp(2px, .8vw, 5px); }
.birthday-calendar th { padding: 5px 0; border-radius: 7px; background: #eee6d4; font-size: .8125rem; }
.birthday-calendar td { padding: 0; vertical-align: top; }

.calendar-day {
  box-sizing: border-box;
  display: grid;
  align-content: start;
  min-height: clamp(57px, 13.5vw, 92px);
  padding: 4px 2px;
  gap: 2px;
  border: 1px solid #eadcc3;
  border-radius: 9px;
  background: #f7f0e1;
}

.calendar-day-number { padding-inline: 3px; color: #584839; font-size: .8125rem; font-weight: 700; }
.calendar-day[aria-current='date'] { border-color: #668875; background: #e9eedb; }
.outside-month .calendar-day { border-color: transparent; background: #f8f4e9; }
.outside-month .calendar-day-number { color: #766957; font-weight: 500; }

.calendar-portrait {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 2px 0;
  gap: 1px;
  border-radius: 6px;
  background: #fffaf0;
  color: #264e3b;
  text-align: center;
  text-decoration: none;
  font-size: .75rem;
  line-height: 1.2;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.calendar-portrait img { width: min(100%, 42px); aspect-ratio: 1; object-fit: contain; }
.calendar-portrait:hover { background: #f6dab9; }

@media (max-width: 520px) {
  .calendar-main { width: calc(100% - 16px); margin-top: 13px; }
  .calendar-portrait img { width: min(100%, 32px); }
  .calendar-portrait span { font-size: .6875rem; }
}
