/* ---------------------------------------------------------------- the club's year (tools/make_calendar.py, js/calendar.js)
   After the Niagara Frontier Volleyball calendar: next up, month tabs, a month grid with a dot for each event beside
   the month's list, a key and a filter. Paper and navy ink; each kind of event keeps one colour in the dots, the list
   and the key. Without JavaScript every month is listed open. */
.c-water { --c: var(--data); }
.c-social { --c: var(--fg); }
.c-dining { --c: #a8803a; }
.c-club { --c: var(--red); }

.cal-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; margin-bottom: clamp(22px, 3vw, 34px); }
.cal-head h2 { margin-bottom: 12px; }
.cal-head .note { margin: 0; max-width: 62ch; }

/* the filter: what to show */
.cal-filter { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--rule); border-radius: 999px; }
.cal-filter button { min-height: 40px; padding: 6px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--fg); font: 600 .875rem/1.2 var(--sans); transition: background-color .18s ease, color .18s ease; }
.cal-filter button:hover { background: var(--panel); }
.cal-filter button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
html:not(.js) .cal-filter { display: none; }

/* next up: the day large, what it is, how long until, and its one action */
.cal-next { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px clamp(16px, 2.4vw, 30px); margin-bottom: 14px; padding: 16px clamp(16px, 2.4vw, 28px); background: var(--bg); border: 1px solid var(--rule); border-radius: 18px; }
.cal-next[hidden] { display: none; }
.cal-next__k { display: flex; align-items: center; gap: 9px; font: 600 .875rem/1.2 var(--sans); color: var(--red-ink); white-space: nowrap; }
.cal-next__k::before { content: ""; flex: none; width: 14px; height: 8px; background: var(--red); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.cal-next__date { display: grid; justify-items: center; min-width: 4.4rem; padding-inline: clamp(12px, 2vw, 24px); border-inline: 1px solid var(--rule); }
.cal-next__date b { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 3.6vw, 3.2rem); line-height: 1; }
.cal-next__date span { font: 600 .8125rem/1.3 var(--sans); color: var(--muted); }
.cal-next__what h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 2.2vw, 2rem); line-height: 1.1; }
.cal-next__what p { margin: 4px 0 0; font: .9375rem/1.4 var(--sans); color: var(--muted); }
.cal-next__what p:empty { display: none; }
.cal-next__in { font: 600 .9375rem/1.2 var(--sans); color: var(--data); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-next__go[hidden] { display: none; }

/* the card and its month tabs */
.cal { background: var(--bg); border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; }
.cal-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.cal-bar[hidden] { display: none; }
.cal-tabs { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cal-tabs::-webkit-scrollbar { display: none; }
.cal-tabs button { flex: 1 0 auto; display: grid; justify-items: center; min-width: 58px; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--fg); font: 600 1rem/1 var(--sans); transition: background-color .18s ease, color .18s ease; }
.cal-tabs button small { margin-top: 4px; font-size: .6875rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-tabs button:hover { background: var(--panel); }
.cal-tabs button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.cal-tabs button[aria-pressed="true"] small { color: rgba(239, 232, 218, .75); }
.cal-step { flex: none; width: 44px; height: 48px; border: 1px solid var(--rule); border-radius: 10px; background: transparent; color: var(--fg); font: 400 1.6rem/1 var(--sans); transition: background-color .18s ease, color .18s ease; }
.cal-step:hover:not(:disabled) { background: var(--fg); color: var(--bg); }
.cal-step:disabled { opacity: .35; }

/* one month: the grid on the left, its list on the right */
.cal-month { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); }
.js .cal-month[hidden] { display: none; }
.cal-month + .cal-month { border-top: 1px solid var(--rule); }
.js .cal-month + .cal-month { border-top: 0; }
.cal-grid-wrap { padding: 22px 22px 18px; border-right: 1px solid var(--rule); }
.cal-title { margin: 0 0 12px; font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; }
.cal-title span { color: var(--muted); }
.cal-grid { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal-grid th { padding: 0 0 4px; font: 600 .75rem/1 var(--sans); color: var(--muted); text-align: center; }
.cal-grid td { padding: 0; }
.cal-day { position: relative; display: grid; align-content: start; justify-items: center; gap: 4px; width: 100%; aspect-ratio: 1 / 1; padding: 7px 0 0; border: 1px solid transparent; border-radius: 8px; background: rgba(20, 32, 74, .045); color: var(--muted); font: inherit; }
.cal-day .n { font: 500 .9375rem/1 var(--sans); font-variant-numeric: tabular-nums; }
button.cal-day { background: #f8f4ec; border-color: var(--rule); color: var(--fg); transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
button.cal-day .n { font-weight: 600; }
button.cal-day:hover { border-color: var(--fg); }
button.cal-day.is-quiet { background: rgba(20, 32, 74, .045); border-color: transparent; color: var(--muted); }
button.cal-day.is-quiet .n { font-weight: 500; }
.cal-day .dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 34px; }
.cal-day .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cal-day .dots i.is-off { display: none; }
.cal-day.is-past .n { opacity: .5; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--red); }
.cal-day.is-today .n { color: var(--red-ink); font-weight: 700; opacity: 1; }
button.cal-day.is-sel { background: var(--fg); border-color: var(--fg); color: var(--bg); }
button.cal-day.is-sel .n { color: var(--bg); }
button.cal-day.is-sel .dots i { box-shadow: 0 0 0 1.5px var(--bg); }

/* the month's list, day by day */
.cal-list { padding: 14px 18px 18px; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
.cal-agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal-item { display: grid; grid-template-columns: 4.8rem minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--rule); border-left: 4px solid var(--c); border-radius: 10px; background: #f8f4ec; transition: opacity .2s ease, background-color .2s ease, border-color .2s ease; }
.cal-when { display: grid; justify-items: center; text-align: center; }
.cal-when b { font-family: var(--display); font-weight: 400; font-size: 1.75rem; line-height: 1; white-space: nowrap; }
.cal-when span { margin-top: 4px; font: 600 .75rem/1.2 var(--sans); color: var(--muted); white-space: nowrap; }
.cal-what h4 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.125rem; line-height: 1.25; }
.cal-what p { margin: 3px 0 0; font: .875rem/1.4 var(--sans); color: var(--muted); max-width: none; }
.cal-go { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid var(--rule); border-radius: 999px; font: 600 .875rem/1.2 var(--sans); white-space: nowrap; text-decoration: none; transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
.cal-go:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.cal-item.is-past { opacity: .55; }
.cal-item.is-hit { background: var(--bg); border-color: var(--fg); border-left-color: var(--c); }
.cal-item.is-dim { opacity: .35; }
.cal-item.is-off { display: none; }
.cal-empty { margin: 8px 2px; }

/* the key */
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 12px 22px; list-style: none; border-top: 1px solid var(--rule); font: 600 .8125rem/1.2 var(--sans); color: var(--muted); }
.cal-legend li { display: inline-flex; align-items: center; gap: 8px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.cal-acts { margin-top: 20px; gap: 12px 28px; }

@media (max-width: 1024px) {
  .cal-month { grid-template-columns: minmax(0, 1fr); }
  .cal-grid-wrap { border-right: 0; border-bottom: 1px solid var(--rule); max-width: 560px; width: 100%; margin-inline: auto; }
  .cal-list { max-height: none; }
}
@media (max-width: 720px) {
  .cal-filter { width: 100%; border-radius: 22px; }
  .cal-filter button { flex: 1 1 auto; padding: 6px 10px; }
  .cal-next { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; }
  .cal-next__k, .cal-next__in { grid-column: 1 / -1; }
  .cal-next__date { padding-inline: 0 16px; border-left: 0; }
  .cal-next__go { grid-column: 1 / -1; justify-self: start; }
  .cal-bar { padding: 8px; gap: 6px; }
  .cal-step { width: 36px; }
  .cal-tabs button { min-width: 52px; padding: 6px; }
  .cal-grid-wrap { padding: 16px 12px 12px; }
  .cal-grid { border-spacing: 3px; }
  .cal-day { padding-top: 5px; gap: 3px; }
  .cal-day .dots i { width: 6px; height: 6px; }
  .cal-list { padding: 12px; }
  .cal-item { grid-template-columns: 3.8rem minmax(0, 1fr); gap: 4px 10px; padding: 10px 12px 10px 8px; }
  .cal-go { grid-column: 2; justify-self: start; margin-top: 4px; }
  .cal-when b { font-size: 1.5rem; }
  .cal-legend { padding: 12px 14px; gap: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cal-filter button, .cal-tabs button, .cal-step, button.cal-day, .cal-item, .cal-go { transition: none; }
}

/* phones: the calendar first, then three events and a button for the rest (js/calendar.js); the next-up strip and
   the long note give way, and the filter is one swipeable line */
.cal-more { display: block; width: 100%; margin-top: 10px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--fg); font: 600 .875rem/1.2 var(--sans); }
.cal-more:hover { background: var(--fg); color: var(--bg); }
.cal-more[hidden] { display: none; }
@media (max-width: 1024px) { .cal-item.is-cut { display: none; } }
@media (max-width: 720px) {
  .cal-next { display: none; }
  .cal-head { gap: 14px; margin-bottom: 18px; }
  .cal-head .note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cal-filter { flex-wrap: nowrap; overflow-x: auto; border-radius: 999px; scrollbar-width: none; }
  .cal-filter::-webkit-scrollbar { display: none; }
  .cal-filter button { flex: 0 0 auto; white-space: nowrap; }
}
