/* Mobile-only FullCalendar layout refinements. Load after style.css. */
@media (max-width: 768px) {
  #tab-calendar,
  #tab-calendar #calendar,
  #tab-calendar .fc {
    min-width: 0;
    max-width: 100%;
  }

  #tab-calendar #calendar {
    padding: 6px;
    overflow: hidden;
  }

  #tab-calendar .fc .fc-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title title" "nav views";
    align-items: center;
    gap: 6px;
    margin-bottom: .6rem;
  }

  #tab-calendar .fc .fc-toolbar-chunk { min-width: 0; }
  #tab-calendar .fc .fc-toolbar-chunk:nth-child(1) { grid-area: nav; }
  #tab-calendar .fc .fc-toolbar-chunk:nth-child(2) { grid-area: title; text-align: left; }
  #tab-calendar .fc .fc-toolbar-chunk:nth-child(3) { grid-area: views; justify-self: end; }
  #tab-calendar .fc .fc-toolbar-title { font-size: 1rem; line-height: 1.25; }
  #tab-calendar .fc .fc-button { padding: 4px 7px; font-size: .75rem; }
  #tab-calendar .fc .fc-today-button { display: none; }

  #tab-calendar .fc .fc-col-header-cell-cushion {
    display: block;
    padding: 5px 0;
    white-space: nowrap;
    font-size: clamp(.64rem, 2.7vw, .78rem);
    line-height: 1.2;
  }

  #tab-calendar .fc .fc-daygrid-day-number {
    padding: 3px 4px;
    font-size: .72rem;
  }
  #tab-calendar .fc .fc-daygrid-day-frame { min-height: 0; }
  #tab-calendar .fc .fc-daygrid-day-events { margin: 1px 2px 0; }
  #tab-calendar .fc .fc-daygrid-event { margin-top: 1px; max-width: 100%; overflow: hidden; }
  #tab-calendar .fc .fc-event-title,
  #tab-calendar .fc .fc-event-time {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: top;
  }
  #tab-calendar .fc .fc-daygrid-event .fc-event-title { font-size: .64rem; }
  #tab-calendar .fc .fc-daygrid-more-link { font-size: .62rem; }
  #tab-calendar .fc .fc-scrollgrid,
  #tab-calendar .fc .fc-daygrid-body,
  #tab-calendar .fc .fc-daygrid-body table { width: 100% !important; }
}

/* The viewport simulator can be enabled on a desktop-sized browser. */
body.viewport-mobile #tab-calendar,
body.viewport-mobile #tab-calendar #calendar,
body.viewport-mobile #tab-calendar .fc { min-width: 0; max-width: 100%; }
body.viewport-mobile #tab-calendar #calendar { padding: 6px; overflow: hidden; }
body.viewport-mobile #tab-calendar .fc .fc-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title title" "nav views";
  align-items: center;
  gap: 6px;
  margin-bottom: .6rem;
}
body.viewport-mobile #tab-calendar .fc .fc-toolbar-chunk { min-width: 0; }
body.viewport-mobile #tab-calendar .fc .fc-toolbar-chunk:nth-child(1) { grid-area: nav; }
body.viewport-mobile #tab-calendar .fc .fc-toolbar-chunk:nth-child(2) { grid-area: title; text-align: left; }
body.viewport-mobile #tab-calendar .fc .fc-toolbar-chunk:nth-child(3) { grid-area: views; justify-self: end; }
body.viewport-mobile #tab-calendar .fc .fc-toolbar-title { font-size: 1rem; line-height: 1.25; }
body.viewport-mobile #tab-calendar .fc .fc-button { padding: 4px 7px; font-size: .75rem; }
body.viewport-mobile #tab-calendar .fc .fc-today-button { display: none; }
body.viewport-mobile #tab-calendar .fc .fc-col-header-cell-cushion {
  display: block; padding: 5px 0; white-space: nowrap;
  font-size: clamp(.64rem, 2.7vw, .78rem); line-height: 1.2;
}
body.viewport-mobile #tab-calendar .fc .fc-daygrid-day-number { padding: 3px 4px; font-size: .72rem; }
body.viewport-mobile #tab-calendar .fc .fc-daygrid-day-frame { min-height: 0; }
body.viewport-mobile #tab-calendar .fc .fc-daygrid-day-events { margin: 1px 2px 0; }
body.viewport-mobile #tab-calendar .fc .fc-daygrid-event { margin-top: 1px; max-width: 100%; overflow: hidden; }
body.viewport-mobile #tab-calendar .fc .fc-event-title,
body.viewport-mobile #tab-calendar .fc .fc-event-time {
  display: inline-block; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: top;
}
body.viewport-mobile #tab-calendar .fc .fc-daygrid-event .fc-event-title { font-size: .64rem; }
body.viewport-mobile #tab-calendar .fc .fc-daygrid-more-link { font-size: .62rem; }
body.viewport-mobile #tab-calendar .fc .fc-scrollgrid,
body.viewport-mobile #tab-calendar .fc .fc-daygrid-body,
body.viewport-mobile #tab-calendar .fc .fc-daygrid-body table { width: 100% !important; }
