/**
 * Astral Archive — Calendar Styles
 * ---------------------------------------------------------------------------
 * The event list is the one reading surface on the site that is prose rather
 * than pixels, so it is typeset as prose: a comfortable measure, real rhythm
 * between rows, and an accent per event kind that carries meaning rather than
 * decoration. Everything is driven by the same design tokens the rest of the
 * site uses, so the calendar cannot drift away from the other pages.
 */

/* -------------------------------------------------------------------------- */
/* Event list                                                                 */
/* -------------------------------------------------------------------------- */

.cal-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  transition: background-color var(--transition-fast);
}

.cal-row:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.cal-row.is-compact {
  padding: 0.75rem 1.5rem;
  gap: 0.75rem;
}

.cal-row.is-compact .cal-detail,
.cal-row.is-compact .cal-rel {
  display: none;
}

.cal-row.is-compact .cal-title {
  font-size: 0.9375rem;
}

/**
 * The icon keeps its own column so that titles align down the list regardless
 * of how long each event's description runs to.
 */
.cal-icon {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--calendar-accent, #C3B4F7);
}

.cal-row.is-compact .cal-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
}

.cal-row.is-compact .cal-icon svg {
  width: 1rem;
  height: 1rem;
}

.cal-body {
  min-width: 0;
  flex: 1 1 auto;
}

.cal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.cal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.cal-when {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.cal-rel {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.cal-meta {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.cal-chip {
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  padding: 0 0.625rem;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--calendar-accent, #C3B4F7);
  background-color: color-mix(in srgb, var(--calendar-accent, #C3B4F7) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--calendar-accent, #C3B4F7) 30%, transparent);
}

.cal-chip-quiet {
  color: var(--text-tertiary);
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.07);
}

.cal-detail {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 68ch;
}

/* Month separator */
.cal-month {
  padding: 1.5rem 1.5rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .cal-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .cal-when {
    font-size: 0.8125rem;
  }

  .cal-row {
    padding: 1rem 1.125rem;
  }
}

/* -------------------------------------------------------------------------- */
/* Forced colours                                                             */
/* -------------------------------------------------------------------------- */
/**
 * The icon column relies on a tinted background for its shape. Under a forced
 * colour scheme that fill is replaced, so the border has to carry the shape on
 * its own or the icons disappear entirely.
 */
@media (forced-colors: active) {
  .cal-icon,
  .cal-chip {
    border: 1px solid CanvasText;
    forced-color-adjust: none;
    color: CanvasText;
    background-color: Canvas;
  }
}

/* -------------------------------------------------------------------------- */
/* Print                                                                      */
/* -------------------------------------------------------------------------- */
/**
 * A calendar is one of the few things on this site someone might genuinely want
 * on paper — an evening plan taken outside where there is no signal.
 */
@media print {
  .cal-icon,
  .cal-chip,
  [data-calendar-export],
  [data-calendar-window],
  [data-calendar-kinds],
  [data-calendar-density],
  aside {
    display: none !important;
  }

  .cal-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    break-inside: avoid;
  }

  .cal-title,
  .cal-detail,
  .cal-when {
    color: #000 !important;
  }
}
