/* ============================================================
   Grace Church Events Calendar — Public Styles
   ============================================================ */

:root {
  --gec-gold:    #C9A84C;
  --gec-navy:    #0D1B2A;
  --gec-navy2:   #1A3050;
  --gec-cream:   #F8F4EE;
  --gec-cream2:  #EDE7DC;
  --gec-white:   #FFFFFF;
  --gec-border:  rgba(201,168,76,0.22);
  --gec-text:    #1A1A1A;
  --gec-muted:   #666;
  --gec-radius:  8px;
  --gec-shadow:  0 4px 24px rgba(13,27,42,0.10);
}

/* ── Wrapping containers ─────────────────────────────── */
.gec-wrap,
.gec-upcoming-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--gec-text);
  line-height: 1.5;
}

/* ── Layout ──────────────────────────────────────────── */
.gec-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.gec-has-sidebar {
  grid-template-columns: 1fr 300px;
}

/* ── Calendar header ─────────────────────────────────── */
.gec-cal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.gec-month-label {
  flex: 1;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gec-navy);
  margin: 0;
  padding: 0;
}
.gec-nav-btn {
  background: var(--gec-cream);
  border: 1px solid var(--gec-border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  color: var(--gec-navy);
  line-height: 1;
}
.gec-nav-btn:hover {
  background: var(--gec-navy);
  color: var(--gec-white);
  border-color: var(--gec-navy);
}
.gec-today-btn {
  background: var(--gec-gold);
  color: var(--gec-navy);
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  letter-spacing: .3px;
}
.gec-today-btn:hover { background: #dbb84f; }

/* ── Calendar grid ───────────────────────────────────── */
.gec-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--gec-cream2);
  border-radius: var(--gec-radius);
  overflow: hidden;
}
.gec-dow {
  background: var(--gec-navy);
  color: rgba(255,255,255,0.75);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 4px;
}
.gec-cell {
  background: var(--gec-white);
  border-right: 1px solid var(--gec-cream2);
  border-bottom: 1px solid var(--gec-cream2);
  height: 88px;
  min-height: 88px;
  max-height: 88px;
  padding: 6px 5px 5px;
  cursor: default;
  transition: background .12s;
  position: relative;
  vertical-align: top;
  overflow: hidden;
  box-sizing: border-box;
}
.gec-cell:hover { background: var(--gec-cream); }
.gec-other-month { background: #fafafa; }
.gec-other-month .gec-day-num { opacity: 0.3; }
.gec-today { background: rgba(201,168,76,0.07); }
.gec-day-num {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gec-navy);
  margin-bottom: 4px;
  line-height: 1;
}
.gec-today-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gec-gold);
  color: var(--gec-navy);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.78rem;
}

/* ── Event chips on calendar ─────────────────────────── */
.gec-event-chip {
  display: block;
  font-size: 0.68rem;
  color: #fff;
  border-radius: 3px;
  padding: 2px 5px;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .12s, transform .12s;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.gec-event-chip:hover { opacity: .85; transform: translateX(1px); }
.gec-recur-tag {
  font-size: 0.6rem;
  margin-right: 2px;
  opacity: .85;
}
.gec-more-chip {
  font-size: 0.65rem;
  color: var(--gec-muted);
  padding: 1px 4px;
  cursor: pointer;
  border-radius: 3px;
  background: var(--gec-cream2);
  display: inline-block;
}
.gec-more-chip:hover { background: var(--gec-navy); color: #fff; }

/* ── Multi-day spanning chips ────────────────────────── */
.gec-chip-multiday {
  border-radius: 2px;
  font-style: italic;
  letter-spacing: 0.2px;
}
.gec-chip-start {
  border-radius: 4px 2px 2px 4px;
  border-left: 3px solid rgba(255,255,255,0.45);
}
.gec-chip-mid {
  border-radius: 1px;
  border-left: none;
  border-right: none;
}
.gec-chip-end {
  border-radius: 2px 4px 4px 2px;
  border-right: 3px solid rgba(255,255,255,0.45);
}

/* ── Color dots (legend) ─────────────────────────────── */
.gec-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--gec-muted);
}
.gec-legend-item { display: flex; align-items: center; gap: 6px; }
.gec-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.gec-color-navy   { background: #0D1B2A; }
.gec-color-gold   { background: #C9A84C; }
.gec-color-purple { background: #7B3FB5; }
.gec-color-orange { background: #D4622A; }
.gec-color-teal   { background: #0D7680; }
.gec-color-red    { background: #B22222; }
.gec-color-green  { background: #2E7D32; }
.gec-recur-icon { font-size: 0.85rem; }

/* ── Sidebar ─────────────────────────────────────────── */
.gec-sidebar { }
.gec-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.gec-sidebar-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gec-navy);
  margin: 0;
}
.gec-add-btn {
  font-size: 0.75rem;
  background: var(--gec-gold);
  color: var(--gec-navy);
  padding: 4px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  transition: background .15s;
}
.gec-add-btn:hover { background: #dbb84f; }

.gec-sidebar-item {
  display: flex;
  align-items: stretch;
  background: var(--gec-cream);
  border-radius: var(--gec-radius);
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  overflow: hidden;
}
.gec-sidebar-item:hover {
  transform: translateX(3px);
  box-shadow: var(--gec-shadow);
}
.gec-sidebar-stripe {
  width: 4px;
  flex-shrink: 0;
  border-radius: 4px 0 0 4px;
}
.gec-sidebar-content { padding: 10px 12px; }
.gec-sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gec-navy);
  margin-bottom: 3px;
}
.gec-sidebar-date {
  font-size: 0.75rem;
  color: var(--gec-muted);
  margin-bottom: 2px;
}
.gec-sidebar-venue {
  font-size: 0.72rem;
  color: var(--gec-muted);
}
.gec-badge {
  display: inline-block;
  font-size: 0.65rem;
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  margin-top: 5px;
}
.gec-badge-recur { background: rgba(201,168,76,.18); color: #7A5C10; }
.gec-no-events { color: var(--gec-muted); font-size: 0.85rem; }

/* ── Modal ───────────────────────────────────────────── */
.gec-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,.65);
  /* Hidden by default — opened via .gec-modal-open class only */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

/* Only open when class is explicitly added by JS */
.gec-modal-overlay.gec-modal-open {
  display: flex;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Prevent page scroll when modal is open */
body.gec-modal-active {
  overflow: hidden;
}
.gec-modal-box {
  background: var(--gec-white);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.gec-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: background .15s, transform .1s;
  line-height: 1;
}
.gec-modal-close:hover {
  background: rgba(255,255,255,.35);
  transform: scale(1.08);
}

.gec-modal-head {
  background: var(--gec-navy);
  padding: 1.75rem 1.75rem 1.25rem;
  border-radius: 12px 12px 0 0;
}
.gec-modal-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.gec-modal-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  color: #fff;
  border-radius: 12px;
  padding: 3px 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.gec-badge-recur-modal {
  background: rgba(201,168,76,.3);
  color: var(--gec-gold);
}
#gec-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gec-white);
  margin: 0 0 6px;
  line-height: 1.25;
  padding-right: 2rem;
}
.gec-modal-date {
  color: rgba(255,255,255,.65);
  font-size: 0.88rem;
}

.gec-modal-body { padding: 1.5rem 1.75rem; }
.gec-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 1rem;
}
.gec-detail-icon {
  width: 34px;
  height: 34px;
  background: var(--gec-cream);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.gec-detail-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--gec-muted);
  margin-bottom: 2px;
}
.gec-detail-value {
  font-size: 0.9rem;
  color: var(--gec-navy);
}
.gec-detail-value a { color: #0069AA; text-decoration: none; }
.gec-detail-value a:hover { text-decoration: underline; }
.gec-zoom-link {
  font-weight: 700;
  color: #0069AA !important;
}
.gec-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gec-cream2);
}
.gec-modal-action-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s;
}
.gec-modal-action-btn:hover { transform: translateY(-1px); }
.gec-btn-primary  { background: var(--gec-gold); color: var(--gec-navy); }
.gec-btn-primary:hover { background: #dbb84f; }
.gec-btn-secondary { background: #0069AA; color: #fff; }
.gec-btn-secondary:hover { background: #005890; }
.gec-btn-outline  { background: transparent; color: var(--gec-navy); border: 1px solid var(--gec-cream2) !important; }
.gec-btn-outline:hover { background: var(--gec-cream); }

.gec-day-list-item {
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--gec-cream);
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform .12s;
}
.gec-day-list-item:hover { transform: translateX(3px); }

/* ── Upcoming Cards Grid ─────────────────────────────── */
.gec-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.gec-event-card {
  background: var(--gec-white);
  border: 1px solid var(--gec-cream2);
  border-radius: var(--gec-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.gec-event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--gec-shadow);
}
.gec-card-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.gec-card-thumb-placeholder {
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gec-card-thumb-placeholder span {
  color: rgba(255,255,255,.7);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.gec-card-body { padding: 1rem; }
.gec-card-type {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.gec-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gec-navy);
  margin: 0 0 8px;
  line-height: 1.3;
}
.gec-card-date,
.gec-card-venue,
.gec-card-speaker {
  font-size: 0.8rem;
  color: var(--gec-muted);
  margin-bottom: 3px;
}
.gec-card-badge {
  display: inline-block;
  font-size: 0.65rem;
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ── Upcoming List View ──────────────────────────────── */
.gec-list-view { }
.gec-list-month-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gec-gold);
  padding: 1rem 0 0.5rem;
  border-bottom: 1px solid var(--gec-cream2);
  margin-bottom: 0.5rem;
}
.gec-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gec-cream2);
  cursor: pointer;
  transition: background .12s;
}
.gec-list-item:hover { background: var(--gec-cream); padding-left: 8px; border-radius: 6px; }
.gec-list-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  min-width: 52px;
  border: 2px solid;
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
}
.gec-list-day {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gec-navy);
  line-height: 1;
}
.gec-list-mon {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gec-muted);
  text-transform: uppercase;
  margin-top: 2px;
}
.gec-list-content { flex: 1; min-width: 0; }
.gec-list-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gec-navy);
  margin-bottom: 3px;
}
.gec-list-meta,
.gec-list-speaker {
  font-size: 0.78rem;
  color: var(--gec-muted);
}
.gec-list-register {
  background: var(--gec-gold);
  color: var(--gec-navy);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.gec-list-register:hover { background: #dbb84f; }

/* ── Admin settings page ─────────────────────────────── */
.gec-admin-page { max-width: 700px; }
.gec-admin-page .form-table th { width: 200px; }
.gec-shortcode-ref {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}
.gec-shortcode-ref h3 { margin-top: 0; font-size: 1rem; }
.gec-shortcode-ref code {
  display: block;
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin: 6px 0;
  overflow-x: auto;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 800px) {
  .gec-has-sidebar {
    grid-template-columns: 1fr;
  }
  .gec-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}
@media (max-width: 560px) {
  .gec-cal-grid { font-size: 0.75rem; }
  .gec-cell { height: 60px; min-height: 60px; max-height: 60px; overflow: hidden; padding: 4px 2px; }
  .gec-event-chip { font-size: 0.6rem; padding: 1px 3px; }
  .gec-cards-grid { grid-template-columns: 1fr; }
  .gec-modal-box { border-radius: 10px 10px 0 0; max-height: 95vh; }
  .gec-modal-head { padding: 1.25rem 1.25rem 1rem; }
  .gec-modal-body { padding: 1.25rem; }
}
