/* ---- 16e. Calendar (day sheet) ------------------------------------------ */

.calendar {
  display: grid;
  gap: 0.75rem;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  border: 1px solid var(--ta-border);
  border-radius: var(--ta-r);
  background: var(--ta-border);
  overflow: hidden;
}

.calendar-dow {
  padding: 0.45rem 0.5rem;
  background: var(--ta-surface-2);
  color: var(--ta-muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-cell {
  min-height: 6.5rem;
  padding: 0.4rem;
  background: var(--ta-surface);
}

.calendar-cell.empty-cell {
  background: var(--ta-surface-2);
}

.calendar-cell.today {
  background: var(--ta-accent-soft);
}

.calendar-day {
  display: block;
  color: var(--ta-muted);
  font-family: var(--ta-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.calendar-cell.today .calendar-day {
  color: var(--ta-accent);
  font-weight: 700;
}

.calendar-events {
  display: grid;
  gap: 0.25rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.calendar-events li {
  font-size: 0.8rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-events a {
  color: var(--ta-text);
  text-decoration: none;
}

.calendar-events a:hover {
  color: var(--ta-accent);
}

/* ---- 16f. Year calendar (the Apple-Calendar "Year" block) -----------------
 * Twelve mini-months with a dot on every day that carries a record, in a
 * glass card with a ◀ year ▶ header. PARITY B14. */

/* The block frame composes `.glass-card` for its MATERIAL (translucent fill,
   rim, blur) but owns its own box: a card pane is padding-free because the
   header rule has to reach the pane's edges, and it pins the radius/overflow
   so the header stays inside the corners. Element+class beats the single-class
   utility regardless of import order. */
section.year-calendar {
  display: flex;
  flex-direction: column;
  /* No `height: 100%`: in the app shell's 100dvh column it would stretch the
     block to the viewport, while the reference's own render is content-height.
     The grid scrolls when the frame is given a definite height by a host
     tile; on a plain page it just shows all twelve months. */
  padding: 0;
  overflow: hidden;
  border-radius: var(--ta-r-lg);
  /* A clipping pane in a flex column must not shrink (the gauge trap): a
     shrinkable item gets squeezed on a tall page and silently crops. */
  flex-shrink: 0;
}

.year-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ta-border);
}

.year-calendar-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.year-calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.year-calendar-page {
  padding: 0.25rem;
  border-radius: var(--ta-r);
  border: 0;
  background: transparent;
  color: var(--ta-muted);
  cursor: pointer;
}

.year-calendar-page:hover {
  background: var(--ta-accent-soft);
  color: var(--ta-text);
}

.year-calendar-year {
  min-width: 3ch;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.year-calendar-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

/* The twelve-month wall grid: 1 column up to sm, then 2 / 3 / 4 as space
   allows — the reference's `grid-cols-1 sm:grid-cols-2 lg:grid-cols-3
   xl:grid-cols-4 gap-x-8 gap-y-10 p-4`. `.enter-stack` adds the reference's
   month-by-month entrance cascade (children ARE the twelve months). */
.year-calendar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem 2rem;
  padding: 1rem;
}

@media (min-width: 640px) {
  .year-calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .year-calendar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .year-calendar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.year-month-name {
  margin: 0 0 0.375rem;
  padding: 0 0.25rem;
  border-radius: 0.25rem;
  border: 0;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ta-text);
  cursor: pointer;
}

.year-month-name:hover,
.year-month-name.current {
  color: var(--ta-accent);
}

.year-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  color: var(--ta-muted);
}

.year-weekdays > div {
  padding: 0.125rem 0;
}

.year-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.year-day-slot {
  padding: 0.25rem 0;
}

/* A day cell: the number in a 24px circle, the event dot under it. The
   hover wash is the group-hover accent the reference paints under the number
   (group-hover:bg-accent), not a ring or outline. */
.year-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.125rem 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.year-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.year-day:hover .year-day-num {
  background: var(--ta-accent-soft);
}

.year-day-num.today {
  background: var(--ta-accent);
  font-weight: 600;
  color: #ffffff;
}

.year-day:hover .year-day-num.today {
  background: var(--ta-accent);
}

.year-dot {
  margin-top: 0.125rem;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 9999px;
  background: transparent;
}

.year-dot.on-event {
  background: #2a78d6;
}

.year-dot.on-today {
  background: var(--ta-accent);
}

