/* Spring Educational Services — website styling */

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-logo {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
}
.brand-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.site-header h1 { margin: 2px 0 0; font-size: 24px; }
.site-nav { display: flex; gap: 8px; }
.site-nav a {
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
}
.site-nav a.active { background: var(--ink); color: #fff; }

/* Boys / Girls / Southeast switch — links, since each is its own page */
.switch-wrap { max-width: 1280px; margin: 0 auto; padding: 20px 28px 0; }
.switch {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.switch a {
  padding: 8px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.switch a:hover { color: var(--ink); }
.switch a.active { background: var(--ink); color: #fff; }

/* Calendar layout */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  padding: 24px 28px;
  max-width: 1280px;
  margin: 0 auto;
}
.sidebar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  height: fit-content;
}
.sidebar h2 { margin: 0 0 4px; font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.toggles { display: flex; flex-direction: column; gap: 10px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.toggle input { width: 16px; height: 16px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
/* Optional calendars (e.g. Southeast) sit at the bottom of the sidebar, split off. */
.optional-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.optional-block h2 { margin-bottom: 12px; }
/* Select all / Clear all above the group toggles */
.group-actions { display: flex; gap: 8px; margin: 0 0 12px; }
.group-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.group-actions button:hover:not(:disabled) { border-color: var(--muted); color: var(--ink); }
.group-actions button:disabled { color: #94a3b8; cursor: default; }
.sidebar > .optional-toggles:first-child .optional-block:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.optional-toggles:empty { display: none; }
/* No groups and no optional calendars (e.g. a page not connected yet): no sidebar. */
.layout.no-sidebar { grid-template-columns: 1fr; }
.layout.no-sidebar .sidebar { display: none; }

.calendar-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

/* Year view: give each mini-month day enough height to show ~3 events before it
   collapses to "+N more" (multiMonth collapsing is height-driven, not dayMaxEvents).
   Kept modest so the whole year still fits without excessive scrolling. */
.fc-multimonth .fc-daygrid-day-frame { min-height: 100px; }

.hidden { display: none; }
.notice {
  background: #fdf1d6;
  color: #a15c07;
  border: 1px solid #f6d78a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  background: #fff;
  border-radius: 14px;
  padding: 26px;
  max-width: 440px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  border: none; background: none; font-size: 26px;
  cursor: pointer; color: var(--muted); line-height: 1;
}
.modal-committee { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.modal-card h3 { margin: 6px 0 12px; font-size: 22px; }
.modal-row { font-size: 14px; color: #334155; margin-bottom: 6px; }
.modal-desc { font-size: 14px; color: var(--muted); margin-top: 10px; white-space: pre-wrap; }

/* Chooser (home page): one big card per calendar page */
.chooser { max-width: 1000px; margin: 0 auto; padding: 28px; }
.chooser-heading { font-size: 20px; margin: 4px 0 18px; }
.chooser-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 18px;
}
.chooser-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 8px solid var(--accent);
  border-radius: 14px;
  overflow: hidden;
}
.chooser-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 22px 22px 18px;
  text-decoration: none;
}
.chooser-main:hover { background: #f8fafc; }
.chooser-label { font-size: 24px; font-weight: 800; color: var(--accent-text, var(--accent)); }
.chooser-blurb { font-size: 14px; color: #334155; line-height: 1.5; margin-bottom: 6px; }
.chooser-go {
  align-self: flex-start;
  margin-top: auto;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink, #fff);
  font-weight: 700;
  font-size: 14px;
}
.chooser-sub {
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.chooser-sub:hover { color: var(--ink); background: #f8fafc; }

/* Subscribe page */
.subscribe { max-width: 1000px; margin: 0 auto; padding: 28px; }
.lead { font-size: 16px; color: #334155; line-height: 1.6; }
.all-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #fff;
  border-radius: 16px;
  padding: 22px 26px;
  margin-top: 24px;
}
.all-banner h2 { margin: 0; font-size: 22px; }
.all-banner p { margin: 4px 0 0; color: #cbd5e1; font-size: 14px; }
.all-actions { display: flex; gap: 10px; flex-wrap: wrap; }
/* Buttons sit on the dark banner — make them readable */
.all-banner .btn.primary { background: #fff; color: #0f172a; }
.all-banner .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.all-note { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }
.combined-cards { display: grid; gap: 14px; margin-top: 24px; }
.sub-section { margin-top: 30px; }
.sub-heading {
  font-size: 18px;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 18px;
  margin: 24px 0 40px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 20px 20px;
  overflow: hidden;
}
.card-bar { height: 8px; margin: 0 -20px 16px; background: var(--accent); }
.card h3 { margin: 0 0 14px; font-size: 18px; }
.card-actions { display: flex; flex-direction: column; gap: 8px; }
.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink, #fff); }
.btn.ghost { border: 1px solid var(--line); color: #334155; }
.btn.disabled { background: #f1f5f9; color: #94a3b8; }

/* Tablet / small screens */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .subscribe, .chooser { padding: 18px 16px; }
  .site-header { padding: 16px; }
  .calendar-wrap { padding: 10px; }
  .switch-wrap { padding: 16px 16px 0; }
  .switch a { padding: 8px 16px; }

  /* FullCalendar: stack the toolbar and shrink controls so nothing overflows */
  .fc .fc-toolbar.fc-header-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }
  .fc .fc-toolbar-title { font-size: 1.15rem; text-align: center; }
  .fc .fc-button { padding: 5px 9px; font-size: 0.85rem; }
  /* Four view buttons (Month/Week/Year/Upcoming) must wrap, not overflow */
  .fc .fc-toolbar-chunk { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

  /* All-events banner + card buttons stack full width */
  .all-banner { flex-direction: column; align-items: stretch; text-align: left; }
  .all-actions { flex-direction: column; }
  .all-actions .btn { display: block; width: 100%; }
}

/* Phones */
@media (max-width: 480px) {
  .brand-logo { width: 44px; height: 44px; }
  .site-header h1 { font-size: 19px; }
  .brand-kicker { font-size: 11px; }
  .lead { font-size: 15px; }
  .fc .fc-daygrid-day-number { font-size: 0.8rem; }
  .fc .fc-event { font-size: 0.72rem; }
}
