/* ============================================
   Events — ViveLaCity Agenda
   Extends city-guide.css design system
   ============================================ */

/* ============================================
   Page wrapper
   ============================================ */

.agenda-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* ============================================
   View Switcher
   ============================================ */

/* ============================================
   Agenda Control Bar — Category + View switcher
   ============================================ */

.agenda-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  margin-bottom: 24px;
}

/* Category dropdown */
.agenda-cat-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 36px 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--color-border, #e5e7eb);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text, #111827);
  background-color: var(--color-surface, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
  min-width: 210px;
  transition: border-color 0.15s;
}
.agenda-cat-select:focus {
  outline: none;
  border-color: var(--color-primary, #414B93);
}
.agenda-cat-select:hover {
  border-color: var(--color-primary, #414B93);
}

/* Desktop segmented view switcher */
.agenda-views-desktop {
  display: flex;
  gap: 2px;
  background: var(--color-bg, #f3f4f6);
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}

.agenda-view-btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary, #6b7280);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
  line-height: 1.4;
}
.agenda-view-btn:hover {
  color: var(--color-text, #111827);
}
.agenda-view-btn.active {
  background: var(--color-surface, #fff);
  color: var(--color-primary, #414B93);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  font-weight: 600;
}

/* Mobile icon switcher — hidden on desktop */
.agenda-views-mobile { display: none; }

/* ============================================
   Day Groups
   ============================================ */

.agenda-day-group {
  margin-bottom: 40px;
}

.agenda-day-header {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text-primary, #111827);
  text-transform: capitalize;
  letter-spacing: 0.01em;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary, #414B93);
}

/* ============================================
   Event Card (List View — horizontal)
   Scoped to .agenda-day-events to override
   .event-card rules from city-guide.css
   (home horizontal scroll widget)
   ============================================ */

.agenda-day-events {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-day-events .event-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}

.agenda-day-events .event-card:last-child {
  margin-right: 0;
}

.agenda-day-events .event-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.event-card-image-link {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
}

.event-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.event-card:hover .event-card-image { transform: scale(1.05); }

.event-card-body {
  padding: 14px 16px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-subsection-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
  text-decoration: none;
}
a.event-subsection-badge:hover { opacity: 0.85; }

.event-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.event-card-title a {
  color: var(--color-text-primary, #111827);
  text-decoration: none;
}

.event-card-title a:hover { color: var(--color-primary, #414B93); }

.event-card-date,
.event-card-venue,
.event-card-organizer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--color-text-secondary, #6b7280);
  margin: 0;
}

.event-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.event-tag-chip {
  padding: 2px 8px;
  background: var(--color-surface-alt, #f3f4f6);
  border-radius: 10px;
  font-size: 11px;
  color: var(--color-text-secondary, #6b7280);
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
}

.event-cost-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary, #414B93);
}

.event-cta-btn {
  display: inline-block;
  padding: 7px 16px;
  background: var(--color-primary, #414B93);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.event-cta-btn:hover {
  background: var(--color-primary-dark, #2d3468);
  transform: scale(1.03);
}

/* ============================================
   Empty state & Past Events link
   ============================================ */

.agenda-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--color-text-secondary, #6b7280);
  font-size: 16px;
}

.agenda-past-link-wrap {
  text-align: center;
  padding: 32px 0 16px;
}

.agenda-past-link {
  color: var(--color-text-secondary, #6b7280);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.agenda-past-link:hover { color: var(--color-primary, #414B93); }

/* ============================================
   Fotos Grid View
   ============================================ */

.agenda-fotos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 8px;
}

.event-photo-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-surface, #fff);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
  display: block;
}

.event-photo-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.event-photo-card-image-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.event-photo-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.event-photo-card:hover .event-photo-card-image-wrap img { transform: scale(1.05); }

.event-photo-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-photo-card-cost {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0,0,0,0.65);
  color: #fff;
}

.event-photo-card-body {
  padding: 12px;
}

.event-photo-card-body h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--color-text-primary, #111827);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-photo-card-body p {
  font-size: 12px;
  color: var(--color-text-secondary, #6b7280);
  margin: 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (min-width: 768px) {
  .agenda-day-events {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .agenda-day-events .event-card {
    grid-template-columns: 156px 1fr;
  }

  .agenda-fotos-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  .agenda-day-events .event-card {
    grid-template-columns: 90px 1fr;
  }

  .event-card-body {
    padding: 10px 12px 10px 0;
    gap: 4px;
  }

  .event-card-title { font-size: 14px; }

  .agenda-fotos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .agenda-fotos-grid .event-photo-card-image-wrap {
    aspect-ratio: 1/1;
  }

  .event-photo-card-cost { display: none; }

  .event-cta-btn { padding: 6px 12px; font-size: 12px; }
}

@media (max-width: 380px) {
  .agenda-fotos-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Single Event Page
   ============================================ */

/* Text header */
.event-title-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--header-height) + 24px) 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-title-header h1 {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  color: #111;
  margin: 0;
  line-height: 1.2;
}

.event-title-date {
  color: #555;
  font-size: 15px;
  margin: 0;
}

/* Page layout */
.event-page {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

.event-content { grid-column: 1; grid-row: 1; min-width: 0; }
.event-sidebar  { grid-column: 2; grid-row: 1 / 3; }
.event-actions  { grid-column: 1; grid-row: 2; min-width: 0; }
.event-recommendations-block { grid-column: 1; grid-row: 3; }

/* Status alert */
.event-status-alert {
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 15px;
}

.event-status-alert strong { display: block; font-size: 16px; margin-bottom: 6px; }
.event-status-alert p { margin: 0; opacity: 0.85; }

.event-status-canceled  { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.event-status-postponed { background: #fef9c3; color: #854d0e; border-left: 4px solid #eab308; }

/* Sections */
.event-section { margin-bottom: 32px; }

.event-section-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 20px;
  color: var(--color-text-primary, #111827);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--color-primary, #414B93);
}

.event-description {
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-primary, #111827);
}

.event-description h2 { font-size: 20px; font-weight: 700; margin: 24px 0 8px; }
.event-description h3 { font-size: 17px; font-weight: 700; margin: 20px 0 8px; }
.event-description p  { margin: 0 0 14px; }
.event-description ul, .event-description ol { padding-left: 20px; margin: 0 0 14px; }

/* Tickets */
.event-tickets-block { margin-bottom: 0; }

.event-tickets-list { display: flex; flex-direction: column; }

.event-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  gap: 12px;
  flex-wrap: wrap;
}

.event-ticket-row:last-child { border-bottom: none; }

.event-ticket-info { display: flex; align-items: center; gap: 10px; }
.event-ticket-name { font-weight: 600; font-size: 15px; }
.event-ticket-actions { display: flex; align-items: center; gap: 12px; }
.event-ticket-price { font-weight: 700; color: var(--color-primary, #414B93); font-size: 15px; }

.badge-paid { background: #dbeafe; color: #1e40af; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.badge-rsvp { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }

/* External CTA */
.event-external-cta { margin-bottom: 24px; }

.event-cta-btn--large {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Calendar */
.event-calendar-cta { margin-bottom: 32px; }

.event-calendar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-text-primary, #111827);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.event-calendar-btn:hover {
  border-color: var(--color-primary, #414B93);
  color: var(--color-primary, #414B93);
}

/* Recommendations block */
.event-recommendations-block {
  margin-top: 48px;
}

.event-promo-banner {
  display: block;
  margin: 0 -16px 40px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.event-promo-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* Related */
.event-related-section { margin-top: 0; padding-top: 0; border-top: none; }

.event-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.event-related-card {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border, #e5e7eb);
  transition: box-shadow 0.15s;
}

.event-related-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.event-related-image-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.event-related-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.event-related-title {
  font-size: 13px;
  font-weight: 700;
  margin: 10px 10px 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-related-date { font-size: 11px; color: var(--color-text-secondary, #6b7280); margin: 0 10px 10px; }

/* Back link */
.event-back-link {
  margin-top: 24px;
}

.event-back-link a {
  font-size: 14px;
  color: var(--color-text-secondary, #6b7280);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.event-back-link a:hover { color: var(--color-primary, #414B93); }

/* Sidebar */
.event-sidebar { display: flex; flex-direction: column; gap: 0; }

.event-detail-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.event-detail-block:last-child { border-bottom: none; }

.event-detail-label {
  font-size: 15px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-primary, #111827);
  margin: 0 0 10px;
}

.event-detail-value { font-size: 14px; margin: 0; line-height: 1.5; }
.event-detail-value a { color: var(--color-primary, #414B93); }
.event-detail-meta { font-size: 13px; color: var(--color-text-secondary, #6b7280); margin: 4px 0 0; }
.event-detail-meta a { color: var(--color-primary, #414B93); }

.event-maps-link { font-size: 13px; color: var(--color-primary, #414B93); }

.event-cost-value { font-size: 18px; font-weight: 700; color: var(--color-primary, #414B93); }

.event-sidebar-cta {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 18px;
  background: var(--color-primary, #414B93);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.event-sidebar-cta:hover { background: var(--color-primary-dark, #2d3468); }

.event-organizer-row { display: flex; gap: 12px; align-items: flex-start; }

.event-organizer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.event-categories-list, .event-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-category-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

/* Responsive — single event */
@media (max-width: 768px) {
  /* Agenda controls: category select flexible + 3 icon buttons */
  .agenda-controls {
    padding: 12px 0;
    gap: 8px;
  }

  .agenda-cat-select {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    padding: 8px 28px 8px 12px;
  }

  .agenda-views-desktop { display: none; }

  .agenda-views-mobile {
    display: flex;
    gap: 2px;
    background: var(--color-bg, #f3f4f6);
    border-radius: 10px;
    padding: 3px;
    flex-shrink: 0;
  }

  .agenda-view-icon {
    width: 38px;
    height: 38px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary, #6b7280);
    text-decoration: none;
    transition: all 0.15s;
  }
  .agenda-view-icon:hover { color: var(--color-text, #111827); }
  .agenda-view-icon.active {
    background: var(--color-surface, #fff);
    color: var(--color-primary, #414B93);
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  }

  /* Event page */
  .event-page {
    grid-template-columns: 1fr;
    padding: 24px 16px 80px;
  }

  .event-content, .event-sidebar, .event-actions, .event-recommendations-block {
    grid-column: auto;
    grid-row: auto;
  }
  .event-content           { order: 1; }
  .event-sidebar           { order: 2; border-top: 2px solid var(--color-border, #e5e7eb); padding-top: 16px; }
  .event-actions           { order: 3; border-top: 2px solid var(--color-border, #e5e7eb); padding-top: 16px; }
  .event-recommendations-block { order: 4; }

  .event-related-grid { grid-template-columns: repeat(2, 1fr); }

}

@media (max-width: 480px) {
  .event-related-grid { grid-template-columns: 1fr; }
  .event-cta-btn--large { width: 100%; justify-content: center; }
}

/* ============================================
   Month Calendar View
   ============================================ */

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}

.cal-nav-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary, #111827);
}

.cal-nav-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary, #111827);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.cal-nav-btn:hover {
  border-color: var(--color-primary, #414B93);
  color: var(--color-primary, #414B93);
}

/* Grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--color-border, #e5e7eb);
  border-left: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}

.cal-header-cell {
  padding: 10px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary, #6b7280);
  background: var(--color-surface-alt, #f9fafb);
  border-right: 1px solid var(--color-border, #e5e7eb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.cal-cell {
  min-height: 100px;
  padding: 6px 4px 6px;
  border-right: 1px solid var(--color-border, #e5e7eb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-surface, #fff);
  vertical-align: top;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-cell--empty {
  background: var(--color-surface-alt, #f9fafb);
  min-height: 100px;
}

.cal-cell--today {
  background: #eff6ff;
}

.cal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  text-decoration: none;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}

.cal-day-num:hover {
  background: var(--color-primary, #414B93);
  color: #fff;
}

.cal-day-num--today {
  background: var(--color-primary, #414B93);
  color: #fff;
}

.cal-pills {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.cal-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  background: var(--pill-color, var(--color-primary, #414B93));
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s;
  line-height: 1.4;
}

.cal-pill:hover { opacity: 0.85; }

.cal-pill-dot {
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
}

.cal-pill-more {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary, #414B93);
  padding: 1px 5px;
  text-decoration: none;
}

.cal-pill-more:hover { text-decoration: underline; }

/* Responsive — month */
@media (max-width: 640px) {
  .cal-cell { min-height: 70px; padding: 4px 2px; }
  .cal-pill { font-size: 10px; padding: 2px 3px; }
  .cal-day-num { width: 22px; height: 22px; font-size: 12px; }
  .cal-nav-title { font-size: 15px; }
  .cal-nav-btn { padding: 6px 10px; font-size: 12px; }
}

/* ============================================
   Time Grid (shared: week + day)
   ============================================ */

/* Wider page for week view */
.agenda-page--wide {
  max-width: 1200px;
}

/* Nav */
.tg-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
  gap: 8px;
}

.cal-nav-btn--active {
  background: var(--color-primary, #414B93);
  border-color: var(--color-primary, #414B93);
  color: #fff;
}

/* Outer wrapper */
.tg-wrapper {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-surface, #fff);
  margin-bottom: 24px;
}

/* Sticky day-header row */
.tg-header {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  border-bottom: 2px solid var(--color-border, #e5e7eb);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface, #fff);
}

.tg-wrapper--day .tg-header {
  grid-template-columns: 56px 1fr;
}

.tg-corner {
  border-right: 1px solid var(--color-border, #e5e7eb);
}

.tg-day-header {
  padding: 10px 4px;
  text-align: center;
  border-right: 1px solid var(--color-border, #e5e7eb);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tg-day-header:last-child { border-right: none; }

.tg-day-header--today {
  background: #eff6ff;
}

.tg-day-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary, #6b7280);
}

.tg-day-num {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary, #111827);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.tg-day-num:hover {
  background: var(--color-primary, #414B93);
  color: #fff;
}

.tg-day-num--today {
  background: var(--color-primary, #414B93);
  color: #fff;
}

/* All-day strip */
.tg-allday-strip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 12px;
  background: var(--color-surface-alt, #f9fafb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  min-height: 36px;
}

.tg-allday-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary, #6b7280);
  text-transform: uppercase;
  white-space: nowrap;
  padding-top: 4px;
  width: 44px;
  flex-shrink: 0;
}

.tg-allday-events {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tg-allday-pill {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s;
}

.tg-allday-pill:hover { opacity: 0.85; }

/* Scrollable time body */
.tg-scroll-wrap {
  overflow-y: auto;
  max-height: 600px;
}

.tg-body {
  display: flex;
}

/* Hour labels */
.tg-labels {
  width: 56px;
  flex-shrink: 0;
  display: grid;
  /* Each slot = 30px, so each hour = 60px */
  grid-template-rows: repeat(36, 30px);
  border-right: 1px solid var(--color-border, #e5e7eb);
  position: sticky;
  left: 0;
  background: var(--color-surface, #fff);
  z-index: 5;
}

.tg-hour-label {
  font-size: 10px;
  color: var(--color-text-secondary, #6b7280);
  padding: 0 6px;
  text-align: right;
  margin-top: -7px; /* vertically center label on the line */
  white-space: nowrap;
}

/* Days grid */
.tg-days-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(36, 30px);
  position: relative;
}

.tg-days-grid--day {
  grid-template-columns: 1fr;
}

/* Hour lines (span all columns) */
.tg-line {
  grid-column: 1 / -1;
  border-top: 1px solid var(--color-border, #e5e7eb);
  pointer-events: none;
}

/* Day columns */
.tg-day-col {
  grid-row: 1 / -1;
  position: relative;
  border-right: 1px solid var(--color-border, #e5e7eb);
  min-width: 0;
}

.tg-day-col:last-child { border-right: none; }

/* Event blocks */
.tg-event {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 0; /* overridden by grid-row on the parent */
  border-radius: 6px;
  padding: 4px 6px;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.3;
  transition: opacity 0.15s, filter 0.15s;
  z-index: 2;
  /* Use grid placement instead of absolute top */
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Override: events use grid-row for vertical placement within tg-day-col */
.tg-day-col .tg-event {
  position: relative;
  left: auto; right: auto; top: auto;
}

/* Re-do: events are children of tg-day-col which has position:relative.
   Use CSS grid on the col itself. */
.tg-day-col {
  display: grid;
  grid-template-rows: repeat(36, 30px);
  align-items: stretch;
}

.tg-event:hover { opacity: 0.88; filter: brightness(1.05); }

.tg-event-time {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.9;
}

.tg-event-title {
  font-size: 11px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tg-empty-day {
  grid-row: 1 / 5;
  grid-column: 1;
  padding: 20px 12px;
  color: var(--color-text-secondary, #6b7280);
  font-size: 14px;
}

/* Responsive — time grid */
@media (max-width: 768px) {
  /* Week: horizontal scroll */
  .tg-wrapper:not(.tg-wrapper--day) {
    overflow-x: auto;
  }

  .tg-header {
    min-width: 560px;
  }

  .tg-days-grid {
    min-width: 504px; /* 7 * 72px */
  }

  .tg-scroll-wrap {
    overflow-x: auto;
  }

  .tg-body {
    min-width: 560px;
  }

  /* Day: full width */
  .tg-wrapper--day .tg-header { min-width: unset; }
  .tg-wrapper--day .tg-body   { min-width: unset; }
  .tg-wrapper--day .tg-days-grid { min-width: unset; }

  .tg-nav {
    flex-wrap: wrap;
    gap: 6px;
  }

  .tg-nav .cal-nav-title { order: -1; width: 100%; text-align: center; }
}

/* ============================================
   Event Gallery (grid + lightbox modal)
   ============================================ */

.event-gallery {
  margin: 0 0 28px;
}

.event-gallery-grid {
  display: grid;
  gap: 8px;
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
}

/* 1 photo: full width */
.event-gallery-grid.count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  height: 340px;
}

/* 2 photos: side by side */
.event-gallery-grid.count-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  height: 340px;
}

/* 3 photos: 1 big left + 2 stacked right */
.event-gallery-grid.count-3 {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.event-gallery-grid.count-3 > .event-gallery-item:first-child {
  grid-row: 1 / 3;
}

/* 4 photos: 1 big left + 3 small right (2 top, 1 bottom full) */
.event-gallery-grid.count-4 {
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.event-gallery-grid.count-4 > .event-gallery-item:first-child {
  grid-row: 1 / 3;
  grid-column: 1 / 2;
}

/* 5+ photos: 1 big left + 2x2 grid right */
.event-gallery-grid.count-5 {
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.event-gallery-grid.count-5 > .event-gallery-item:first-child {
  grid-row: 1 / 3;
  grid-column: 1 / 2;
}

.event-gallery-item {
  position: relative;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  overflow: hidden;
  background: #eee;
  font: inherit;
}

.event-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, filter 0.2s ease;
}

.event-gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(0.95);
}

.event-gallery-more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  pointer-events: none;
  letter-spacing: 0.3px;
}

/* ── Modal / Lightbox ─────────────────────────── */
.event-gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: galleryFadeIn 0.2s ease;
}

.event-gallery-modal.is-open {
  display: flex;
}

@keyframes galleryFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.event-gallery-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s ease;
}
.event-gallery-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.event-gallery-counter {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.55);
  padding: 8px 18px;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}

.event-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s ease;
}
.event-gallery-arrow:hover {
  background: rgba(255, 255, 255, 0.28);
}
.event-gallery-arrow--prev { left: 24px; }
.event-gallery-arrow--next { right: 24px; }

.event-gallery-stage {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-gallery-stage img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.gallery-open {
  overflow: hidden;
}

/* ── Gallery mobile ───────────────────────────── */
@media (max-width: 768px) {
  .event-gallery {
    margin: 0 0 20px;
  }

  .event-gallery-grid,
  .event-gallery-grid.count-1,
  .event-gallery-grid.count-2,
  .event-gallery-grid.count-3,
  .event-gallery-grid.count-4,
  .event-gallery-grid.count-5 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 180px 90px;
    height: auto;
    gap: 6px;
  }

  .event-gallery-grid > .event-gallery-item:first-child {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  /* Hide anything past item 3 on mobile — keep 1 big + 2 small */
  .event-gallery-grid .event-gallery-item:nth-child(n+4) {
    display: none;
  }

  /* If fewer than 3 items, single row */
  .event-gallery-grid.count-1 { grid-template-rows: 200px; }
  .event-gallery-grid.count-2 {
    grid-template-rows: 180px;
  }
  .event-gallery-grid.count-2 > .event-gallery-item:first-child {
    grid-column: 1;
  }

  .event-gallery-more-overlay {
    font-size: 14px;
  }

  .event-gallery-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 26px;
  }

  .event-gallery-counter {
    top: 20px;
    font-size: 12px;
    padding: 6px 14px;
  }

  .event-gallery-arrow {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }
  .event-gallery-arrow--prev { left: 8px; }
  .event-gallery-arrow--next { right: 8px; }
}

