/* ============================================
   Do The Most Good — Event Calendar Styles
   Hosted on GitHub, served via jsDelivr CDN

   Brand palette (from dothemostgood.shared.f2c788906.min.css):
     --base-color-brand--dark-blue:  #153a43
     --base-color-brand--blue:       #389bb4  (primary accent — used for toolbar)
     --base-color-brand--light-blue: #7ed4ea
     --base-color-brand--vermillion: #ff4401
     --base-color-brand--pearl:      #fcfbfa
   ============================================ */

/* Calendar container */
#divCalendar {
  max-width: none;
  margin: 0 auto;
  padding: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #153a43;
}

/* Toolbar styling */
.fc .fc-toolbar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #153a43;
}
.fc .fc-button {
  font-size: 0.875rem;
  padding: 0.4em 0.8em;
  border-radius: 6px;
}
.fc .fc-button-primary {
  background-color: #389bb4;
  border-color: #389bb4;
}
.fc .fc-button-primary:hover {
  background-color: #2e8297;
  border-color: #2e8297;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background-color: #246a7a;
  border-color: #246a7a;
}
.fc .fc-button-primary:focus {
  box-shadow: 0 0 0 0.2rem rgba(56, 155, 180, 0.35);
}

/* Day cells */
.fc .fc-daygrid-day-number {
  font-size: 0.875rem;
  padding: 4px 8px;
}
.fc .fc-day-today {
  background-color: rgba(56, 155, 180, 0.07) !important;
}

/* Events — card style */
.fc-event {
  cursor: pointer;
  background: #f8f9fc !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: #eef0f7 !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: #153a43;
  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: #153a43;
}

/* List view */
.fc .fc-list-event-title a {
  color: inherit;
  text-decoration: none;
}

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

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

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #9ca3af;
  background: none;
  border: none;
  line-height: 1;
  z-index: 1;
}
.modal-close:hover {
  color: #153a43;
}

#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: #153a43;
}

#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: #153a43;
  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: #389bb4;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
}
#modalLink:hover {
  background: #2e8297;
}

/* --- Add to Calendar --- */
.add-cal-wrapper {
  position: relative;
  display: inline-block;
  margin-left: 10px;
}
.add-cal-btn {
  background: none;
  color: #389bb4;
  border: 1px solid #389bb4;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.add-cal-btn:hover {
  background: #389bb4;
  color: #fff;
}
.add-cal-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  margin-bottom: 6px;
  min-width: 180px;
  z-index: 10;
}
.add-cal-menu a {
  display: block;
  padding: 10px 16px;
  color: #153a43;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.add-cal-menu a:hover {
  background: #f3f4f6;
}
.add-cal-menu a:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .fc .fc-toolbar {
    flex-direction: column;
    gap: 8px;
  }
  .fc .fc-toolbar-title {
    font-size: 1.2rem;
  }
  .modal-content {
    max-width: 100%;
  }
}

/* Hidden CMS feed wrapper — JS reads from DOM, must be present but invisible */
#calendarFeed { display: none; }
