/* The club calendar on the site: the Events tab (/events, /events/<id>, /js/events-site.js), and the
   small calendar page (.ev-date) that the Events tab, the home page's Coming up, the hub's Events and
   the dashboard all draw. The page frame (.sd, .sd-head, .sd-guest, .sd-back, .sd-empty, .sd-article)
   comes from docs.css, so the Events and Docs tabs read alike. Colors come from the tokens in app.css. */

/* ---------- the small calendar page: OCT, 8, Thu ---------- */

.ev-date {
  flex: none; display: grid; justify-items: center; align-content: center; width: 56px; min-height: 62px; padding: 6px 0;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  line-height: 1.1; text-align: center;
}
.ev-date-mon { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.ev-date-day { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.ev-date-dow { font-size: 11px; font-weight: 650; color: var(--muted); }

/* ---------- /events ---------- */

.se-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.se-main { min-width: 0; }
.se-side { position: sticky; top: 16px; display: grid; gap: 12px; }

.se-month + .se-month { margin-top: 24px; }
.se-month-title { margin: 0 0 10px; font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.se-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.se-card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.se-card:hover, .se-card:focus-within { border-color: var(--accent); }
.se-card-main { min-width: 0; display: grid; gap: 4px; }
.se-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.se-card-title { margin: 2px 0 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.se-card-title a { color: var(--text); text-decoration: none; }
/* The whole card is the link's target area; the title stays the one link a screen reader hears. */
.se-card-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.se-card-title a:focus-visible { outline: none; }
.se-card:has(.se-card-title a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.se-card-when, .se-card-place, .se-card-weekly { display: flex; align-items: flex-start; gap: 7px; margin: 0; overflow-wrap: anywhere; }
.se-card-when { font-weight: 650; }
.se-card-place, .se-card-weekly { color: var(--muted); font-size: 14px; }
.se-card-when svg, .se-card-place svg, .se-card-weekly svg { flex: none; margin-top: 3px; color: var(--muted); }
.se-card-preview {
  margin: 4px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* The hackathon's featured card (events-site.js featuredHackathon, 2026-10-26): first in what is coming up, under its
   own Featured heading, drawn like every card, with its edge in the Hackathon label's amber so it stands out a
   little. Its date and hours read as every card's ("Fri, Nov 6, 9 AM to 5 PM"), one line even at 320. */
.se-featured + .se-upcoming, .se-featured + .sd-empty { margin-top: 24px; }
.se-card.is-featured { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.se-card.is-featured:hover, .se-card.is-featured:focus-within { border-color: var(--accent); }
/* Under it, "Nothing else on the calendar right now" wraps in even lines on a phone, never "now" alone. */
.se-featured + .sd-empty .sd-empty-title { text-wrap: balance; }
/* A later date of a weekly event: the date, the title and the time. */
.se-card.is-repeat { padding: 10px 18px; align-items: center; box-shadow: none; }
.se-card.is-repeat .ev-date { min-height: 0; padding: 4px 0; }
.se-card.is-repeat .ev-date-dow { display: none; }
.se-card.is-repeat .se-card-title { margin: 0; font-size: 16px; }
.se-card.is-repeat .se-card-when { flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.se-card.is-cancelled { box-shadow: none; }
.se-card.is-cancelled .se-card-title a { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.se-card.is-cancelled .ev-date { background: transparent; border-color: color-mix(in srgb, var(--line) 60%, transparent); }
.se-card.is-cancelled .ev-date-mon, .se-card.is-cancelled .ev-date-day { color: var(--muted); }

.se-kind { font-size: 12px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.se-kind.kind-build { color: var(--accent); }
.se-kind.kind-workshop { color: var(--free); }
.se-kind.kind-hackathon { color: var(--warn); }
.se-cancelled {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--danger); color: var(--danger); font-size: 12px; font-weight: 750;
}
.se-rel { padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: 12px; font-weight: 800; line-height: 20px; }
.se-rel.is-now { background: var(--accent); color: var(--accent-ink); }
/* On its light tint the text needs to be a little darker for 4.5:1 (as .hub-badge). */
@media (prefers-color-scheme: light) {
  .se-rel:not(.is-now) { color: color-mix(in srgb, var(--accent) 82%, var(--text)); }
}

.se-subscribe {
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.se-subscribe-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; }
.se-subscribe-title svg { color: var(--accent); }
.se-subscribe-line { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.se-subscribe-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
input[type="text"].se-ics-url { min-height: 38px; font-size: 13px; color: var(--muted); }
.se-subscribe-tip { margin: 8px 0 0; font-size: 13px; }

.se-past { margin-top: 30px; }
.se-past-title { margin: 0 0 10px; font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.se-past-list { list-style: none; margin: 0; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.se-past-list li + li { border-top: 1px solid var(--line); }
.se-past-row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 48px; padding: 8px 14px; color: var(--text); text-decoration: none;
}
.se-past-row:hover .se-past-name { text-decoration: underline; text-underline-offset: 3px; }
.se-past-when { color: var(--muted); font-size: 14px; }
.se-past-name { font-weight: 650; overflow-wrap: anywhere; }
.se-more { margin-top: 10px; }
.se-later:empty { display: none; }
.se-later { margin-top: 20px; display: grid; justify-items: start; gap: 8px; }
.se-later-line { margin: 0; }
.se-later-btn[aria-disabled="true"] { opacity: 0.7; cursor: progress; }
.se-later-problem { margin: 0; color: var(--danger); }
.se-later-problem:empty { display: none; }

/* ---------- /events/<id> ---------- */

.se-article { max-width: 760px; }
.se-head { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.se-head:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.se-title { margin: 10px 0 12px; font-size: clamp(26px, 4.4vw, 34px); overflow-wrap: anywhere; }
.se-title:focus { outline: none; }
.se-facts { display: grid; gap: 10px; margin: 0; }
.se-fact { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.se-fact dt { margin: 2px 0 0; color: var(--accent); }
.se-fact dd { margin: 0; display: grid; overflow-wrap: anywhere; }
.se-fact-main { font-weight: 700; font-size: 17px; }
.se-fact-sub { color: var(--muted); }
.se-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.se-actions .btn { gap: 8px; }
.se-notice {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); font-size: 15px;
}
.se-notice svg { flex: none; margin-top: 2px; color: var(--accent); }
.se-notice.is-cancelled { border-color: color-mix(in srgb, var(--danger) 45%, transparent); border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.se-notice.is-cancelled svg { color: var(--danger); }
.se-text p:last-child { margin-bottom: 0; }
.se-more-dates { max-width: 760px; margin-top: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.se-more-dates h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; }
.se-more-dates h2 svg { color: var(--accent); }
.se-more-dates ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.se-more-dates li.is-cancelled a { color: var(--muted); text-decoration: line-through; }

@media (min-width: 900px) {
  .se > .sd-head .sd-extras { width: 320px; }
  /* An officer's link to the hub fills that column; its words wrap into two even lines. */
  .se > .sd-head .sd-extras .btn { width: 100%; padding-top: 6px; padding-bottom: 6px; text-wrap: balance; }
}

/* ---------- tablets and phones ---------- */

@media (max-width: 899px) {
  .se-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .se-side { position: static; }
}

@media (max-width: 759px) {
  input[type="text"].se-ics-url { min-height: 44px; } /* the phone tap target (app.css) */
  .se-card { padding: 14px; gap: 12px; }
  .se-card.is-repeat { padding: 10px 14px; }
  .se-card-top { column-gap: 6px; }
  .ev-date { width: 50px; min-height: 56px; }
  .ev-date-day { font-size: 19px; }
  .se-card-title { font-size: 17px; }
  .se-subscribe { padding: 14px 16px; }
  .se-subscribe-actions .btn { flex: 1 1 auto; min-height: 44px; }
  .se-past-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when badge" "name badge"; gap: 0 10px; padding: 10px 14px; }
  .se-past-when { grid-area: when; font-size: 13px; }
  .se-past-name { grid-area: name; }
  .se-past-row .vis-badge { grid-area: badge; }
  .se-actions .btn { flex: 1 1 auto; min-height: 44px; }
  .btn.se-more { min-height: 44px; }
  .se-more-dates { padding: 14px 16px; }
  .se-more-dates a { display: inline-block; min-height: 32px; padding: 4px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .se-card { transition: none; }
}
