/* ── CALENDAR PAGE ── */
.cal-wrap { padding: 4rem 0 5rem; }
.cal-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; align-items: start; }

.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.cal-month-label { font-family: var(--f-head); font-size: 1.35rem; font-weight: 800; color: var(--navy); }
.cal-nav-btn { width: 36px; height: 36px; background: var(--navy); color: white; border: none; border-radius: 3px; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.cal-nav-btn:hover { background: var(--navy-light); }

/* ── Page content (Upper/Lower Content) ── */
.cal-content-block { padding: 2rem 0; }
.cal-content { max-width: 780px; margin: 0 auto; }
.cal-content p { font-size: 0.97rem; color: var(--text); line-height: 1.85; margin-bottom: 1.2rem; }
.cal-content h2, .cal-content h3 { font-family: var(--f-head); font-weight: 800; color: var(--navy); line-height: 1.25; margin: 1.6rem 0 0.9rem; }
.cal-content img { max-width: 100%; border-radius: 4px; }
.cal-content a { color: var(--navy); text-decoration: underline; }
.cal-content a:hover { color: var(--gold); }

/* ── Calendar grid — multi-day event bars, same rendering as the admin
   Events page calendar, with colors driven by the event type's DB colors ── */
.event-calendar { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }

.ecal-dow-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.event-cal-dow {
  background: var(--navy);
  color: rgba(255,255,255,0.85);
  font-family: var(--f-head);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0.55rem 0;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.event-cal-dow:last-child { border-right: none; }

.ecal-week { position: relative; }
.ecal-daygrid { display: grid; grid-template-columns: repeat(7, 1fr); }

.event-cal-cell {
  min-height: calc(60px + var(--ecal-rows, 1) * 20px);
  padding: 4px 5px 5px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
}
.event-cal-cell:nth-child(7n) { border-right: none; }
.event-cal-cell--empty { background: #f9f8f5; }
.event-cal-cell--today { background: #e0f2fe; }

.event-cal-date { display: block; font-family: var(--f-head); font-size: 0.8rem; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.event-cal-date--today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
}

.ecal-bars {
  position: absolute;
  top: 28px;
  left: 1px;
  right: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 19px;
  row-gap: 2px;
  pointer-events: none;
}
.ecal-bar {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 19px;
  padding: 0 6px;
  font-family: var(--f-head);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
}
.ecal-bar-title { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.ecal-bar--solo  { border-radius: 3px; }
.ecal-bar--start { border-radius: 3px 0 0 3px; }
.ecal-bar--end   { border-radius: 0 3px 3px 0; }
.ecal-bar--mid   { border-radius: 0; }

.ecal-more { font-size: 0.66rem; color: var(--muted); padding: 0 4px; align-self: center; }

.event-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  padding: 0.8rem 0.2rem 0;
}
.event-cal-legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.event-cal-legend-dot { display: inline-block; width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }

/* ── Upcoming sidebar ── */
.upcoming-card { background: white; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow); }
.upcoming-card-header { background: var(--navy); padding: 0.9rem 1.2rem; }
.upcoming-card-header h3 { font-family: var(--f-head); font-size: 0.85rem; font-weight: 700; color: white; text-transform: uppercase; letter-spacing: 0.07em; }
.up-event { display: flex; gap: 0.85rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border); align-items: flex-start; cursor: pointer; }
.up-event:last-child { border: none; }
.up-event:hover { background: var(--cream); }
.up-date { flex-shrink: 0; text-align: center; background: var(--navy); color: white; border-radius: 3px; padding: 0.3rem 0.5rem; min-width: 42px; }
.up-date-m { font-family: var(--f-head); font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); display: block; }
.up-date-d { font-family: var(--f-head); font-size: 1.2rem; font-weight: 800; line-height: 1.1; display: block; }
.up-info { flex: 1; }
.up-title { font-family: var(--f-head); font-size: 0.83rem; font-weight: 700; color: var(--navy); margin-bottom: 0.25rem; line-height: 1.3; }
.up-detail { font-size: 0.75rem; color: var(--muted); line-height: 1.5; }

/* ── Modal ── */
.cal-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 900; align-items: center; justify-content: center; padding: 1rem; }
.cal-modal-overlay.open { display: flex; }
.cal-modal-box { background: white; border-radius: 6px; max-width: 580px; width: 100%; max-height: 90vh; overflow: hidden auto; box-shadow: 0 12px 48px rgba(0,0,0,0.2); }
.cal-modal-img { width: 100%; height: 240px; object-fit: cover; display: block; }
.cal-modal-header { padding: 1.2rem 1.4rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.cal-modal-header-text { display: flex; flex-direction: column; gap: 0.45rem; }
.cal-modal-header h3 { font-family: var(--f-head); font-size: 1.1rem; font-weight: 800; color: inherit; line-height: 1.3; }
.cal-modal-type-tag {
  display: inline-block;
  align-self: flex-start;
  border: 1px solid currentColor;
  color: inherit;
  font-family: var(--f-head);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  opacity: 0.9;
}
.cal-modal-header-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.cal-modal-signup-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  color: inherit;
  font-family: var(--f-head);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.cal-modal-signup-btn:hover { opacity: 0.7; }
.cal-modal-close { background: none; border: none; color: inherit; opacity: 0.75; font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0; }
.cal-modal-close:hover { opacity: 1; }
.cal-modal-body { padding: 1.4rem; }
.cal-modal-row { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.9rem; font-size: 0.88rem; color: var(--text); }
.cal-modal-row:last-child { margin: 0; }
.cal-modal-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.05rem; }
.cal-modal-email-link { color: var(--navy); font-weight: 600; }
.cal-modal-email-link:hover { color: var(--gold); }

/* ── Responsive ── */
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .event-cal-cell { min-height: calc(40px + var(--ecal-rows, 1) * 16px); padding: 0.25rem 0.2rem; }
  .event-cal-date { font-size: 0.68rem; }
  .ecal-bar { font-size: 0; height: 14px; }
  .ecal-bars { grid-auto-rows: 15px; }
}
