/* ============================================
   Swing Dance Calendar — Jazz-Age Modern
   ============================================ */

:root {
  --bg: #FAF7F2;
  --bg-card: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --gold: #C4973B;
  --burgundy: #8B2635;
  --rose: #D4756B;
  --sage: #6B7F5E;
  --border: #E8E4DE;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1), 0 2px 10px rgba(0, 0, 0, 0.04);
  --radius: 10px;
  --radius-sm: 6px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --transition: 200ms ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  min-height: 100dvh;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
.site-header {
  padding: 1.5rem 1rem 0;
  text-align: center;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
}

.header-logo {
  display: block;
  margin: 0 auto 0.5rem;
  width: 80px;
  height: auto;
  object-fit: contain;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: #2A2A2A;
}

.tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.seo-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 0.5rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.header-rule {
  max-width: 720px;
  margin: 1rem auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold) 30%,
    var(--gold) 70%,
    transparent
  );
  opacity: 0.5;
}

/* ---- Main ---- */
.main {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1rem 2rem;
  flex: 1;
}

/* ---- Toolbar ---- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.current-month {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  white-space: nowrap;
  min-width: 10rem;
}

/* Buttons */
.btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}

.btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
}

.view-toggles {
  display: flex;
  gap: 0.35rem;
}

.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.btn-view {
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.65rem;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
}

.btn-view svg {
  display: block;
}

.btn-view.active {
  background: var(--bg-card);
  box-shadow: var(--shadow);
  color: var(--text);
}

.btn-view:hover:not(.active) {
  color: var(--gold);
  border-color: transparent;
}

/* ---- Calendar Overrides ---- */
.calendar-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  overflow: hidden;
}

/* Hide FullCalendar's default toolbar */
.fc .fc-header-toolbar { display: none !important; }

/* Table styles */
.fc {
  --fc-border-color: var(--border);
  --fc-today-bg-color: rgba(196, 151, 59, 0.06);
  --fc-neutral-bg-color: transparent;
  --fc-page-bg-color: transparent;
  --fc-event-border-color: transparent;
  font-family: var(--font-body);
  font-size: 0.75rem;
}

.fc .fc-col-header-cell-cushion {
  font-weight: 500;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.4rem 0;
}

.fc .fc-daygrid-day-number {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.4rem;
  color: var(--text);
}

.fc .fc-day-today {
  background: rgba(196, 151, 59, 0.20) !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
  font-weight: 700;
}

/* Event dots in month view */
.fc-daygrid-event {
  border-radius: 4px;
  padding: 1px 3px;
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
}

.fc-daygrid-event:hover {
  opacity: 0.8;
}

.fc .fc-daygrid-dot-event .fc-event-title {
  font-weight: 500;
}

/* List view */
.fc-list {
  border: none !important;
}

.fc .fc-list-day-cushion {
  background: var(--bg) !important;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
}

.fc .fc-list-event {
  cursor: pointer;
}

.fc .fc-list-event:hover td {
  background: rgba(196, 151, 59, 0.04);
}

.fc .fc-list-event-dot {
  border-radius: 3px;
}

.event-city-tag {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ---- Multi-month view: compact events (mobile only) ---- */
@media (max-width: 767px) {
  .fc-multimonth .fc-daygrid-event {
    font-size: 10px;
    padding: 0 2px;
    line-height: 1.1;
    margin-bottom: 0;
    border-radius: 2px;
    overflow: hidden;
    white-space: nowrap;
    max-height: 14px;
  }

  .fc-multimonth .fc-daygrid-day-events {
    min-height: 0 !important;
    margin-top: 0 !important;
  }

  .fc-multimonth .fc-daygrid-day-frame {
    min-height: 3em !important;
  }

  .fc-multimonth .fc-daygrid-more-link {
    font-size: 10px;
    line-height: 1.1;
    padding: 0 2px;
  }

  .fc-multimonth .fc-daygrid-day-number {
    font-size: 10px !important;
    padding: 1px 2px !important;
  }


}

/* ---- More Events Link & Popover ---- */
.fc .fc-daygrid-more-link {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--gold);
  padding: 1px 3px;
}


.fc .fc-popover {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.fc .fc-popover-header {
  background: var(--bg);
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.fc .fc-popover-body {
  padding: 0.25rem 0.4rem;
}

/* ---- Legend ---- */
.legend {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  display: inline-block;
}

.dot-social { background: var(--gold); }
.dot-workshop { background: var(--burgundy); }
.dot-festival { background: var(--rose); }
.dot-concert { background: #B87333; }
.dot-jam { background: var(--sage); }

/* ---- Festivals page overrides ---- */
.page-festivals .current-month {
  min-width: 4rem;
}

/* ---- City Navigation (festivals landing page) ---- */
.city-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  justify-content: center;
  align-items: center;
}

.city-nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.city-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.city-nav-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.city-nav-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ---- Festivals Nav Link (city pages) ---- */
.festivals-nav {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.festivals-nav-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.festivals-nav-link:hover {
  background: rgba(196, 151, 59, 0.08);
}

/* ---- Filters ---- */
.filters {
  margin-bottom: 0.6rem;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  user-select: none;
}

.filter-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}

.filter-toggle input[type="checkbox"]:checked {
  background: var(--gold);
  border-color: var(--gold);
}

.filter-toggle input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.filter-label {
  line-height: 1.3;
}

/* ---- Suggest Bar ---- */
.suggest-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.suggest-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-suggest {
  padding: 0.45rem 1rem;
  background: var(--gold);
  color: white;
  border-color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.btn-suggest:hover {
  background: #b08832;
  border-color: #b08832;
  color: white;
}


/* ---- Modal ---- */
.event-modal {
  border: none;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: calc(100% - 2rem);
  padding: 0;
  overflow: hidden;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  animation: modal-in 250ms ease forwards;
}

.event-modal::backdrop {
  background: rgba(26, 26, 26, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-content {
  padding: 1.75rem;
  max-height: 80dvh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
  z-index: 1;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  color: white;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 1rem;
  padding-right: 1.5rem;
}

.modal-details {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.modal-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-row[hidden] { display: none; }

.modal-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: var(--gold);
}

.modal-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.modal-link:hover {
  border-bottom-color: var(--gold);
}

.modal-link[hidden] { display: none; }

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  margin-top: auto;
  max-width: 720px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.kofi-link {
  display: inline-block;
  margin-top: 1.5rem;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.kofi-link:hover {
  opacity: 0.8;
}

.kofi-link img {
  display: block;
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 1rem;
}

/* ---- Responsive — Desktop ---- */
@media (min-width: 768px) {
  .site-header { padding: 2.5rem 2rem 0; }
  .header-logo { width: 100px; }
  .wordmark { font-size: 2rem; }
  .main { padding: 1.25rem 2rem 3rem; }
  .current-month { font-size: 1.3rem; }
  .calendar-wrapper { padding: 1rem; overflow: visible; }
  .fc { font-size: 0.8rem; }
  .fc .fc-col-header-cell-cushion { font-size: 0.7rem; }
  .fc .fc-daygrid-day-number { font-size: 0.8rem; }
  .fc-daygrid-event { font-size: 0.7rem; }
  .legend { gap: 1rem; }
  .legend-item { font-size: 0.7rem; }
  .dot { width: 8px; height: 8px; }
  .event-city-tag { font-size: 0.6rem; }

}

@media (max-width: 767px) {
  .event-modal {
    width: calc(100% - 2rem);
  }

  .modal-content {
    max-height: 75dvh;
  }

  .toolbar {
    gap: 0.4rem;
  }

  .nav-group {
    order: 1;
    flex: 1;
    min-width: 0;
  }

  .view-toggles {
    order: 2;
    flex-shrink: 0;
  }
}

/* Loading state */
.calendar-wrapper.loading {
  position: relative;
  min-height: 300px;
}

.calendar-wrapper.loading #calendar {
  visibility: hidden;
}

.calendar-wrapper.loading::after {
  content: '';
  position: absolute;
  top: calc(50% - 12px);
  left: calc(50% - 12px);
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

