/* FullCalendar — Webflow Calendar Tool Styles
   Add to page <head> custom code or Webflow site-level custom code */

/* Calendar container */
#divCalendar {
  max-width: auto;
  margin: 0 auto;
  padding: 0 !important;
  font-family: inherit;
}

/* Toolbar styling */
.fc .fc-toolbar-title {
  font-size: 1.5rem;
  font-weight: 600;
}
.fc .fc-button {
  font-size: 0.875rem;
  padding: 0.4em 0.8em;
  border-radius: 6px;
}
.fc .fc-button-primary {
  background-color: #374151;
  border-color: #374151;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background-color: #111827;
  border-color: #111827;
}

/* Day cells */
.fc .fc-daygrid-day-number {
  font-size: 0.875rem;
  padding: 4px 8px;
}
.fc .fc-day-today {
  background-color: rgba(59, 130, 246, 0.05) !important;
}

/* Events — Lincoln Center card style */
.fc-event {
  cursor: pointer;
  background: #f9fafb !important;
  border: none !important;
  border-radius: 4px;
  padding: 0 !important;
  margin-bottom: 3px !important;
  overflow: visible;
}
.fc-daygrid-event {
  white-space: normal !important;
}
.fc-event:hover {
  background: #f3f4f6 !important;
}

/* Event card layout */
.fc-event-card {
  padding: 6px 8px 6px 10px;
  line-height: 1.3;
  border-left: 3px solid var(--card-color, #6b7280);
}
.fc-event-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2px;
}
.fc-event-card-category {
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 2px;
}
.fc-event-card-time {
  font-size: 0.75rem;
  font-weight: 400;
  color: #111827;
}

/* Envoy registration status on a session: "Full" / "Cancelled" */
.fc-event-card-tag {
  display: inline-block;
  margin-top: 2px;
  padding: 0 6px;
  border-radius: 8px;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.fc-event-card-tag--cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* Week (time-grid) view: the box height is the event's duration, so keep
   the card inside it instead of spilling over the next event */
.fc .fc-timegrid-slot {
  height: 2em;
}
.fc .fc-timegrid-event.fc-event {
  overflow: hidden;
}
.fc-event-card--timegrid {
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 3px 6px 3px 8px;
}
.fc-event-card-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8rem;
  line-height: 1.3;
  color: #111827;
}
.fc-timegrid-event-short .fc-event-card-clamp {
  -webkit-line-clamp: 1;
}
.fc-event-card-clamp .fc-event-card-title,
.fc-event-card-clamp .fc-event-card-time {
  display: inline;
  margin: 0;
  font-size: inherit;
}
.fc-event-card-clamp .fc-event-card-tag {
  margin: 0 4px 0 0;
  vertical-align: 1px;
}

/* List view: the dot and time column already carry color and time */
.fc .fc-list-event-title a {
  color: inherit;
  text-decoration: none;
}
.fc-event-card--list {
  padding: 0;
  border-left: none;
}
.fc-event-card--list .fc-event-card-title {
  font-size: 0.9rem;
}
.fc-event-card--list .fc-event-card-category {
  font-size: 0.75rem;
  margin-bottom: 0;
}

/* Phone month grid: one-line colored bars (tap opens the event) */
.fc-phone .fc-daygrid-event {
  white-space: nowrap !important;
  margin-bottom: 2px !important;
}
.fc-phone .fc-daygrid-event .fc-event-card {
  padding: 2px 3px 2px 4px;
  border-left-width: 2px;
  min-width: 0;
}
.fc-phone .fc-daygrid-event .fc-event-card-title {
  font-size: 0.65rem;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-phone .fc-daygrid-event .fc-event-card-category,
.fc-phone .fc-daygrid-event .fc-event-card-time,
.fc-phone .fc-daygrid-event .fc-event-card-tag {
  display: none;
}
.fc-phone .fc-daygrid-day-number {
  font-size: 0.75rem;
  padding: 2px 4px;
}

/* ── Event Modal ──────────────────────────────────── */
#eventModal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* 44px touch target with its own backing so it reads over any photo */
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.75rem;
  cursor: pointer;
  color: #374151;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  line-height: 1;
  z-index: 1;
}
.modal-close:hover {
  color: #111827;
  background: #fff;
}

/* Page behind the open modal doesn't scroll */
html.cal-modal-open,
html.cal-modal-open body {
  overflow: hidden;
}

#modalImage {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

.modal-body {
  padding: 24px;
}

#modalTitle {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #111827;
}

#modalCategory {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#modalDate {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 8px;
}

#modalCost {
  font-size: 0.9rem;
  color: #374151;
  font-weight: 600;
  margin-bottom: 12px;
}

#modalDescription {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 16px;
}

#modalLink {
  display: inline-block;
  background: #374151;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}
#modalLink:hover {
  background: #111827;
}

/* Envoy registration (optional #modalStatus / #modalRegister) */
#modalStatus {
  font-size: 0.9rem;
  color: #374151;
  font-weight: 600;
  margin-bottom: 12px;
}
#modalRegister {
  display: inline-block;
  margin: 0 8px 8px 0;
  background: #374151;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}
#modalRegister:hover {
  background: #111827;
}

/* ── Responsive ───────────────────────────────────── */
/* Phones: nav + view buttons share the first row, title sits below */
@media (max-width: 767px) {
  .fc .fc-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .fc .fc-toolbar-chunk:nth-child(2) {
    order: 3;
    width: 100%;
    text-align: center;
  }
  .fc .fc-toolbar-title {
    font-size: 1.2rem;
  }
  .modal-content {
    max-width: 100%;
  }
}
