/*
 * The month calendar, on the website's Calendar page and the admin Calendar
 * screen. Laid out like the old site's calendar (month with arrows, then a
 * Sunday-to-Saturday grid with events written in the days) but in the new
 * site's colours and type.
 */
.cal { --cal-ui: var(--font-ui, var(--font, "Segoe UI", system-ui, sans-serif)); margin: 0 0 2.5rem; }

.cal-head { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin-bottom: 0.4rem; }
.cal-title { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; color: var(--teal); margin: 0; min-width: 12ch; text-align: center; }
.cal-arrow {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none;
  border: 1.5px solid var(--teal); border-radius: 50%; color: var(--teal); text-decoration: none;
  font-size: 1.5rem; line-height: 1; padding-bottom: 0.15rem;
}
.cal-arrow:hover { background: var(--teal); color: #fff; }
.cal-today-link { text-align: center; font-family: var(--cal-ui); font-size: 0.9rem; margin: 0 0 0.75rem; }

.cal-grid { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--rust); }
.cal-grid th {
  font-family: var(--cal-ui); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; background: var(--teal); padding: 0.55rem 0.25rem; text-align: center;
}
.cal-grid abbr { text-decoration: none; }
.cal-day { position: relative; height: 7.5rem; vertical-align: top; padding: 0.35rem 0.4rem 0.5rem; border: 1px solid var(--line); }
.cal-out { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(23, 63, 66, 0.035) 8px 9px); }
.cal-past .cal-num { color: #66706e; }   /* faded for past days, but still readable (4.9:1) */
.cal-num { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--teal); line-height: 1.2; }
.cal-today { background: #fbf6ec; box-shadow: inset 0 0 0 2px var(--gold); }
.cal-today .cal-num { font-weight: 700; color: var(--rust); }

.cal-items { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.cal-item + .cal-item { margin-top: 0.3rem; }
.cal-item a {
  display: block; padding: 0.25rem 0.4rem; border-radius: 4px; text-decoration: none;
  font-family: var(--cal-ui); font-size: 0.78rem; line-height: 1.3; color: var(--teal);
  background: #eef3f2; border-left: 3px solid var(--teal-mid, var(--teal));
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.cal-item a:hover, .cal-item a[aria-expanded="true"] { background: var(--teal); color: #fff; }
.cal-item-update a { background: #f8f1e3; border-left-color: var(--gold); }
.cal-past .cal-item a { opacity: 0.75; }
.cal-time { font-weight: 700; margin-right: 0.25rem; }
.cal-add {
  position: absolute; top: 0.25rem; right: 0.3rem; width: 1.5rem; height: 1.5rem; display: grid; place-items: center;
  border-radius: 50%; text-decoration: none; font-weight: 700; color: var(--ink-soft); opacity: 0.35;
}
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; background: var(--rust); color: #fff; }

/* The small panel that opens when an event is clicked (site.js). */
.cal-pop {
  position: absolute; z-index: 40; width: min(22rem, calc(100vw - 2rem));
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--rust); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 14px 34px rgba(15, 44, 46, 0.22); padding: 1rem 1.1rem 1.1rem; font-family: var(--cal-ui); font-size: 0.92rem;
}
.cal-pop-title { font-family: var(--font-display); font-size: 1.15rem; color: var(--teal); margin: 0 1.5rem 0.4rem 0; line-height: 1.3; }
.cal-pop p { margin: 0.25rem 0; }
.cal-pop-when { font-weight: 600; }
.cal-pop-where, .cal-pop-repeats { color: var(--ink-soft); }
.cal-pop-summary { margin-top: 0.5rem !important; }
.cal-pop-more { display: inline-block; margin-top: 0.6rem; font-weight: 600; }
.cal-pop-close { position: absolute; top: 0.4rem; right: 0.4rem; width: 2rem; height: 2rem; border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: var(--ink-soft); }

/* Phones: the grid becomes a list of the days that have events. */
@media (max-width: 700px) {
  .cal-grid, .cal-grid tbody, .cal-grid tr, .cal-grid td { display: block; width: 100%; }
  .cal-grid thead { display: none; }
  .cal-grid { border-top-width: 3px; }
  .cal-day { height: auto; display: none; border-width: 0 0 1px; padding: 0.75rem 0.5rem; }
  .cal-day.cal-has, .cal-today { display: grid; grid-template-columns: 3rem 1fr; gap: 0.5rem; }
  .cal-num { font-size: 1.4rem; }
  .cal-items { margin: 0; }
  .cal-item a { font-size: 0.92rem; -webkit-line-clamp: unset; }
  .cal-add { position: static; opacity: 1; }
  .cal-title { font-size: 1.5rem; }
}

/* Calendar entry page */
.event-repeats { font-family: var(--cal-ui, var(--font-ui)); font-size: 0.9rem; color: var(--teal); font-weight: 600; margin-top: 0.2rem; }
.date-list { columns: 2 14rem; padding-left: 1.2rem; font-family: var(--font-ui); }
.notice-past { font-family: var(--font-ui); color: var(--ink-soft); font-style: italic; }
