/* ============================================================
   Calendar page — month grid with event markers + upcoming list.
   Inherits palette from today.css.
   ============================================================ */

.calendar-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.calendar-head h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.02em;
}
.calendar-head .nav {
  display: flex; gap: 6px;
}
.calendar-head .nav button {
  font: inherit;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.calendar-head .nav button:active { transform: scale(0.96); }

/* weekday strip */
.dow-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.dow-strip span {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  text-align: center;
}

/* month grid — 6 rows × 7 cols */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.cal-day {
  aspect-ratio: 1 / 1;
  background: var(--paper);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-height: 0;
  font-family: 'Fraunces', Georgia, serif;
}
.cal-day .num {
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}
.cal-day.outside { background: var(--paper-2); }
.cal-day.outside .num { color: var(--mute); }
.cal-day.today { background: var(--paper-2); }
.cal-day.today .num {
  color: var(--rust);
  font-weight: 700;
}
.cal-day.selected {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

/* event markers in each cell — small dots stacked */
.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.dot.event     { background: var(--plum); }
.dot.task      { background: var(--rust); }
.dot.task.done { background: var(--mute); opacity: 0.5; }
.dot.milestone { background: var(--ochre); }

/* selected day's events panel */
.day-panel {
  margin: 18px 0 28px;
  padding: 16px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.day-panel .day-panel-head {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 6px;
}
.day-panel .day-panel-date {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.day-panel ul {
  list-style: none;
  display: flex; flex-direction: column;
}
.day-panel .entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: baseline; gap: 10px;
}
.day-panel .entry:last-child { border-bottom: 0; }
.day-panel .entry .kind {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rust);
  flex: 0 0 64px;
  padding-top: 1px;
}
.day-panel .entry.kind-event .kind     { color: var(--plum); }
.day-panel .entry.kind-task .kind      { color: var(--rust); }
.day-panel .entry.kind-milestone .kind { color: var(--ochre); }
.day-panel .entry .name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px;
  flex: 1;
  line-height: 1.3;
}
.day-panel .entry .meta {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: var(--mute);
  margin-top: 1px;
  margin-left: 74px;
}
.day-panel .empty {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  color: var(--mute);
}

/* legend */
.cal-legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--mute);
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* + add event button */
.add-event-btn {
  font: inherit;
  width: 100%;
  padding: 12px 16px;
  margin: 14px 0 24px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-size: 15px;
}
.add-event-btn:active { transform: scale(0.98); }

/* upcoming list (below month grid) */
.upcoming {
  margin-top: 8px;
}
.upcoming h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 6px;
}
.upcoming-deck {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  color: var(--mute);
  font-size: 14px;
  margin-bottom: 14px;
}
.upcoming ul {
  list-style: none;
}
.upcoming .row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.upcoming .row:last-child { border-bottom: 0; }
.upcoming .row .when {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 13px;
  color: var(--mute);
  font-style: italic;
  flex: 0 0 80px;
}
.upcoming .row .name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px;
  flex: 1;
}
.upcoming .row .kind-pill {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
}
.upcoming .row.kind-event     .kind-pill { color: var(--plum); border-color: rgba(107,58,74,0.3); }
.upcoming .row.kind-task      .kind-pill { color: var(--rust); border-color: rgba(160,74,37,0.3); }
.upcoming .row.kind-milestone .kind-pill { color: var(--ochre); border-color: rgba(184,134,44,0.3); }
