/* ==========================================================================
   Life HQ — Calendar Page (month grid, week columns, agenda list)
   ========================================================================== */

/* ---- Main calendar card: bounded height, scrolls internally so the
   grid never pushes the side rail / footer far down the page ---- */
#calMain {
  max-height: min(640px, calc(100vh - 300px));
  overflow-y: auto;
}

/* ---- Month view ---- */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.month-weekday {
  text-align: center;
  font-size: var(--fs-tiny);
  font-weight: 700;
  color: var(--ink-faint);
  padding-bottom: 4px;
}

.month-cell {
  min-height: 68px;
  border-radius: var(--radius-md);
  background: var(--periwinkle-50);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.month-cell:hover { background: var(--periwinkle-100); transform: translateY(-2px); }
.month-cell.is-outside { opacity: 0.4; }
.month-cell.is-today { background: var(--yellow-100); box-shadow: inset 0 0 0 2px var(--yellow-400); }

.month-cell .cell-day {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--ink-strong);
}

.month-event-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--ink);
  background: var(--white);
  border-radius: 8px;
  padding: 2px 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.month-event-chip .chip-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
}
.month-cell .cell-more {
  font-size: 0.7rem;
  color: var(--ink-faint);
  padding-left: 6px;
}

/* ---- Week view ---- */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-xs);
}

.week-column {
  background: var(--periwinkle-50);
  border-radius: var(--radius-md);
  padding: var(--space-xs);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.week-column.is-today { background: var(--yellow-100); box-shadow: inset 0 0 0 2px var(--yellow-400); }

.week-column .col-head {
  text-align: center;
  font-size: var(--fs-tiny);
  font-weight: 700;
  color: var(--ink-light);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.7);
}

.week-event {
  background: var(--white);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
  border-left: 3px solid var(--periwinkle-400);
}
.week-event:hover { transform: translateY(-2px); }
.week-event .we-time { color: var(--ink-faint); font-size: 0.68rem; }
.week-event .we-title { color: var(--ink-strong); font-weight: 600; }

/* ---- Agenda view ---- */
.agenda-list { display: flex; flex-direction: column; gap: var(--space-md); }

.agenda-day-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink-strong);
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--cream-edge);
}

/* ---- Loading / disconnected ---- */
@media (max-width: 900px) {
  .month-grid { grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
  .month-cell { min-height: 64px; padding: 5px; }
  .month-event-chip { display: none; }
  .month-cell .cell-more { display: none; }
  .week-grid { grid-template-columns: 1fr; }
}
