.calendar-header {
  background: #a9ddf8;
  padding: 22px 0;
}
.calendar-header [aria-current="page"] {
  background: #e6f3fc;
  border-radius: 99px;
  padding: 9px 13px;
}
.school-calendar {
  background: #eef1f8;
  padding: clamp(32px, 4vw, 60px) max(14px, calc((100% - 1280px) / 2));
}
.school-calendar h1 { font-size: clamp(2.75rem, 6vw, 5.5rem); }
.calendar-note {
  display: inline-block;
  margin: 0 0 24px;
  padding: 6px 12px;
  border-radius: 99px;
  background: #d8ebfb;
  font-size: .8rem;
  font-weight: 700;
}
.calendar-note[hidden] { display: none; }
.calendar-board {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr);
  gap: 8px;
  background: #171c29;
  padding: 8px;
  border-radius: 30px;
  align-items: stretch;
}
.calendar-board[hidden] { display: none; }
.calendar-month, .calendar-agenda {
  min-width: 0;
  border-radius: 22px;
  padding: clamp(12px, 2.6vw, 28px);
}
.calendar-month { background: white; }
.calendar-agenda { background: #252936; color: #fff; }
.calendar-agenda h2, .calendar-toolbar h2, .calendar-agenda h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  letter-spacing: -.035em;
}
.calendar-toolbar, .calendar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.calendar-toolbar { justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.school-calendar button {
  font: inherit;
  font-weight: 700;
  color: inherit;
  border: 0;
  cursor: pointer;
}
.school-calendar button:focus-visible { outline: 3px solid #1766ad; outline-offset: 2px; }
.calendar-controls button {
  min-height: 38px;
  min-width: 38px;
  padding: 0 10px;
  background: #edf5fb;
  border-radius: 99px;
}
.calendar-controls button:hover { background: #d8ebfb; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; margin: 0 0 16px; }
.calendar-legend li { border-radius: 99px; font-size: .75rem; font-weight: 700; }
.school-calendar .calendar-legend li { padding: 5px 9px; }
.calendar-month table { border-spacing: 4px; width: 100%; table-layout: fixed; text-align: center; }
.calendar-month th { font-size: clamp(.65rem, 2vw, .82rem); color: #4b6379; padding-bottom: 5px; }
.calendar-month abbr { text-decoration: none; }
.calendar-month td { padding: 0; }
.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 5px;
  text-align: left;
  width: 100%;
  height: clamp(58px, 7vw, 96px);
  padding: 8px;
  border-radius: 12px;
  background: #f4f7fa;
}
.calendar-day-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  font-size: .75rem;
  line-height: 1.2;
}
.calendar-day[aria-current="date"] { box-shadow: inset 0 0 0 1px #2674a8; }
.calendar-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #142234; }
button.calendar-day:hover { filter: brightness(.94); }
.school-calendar .category-community { background: #a9e9f6; color: #142234; }
.school-calendar .category-families { background: #fff08f; color: #142234; }
.school-calendar .category-activities { background: #ddc2ff; color: #142234; }
#calendar-events { margin: 12px 0 20px; padding: 0; list-style: none; }
#calendar-events li + li { margin-top: 6px; }
.agenda-event {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 16px;
}
.agenda-event:hover { filter: brightness(.94); }
.agenda-event[aria-pressed="true"] { outline: 2px solid white; outline-offset: 2px; }
.calendar-agenda button:focus-visible { outline-color: #fff; }
.agenda-day { display: grid; place-items: center; min-width: 32px; min-height: 32px; border-radius: 9px; background: #ffffff80; }
.calendar-agenda .calendar-detail-title { padding-top: 16px; border-top: 1px solid #ffffff32; }
#calendar-details { font-size: .9rem; }
#calendar-details > p { margin-bottom: 0; }
.event-detail { margin-top: 10px; padding: 14px; background: #fff; color: #142234; border-radius: 14px; }
.event-detail h4 { margin: 8px 0 0; font-size: 1rem; }
.event-detail p { margin: 5px 0 0; }
.event-tag { display: inline-block; font-weight: 700; border-radius: 99px; }
.school-calendar .event-tag { padding: 3px 8px; }
@media (max-width: 800px) {
  .calendar-board { grid-template-columns: 1fr; padding: 8px; border-radius: 22px; }
}
@media (max-width: 520px) {
  .calendar-day { align-items: center; justify-content: center; height: 40px; padding: 0; }
  .calendar-day-title { display: none; }
}
@media (max-width: 390px) {
  .calendar-month { padding: 8px; }
  .calendar-month table { border-spacing: 2px; }
  .calendar-day { border-radius: 7px; }
}
