:root {
  --olive-green: #708A58;
  --olive-light: #8FA976;
  --olive-dark: #5A6E48;
  --light-bg: #f8f9fa;
  --text-dark: #2c3e50;
  --text-light: #6c757d;
  --surface: #ffffff;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-strong: rgba(0, 0, 0, 0.12);
  --border-light: #e9ecef;
  --accent-blue: #3498db;
  --accent-orange: #e67e22;
  --pomegranate:   #c0392b;
  

}

/* ───────────────────────────────────────────────────────────────────
   HIGHLIGHTED EVENT BANNER
   Sits between the page banner and the calendar, surfacing one
   upcoming event with a CTA that opens the signup popup.
   ─────────────────────────────────────────────────────────────────── */
.event-highlight {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem 0;
}

.event-highlight-card {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f6f8f3 100%);
  border-radius: 1rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-light);
  border-left: 6px solid var(--olive-green);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.event-highlight-label {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--olive-dark);
  background: rgba(112, 138, 88, 0.12);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.event-highlight-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.25rem, 0.9rem + 1.3vw, 1.85rem);
  color: var(--text-dark);
  margin: 0;
  line-height: 1.3;
  font-weight: 700;
}

.event-highlight-subtitle {
  margin: 0;
  color: var(--text-light);
  font-style: italic;
  font-size: clamp(0.9rem, 0.8rem + 0.3vw, 1.05rem);
}

.event-highlight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  color: var(--text-dark);
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.event-highlight-meta i {
  color: var(--olive-green);
  margin-right: 0.45rem;
}

.event-highlight-cta {
  align-self: flex-start;
  margin-top: 0.5rem;
  background: var(--olive-green);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.event-highlight-cta:hover,
.event-highlight-cta:focus-visible {
  background: var(--olive-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(112, 138, 88, 0.3);
  outline: none;
}

@media (max-width: 768px) {
  .event-highlight {
    padding: 0.5rem 0.5rem 0;
  }
  .event-highlight-meta {
    gap: 0.4rem 1rem;
    font-size: 0.85rem;
  }
}

/* Page layout */
.content {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ───────────────────────────────────────────────────────────────────
   SIDEBAR "Event Details"
   ─────────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-radius: 1rem;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 20px var(--shadow);
  width: 400px;
  min-height: 600px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.sidebar h2 {
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
  color: var(--olive-green);
  font-weight: 700;
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
}

.selected-date {
  margin-bottom: 1.5rem;
}

.selected-date h3 {
  font-size: 1.1rem;
  color: var(--text-dark);
  text-align: center;
  margin: 0;
}

.event-details {
  flex: 1;
  overflow-y: visible;
}

.event-details::-webkit-scrollbar {
  width: 6px;
}

.event-details::-webkit-scrollbar-track {
  background: var(--light-bg);
  border-radius: 3px;
}

.event-details::-webkit-scrollbar-thumb {
  background: var(--olive-light);
  border-radius: 3px;
}

.event-details .placeholder {
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

/* Event categories and items */
.event-category {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.event-category:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.category-title {
  color: var(--olive-dark);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  border-left: 4px solid var(--olive-green);
}

.event-item {
  background: var(--light-bg);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.event-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
  border-color: var(--olive-light);
}

.event-item h5 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--text-dark);
  font-weight: 600;
}

.event-time {
  font-size: 0.9rem;
  color: var(--olive-green);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.event-time i {
  margin-right: 0.5rem;
}

.event-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-light);
  margin: 0;
}

.recurring-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--accent-blue);
  color: white;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ───────────────────────────────────────────────────────────────────
   CALENDAR CARD
   ─────────────────────────────────────────────────────────────────── */
.calendar-container {
  flex: 1;
}

.calendar {
  background: var(--surface);
  border-radius: 1rem;
  box-shadow: 0 6px 30px var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
}

.calendar-header button {
  background: var(--light-bg);
  border: 2px solid transparent;
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--text-dark);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-header button:hover {
  color: var(--olive-green);
  border-color: var(--olive-green);
  background: rgba(112, 138, 88, 0.1);
}

.month-year {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--olive-green);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Weekdays row */
.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

/* Calendar grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.day {
  position: relative;
  padding: 0.75rem;
  min-height: 60px;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
}

.day.other-month {
  color: #d1d5db;
  cursor: default;
}

.day .date {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Event indicators */
.event-dot {
  position: absolute;
  bottom: 6px;
  width: 6px;
  height: 6px;
  /* background: var(--olive-green); */
  border-radius: 50%;
  background: transparent;
}

.event-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--accent-orange);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hover & selection states */
.day:not(.other-month):hover {
  background: rgba(112, 138, 88, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--shadow-strong);
}

.day.has-event:not(.other-month):hover {
  border-color: var(--olive-light);
}

.day.selected {
  background: rgba(112, 138, 88, 0.2);
  border-color: var(--olive-green);
  box-shadow: 0 0 0 3px rgba(112, 138, 88, 0.2);
}

/* Calendar legend */
.calendar-legend {
  background: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 15px var(--shadow);
}

.calendar-legend h3 {
  font-size: 1.2rem;
  color: var(--olive-green);
  margin-bottom: 1rem;
}

.legend-items {
  display: flex;
  gap: 2rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-light);
}

/* .legend-item .event-dot {
  position: static;
  margin: 0;
} */

/* .legend-item .event-count {
  position: static;
  margin: 0;
} */
/* Category‑specific overrides */
.event-count.adult {
  background: var(--accent-blue);
}
.event-dot.youth,
.event-count.youth {
  background: var(--olive-green);
}
.event-dot.cultural {
  background: var(--pomegranate);
}
/* Position adult count in bottom‑right */
.event-count.adult {
  position: absolute;
  bottom: 6px;
  right: 6px;
}

/* Position youth count just to the left of the adult badge */
.event-count.youth {
  position: absolute;
  bottom: 6px;
  /* right: 30px; */
  left: 6px;
}

/* Position cultural dot in bottom‑left */
.event-dot.cultural {
  position: absolute;
  bottom: 8px;
  left: 90px;
}


/* Responsive design */
@media (max-width: 1024px) {
  .content {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  /* Calendar first, sidebar (event details) below */
  .calendar-container { order: 1; }
  .sidebar            { order: 2; }

  .sidebar {
    width: 100%;
    min-height: auto;
    max-height: 500px;
  }

  .event-details {
    max-height: 380px;
  }
}

@media (max-width: 768px) {
  .calendar {
    padding: 1rem;
  }
  
  .month-year {
    font-size: 1.4rem;
  }
  
  .day {
    min-height: 50px;
    padding: 0.5rem;
  }
  
  .day .date {
    font-size: 1rem;
  }
}

/* Legend icon base */
.legend-item .event-legend {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

/* Legend colors */
.legend-item .event-legend.adult {
  background: var(--accent-blue);
}
.legend-item .event-legend.youth {
  background: var(--olive-green);
}
.legend-item .event-legend.cultural {
  background: var(--pomegranate);
}

/* Ensure legend text & icons line up */
.calendar-legend .legend-items {
  display: flex;
  gap: 1.5rem;
}
.legend-item {
  display: flex;
  align-items: center;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ===== Responsive calendar enhancements ===== */

/* Fluid design tokens */
:root {
  --cal-padding: clamp(8px, 2.5vw, 16px);
  --cal-gap: clamp(2px, 1vw, 8px);
  --cal-radius: clamp(8px, 2vw, 14px);
  --cal-date-size: clamp(0.8rem, 2.6vw, 1rem);
  --cal-title-size: clamp(1rem, 4vw, 1.4rem);
  --cal-badge: clamp(16px, 3.2vw, 22px);
}

/* Container scales gracefully */
.calendar {
  max-width: min(100%, 1000px);
  margin: clamp(8px, 3vw, 32px) auto;
  border-radius: var(--cal-radius);
  touch-action: pan-y; /* allow vertical page scroll while we detect horizontal swipe */
}

/* Header tweaks */
.calendar-header {
  padding: var(--cal-padding);
}
.calendar-header .month-year,
#month-year {
  font-size: var(--cal-title-size);
  margin: 0;
}
.calendar-header button {
  width: clamp(36px, 8vw, 44px);
  height: clamp(36px, 8vw, 44px);
  font-size: clamp(20px, 6vw, 28px);
  border-radius: clamp(8px, 2vw, 10px);
}

/* Weekday row */
.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--cal-gap);
  padding: 0 var(--cal-padding);
  color: var(--text-light, #6c757d); /* fallback if var not defined earlier */
  font-size: clamp(10px, 2.4vw, 12px);
}
.weekday-row > div {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(22px, 6vw, 32px);
}

/* Calendar grid auto-fits width; cells are always square */
#calendar-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--cal-gap);
  padding: var(--cal-padding);
}

/* Day cells become square using aspect-ratio (prevents “weird” stretching on phones) */
.day {
  height: auto;                    /* override any fixed heights */
  aspect-ratio: 1 / 1;             /* perfect squares at any width */
  border-radius: var(--cal-radius);
  padding: clamp(4px, 1.2vw, 8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Date + indicators scale down slightly on small screens */
.date {
  font-size: var(--cal-date-size);
  font-weight: 600;
  align-self: flex-end;
}

/* Badges/dots shrink gracefully */
.event-count {
  min-width: var(--cal-badge);
  height: var(--cal-badge);
  font-size: clamp(10px, 2.4vw, 12px);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.event-dot {
  width: clamp(8px, 2.2vw, 10px);
  height: clamp(8px, 2.2vw, 10px);
  border-radius: 999px;
}

/* Legend trims on very small screens */
.calendar-legend {
  padding: 0 var(--cal-padding) var(--cal-padding);
  font-size: clamp(12px, 2.8vw, 14px);
}
.calendar-legend .legend-items {
  display: flex;
  gap: clamp(10px, 3vw, 18px);
  flex-wrap: wrap;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   APPLE CALENDAR MOBILE STYLE  (≤768px)
   ============================================================ */
@media (max-width: 768px) {

  /* ── Outer layout ── */
  .content {
    padding: 0.5rem;
    gap: 0.75rem;
  }

  /* ── Calendar card ── */
  .calendar {
    padding: 0.6rem 0.5rem 0.75rem;
    border-radius: 1rem;
    margin-bottom: 0;
  }

  /* ── Month header ── */
  .calendar-header {
    padding: 0.25rem 0 0.5rem;
    margin-bottom: 0.4rem;
  }
  #month-year, .month-year {
    font-size: 1rem;
    letter-spacing: 0.5px;
  }
  .calendar-header button {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: 50%;
  }

  /* ── Weekday row ── */
  .weekdays {
    font-size: 0.65rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    padding-bottom: 0.25rem;
  }

  /* ── Calendar grid ── */
  #calendar-grid, .calendar-grid {
    gap: 3px;
    padding: 0 1px;
  }

  /* ── Day cells: circular Apple style ── */
  .day {
    aspect-ratio: 1 / 1;
    min-height: unset;
    height: auto;
    padding: 0;
    border: none !important;
    border-radius: 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    background: transparent;
    box-shadow: none !important;
  }
  .day:not(.other-month):hover {
    transform: none;
    box-shadow: none !important;
    background: rgba(112, 138, 88, 0.1);
  }
  .day.selected {
    background: rgba(112, 138, 88, 0.08) !important;
    border: none !important;
    box-shadow: none !important;
  }
  .day.other-month {
    opacity: 0.15;
    pointer-events: none;
  }

  /* ── Date number: circular hit target ── */
  .day .date {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    width: clamp(22px, 6.5vw, 30px);
    height: clamp(22px, 6.5vw, 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
  }

  /* Today → iOS blue circle */
  .day.today .date {
    background: #007aff;
    color: #fff;
    font-weight: 700;
  }
  /* Selected (not today) → olive */
  .day.selected:not(.today) .date {
    background: var(--olive-green);
    color: #fff;
  }
  /* Today AND selected → olive (selected wins visually) */
  .day.today.selected .date {
    background: var(--olive-green);
    color: #fff;
  }

  /* ── Badges: strip absolute positioning, show inline dots ── */
  .day .badges {
    display: flex;
    gap: 2px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
  }

  /* All count & dot elements → tiny static dots on mobile */
  .event-count,
  .event-count.adult,
  .event-count.youth,
  .event-dot,
  .event-dot.cultural {
    position: static !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    width: 5px !important;
    height: 5px !important;
    min-width: 5px !important;
    font-size: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-block !important;
  }

  /* ── Sidebar → clean schedule list ── */
  .sidebar {
    max-height: none;
    min-height: unset;
    border-radius: 1rem;
    padding: 1rem;
  }
  .sidebar h2 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    text-align: left;
  }
  .selected-date {
    margin-bottom: 0.6rem;
  }
  .selected-date h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--olive-dark);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
  }

  /* Category labels */
  .category-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    color: var(--text-light);
    border-left: none;
    padding-left: 0;
    margin-bottom: 0.35rem;
  }
  .event-category {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  /* Event rows: stacked layout on mobile */
  .event-item {
    display: block !important;
    padding: 7px 0 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border-light) !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    transform: none !important;
    box-shadow: none !important;
    position: relative;
  }
  .event-time {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--olive-dark);
    margin-bottom: 2px;
    white-space: normal;
  }
  .event-time i { display: none; }
  .event-item h5 {
    font-size: 0.82rem;
    margin: 0 0 2px;
    color: var(--text-dark);
  }
  .event-description {
    font-size: 0.72rem;
    line-height: 1.4;
    margin: 0;
    color: var(--text-light);
  }
  .recurring-badge {
    position: static !important;
    font-size: 0.58rem;
    padding: 1px 4px;
    margin-bottom: 2px;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
  }

  .event-details {
    overflow-y: visible;
  }

  /* Legend: compact, wraps */
  .calendar-legend {
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
  }
  .calendar-legend h3 {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
  }
  .calendar-legend .legend-items {
    gap: 0.6rem;
    flex-wrap: wrap;
  }
  .legend-item {
    font-size: 0.78rem;
  }
}
